Commit Graph

118910 Commits

Author SHA1 Message Date
Benjamin Kramer
530a616a9d [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
2015-06-23 14:47:36 +00:00
Benjamin Kramer
336ead08bd [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
2015-06-23 14:47:29 +00:00
Benjamin Kramer
d18bb88b2e [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
2015-06-23 14:47:18 +00:00
Rafael Espindola
7376033762 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
2015-06-23 14:42:34 +00:00
Toma Tabacu
115be6213d [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
2015-06-23 14:39:42 +00:00
Rafael Espindola
0e9288493a 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
2015-06-23 14:11:09 +00:00
Toma Tabacu
88278a22cc [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
2015-06-23 14:00:54 +00:00
Rafael Espindola
9758b4ae95 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
2015-06-23 13:59:29 +00:00
Petar Jovanovic
7c5bf4d38a [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
2015-06-23 13:54:42 +00:00
Krzysztof Parzyszek
14e438dfb3 [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
2015-06-23 13:50:23 +00:00
Toma Tabacu
29e004491e [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
2015-06-23 12:34:19 +00:00
Rafael Espindola
7737c637f0 Don't repeat names in comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240396 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-23 12:29:52 +00:00
Rafael Espindola
b9ed9af341 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
2015-06-23 12:21:54 +00:00
Daniel Jasper
b7f5b8b4b2 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
2015-06-23 11:31:32 +00:00
Alexander Kornienko
b7c46b5fc9 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
2015-06-23 10:48:35 +00:00
Daniel Sanders
43fab48d42 [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
2015-06-23 10:11:36 +00:00
Alexander Kornienko
cd52a7a381 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
2015-06-23 09:49:53 +00:00
Elena Demikhovsky
d96e362b3f 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
2015-06-23 08:19:46 +00:00
Justin Bogner
1e4a7e02f8 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
2015-06-23 07:32:55 +00:00
Justin Bogner
46a8f93144 [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
2015-06-23 07:28:57 +00:00
Justin Bogner
a915f41453 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
2015-06-23 06:46:54 +00:00
Weiming Zhao
ab3926f6e4 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
2015-06-23 05:31:09 +00:00
Rafael Espindola
9e7539a79f 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
2015-06-23 03:45:23 +00:00
Rafael Espindola
da523bd707 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
2015-06-23 03:42:44 +00:00
Rafael Espindola
8bfd2e8447 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
2015-06-23 03:36:08 +00:00
David Majnemer
3f2dc2455d [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
2015-06-23 02:49:24 +00:00
Rafael Espindola
393bbf5c86 Fix tests when X86 is not enabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240368 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-23 02:45:44 +00:00
Rafael Espindola
dba070638a 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
2015-06-23 02:20:37 +00:00
Rafael Espindola
344dd6519e 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
2015-06-23 02:08:48 +00:00
Matt Arsenault
080d72c9a5 AMDGPU: Use getAsInteger instead of atoi
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240365 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-23 02:05:55 +00:00
Sanjoy Das
c49542e5bb [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
2015-06-23 01:05:26 +00:00
Sanjoy Das
14b492752c 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
2015-06-23 01:05:21 +00:00
NAKAMURA Takumi
b5aa0b9af4 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
2015-06-23 00:59:12 +00:00
Sanjay Patel
8bd59f505a [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
2015-06-23 00:39:40 +00:00
Justin Bogner
b06f3b4a33 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
2015-06-22 23:58:05 +00:00
Justin Bogner
fe3176fc13 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
2015-06-22 23:56:53 +00:00
Pete Cooper
46a3ee7346 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
2015-06-22 23:48:35 +00:00
Evgeniy Stepanov
845d1a6a17 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
2015-06-22 23:36:03 +00:00
Logan Chien
3755f9f48c 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
2015-06-22 23:16:02 +00:00
Adam Nemet
08056a49f1 [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
2015-06-22 22:59:40 +00:00
David Blaikie
0c17f95006 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
2015-06-22 22:06:37 +00:00
Chris Bieneman
cf300d8b0e [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
2015-06-22 21:58:02 +00:00
Pawel Bylica
e903f64b10 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
2015-06-22 21:54:07 +00:00
Simon Pilgrim
7132523d6a [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
2015-06-22 21:49:41 +00:00
Peter Collingbourne
c2433959db 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
2015-06-22 21:46:51 +00:00
Joseph Tremoulet
864619a387 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
2015-06-22 21:37:34 +00:00
Frederic Riss
11fcb49922 [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
2015-06-22 21:33:24 +00:00
Pawel Bylica
9a2f12cea9 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
2015-06-22 21:18:10 +00:00
Hans Wennborg
33d68a5183 test-release.sh: Minor fixes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240334 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-22 21:13:30 +00:00
Simon Pilgrim
6f214c72d6 [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
2015-06-22 21:10:42 +00:00