38745 Commits

Author SHA1 Message Date
Weiming Zhao
98f00b718b [ARM] Fix 28282: cost computation for constant hoisting
Summary:
This fixes bug: https://llvm.org/bugs/show_bug.cgi?id=28282

Currently the cost model of constant hoisting checks the bit width of the data type of the constants.
However, the actual immediate value is small enough and not need to be hoisted.
This patch checks for the actual bit width needed for the constant.

Reviewers: t.p.northover, rengolin

Subscribers: aemerson, rengolin, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274073 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-28 22:30:45 +00:00
Dehao Chen
527613bc4e Relax the clearance calculating for breaking partial register dependency.
Summary: LLVM assumes that large clearance will hide the partial register spill penalty. But in our experiment, 16 clearance is too small. As the inserted XOR is normally fairly cheap, we should have a higher clearance threshold to aggressively insert XORs that is necessary to break partial register dependency.

Reviewers: wmi, davidxl, stoklund, zansari, myatsina, RKSimon, DavidKreitzer, mkuper, joerg, spatel

Subscribers: davidxl, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274068 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-28 21:19:34 +00:00
Zhan Jun Liau
a1bfbb709d [SystemZ] Use NILL instruction instead of NILF where possible
Summary: SystemZ shift instructions only use the last 6 bits of the shift
amount. When the result of an AND operation is used as a shift amount, this
means that we can use the NILL instruction (which operates on the last 16 bits)
rather than NILF (which operates on the last 32 bits) for a 16-bit savings in
instruction size.

Reviewers: uweigand

Subscribers: llvm-commits

Author: colpell
Committing on behalf of Elliot.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274066 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-28 21:03:19 +00:00
Matthias Braun
b102a31d3c X86FrameLowering: Check subregs when deciding prolog kill flags
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274057 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-28 20:31:56 +00:00
Rafael Espindola
c4cbe67fa8 Use isPositionIndependent in a few more places.
I think this converts all the simple cases that really just care about
the generated code being position independent or not. The remaining
uses are a bit more complicated and are checking things like "is this
a library or executable" or "can this symbol be preempted".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274055 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-28 20:13:36 +00:00
Matt Arsenault
364fc298eb AMDGPU: Fix global isel crashes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274039 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-28 17:42:09 +00:00
Michael Kuperstein
558b25ffb5 [X86] Reorder source list alphabetically. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274036 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-28 17:11:15 +00:00
Matt Arsenault
927f3f9d4a AMDGPU: Fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274034 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-28 16:59:53 +00:00
Matt Arsenault
bd1991ecf2 AMDGPU: Remove unused function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274033 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-28 16:59:49 +00:00
David Majnemer
89493fda7e [X86] Make WRPKRU/RDPKRU pass -verify-machineinstrs
The original implementation attempted to zero registers using
XOR %foo, %foo.  This is problematic because it constitutes a
read-modify-write of a register which might not be defined.

Instead, use MOV32r0 to avoid these problems; expandPostRAPseudo does
the right thing here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274024 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-28 16:04:46 +00:00
Rafael Espindola
eeeea1e6dc Don't pass a Reloc::Model to GVIsIndirectSymbol.
It already has access to it.

While at it, rename it to isGVIndirectSymbol.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274023 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-28 15:38:13 +00:00
Rafael Espindola
b13ddb18db Don't pass Reloc::Model to places that already have it. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274022 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-28 15:18:26 +00:00
Rafael Espindola
3315ba73c8 Convert more cases to isPositionIndependent(). NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274021 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-28 14:33:28 +00:00
Rafael Espindola
a57faa40c2 Delete dead code. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274020 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-28 14:26:39 +00:00
Marcin Koscielnicki
6a26759b4c [SystemZ] Save/restore r6 and r7 if function contains landing pad.
This fixes PR27102.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274017 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-28 14:13:11 +00:00
Simon Pilgrim
93497543cc [X86][AVX] Peek through bitcasts to find the source of broadcasts (reapplied)
AVX1 can only broadcast vectors as floats/doubles, so for 256-bit vectors we insert bitcasts if we are shuffling v8i32/v4i64 types. Unfortunately the presence of these bitcasts prevents the current broadcast lowering code from peeking through cases where we have concatenated / extracted vectors to create the 256-bit vectors.

This patch allows us to peek through bitcasts as long as the number of elements doesn't change (i.e. element bitwidth is the same) so the broadcast index is not affected.

Note this bitcast peek is different from the stage later on which doesn't care about the type and is just trying to find a load node.

As we're being more aggressive with bitcasts, we also need to ensure that the broadcast type is correctly bitcasted

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274013 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-28 13:24:05 +00:00
Rafael Espindola
05bd016f73 Convert 2 more uses to shouldAssumeDSOLocal(). NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274009 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-28 12:49:12 +00:00
Rafael Espindola
f62d1a880b Use isPositionIndependent(). NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274005 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-28 12:25:00 +00:00
Simon Pilgrim
f5d0848f55 [X86][SSE] Added support for combining target shuffles to (V)PSHUFD/VPERMILPD/VPERMILPS immediate permutes
This patch allows target shuffles to be combined to single input immediate permute instructions - (V)PSHUFD/VPERMILPD/VPERMILPS - allowing more general pattern matching than what we current do and improves the likelihood of memory folding compared to existing patterns which tend to reuse the input in multiple arguments.

Further permute instructions (V)PSHUFLW/(V)PSHUFHW/(V)PERMQ/(V)PERMPD may be added in the future but its proven tricky to create tests cases for them so far. (V)PSHUFLW/(V)PSHUFHW is already handled quite well in combineTargetShuffle so it may be that removing some of that code may allow us to perform more of the combining in one place without duplication.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273999 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-28 08:08:15 +00:00
Nick Lewycky
9ad3314df4 NFC. Fix popular typo in comment 'deferencing' --> 'dereferencing'.
Bonus changes, * placement in X86ISelLowering and 'exerce' -> 'exercise' in test.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273984 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-28 01:45:05 +00:00
Matt Arsenault
1bf162a64a AMDGPU: Fix out of bounds indirect indexing errors
This was producing acceses to registers beyond the super
register's limits, resulting in verifier failures.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273977 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-28 01:09:00 +00:00
Matthias Braun
aa99e51240 AArch64: Remove unnecessary namespace llvm; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273975 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-28 00:54:33 +00:00
Matt Arsenault
b0b8d0af0c AMDGPU: Fix global isel build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273964 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-28 00:11:26 +00:00
Rafael Espindola
5e49c0d4a2 Fix typo.
Thanks to Benjamin Kramer for noticing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273959 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 23:21:07 +00:00
Rafael Espindola
d980ed0d00 Move shouldAssumeDSOLocal to Target.
Should fix the shared library build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273958 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 23:15:57 +00:00
Chris Dewhurst
95c869b234 [Sparc] Atomics pass changes to make work with SparcV8 back-ends.
This change reverts a "false" test that was placed to avoid regressions while the atomics pass was completed for the Sparc back-ends.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273949 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 22:11:09 +00:00
Matt Arsenault
e4c2111aa4 AMDGPU: Set MinInstAlignment
Not sure this actually changes anything

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273947 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 21:42:49 +00:00
Rafael Espindola
aac123825e Convert a few more comparisons to isPositionIndependent(). NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273945 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 21:33:08 +00:00
Rafael Espindola
edc588dfd7 Delete the IsStatic predicate.
In all its uses it was equivalent to IsNotPIC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273943 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 21:09:14 +00:00
Matt Arsenault
d35aece639 AMDGPU: Implement per-function subtargets
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273940 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 20:48:03 +00:00
Matt Arsenault
dca409d5ad AMDGPU: Move subtarget feature checks into passes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273937 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 20:32:13 +00:00
Justin Holewinski
76e2771df0 Only emit extension for zeroext/signext arguments if type is < 32 bits
Reviewers: jingyue, jlebar

Subscribers: jholewinski

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273922 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 20:22:22 +00:00
Rafael Espindola
bc84e94c11 Teach shouldAssumeDSOLocal about tls.
Fixes a fixme about handling other visibilities.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273921 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 20:19:14 +00:00
Matt Arsenault
5123c149e7 AMDGPU: Fix verifier errors with undef vector indices
Also fix pointlessly adding exec to liveins.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273916 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 19:57:44 +00:00
Rafael Espindola
c01c8ebe61 Use isPositionIndependent(). NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273907 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 19:15:08 +00:00
Rafael Espindola
4d570622b2 Use isPositionIndependent(). NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273903 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 18:37:44 +00:00
Rafael Espindola
8c57f91d70 Refactor duplicated condition.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273900 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 18:09:22 +00:00
Elena Demikhovsky
89fca4c1b1 X86 Lowering - Fixed a crash in ICMP scalar instruction
Fixed a bug in EmitTest() function in combining shl + icmp.

https://llvm.org/bugs/show_bug.cgi?id=28119



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273899 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 18:07:16 +00:00
Rafael Espindola
0c5a6a8955 Use isPositionIndependent(). NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273896 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 17:21:46 +00:00
Zhan Jun Liau
ff74d2352e [SystemZ] Avoid generating 2 XOR instructions for (and (xor x, -1), y)
Summary:
Created a pattern to match 64-bit mode (and (xor x, -1), y)
to a shorter sequence of instructions.

Before the change, the canonical form is translated to:
        xihf    %r3, 4294967295
        xilf    %r3, 4294967295
        ngr     %r2, %r3

After the change, the canonical form is translated to:
        ngr     %r3, %r2
        xgr     %r2, %r3

Reviewers: zhanjunl, uweigand

Subscribers: llvm-commits

Author: assem

Committing on behalf of Assem.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273887 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 15:55:30 +00:00
Krzysztof Parzyszek
339dc3dc8f [Hexagon] Equally-sized vectors are equivalent in ISel (except vNi1)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273885 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 15:08:22 +00:00
Simon Dardis
4cc8cc2f69 [mips] Add instruction itineraries for LSA, DLSA
Reviewers: vkalintiris, dsanders

Differential Review: http://reviews.llvm.org/D21679


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273883 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 14:55:07 +00:00
Nico Weber
ebad00c746 Revert 273848, it caused PR28329
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273879 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 14:36:46 +00:00
Chris Dewhurst
56b08a5b8c Last line of file missing on previous check-in.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273878 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 14:35:07 +00:00
Rafael Espindola
665d49773d Move isPositionIndependent up to AsmPrinter.
Use it in ppc too.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273877 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 14:19:45 +00:00
Chris Dewhurst
97f87458e4 [Sparc] Formatting and commenting changes per review.
Differential Review: http://reviews.llvm.org/rL273108

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273876 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 14:19:19 +00:00
Rafael Espindola
47347b8315 Use the isPositionIndependent predicate. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273875 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 14:05:43 +00:00
Diana Picus
e50b5c5180 [ARM] Use member initializers in ARMSubtarget. NFCI
Same as r273556, but with C++11 member initializers.

Change suggested by Matthias Braun (see http://reviews.llvm.org/D21432).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273873 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 13:06:10 +00:00
Simon Pilgrim
b0c59abcd3 Fix "not all control paths return a value" warning on MSVC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273872 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 12:58:10 +00:00
Rafael Espindola
7a6104fd55 Simplify getLabelAccessInfo.
It now takes a IsPIC flag instead of computing and returning it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273871 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 12:56:02 +00:00