Sanjay Patel [Tue, 23 Jun 2015 23:05:08 +0000 (23:05 +0000)]
don't repeat function names in comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240478
91177308-0d34-0410-b5e6-
96231b3b80d8
Petar Jovanovic [Tue, 23 Jun 2015 22:52:19 +0000 (22:52 +0000)]
Add "-mcpu=" option to llvm-rtdyld
This patch adds the -mcpu= option to llvm-rtdyld. With this option, one
can test relocations for different types of CPUs (e.g. Mips64r6).
Patch by Vladimir Radosavljevic.
Differential Revision: http://reviews.llvm.org/D10503
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240477
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Tue, 23 Jun 2015 22:39:23 +0000 (22:39 +0000)]
MIR Parser: Use correct source locations for machine instruction diagnostics.
This commit translates the source locations for MIParser diagnostics from
the locations in the machine instruction string to the locations in the
MIR file.
Reviewers: Duncan P. N. Exon Smith
Differential Revision: http://reviews.llvm.org/D10574
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240474
91177308-0d34-0410-b5e6-
96231b3b80d8
Pete Cooper [Tue, 23 Jun 2015 21:55:11 +0000 (21:55 +0000)]
Devirtualize Constant::destroyConstant.
This reorganizes destroyConstant and destroyConstantImpl.
Now there is only destroyConstant in Constant itself, while
subclasses are required to implement destroyConstantImpl.
destroyConstantImpl no longer calls delete but is instead only
responsible for removing the constant from any maps in which it
is contained.
Reviewed by Duncan Exon Smith.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240471
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Tue, 23 Jun 2015 21:18:15 +0000 (21:18 +0000)]
[X86][SSE] Added full set of 128-bit vector shift tests.
Removed some old duplicate tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240465
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Samsonov [Tue, 23 Jun 2015 21:00:08 +0000 (21:00 +0000)]
Let llvm::ReplaceInstWithInst copy debug location from old to new instruction.
Currently some users of this function do this explicitly, and all the
rest forget to do this.
ThreadSanitizer was one of such users, and had missing debug
locations for calls into TSan runtime handling atomic operations,
eventually leading to poorly symbolized stack traces and malfunctioning
suppressions.
This is another change relevant to PR23837.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240460
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeniy Stepanov [Tue, 23 Jun 2015 20:57:26 +0000 (20:57 +0000)]
Pass 2 more variables to lit tests.
Pass ADB and ADB_SERIAL environment variables to lit tests.
This would allow running Android tests in compiler-rt when
there is more than one device attached to the host.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240459
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Tue, 23 Jun 2015 20:09:03 +0000 (20:09 +0000)]
Revert "[FaultMaps] Move FaultMapParser to Object/"
This reverts commit r240364 (git
c49542e5bb186). The issue r240364 was
trying to fix was fixed independently in r240362.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240448
91177308-0d34-0410-b5e6-
96231b3b80d8
Steven Wu [Tue, 23 Jun 2015 18:56:48 +0000 (18:56 +0000)]
Adding the missing LTO API to lto.exports
Summary:
lto_codegen_set_should_embed_uselists is introduced in r235943 but not
added to lto.exports. Add to export list to expose the API.
Reviewers: dexonsmith
Subscribers: rafael, llvm-commits
Differential Revision: http://reviews.llvm.org/D10658
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240442
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 23 Jun 2015 18:34:25 +0000 (18:34 +0000)]
Don't pass a 32 bit value to "%08" PRIx64.
Should fix the arm bots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240439
91177308-0d34-0410-b5e6-
96231b3b80d8
Mark Heffernan [Tue, 23 Jun 2015 18:26:50 +0000 (18:26 +0000)]
This change fixes three bugs in loop unswitching. This change causes an 81% speed-up on a benchmark that is based on EigenConvolutionKernel2D from Eigen3, where the lack of loop unswitching blocks hoisting of loads out of a nested loop (see bug 23816 for how loop unswitching and load hoisting are related).
Change 1: Unswitching on trivial conditions should always happen regardless of the computed unswitching cost, as really the cost is zero. While there is code to make that happen, the logic that checks the unswitching cost against a threshold was moved to an earlier point (revision 147935) than the point where trivial unswitching is detected, so trivial unswitching is currently blocked by the cost threshold. This change fixes that.
Change 2: Before revision 147935 (from 2012-01-11), the threshold parameter was a per-loop threshold. So an unswitching happened only if the cost of the unswitching was less than the threshold. In an indirect way (and I believe unintentionally), the logic for this since then has been that the threshold is an over-all budget across all loops for all loop unswitching done by a given LoopUnswitch loop pass object. So if an unswitching with cost 100 happens in one function, that in effect reduces the threshold from 100 to 0 for the loops even in another function. This persists for the lifetime of that loop pass object. This makes no difference for most small examples but it is important for large examples. This revision fixes that.
Change 3: The cost is currently calculated as std::min(NumInstructions, 5 * NumBlocks). So a loop with 2 blocks and a million instructions will have an unswitching cost of 10. I changed this to just NumInstructions, as it were before revision 147935, though I'm open to e.g. instead replacing std::min with std::max.
I've tried to make the change minimally invasive while staying with what I think was the original intent of the code.
Submitted on behalf of broune@.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240438
91177308-0d34-0410-b5e6-
96231b3b80d8
Artem Belevich [Tue, 23 Jun 2015 18:22:17 +0000 (18:22 +0000)]
[NVPTX] Added missing test case for llvm.nvvm.sqrt.f NVPTX intrinsic
Differential Revision: http://reviews.llvm.org/D10663
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240437
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Tue, 23 Jun 2015 18:22:10 +0000 (18:22 +0000)]
ADT: Add a string APSInt constructor.
This commit moves the APSInt initialization code that's used by
the LLLexer class into a new APSInt constructor that constructs
APSInts from strings.
This change is useful for MIR Serialization, as it would allow
the MILexer class to use the same APSInt initialization as
LLexer when parsing immediate machine operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240436
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 23 Jun 2015 18:04:54 +0000 (18:04 +0000)]
Pass -m to the linker in this test.
Fixes the test on a ppc host.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240431
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Tue, 23 Jun 2015 17:10:10 +0000 (17:10 +0000)]
AsmParser: Extend the API to make the global value and metadata node slot mappings publicly accessible.
This commit creates a new structure called 'SlotMapping' in the AsmParser library.
This structure can be passed into the public parsing APIs from the AsmParser library
in order to extract the data structures that map from slot numbers to unnamed global
values and metadata nodes.
This change is useful for MIR Serialization, as the MIR Parser has to lookup the
unnamed global values and metadata nodes by their slot numbers.
Reviewers: Duncan P. N. Exon Smith
Differential Revision: http://reviews.llvm.org/D10551
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240427
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Tue, 23 Jun 2015 16:41:57 +0000 (16:41 +0000)]
ELF: Fix defintion of STT_LOOS and STT_HIOS.
Reviewers: chandlerc, Bigcheese, rafael
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D10647
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240426
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Tue, 23 Jun 2015 16:35:26 +0000 (16:35 +0000)]
MIR Serialization: Serialize physical register machine operands.
This commit introduces functionality that's used to serialize machine operands.
Only the physical register operands are serialized by this commit.
Reviewers: Duncan P. N. Exon Smith
Differential Revision: http://reviews.llvm.org/D10525
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240425
91177308-0d34-0410-b5e6-
96231b3b80d8
John Brawn [Tue, 23 Jun 2015 16:02:11 +0000 (16:02 +0000)]
[ARM] ARMLoadStoreOpt::UpdateBaseRegUses should stop on def
When UpdateBaseRegUses sees an instruction that defines the base
register it must stop, as the base register value it is updating is no
longer live. Ideally we would already have seen the register be killed
(which is already checked for), but the kill flags may be inaccurate
and we have to account for this.
Differential Revision: http://reviews.llvm.org/D10566
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240424
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 23 Jun 2015 15:45:38 +0000 (15:45 +0000)]
objdump: Don't print a (always 0) size for MachO symbols.
Only common symbol on MachO and COFF have a size.
For COFF we already had a custom format.
For MachO, there is no native objdump and we were printing it as ELF. Now
we only print the sizes for symbols that actually have them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240422
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Tue, 23 Jun 2015 15:38:24 +0000 (15:38 +0000)]
SystemZ: Avoid left shifting negative values (it's UB)
Found by ubsan.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240420
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Tue, 23 Jun 2015 15:28:10 +0000 (15:28 +0000)]
[Option] Plug a leak when move-assigning an InputArgList.
The class has a non-trivial dtor so we have to clean up before we move
in new members. Remove misleading comment as a default move assignment
operator will never be synthesized for this class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240417
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Tue, 23 Jun 2015 14:51:40 +0000 (14:51 +0000)]
Make helper functions static. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240416
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Tue, 23 Jun 2015 14:47:36 +0000 (14:47 +0000)]
[BranchFolding] Document why replacing HashMachineInstr with hash_code doesn't work
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240415
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Tue, 23 Jun 2015 14:47:29 +0000 (14:47 +0000)]
[MachineBasicBlock] Add getFirstNonDebugInstr to complement getLastNonDebugInstr
Use it in CodeGen where applicable. No functionality change intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240414
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Tue, 23 Jun 2015 14:47:18 +0000 (14:47 +0000)]
[MachineBasicBlock] Use the const_cast(this) trick to reduce duplication
NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240413
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 23 Jun 2015 14:42:34 +0000 (14:42 +0000)]
Be sure to set the DataLayout before checking the cache.
This makes sure the same mangling is used.
Should fix the OS X bots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240411
91177308-0d34-0410-b5e6-
96231b3b80d8
Toma Tabacu [Tue, 23 Jun 2015 14:39:42 +0000 (14:39 +0000)]
[mips] [IAS] Add partial support for the ULHU pseudo-instruction.
Summary:
This only adds support for ULHU of an immediate address with/without a source register.
It does not include support for ULHU of the address of a symbol.
Reviewers: dsanders
Reviewed By: dsanders
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D9671
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240410
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 23 Jun 2015 14:11:09 +0000 (14:11 +0000)]
Remove unused arguments and move ManglerPrefixTy to the implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240408
91177308-0d34-0410-b5e6-
96231b3b80d8
Toma Tabacu [Tue, 23 Jun 2015 14:00:54 +0000 (14:00 +0000)]
[mips] [IAS] Add support for generating DADDu to createAddu(). NFC.
Summary: This isn't used right now, but it will be in some upcoming changes.
Reviewers: dsanders
Reviewed By: dsanders
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D10568
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240407
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 23 Jun 2015 13:59:29 +0000 (13:59 +0000)]
Simplify the Mangler interface now that DataLayout is mandatory.
We only need to pass in a DataLayout when mangling a raw string, not when
constructing the mangler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240405
91177308-0d34-0410-b5e6-
96231b3b80d8
Petar Jovanovic [Tue, 23 Jun 2015 13:54:42 +0000 (13:54 +0000)]
[mips64] Emit correct addend for some PC-relative relocations
So far, LLVM has not emitted correct addend for N64 and N32 ABI. This patch
fixes that. It also removes fixup from MCJIT for R_MIPS_PC16 relocation.
Patch by Vladimir Radosavljevic.
Differential Revision: http://reviews.llvm.org/D10565
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240404
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Tue, 23 Jun 2015 13:50:23 +0000 (13:50 +0000)]
[Hexagon] Use MF reference from parent class in HexagonPacketizerList
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240403
91177308-0d34-0410-b5e6-
96231b3b80d8
Toma Tabacu [Tue, 23 Jun 2015 12:34:19 +0000 (12:34 +0000)]
[mips] [IAS] Move some function definitions to MipsTargetStreamer.cpp. NFC.
Summary: For the sake of consistency and to make some upcoming changes a little less noisy.
Reviewers: dsanders
Reviewed By: dsanders
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D10639
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240398
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 23 Jun 2015 12:29:52 +0000 (12:29 +0000)]
Don't repeat names in comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240396
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 23 Jun 2015 12:21:54 +0000 (12:21 +0000)]
Use MCSymbols for FastISel.
The summary is that it moves the mangling earlier and replaces a few
calls to .addExternalSymbol with addSym.
I originally wanted to replace all the uses of addExternalSymbol with
addSym, but noticed it was a lot of work and doesn't need to be done
all at once.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240395
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Tue, 23 Jun 2015 11:31:32 +0000 (11:31 +0000)]
Revert r240302 ("Bring r240130 back.").
This causes errors like:
ld: error: blah.o: requires dynamic R_X86_64_PC32 reloc against '' which
may overflow at runtime; recompile with -fPIC
blah.cc:function f(): error: undefined reference to ''
blah.o:g(): error: undefined reference to ''
I have not yet come up with an appropriate reproduction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240394
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexander Kornienko [Tue, 23 Jun 2015 10:48:35 +0000 (10:48 +0000)]
Revert r240271 (Fixed/added namespace ending comments using clang-tidy. NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240393
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Tue, 23 Jun 2015 10:11:36 +0000 (10:11 +0000)]
[mips] llvm-readobj can parse .MIPS.abiflags. No need to check the bytes.
Summary:
Reviewers: atanasyan
Reviewed By: atanasyan
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D10538
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240392
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexander Kornienko [Tue, 23 Jun 2015 09:49:53 +0000 (09:49 +0000)]
Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC)
Apparently, the style needs to be agreed upon first.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240390
91177308-0d34-0410-b5e6-
96231b3b80d8
Elena Demikhovsky [Tue, 23 Jun 2015 08:19:46 +0000 (08:19 +0000)]
AVX-512: Added all forms of VPABS instruction
Added all intrinsics, tests for encoding, tests for intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240386
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Tue, 23 Jun 2015 07:32:55 +0000 (07:32 +0000)]
MCExpr: Avoid UB by evaluating this shift as unsigned
We hit undefined behaviour in some MCExpr tests when the LHS of a left
shift is -1. Twos-complement semantics are completely reasonable here,
so we should just do the shift in unsigned.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240385
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Tue, 23 Jun 2015 07:28:57 +0000 (07:28 +0000)]
[mips] Fix some UB by shifting before sign-extending
Avoid shifting a negative value by sign-extending after the shift.
Fixes a couple of tests that were failing under ubsan.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240381
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Tue, 23 Jun 2015 06:46:54 +0000 (06:46 +0000)]
test: Move target dependent test in their own folder for c API test
Dissasembly tests depends on target. The problem is that it disable
all tests if all targets are not compiled. This moves things around in
order to get target specific code in a target specific folder.
Patch by Amaury Sechet. Thanks!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240380
91177308-0d34-0410-b5e6-
96231b3b80d8
Weiming Zhao [Tue, 23 Jun 2015 05:31:09 +0000 (05:31 +0000)]
Fix PR13851: Preserve metadata for the unswitched branch
This patch copies the metadata of the unswitched branch to the newly
crreated branch in loop unswitch pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240378
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 23 Jun 2015 03:45:23 +0000 (03:45 +0000)]
Remove broken banner.
Thanks to Filipe Cabecinhas for noticing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240375
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 23 Jun 2015 03:42:44 +0000 (03:42 +0000)]
Add a test for the previous commit.
This shows how two symbols at the same address are handled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240374
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 23 Jun 2015 03:36:08 +0000 (03:36 +0000)]
Handle multiple symbols having the same address.
I will add an explicit test in a second, but this fixes the bots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240372
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Tue, 23 Jun 2015 02:49:24 +0000 (02:49 +0000)]
[InstCombine] Optimize subtract of selects into a select of a sub
This came up when examining some code generated by clang's IRGen for
certain member pointers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240369
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 23 Jun 2015 02:45:44 +0000 (02:45 +0000)]
Fix tests when X86 is not enabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240368
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 23 Jun 2015 02:20:37 +0000 (02:20 +0000)]
Compute correct symbol sizes for MachO and COFF.
Before this would dump from the symbol start to the end of the section.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240367
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 23 Jun 2015 02:08:48 +0000 (02:08 +0000)]
Extract an utility for computing symbol sizes on MachO and COFF.
I will add a second user in the next commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240366
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Tue, 23 Jun 2015 02:05:55 +0000 (02:05 +0000)]
AMDGPU: Use getAsInteger instead of atoi
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240365
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Tue, 23 Jun 2015 01:05:26 +0000 (01:05 +0000)]
[FaultMaps] Move FaultMapParser to Object/
Summary:
That way llvm-objdump can rely on it without adding an extra dependency
on CodeGen.
This change duplicates the FaultKind enum and the code that serializes
it to a string. I could not figure out a way to get around this without
adding a new dependency to Object
Reviewers: rafael, ab
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D10619
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240364
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Tue, 23 Jun 2015 01:05:21 +0000 (01:05 +0000)]
Fix a typo in a comment in FaultMaps.h. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240363
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Tue, 23 Jun 2015 00:59:12 +0000 (00:59 +0000)]
llvm/tools/llvm-objdump/CMakeLists.txt: Update libdeps to fix r240304.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240362
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Tue, 23 Jun 2015 00:39:40 +0000 (00:39 +0000)]
[x86] generalize reassociation optimization in machine combiner to 2 instructions
Currently ( D10321, http://reviews.llvm.org/rL239486 ), we can use the machine combiner pass
to reassociate the following sequence to reduce the critical path:
A = ? op ?
B = A op X
C = B op Y
-->
A = ? op ?
B = X op Y
C = A op B
'op' is currently limited to x86 AVX scalar FP adds (with fast-math on), but in theory, it could
be any associative math/logic op (see TODO in code comment).
This patch generalizes the pattern match to ignore the instruction that defines 'A'. So instead of
a sequence of 3 adds, we now only need to find 2 dependent adds and decide if it's worth
reassociating them.
This generalization has a compile-time cost because we can now match more instruction sequences
and we rely more heavily on the machine combiner to discard sequences where reassociation doesn't
improve the critical path.
For example, in the new test case:
A = M div N
B = A add X
C = B add Y
We'll match 2 reassociation patterns, but this transform doesn't reduce the critical path:
A = M div N
B = A add Y
C = B add X
We need the combiner to reject that pattern but select this:
A = M div N
B = X add Y
C = B add A
Differential Revision: http://reviews.llvm.org/D10460
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240361
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Mon, 22 Jun 2015 23:58:05 +0000 (23:58 +0000)]
Re-apply "InstrProf: When reading, copy the data instead of taking a reference. NFC"
This version fixes a missing include that MSVC noticed and
clarifies the ownership of the counter buffer that's passed to
InstrProfRecord.
This restores r240206, which was reverted in r240208.
Patch by Betul Buyukkurt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240360
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Mon, 22 Jun 2015 23:56:53 +0000 (23:56 +0000)]
InstrProf: Add a test for multiple copies of the same with different hashes
This functionality wasn't being tested.
Patch by Betul Buyukkurt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240359
91177308-0d34-0410-b5e6-
96231b3b80d8
Pete Cooper [Mon, 22 Jun 2015 23:48:35 +0000 (23:48 +0000)]
Create Value.def helper. NFC.
This is similar to Metadata.def and Instructions.def but for Value's.
It will be used in upcoming commits to devirtualize the Value class.
Reviewed by Duncan Exon Smith.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240358
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeniy Stepanov [Mon, 22 Jun 2015 23:36:03 +0000 (23:36 +0000)]
Fix PR23914.
r226830 moved the declaration of Buf to a nested scope, resulting
in a dangling reference (in StringRef Name), and a use-after-free.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240357
91177308-0d34-0410-b5e6-
96231b3b80d8
Logan Chien [Mon, 22 Jun 2015 23:16:02 +0000 (23:16 +0000)]
Code cleanup: Remove std::move() around xvalue (NFC)
Remove std::move() around xvalue so that copy elision is eligible.
In case that copy elision is not appliable, the c++ standard also
guarantees the move semantics on xvalue. Thus, it is not necessary
to wrap Args with std::move.
This also silence a warning since r240345.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240355
91177308-0d34-0410-b5e6-
96231b3b80d8
Adam Nemet [Mon, 22 Jun 2015 22:59:40 +0000 (22:59 +0000)]
[LoopDist] Improve variable names and comments in LoopVersioning class, NFC
As with the previous patch, the goal is to turn the class into a general
loop-versioning class. This patch removes any references to loop
distribution.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240352
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Mon, 22 Jun 2015 22:06:37 +0000 (22:06 +0000)]
Modify ParseArgs to return the InputArgList by value - there's no need for dynamic allocation/ownership here
The one caller that does anything other than keep this variable on the
stack is the single use of DerivedArgList in Clang, which is a bit more
interesting but can probably be cleaned up/simplified a bit further
(have DerivedArgList take ownership of the InputArgList rather than
needing to reference its Args indirectly) which I'll try to after this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240345
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Mon, 22 Jun 2015 21:58:02 +0000 (21:58 +0000)]
[CMake] Treating LLVM_INCLUDE_TOOLS, which is a bool, as a string to change behaviors of the build is a dirty hack. We shouldn't do it.
Summary: I don't think anyone is relying on this behavior for bootstrapping (because I don't think it works), but if you do need it, speak now or forever hold your peace.
Reviewers: chapuni, samsonov
Reviewed By: samsonov
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D10613
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240344
91177308-0d34-0410-b5e6-
96231b3b80d8
Pawel Bylica [Mon, 22 Jun 2015 21:54:07 +0000 (21:54 +0000)]
Revert r240291: causes problems in self-hosted builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240343
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Mon, 22 Jun 2015 21:49:41 +0000 (21:49 +0000)]
[X86][FMA4] FMA4 ops can perform unaligned folded loads.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240342
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Mon, 22 Jun 2015 21:46:51 +0000 (21:46 +0000)]
Linker: Do not expect comdat to exist in source module.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240341
91177308-0d34-0410-b5e6-
96231b3b80d8
Joseph Tremoulet [Mon, 22 Jun 2015 21:37:34 +0000 (21:37 +0000)]
Fix line endings (NFC)
I inadvertently checked these in with Windows-style line
endings in r240288.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240340
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Mon, 22 Jun 2015 21:33:24 +0000 (21:33 +0000)]
[Object] Search for architecures by name in MachOUniversalBinary::getObjectForArch()
The reason we need to search by name rather than by Triple::ArchType
is to handle subarchitecture correclty. There is no different ArchType
for the x86_64h architecture (it identifies itself as x86_64), or for
the various ARM subarches. The only way to get to the subarch slice
in an universal binary is to search by name.
This issue led to hard to debug and transient symbolication failures
in Asan tests (it mostly works, because the files are very similar).
This also affects the Profiling infrastucture as it is the other user
of that API.
Reviewers: samsonov, bogner
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D10604
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240339
91177308-0d34-0410-b5e6-
96231b3b80d8
Pawel Bylica [Mon, 22 Jun 2015 21:18:10 +0000 (21:18 +0000)]
Set missing x86 arch in a CodeGen regression test.
Fixes the regression test added in r240291.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240336
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Mon, 22 Jun 2015 21:13:30 +0000 (21:13 +0000)]
test-release.sh: Minor fixes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240334
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Mon, 22 Jun 2015 21:10:42 +0000 (21:10 +0000)]
[X86][AVX2] Added missing stack folding tests for vpshufhw/vpshuflw
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240332
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Mon, 22 Jun 2015 21:03:54 +0000 (21:03 +0000)]
R600/SI: Use ELF64 format instead of ELF32
Reviewers: arsenm, rafael
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D10392
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240331
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Mon, 22 Jun 2015 21:03:52 +0000 (21:03 +0000)]
R600: Use EM_AMDGPU for the ELF Machine type
Reviewers: arsenm, rafael
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D10390
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240330
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Mon, 22 Jun 2015 21:03:47 +0000 (21:03 +0000)]
Support/ELF: Add EM_AMDGPU
Summary: This will be used by the R600 backend.
Reviewers: chandlerc, rafael
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D10389
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240329
91177308-0d34-0410-b5e6-
96231b3b80d8
Ahmed Bougacha [Mon, 22 Jun 2015 20:51:51 +0000 (20:51 +0000)]
[X86] Teach load folding to accept scalar _Int users of MOVSS/MOVSD.
The _Int instructions are special, in that they operate on the full
VR128 instead of FR32. The load folding then looks at MOVSS, at the
user, and bails out when it sees a size mismatch.
What we really know is that the rm_Int instructions don't load the
higher lanes, so folding is fine.
This happens for the straightforward intrinsic code, e.g.:
_mm_add_ss(a, _mm_load_ss(p));
Fixes PR23349.
Differential Revision: http://reviews.llvm.org/D10554
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240326
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Mon, 22 Jun 2015 20:37:46 +0000 (20:37 +0000)]
MIR Serialization: Introduce a lexer for machine instructions.
This commit adds a function that tokenizes the string containing
the machine instruction. This commit also adds a struct called
'MIToken' which is used to represent the lexer's tokens.
Reviewers: Sean Silva
Differential Revision: http://reviews.llvm.org/D10521
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240323
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Mon, 22 Jun 2015 20:26:54 +0000 (20:26 +0000)]
SafeStack: Create the unsafe stack pointer on demand.
This avoids creating an unnecessary undefined reference on targets such as
NVPTX that require such references to be declared in asm output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240321
91177308-0d34-0410-b5e6-
96231b3b80d8
Pete Cooper [Mon, 22 Jun 2015 19:57:33 +0000 (19:57 +0000)]
Move MCSymbol Value in to the union of Offset and CommonSize.
This is a reapplication of r239440 which was reverted in r239441.
There are no changes to this patch from then, but this had instead exposed
a bug in .thumb_set which was fixed in r240318. Having fixed that bug, it
is now safe to re-apply this code.
Original commit message below:
It wasn't possible to have a variable Symbol with offset or 'isCommon' so
this just enables better packing of the MCSymbol class.
Reviewed by Rafael Espindola.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240320
91177308-0d34-0410-b5e6-
96231b3b80d8
Pete Cooper [Mon, 22 Jun 2015 19:35:57 +0000 (19:35 +0000)]
Change .thumb_set to have the same error checks as .set.
According to the documentation, .thumb_set is 'the equivalent of a .set directive'.
We didn't have equivalent behaviour in terms of all the errors we could throw, for
example, when a symbol is redefined.
This change refactors parseAssignment so that it can be used by .set and .thumb_set
and implements tests for .thumb_set for all the errors thrown by that method.
Reviewed by Rafael Espíndola.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240318
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Mon, 22 Jun 2015 18:59:44 +0000 (18:59 +0000)]
Remove "const" from the MachineFunction reference in VLIWPacketizerList
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240317
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Mon, 22 Jun 2015 18:55:46 +0000 (18:55 +0000)]
docs: Update allowed values for LLVM_USE_SANITIZER
"Thread" and combinations of "Address" and "Undefined" have been
accepted for a while now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240316
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Mon, 22 Jun 2015 18:29:44 +0000 (18:29 +0000)]
[x86] set default reciprocal (division and square root) codegen to match GCC
D8982 ( checked in at http://reviews.llvm.org/rL239001 ) added command-line
options to allow reciprocal estimate instructions to be used in place of
divisions and square roots.
This patch changes the default settings for x86 targets to allow that recip
codegen (except for scalar division because that breaks too much code) when
using -ffast-math or its equivalent.
This matches GCC behavior for this kind of codegen.
Differential Revision: http://reviews.llvm.org/D10396
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240310
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Mon, 22 Jun 2015 18:24:50 +0000 (18:24 +0000)]
Fix MSVC build (again!).
Remove two `typename`s that I should have removed in r240307 but left in
by mistake.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240309
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 22 Jun 2015 18:24:01 +0000 (18:24 +0000)]
Do not pass -allow-shlib-undefined to the Solaris linker.
Patch by Xan López.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240308
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Mon, 22 Jun 2015 18:20:10 +0000 (18:20 +0000)]
Fix MSVC build.
I had some unnecessary `typename`s left in after addressing review.
This compiled successfully with clang++ but MSVC reported an error. Fix
the build error by removing the redundant `typename`s.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240307
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 22 Jun 2015 18:06:15 +0000 (18:06 +0000)]
Remove the IsStreamed member variable.
Having different code paths for streamed and regular bitcode reading was a
source of bugs in the past and this defines them away.
It has a small but noticeable impact on performance. I timed running
"opt -disable-output -disable-verify" on a ltoed clang. It goes from
14.
752845231 seconds time elapsed ( +- 0.16% )
to
15.
012463721 seconds time elapsed ( +- 0.11% )
Extracted from a patch by Karl Schimpf.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240305
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Mon, 22 Jun 2015 18:03:02 +0000 (18:03 +0000)]
[FaultMaps] Add a parser for the __llvm__faultmaps section.
Summary:
The parser is exercised by llvm-objdump using -print-fault-maps. As is
probably obvious, the code itself was "heavily inspired" by
http://reviews.llvm.org/D10434.
Reviewers: reames, atrick, JosephTremoulet
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D10491
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240304
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Mon, 22 Jun 2015 18:02:55 +0000 (18:02 +0000)]
[NFC] Capitalization in documentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240303
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 22 Jun 2015 17:52:52 +0000 (17:52 +0000)]
Bring r240130 back.
Now that pr23900 is fixed, we can bring it back with no changes.
Original message:
Make all temporary symbols unnamed.
What this does is make all symbols that would otherwise start with a .L
(or L on MachO) unnamed.
Some of these symbols still show up in the symbol table, but we can just
make them unnamed.
In order to make sure we produce identical results when going thought assembly,
all .L (not just the compiler produced ones), are now unnamed.
Running llc on llvm-as.opt.bc, the peak memory usage goes from 208.24MB to
205.57MB.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240302
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 22 Jun 2015 17:46:53 +0000 (17:46 +0000)]
Avoid a Symbol -> Name -> Symbol conversion.
Before this we were producing a TargetExternalSymbol from a MCSymbol.
That meant extracting the symbol name and fetching the symbol again
down the pipeline.
This patch adds a DAG.getMCSymbol that lets the MCSymbol pass unchanged on the
DAG.
Doing so removes the need for MO_NOPREFIX and fixes the root cause of pr23900,
allowing r240130 to be committed again.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240300
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Mon, 22 Jun 2015 17:02:30 +0000 (17:02 +0000)]
MIR Serialization: Serialize machine instruction names.
This commit implements initial machine instruction serialization. It
serializes machine instruction names. The instructions are represented
using a YAML sequence of string literals and are a part of machine
basic block YAML mapping.
This commit introduces a class called 'MIParser' which will be used to
parse the machine instructions and operands.
Reviewers: Duncan P. N. Exon Smith
Differential Revision: http://reviews.llvm.org/D10481
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240295
91177308-0d34-0410-b5e6-
96231b3b80d8
Pawel Bylica [Mon, 22 Jun 2015 15:58:11 +0000 (15:58 +0000)]
Fix shl folding in DAG combiner.
Summary: The code responsible for shl folding in the DAGCombiner was assuming incorrectly that all constants are less than 64 bits. This patch simply changes the way values are compared.
Test Plan: A regression test included.
Reviewers: andreadb
Reviewed By: andreadb
Subscribers: andreadb, test, llvm-commits
Differential Revision: http://reviews.llvm.org/D10602
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240291
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 22 Jun 2015 15:44:20 +0000 (15:44 +0000)]
Add a triple to the test to fix it on some hosts.
The slp vectorizer doesn't optimize this case in 32 bits.
Fixes PR23453.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240289
91177308-0d34-0410-b5e6-
96231b3b80d8
Joseph Tremoulet [Mon, 22 Jun 2015 15:27:58 +0000 (15:27 +0000)]
[ORC] Add NullResolver
Summary:
This is an implementation of RuntimeDyld::SymbolResolver that simply
rejects all resolution requests; useful for clients that do not have any
cross-object symbol references.
Reviewers: lhames
Reviewed By: lhames
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D10455
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240288
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 22 Jun 2015 15:06:17 +0000 (15:06 +0000)]
Support Solaris unused sections' gc link syntax.
It is not clear if this would work or not with LLVM_NO_DEAD_STRIP
binaries, so be conservative for now.
Patch by Xan López.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240287
91177308-0d34-0410-b5e6-
96231b3b80d8
Toma Tabacu [Mon, 22 Jun 2015 13:10:23 +0000 (13:10 +0000)]
[mips] [IAS] Add support for LAReg with identical source and destination register operands.
Summary: In this case, we're supposed to load the immediate in AT and then ADDu it with the source register and put it in the destination register.
Reviewers: dsanders
Reviewed By: dsanders
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D9367
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240278
91177308-0d34-0410-b5e6-
96231b3b80d8
Elena Demikhovsky [Mon, 22 Jun 2015 13:00:42 +0000 (13:00 +0000)]
AVX-512: added VPSHUFB instruction - all SKX forms
Added intrinsics and encoding tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240277
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 22 Jun 2015 12:41:52 +0000 (12:41 +0000)]
Do not pass optimization flags to Solaris' linker.
It is not supported.
Patch by Xan López.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240276
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 22 Jun 2015 12:34:54 +0000 (12:34 +0000)]
Use right syntax to pass version script to Solaris' ld.
Patch by Xan Lopez!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240275
91177308-0d34-0410-b5e6-
96231b3b80d8