38763 Commits

Author SHA1 Message Date
Duncan P. N. Exon Smith
a204da23db CodeGen: Use MachineInstr& in TargetLowering, NFC
This is a mechanical change to make TargetLowering API take MachineInstr&
(instead of MachineInstr*), since the argument is expected to be a valid
MachineInstr.  In one case, changed a parameter from MachineInstr* to
MachineBasicBlock::iterator, since it was used as an insertion point.

As a side effect, this removes a bunch of MachineInstr* to
MachineBasicBlock::iterator implicit conversions, a necessary step
toward fixing PR26753.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274287 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 22:52:52 +00:00
David L Kreitzer
c909aafffe Test commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274284 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 21:43:11 +00:00
Matt Arsenault
7b7d4b781c AMDGPU: Add m0 vgpr load loop block as successor
This shows up as a verifier error when I move this
earlier, not sure why it didn't before.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274275 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 20:49:28 +00:00
Rafael Espindola
9931d67967 Delete MCCodeGenInfo.
MC doesn't really care about CodeGen stuff, so this was just
complicating target initialization.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274258 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 18:25:11 +00:00
Elliot Colp
aac735c45f Test commit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274232 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 14:42:47 +00:00
Rafael Espindola
1e7d61d581 Don't repeat names in comments. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274226 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 12:44:52 +00:00
Rafael Espindola
809018e56e Delete unused includes. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274225 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 12:19:16 +00:00
Jonas Paulsson
1f07eb983a [SystemZ] Let z13 also support FeatureMiscellaneousExtensions.
This processor feature had been left out by mistake from the z13
ProcessorModel.

This time with updated test case. Thanks, Hans.

Reviewed by Ulrich Weigand.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274216 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 07:13:56 +00:00
Pankaj Gode
a822c61ca7 [AArch64] Add Broadcom Vulcan scheduling model.
Adding scheduling model for new Broadcom Vulcan core (ARMv8.1A).

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274213 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 06:42:31 +00:00
Craig Topper
8c91459fa9 Use ShuffleVectorSDNode::isSplat member method instead of static method isSplatMask where the mask came directly from getMask() on a shuffle node.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274208 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 04:38:51 +00:00
Marcin Koscielnicki
63e0af7cc9 [SystemZ] Split up PerformDAGCombine. [NFC]
This function is already a bit too long, and I'm about to make it worse.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274191 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 00:08:54 +00:00
Duncan P. N. Exon Smith
567409db69 CodeGen: Use MachineInstr& in TargetInstrInfo, NFC
This is mostly a mechanical change to make TargetInstrInfo API take
MachineInstr& (instead of MachineInstr* or MachineBasicBlock::iterator)
when the argument is expected to be a valid MachineInstr.  This is a
general API improvement.

Although it would be possible to do this one function at a time, that
would demand a quadratic amount of churn since many of these functions
call each other.  Instead I've done everything as a block and just
updated what was necessary.

This is mostly mechanical fixes: adding and removing `*` and `&`
operators.  The only non-mechanical change is to split
ARMBaseInstrInfo::getOperandLatencyImpl out from
ARMBaseInstrInfo::getOperandLatency.  Previously, the latter took a
`MachineInstr*` which it updated to the instruction bundle leader; now,
the latter calls the former either with the same `MachineInstr&` or the
bundle leader.

As a side effect, this removes a bunch of MachineInstr* to
MachineBasicBlock::iterator implicit conversions, a necessary step
toward fixing PR26753.

Note: I updated WebAssembly, Lanai, and AVR (despite being
off-by-default) since it turned out to be easy.  I couldn't run tests
for AVR since llc doesn't link with it turned on.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274189 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 00:01:54 +00:00
Artem Belevich
a872e23126 Revert r273313 "[NVPTX] Improve lowering of byval args of device functions."
The change causes llvm crash in some unoptimized builds.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274163 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-29 20:51:15 +00:00
Nirav Dave
a4d56588c9 Permit memory operands in ins/outs instructions
[x86] (PR15455) While (ins|outs)[bwld] instructions do not take %dx as a
memory operand, various unofficial references do and objdump
disassembles to this format. Extend special treatment of
similar (in|out)[bwld] operations.

Reviewers: craig.topper, rnk, ab

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274152 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-29 19:54:27 +00:00
Nico Weber
7925338a8e Revert r272251, it caused PR28348.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274141 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-29 17:33:41 +00:00
Ahmed Bougacha
cdfe078a42 [X86] Lower blended PACKUSes using appropriate types.
When lowering two blended PACKUS, we used to disregard the types
of the PACKUS inputs, indiscriminately generating a v16i8 PACKUS.

This leads to non-selectable things like:
    (v16i8 (PACKUS (v4i32 v0), (v4i32 v1)))

Instead, check that the PACKUSes have the same type, and use that
as the final result type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274138 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-29 16:56:09 +00:00
Rafael Espindola
99b487713f Drop support for creating $stubs.
They are created by ld64 since OS X 10.5.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274130 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-29 14:59:50 +00:00
Marcin Koscielnicki
d565c876ef [SystemZ] Add floating-point test data class instructions.
These are not used by CodeGen yet - ISD combiners creating the new node
will come in subsequent patches.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274108 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-29 07:29:07 +00:00
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