Commit Graph

130091 Commits

Author SHA1 Message Date
Quentin Colombet
1a11591ceb [RegBankSelect] Teach the repairing code how to handle physical
registers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266029 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-12 00:38:51 +00:00
Quentin Colombet
08f81ce293 [AArch64] Add a test case for the propagation of register banks through
phis.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266028 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-12 00:32:55 +00:00
Quentin Colombet
edae2f105b [RegisterBankInfo] Do not provide a default mapping for non-reg of phi
operations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266027 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-12 00:30:14 +00:00
Quentin Colombet
73ec6f759b [AArch64] Add a test case for the repairing of definitions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266026 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-12 00:25:22 +00:00
Quentin Colombet
be78bfb92c [RegBankSelect] Teach how to repair definitions.
Although repairing definitions is not mandatory for correctness (only
phis would be impacted because of the RPO traversal), not repairing
might go against the cost model. Therefore, just repair when it is
possible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266025 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-12 00:12:59 +00:00
Quentin Colombet
4307705245 [MachineIRBuilder] Expose the insertion point in the public API.
It may be convenient to know where we are about to insert some code, for
instance to save and then restore this insertion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266024 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-12 00:07:14 +00:00
JF Bastien
9701ed8d76 MergeFunctions: test alloca better
r237193 fix handling of alloca size / align in MergeFunctions, but only tested one and didn't follow FunctionComparator::cmpOperations's usual comparison pattern. It also didn't update Instruction.cpp:haveSameSpecialState which I'll do separately.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266022 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-12 00:03:26 +00:00
Quentin Colombet
bf9de3a3ee [AArch64] Test that RegBankSelect inserts the proper copies to fix the
register bank assignments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266021 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-12 00:00:42 +00:00
Derek Schuff
40e099b405 Replace MachineRegisterInfo::TracksLiveness with a MachineFunctionProperty
Use the MachineFunctionProperty mechanism to indicate whether the
liveness info is accurate instead of a bool flag on MRI.
Keeps the MRI accessor function for convenience. NFC

Differential Revision: http://reviews.llvm.org/D18767

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266020 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-11 23:32:13 +00:00
Adrian Prantl
5ed848ead6 Add a missing DICompileUnit to testcase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266019 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-11 23:30:29 +00:00
Mehdi Amini
18a65be70f ThinLTO renaming: use module hash instead of position in the summary
This is more robust to changes in the link ordering.

Differential Revision: http://reviews.llvm.org/D18946

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266018 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-11 23:26:46 +00:00
Adrian Prantl
f53db33e15 Legalize the debug info in this testcase in anticipation of future Verifier improvements.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266017 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-11 23:26:31 +00:00
JF Bastien
382ee0ee8c AtomicExpandPass: mark assert variable as used
Avoid -Wunused-variable

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266016 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-11 23:03:54 +00:00
James Y Knight
076e8dfe0b Fix compile with GCC after r266002 (Add __atomic_* lowering to AtomicExpandPass)
It doesn't like implicitly calling the ArrayRef constructor with a
returned array -- it appears to decays the returned value to a pointer,
first, before trying to make an ArrayRef out of it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266011 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-11 22:52:42 +00:00
Justin Bogner
b4aa9bf76e CodeGen: Fix a use-after-free in TailDuplication
The call to processPHI already erased MI from its parent, so MI isn't
even valid here, making the getParent() call a use-after-free in
addition to being redundant.

Found by ASan with the ArrayRecycler changes in llvm.org/pr26808.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266008 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-11 22:37:13 +00:00
JF Bastien
eb5d561d4c NFC: keep comment up to date
MergeFunctions was refactored a while ago, and Instruction.cpp's comments went out of sync. The content did as well, will fix later.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266007 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-11 22:30:37 +00:00
Evgeniy Stepanov
00cd59a292 [safestack] Add canary to unsafe stack frames
Add StackProtector to SafeStack. This adds limited protection against
data corruption in the caller frame. Current implementation treats
all stack protector levels as -fstack-protector-all.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266004 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-11 22:27:48 +00:00
Tim Northover
47cbd520cf ARM: use r7 as the frame-pointer on all MachO targets.
This is better for a few reasons:
  + It matches the other tooling for iOS.
  + It matches EABI in more cases (i.e. Thumb-mode, and in practice we don't
    use ARM mode).
  + It leads to infinitesimally smaller code (0.2%, yay!).

rdar://25369506

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266003 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-11 22:27:40 +00:00
James Y Knight
36720c565c Add __atomic_* lowering to AtomicExpandPass.
AtomicExpandPass can now lower atomic load, atomic store, atomicrmw, and
cmpxchg instructions to __atomic_* library calls, when the target
doesn't support atomics of a given size.

This is the first step towards moving all atomic lowering from clang
into llvm. When all is done, the behavior of __sync_* builtins,
__atomic_* builtins, and C11 atomics will be unified.

Previously LLVM would pass everything through to the ISelLowering
code. There, unsupported atomic instructions would turn into __sync_*
library calls. Because of that behavior, Clang currently avoids emitting
llvm IR atomic instructions when this would happen, and emits __atomic_*
library functions itself, in the frontend.

This change makes LLVM able to emit __atomic_* libcalls, and thus will
eventually allow clang to depend on LLVM to do the right thing.

It is advantageous to do the new lowering to atomic libcalls in
AtomicExpandPass, before ISel time, because it's important that all
atomic operations for a given size either lower to __atomic_*
libcalls (which may use locks), or native instructions which won't. No
mixing and matching.

At the moment, this code is enabled only for SPARC, as a
demonstration. The next commit will expand support to all of the other
targets.

Differential Revision: http://reviews.llvm.org/D18200

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266002 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-11 22:22:33 +00:00
Manman Ren
53d36f5645 swifterror: fix up a testing case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266000 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-11 21:45:33 +00:00
Davide Italiano
d63fceeb37 [DebugInfo/Test] Add CU as required.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265999 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-11 21:16:48 +00:00
Simon Pilgrim
1f4a5003d2 [DAGCombiner] Fold xor/and/or (bitcast(A), bitcast(B)) -> bitcast(op (A,B)) anytime before LegalizeVectorOprs
xor/and/or (bitcast(A), bitcast(B)) -> bitcast(op (A,B)) was only being combined at the AfterLegalizeTypes stage, this patch permits the combine to occur anytime before then as well.

The main aim with this to improve the ability to recognise bitmasks that can be converted to shuffles.

I had to modify a number of AVX512 mask tests as the basic bitcast to/from scalar pattern was being stripped out, preventing testing of the mmask bitops. By replacing the bitcasts with loads we can get almost the same result.

Differential Revision: http://reviews.llvm.org/D18944

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265998 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-11 21:10:33 +00:00
Manman Ren
b99afeb7f7 Swift Calling Convention: swifterror target support.
Differential Revision: http://reviews.llvm.org/D18716


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265997 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-11 21:08:06 +00:00
Adrian Prantl
2f1daccfad Revert accidentally committed change
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265996 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-11 21:00:26 +00:00
Adrian Prantl
29b4ba0da5 Add missing DICompileUnit to this testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265995 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-11 20:58:57 +00:00
Zachary Turner
21c130455f Fix some display bugs in llvm-pdbdump.
We were incorrectly reporting all non-64 bit integers as int64s.
This is most evident when trying to print the "short" type, but
in theory could happen with chars too (although usually chars use
a different builtin type).

Additionally, we were using the wrong check when deciding whether
to print an enum definition as a global enum.  We were checking
whether or not the enum was "nested", and if so saving it until
we print the class definition that it was nested in.  But this is
not correct in rare situations where the enum is nested, but the
class that it's nested in does not have type information in the PDB.
So instead we check if there is a class definition for the parent
in the PDB.  If so we save it for later, otherwise we print it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265993 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-11 20:39:17 +00:00
Tom Stellard
62063a8486 Revert "AMDGPU/SI: Do not generate s_waitcnt after ds_permute/ds_bpermute"
This reverts commit r263720.

Just confirmed that s_waitcnt is required after ds_permute/ds_bpermute.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265992 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-11 20:38:40 +00:00
Hans Wennborg
ea91af800b Fix repeated conditional expression (PR20711)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265990 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-11 20:36:05 +00:00
Hans Wennborg
9884687ac7 Fix broken assert, PR24624
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265989 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-11 20:35:41 +00:00
Hans Wennborg
f721b994c5 Remove redundant .c_str(), as suggested by PR25633
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265988 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-11 20:35:17 +00:00
Hans Wennborg
683020d01d Fix a couple of redundant conditional expressions (PR27283, PR28282)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265987 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-11 20:35:01 +00:00
Sanjay Patel
f3fc3d19a4 use range-loops; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265985 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-11 20:13:44 +00:00
Tim Northover
77e5760b43 MCParser: diagnose missing directional labels more clearly.
Before, ELF at least managed a diagnostic but it was a completely untraceable
"undefined symbol" error. MachO had a variety of even worse behaviours: crash,
emit corrupt file, or an equally bad message.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265984 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-11 19:50:46 +00:00
Matthew Simpson
09e9ded8a1 [LoopUtils, LV] Fix PR27246 (first-order recurrences)
This patch ensures that when we detect first-order recurrences, we reject a phi
node if its previous value is also a phi node. During vectorization the initial
and previous values of the recurrence are shuffled together to create the value
for the current iteration. However, phi nodes are not widened like other
instructions. This fixes PR27246.

Differential Revision: http://reviews.llvm.org/D18971

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265983 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-11 19:48:18 +00:00
Davide Italiano
e09329d549 [DebugInfo] Fix even more tests to include DICompileunit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265980 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-11 18:53:27 +00:00
Sriraman Tallam
0fd07efa78 Test commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265976 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-11 18:40:50 +00:00
Lang Hames
90ae214a17 [Object] Make .alt_entry directive parsing MachO specific.
ELF and COFF will now treat .alt_entry like any other unrecognized directive.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265975 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-11 18:33:45 +00:00
Adrian Prantl
5362126448 Fix missing DICompileUnits in testcases
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265974 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-11 18:15:44 +00:00
Sanjay Patel
013403c592 [InstCombine] consolidate tests for related bugs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265973 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-11 17:58:37 +00:00
Reid Kleckner
41e5af8e94 Use member initializers for all scalar fields of MachineFrameInfo to save boilerplate
No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265972 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-11 17:54:16 +00:00
Reid Kleckner
67e74634d3 Combine redundant stack realignment booleans in MachineFrameInfo
MachineFrameInfo does not need to be able to distinguish between the
user asking us not to realign the stack and the target telling us it
doesn't support stack realignment. Either way, fixed stack objects have
their alignment clamped.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265971 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-11 17:54:03 +00:00
Sanjay Patel
a05380c564 add FIXME comment; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265970 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-11 17:35:57 +00:00
Sanjay Patel
c19ec77e20 add an assert for safety; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265969 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-11 17:27:44 +00:00
Sanjay Patel
38d4f53fc1 variable names start with a capital letter; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265968 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-11 17:25:23 +00:00
Hemant Kulkarni
14dddbfb19 [llvm-readobj] Add ELF hash histogram printing
Differential Revision: http://reviews.llvm.org/D18907

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265967 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-11 17:15:30 +00:00
Xinliang David Li
6a7ae27ea4 Add code comment/NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265966 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-11 17:13:08 +00:00
Sanjay Patel
09a3a210e0 [InstCombine] use canEvaluateShiftedShift() to handle the lshr case (NFCI)
We need just a couple of logic tweaks to consolidate the shl and lshr cases.

This is step 5 of refactoring to solve PR26760:
https://llvm.org/bugs/show_bug.cgi?id=26760



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265965 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-11 17:11:55 +00:00
Adrian Prantl
96f2e57825 Make the distinct DISubprogram in this testcase really distinct.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265962 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-11 16:58:40 +00:00
Adrian Prantl
a265a6ede6 Update discriminator testcases to use proper NoDebug CUs instead of omitting
!llvm.dbg.cu.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265961 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-11 16:58:35 +00:00
Sanjay Patel
5740d620f3 [InstCombine] don't try to shift an illegal amount (PR26760)
This is the straightforward fix for PR26760:
https://llvm.org/bugs/show_bug.cgi?id=26760

But we still need to make some changes to generalize this helper function
and then send the lshr case into here.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265960 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-11 16:50:32 +00:00