Commit Graph

123648 Commits

Author SHA1 Message Date
Ahmed Bougacha
3ba3c01646 [X86] SRL non-LSB extracts when folding to truncating broadcasts.
Now that we recognize this, we can support it instead of bailing out.
That is, we can fold:
  (v8i16 (shufflevector
    (v8i16 (bitcast (v4i32 (build_vector X, Y, ...)))),
    <1,1,...,1>))
into:
  (v8i16 (vbroadcast (i16 (trunc (srl Y, 16)))))

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252362 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-06 23:16:43 +00:00
Ahmed Bougacha
b1769420b8 [X86] Don't fold non-LSB extracts into truncating broadcasts.
We used to incorrectly assume that the offset we're extracting from
was a multiple of the element size. So, we'd fold:
  (v8i16 (shufflevector
    (v8i16 (bitcast (v4i32 (build_vector X, Y, ...)))),
    <1,1,...,1>))
into:
  (v8i16 (vbroadcast (i16 (trunc Y))))
whereas we should have extracted the higher bits from X.

Instead, bail out if the assumption doesn't hold.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252361 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-06 23:16:38 +00:00
Tom Stellard
136bd632b6 DAGCombiner: Check shouldReduceLoadWidth before combining (and (load), x) -> extload
Reviewers: resistor, arsenm

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252349 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-06 21:58:37 +00:00
Dan Gohman
b9615b21ea [WebAssembly] Use more explicit types in testcases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252345 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-06 21:32:42 +00:00
Dan Gohman
df86d51b37 [WebAssembly] Add more explicit pushes to the tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252344 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-06 21:26:50 +00:00
David Majnemer
16261dd30c [InstCombine] Don't RAUW tokens with undef
Let SimplifyCFG remove unreachable BBs which define token instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252343 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-06 21:26:32 +00:00
Davide Italiano
b418909313 [SimplifyLibCalls] Don't hardcode the function name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252342 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-06 21:05:07 +00:00
Quentin Colombet
1cc0c4325b [ShrinkWrapping] Teach shrink-wrapping how to analyze RegMask.
Previously we were conservatively assuming that RegMask operands clobber
callee saved registers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252341 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-06 21:00:13 +00:00
Matthias Braun
810bd4f219 MachineScheduler: Add regpressure information to debug dump
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252340 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-06 20:59:02 +00:00
Tom Stellard
bc78f60f4a AMDGPU/SI: Refactor VOP[12C] tablegen definitions
Summary:
Pass the VOPProfile object all the through to *_m multiclasses.  This will
allow us to do more simplifications in the future.

Reviewers: arsenm

Subscribers: arsenm, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252339 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-06 20:56:18 +00:00
Mehdi Amini
7d84928143 Fix SLPVectorizer commutativity reordering
The SLPVectorizer had a very crude way of trying to benefit
from associativity: it tried to optimize for splat/broadcast
or in order to have the same operator on the same side.
This is benefitial to the cost model and allows more vectorization
to occur.
This patch improve the logic and make the detection optimal (locally,
we don't look at the full tree but only at the immediate children).

Should fix https://llvm.org/bugs/show_bug.cgi?id=25247

Reviewers: mzolotukhin

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

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252337 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-06 20:17:51 +00:00
Andrew Kaylor
91950eea55 Improved the operands commute transformation for X86-FMA3 instructions.
All 3 operands of FMA3 instructions are commutable now.

Patch by Slava Klochkov

Reviewers: Quentin Colombet(qcolombet), Ahmed Bougacha(ab).

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252335 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-06 19:47:25 +00:00
Dan Gohman
11228e360e [WebAssembly] Make expression-stack pushing explicit
Modelling of the expression stack is evolving. This patch takes another
step by making pushes explicit.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252334 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-06 19:45:01 +00:00
Sanjoy Das
e2b013ff76 [ValueTracking] Add parameters to isImpliedCondition; NFC
Summary:
This change makes the `isImpliedCondition` interface similar to the rest
of the functions in ValueTracking (in that it takes a DataLayout,
AssumptionCache etc.).  This is an NFC, intended to make a later diff
less noisy.

Depends on D14369

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252333 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-06 19:01:08 +00:00
Sanjoy Das
18e290023d [ValueTracking] De-pessimize isImpliedCondition around unsigned compares
Summary:
Currently `isImpliedCondition` will optimize "I +_nuw C < L ==> I < L"
only if C is positive.  This is an unnecessary restriction -- the
implication holds even if `C` is negative.

Reviewers: reames, majnemer

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252332 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-06 19:01:03 +00:00
Sanjoy Das
772fb1e0b6 [ValueTracking] Add a framework for encoding implication rules
Summary:
This change adds a framework for adding more smarts to
`isImpliedCondition` around inequalities.  Informally,
`isImpliedCondition` will now try to prove "A < B ==> C < D" by proving
"C <= A && B <= D", since then it follows "C <= A < B <= D".

While this change is in principle NFC, I could not think of a way to not
handle cases like "i +_nsw 1 < L ==> i < L +_nsw 1" (that ValueTracking
did not handle before) while keeping the change understandable.  I've
added tests for these cases.

Reviewers: reames, majnemer, hfinkel

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252331 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-06 19:00:57 +00:00
Renato Golin
abe916ea5c [Docs] Change ARM build info to CMake
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252329 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-06 18:39:34 +00:00
Matt Arsenault
fd920596a2 AMDGPU: Cleanup includes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252328 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-06 18:23:00 +00:00
Matt Arsenault
ade9b95acb AMDGPU: Create emergency stack slots during frame lowering
Test has a bogus verifier error which will be fixed by later commits.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252327 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-06 18:17:45 +00:00
Matt Arsenault
2b642eb437 AMDGPU: Remove unused scratch resource operands
The SGPR spill pseudos don't actually use them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252324 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-06 18:07:53 +00:00
Matt Arsenault
454a57ccb6 AMDGPU: Add pass to detect used kernel features
Mark kernels that use certain features that require user
SGPRs to support with kernel attributes. We need to know
before instruction selection begins because it impacts
the kernel calling convention lowering.

For now this only detects the workitem intrinsics.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252323 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-06 18:01:57 +00:00
Matt Arsenault
af4bb57907 AMDGPU: Fix hardcoded alignment of spill.
Instead of forcing 4 alignment when spilled, set register class
alignments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252322 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-06 17:54:47 +00:00
Matt Arsenault
bf0ce512c5 AMDGPU: Hack for VS_32 register pressure
For some reason VS_32 ends up factoring into the pressure heuristics
even though we should never see a virtual register with this class.

When SGPRs are reserved for register spilling, this for some reason
triggers reg-crit scheduling.

Setting isAllocatable = 0 may help with this since that seems to remove
it from the default implementation's generated table.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252321 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-06 17:54:43 +00:00
Teresa Johnson
99ee897f54 Restore "Move metadata linking after lazy global materialization/linking."
Summary:
This reverts commit r251965.

Restore "Move metadata linking after lazy global materialization/linking."

This restores commit r251926, with fixes for the LTO bootstrapping bot
failure.

The bot failure was caused by references from debug metadata to
otherwise unreferenced globals. Previously, this caused the lazy linking
to link in their defs, which is unnecessary. With this patch, because
lazy linking is complete when we encounter the metadata reference, the
materializer created a declaration. For definitions such as aliases and
comdats, it is illegal to have a declaration. Furthermore, metadata
linking should not change code generation. Therefore, when linking of
global value bodies is complete, the materializer will simply return
nullptr as the new reference for the linked metadata.

This change required fixing a different test to ensure there was a
real reference to a linkonce global that was only being reference from
metadata.

Note that the new changes to the only-needed-named-metadata.ll test
illustrate an issue with llvm-link -only-needed handling of comdat
groups, whereby it may result in an incomplete comdat group. I note this
in the test comments, but the issue is orthogonal to this patch (it can
be reproduced without any metadata at head).

Reviewers: dexonsmith, rafael, tra

Subscribers: tobiasvk, joker.eph, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252320 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-06 17:50:53 +00:00
Teresa Johnson
46c7bcb5d1 Restore "Move metadata linking after lazy global materialization/linking."
This reverts commit r251965.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252319 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-06 17:50:48 +00:00
Reid Kleckner
f0a04c06ab [WinEH] Mark funclet entries and exits as clobbering all registers
Summary:
In this implementation, LiveIntervalAnalysis invents a few register
masks on basic block boundaries that preserve no registers. The nice
thing about this is that it prevents the prologue inserter from thinking
it needs to spill all XMM CSRs, because it doesn't see any explicit
physreg defs in the MI.

Reviewers: MatzeB, qcolombet, JosephTremoulet, majnemer

Subscribers: MatzeB, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252318 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-06 17:06:38 +00:00
Chad Rosier
8be4aacc6e [LIR] Simplify code by making DataLayout globally accessible. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252317 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-06 16:33:57 +00:00
Jun Bum Lim
de4969d37c [AArch64]Enable the narrow ld promotion only on profitable microarchitectures
The benefit from converting narrow loads into a wider load (r251438) could be
micro-architecturally dependent, as it assumes that a single load with two bitfield
extracts is cheaper than two narrow loads. Currently, this conversion is
enabled only in cortex-a57 on which performance benefits were verified.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252316 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-06 16:27:47 +00:00
Rafael Espindola
012d959bc5 Bring r252305 back with a test fix.
We now create the .eh_frame section early, just like every other special
section.

This means that the special flags are visible in code that explicitly
asks for ".eh_frame".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252313 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-06 15:30:45 +00:00
Rafael Espindola
f7b07fc667 Revert "Simplify the creation of .eh_frame/.debug_frame sections."
This reverts commit r252305.

Investigating a test failure.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252306 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-06 14:51:09 +00:00
Rafael Espindola
e48fa8c07e Simplify the creation of .eh_frame/.debug_frame sections.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252305 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-06 14:47:44 +00:00
Rafael Espindola
8ebb149114 git clang-format and fix variable names. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252304 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-06 14:12:17 +00:00
Rafael Espindola
20db473172 Use SHT_X86_64_UNWIND on every OS.
That is the ABI required type. Linkers still check the section name, so
everything should still work.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252300 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-06 13:35:35 +00:00
Rafael Espindola
ee3332fb71 Pass SectionStart directly to the one function that uses it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252299 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-06 13:14:59 +00:00
Daniel Sanders
169bb7dc81 [mips][ias] Range check uimm4 operands and fixed a bug this revealed.
Summary:
The bug was that the sldi instructions have immediate widths dependant on
their element size. So sldi.d has a 1-bit immediate and sldi.b has a 4-bit
immediate. All of these were using 4-bit immediates previously.

Reviewers: vkalintiris

Subscribers: llvm-commits, atanasyan, dsanders

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252297 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-06 12:41:43 +00:00
Daniel Sanders
4b305e4b19 [mips][ias] Range check uimm3 operands.
Summary:

Reviewers: vkalintiris

Subscribers: atanasyan, dsanders, llvm-commits

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252296 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-06 12:31:27 +00:00
Daniel Sanders
f5ed626e96 [mips][ias] Range check uimm2 operands and fix a bug this revealed.
Summary:
The bug was that the MIPS32R6/MIPS64R6/microMIPS32R6 versions of LSA and DLSA
(unlike the MSA version) failed to account for the off-by-one encoding of the
immediate. The range is actually 1..4 rather than 0..3.

Reviewers: vkalintiris

Subscribers: atanasyan, dsanders, llvm-commits

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252295 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-06 12:22:31 +00:00
Daniel Sanders
b08deab895 [mips][ias] Range check uimmz operands.
Reviewers: vkalintiris

Subscribers: dsanders, atanasyan, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252294 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-06 12:11:03 +00:00
Vasileios Kalintiris
309de66dc9 [mips] Define patterns for the atomic_{load,store}_{8,16,32,64} nodes.
Summary:
Without these patterns we would generate a complete LL/SC sequence.
This would be problematic for memory regions marked as WRITE-only or
READ-only, as the instructions LL/SC would read/write to the protected
memory regions correspondingly.

Reviewers: dsanders

Subscribers: llvm-commits, dsanders

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252293 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-06 12:07:20 +00:00
Tom Stellard
65cad952e4 AMDGPU/SI: Emit HSA kernels with symbol type STT_AMDGPU_HSA_KERNEL
Reviewers: arsenm

Subscribers: arsenm, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252291 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-06 11:45:14 +00:00
James Molloy
d001932f3a Add a new attribute: norecurse
This attribute allows the compiler to assume that the function never recurses into itself, either directly or indirectly (transitively). This can be used among other things to demote global variables to locals.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252282 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-06 10:32:53 +00:00
NAKAMURA Takumi
2c55ab4f58 DIBuilder.h: Prune \param(s) corresponding to r252219. [-Wdocumentation]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252280 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-06 10:30:32 +00:00
NAKAMURA Takumi
353c554d98 Revert r252249 (and r252255, r252258), "[WinEH] Clone funclets with multiple parents"
It behaved flaky due to iterating pointer key values on std::set and std::map.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252279 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-06 10:07:33 +00:00
Xinliang David Li
4d774a3941 Code style fix (caused by wrongly default clang-format style) (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252276 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-06 07:54:21 +00:00
Rafael Espindola
bf27814484 Simplify the alignment handling in FDE emission.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252271 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-06 03:02:51 +00:00
Rafael Espindola
63ab0b3c13 Delete dead store. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252270 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-06 02:44:22 +00:00
Peter Collingbourne
d04e60e166 docs: Document function-attached metadata and IR changes from r252219.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252268 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-06 02:41:02 +00:00
Reid Kleckner
baea4d9d8f Range-for some LiveIntervals code under review
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252267 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-06 02:01:02 +00:00
Reid Kleckner
2ff8f92da7 [WinEH] Split EH_RESTORE out of CATCHRET for 32-bit EH
This adds the EH_RESTORE x86 pseudo instr, which is responsible for
restoring the stack pointers: EBP and ESP, and ESI if stack realignment
is involved. We only need this on 32-bit x86, because on x64 the runtime
restores CSRs for us.

Previously we had to keep the CATCHRET instruction around during SEH so
that we could convince X86FrameLowering to restore our frame pointers.
Now we can split these instructions earlier.

This was confusing, because we had a return instruction which wasn't
really a return and was ultimately going to be removed by
X86FrameLowering. This change also simplifies X86FrameLowering, which
really shouldn't be building new MBBs.

No observable functional change currently, but with the new register
mask stuff in D14407, CATCHRET will become a register allocator barrier,
and our existing tests rely on us having reasonable register allocation
around SEH.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252266 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-06 01:49:05 +00:00
Cameron Esfahani
70de10b99a NFC: Update documentation for createUniqueFile() to explain that models without an absolute path will be created in the current directory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252265 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-06 01:45:30 +00:00