Commit Graph

82644 Commits

Author SHA1 Message Date
Pete Cooper
b428511989 Added address space qualifier to intrinsic PointerType arguments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157218 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-21 23:21:28 +00:00
Owen Anderson
4b6e6750fe Fix use of an unitialized value in the LegalizeOps expansion for ISD::SUB. No in-tree targets exercise this path.
Patch by Micah Villmow.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157215 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-21 22:39:20 +00:00
Jim Grosbach
b551f0cc78 Thumb2: RSB source register should be rGRP not GPRnopc.
t2RSB defined the operand correctly, but tRSBS didn't.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157200 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-21 17:57:17 +00:00
Dan Gohman
4c8f909cdf Mark an unreachable region of code with llvm_unreachable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157197 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-21 17:41:28 +00:00
Chad Rosier
f496deaa03 Typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157195 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-21 17:13:41 +00:00
Owen Anderson
5b2d81bb50 Make it so that the MArch, MCPU, MAttrs passed to EngineBuilder are actually used.
Patch by Jose Fonseca.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157191 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-21 16:57:17 +00:00
Patrik Hägglund
8c3f33d337 test commit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157184 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-21 13:18:06 +00:00
Stepan Dyatkovskiy
1c8f4b8c34 PR1255 (case ranges: work with ConstantRangesSet instead of ConstantInt) related changes for Execution and Verifier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157183 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-21 10:44:40 +00:00
Craig Topper
8ae97baef2 Allow 256-bit shuffles to still be split even if only half of the shuffle comes from two 128-bit pieces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157175 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-21 06:40:16 +00:00
Jakob Stoklund Olesen
1dc12aa148 Give a small negative bias to giant edge bundles.
This helps compile time when the greedy register allocator splits live
ranges in giant functions. Without the bias, we would try to grow
regions through the giant edge bundles, usually to find out that the
region became too big and expensive.

If a live range has many uses in blocks near the giant bundle, the small
negative bias doesn't make a big difference, and we still consider
regions including the giant edge bundle.

Giant edge bundles are usually connected to landing pads or indirect
branches.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157174 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-21 03:11:23 +00:00
Jakob Stoklund Olesen
857ed22604 Clear kill flags on the fly when joining intervals.
With physreg joining out of the way, it is easy to recognize the
instructions that need their kill flags cleared while testing for
interference.

This allows us to skip the final scan of all instructions for an 11%
speedup of the coalescer pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157169 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-20 21:41:05 +00:00
Nick Lewycky
529b8424f1 Add RPO to the lexicon.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157166 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-20 20:30:47 +00:00
Jakob Stoklund Olesen
53df9259e9 Make the global base reg GR32_NOSP.
It can sometimes be used in addressing modes that don't support %ESP.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157165 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-20 18:43:00 +00:00
Jakob Stoklund Olesen
418a3638ac Constrain regclasses in PeepholeOptimizer.
It can be necessary to restrict to a sub-class before accessing
sub-registers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157164 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-20 18:42:55 +00:00
Jakob Stoklund Olesen
0fda545c2c Constrain register classes in TailDup.
When rewriting operands, make sure the new registers have a compatible
register class.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157163 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-20 18:42:51 +00:00
Peter Collingbourne
92d63ccfc7 When legalising shifts, do not pre-build a list of operands which
may be RAUW'd by the recursive call to LegalizeOps; instead, retrieve
the other operands when calling UpdateNodeOperands.  Fixes PR12889.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157162 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-20 18:36:15 +00:00
Benjamin Kramer
5875c33746 Emit memcmp directly from the StringMatcherEmitter.
There should be no difference in the resulting binary, given a sufficiently
smart compiler. However we already had compiler timeouts on the generated
code in Intrinsics.gen, this hopefully makes the lives of slow buildbots a
little easier.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157161 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-20 18:10:42 +00:00
Benjamin Kramer
6514551be7 Plug a leak when using MCJIT.
Found by valgrind.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157160 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-20 17:24:08 +00:00
Hal Finkel
2e8e5c0eca Add a missing PPC 64-bit stwu pattern.
This seems to fix the remaining compile-time failures on PPC64 when
compiling with -enable-ppc-preinc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157159 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-20 17:11:24 +00:00
Benjamin Kramer
79485315cd Use TargetMachine's register info instead of creating a new one and leaking it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157155 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-20 11:24:27 +00:00
Jakob Stoklund Olesen
027c32a14e Use the right register class for LDRrs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157152 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-20 06:38:47 +00:00
Jakob Stoklund Olesen
6e6269a976 Transfer memory operands to the right instruction.
They need to go on the PICLDR as the verifier points out.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157151 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-20 06:38:42 +00:00
Jakob Stoklund Olesen
ee0d5d4398 Properly constrain register classes for sub-registers.
Not all GR64 registers have sub_8bit sub-registers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157150 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-20 06:38:37 +00:00
Jakob Stoklund Olesen
8e86929e3c Properly constrain register classes in 2-addr.
X86 has 2-addr instructions with different constraints on the tied def
and use operands. One is GR32, one is GR32_NOSP.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157149 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-20 06:38:32 +00:00
Jakob Stoklund Olesen
4991de8fe1 Missed a push_back in r157147.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157148 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-20 05:28:53 +00:00
Jakob Stoklund Olesen
f0bf8b4018 Avoid deleting extra copies when RegistersDefinedFromSameValue is true.
This function adds copies to be erased to DupCopies, avoid also adding
them to DeadCopies.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157147 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-20 04:52:48 +00:00
Jakob Stoklund Olesen
067fcb4087 Fix build bots.
Avoid looking at the operands of a potentially erased instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157146 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-20 03:57:12 +00:00
Jakob Stoklund Olesen
97769fcdd1 LiveRangeQuery simplifies shrinkToUses().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157145 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-20 02:54:52 +00:00
Jakob Stoklund Olesen
93e29ce066 Use LiveRangeQuery in ScheduleDAGInstrs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157144 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-20 02:44:38 +00:00
Jakob Stoklund Olesen
e1b93d2e86 Eliminate some uses of struct LiveRange.
That struct ought to be a LiveInterval implementation detail.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157143 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-20 02:44:36 +00:00
Jakob Stoklund Olesen
92a05fa450 Use LiveRangeQuery instead of getLiveRangeContaining().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157142 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-20 02:44:33 +00:00
Jakob Stoklund Olesen
c313c6b9ff Add a LiveRangeQuery class.
This class is meant to be the primary interface for examining a live
range in the vicinity on a given instruction. It avoids all the messy
dealings with iterators and early clobbers.

This is a more abstract interface to live ranges, hiding the
implementation as a vector of segments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157141 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-20 02:44:30 +00:00
Peter Collingbourne
fcaf5fa89c Do not pass an invalid domtree to SimplifyInstruction from
LoopUnswitch.  Fixes PR12887.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157140 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-20 01:32:09 +00:00
Jakob Stoklund Olesen
a991ea5f7f Simplify overlap check.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157137 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-19 23:59:27 +00:00
Jakob Stoklund Olesen
7ebed91fdd Fix 12892.
Dead code elimination during coalescing could cause a virtual register
to be split into connected components. The following rewriting would be
confused about the already joined copies present in the code, but
without a corresponding value number in the live range.

Erase all joined copies instantly when joining intervals such that the
MI and LiveInterval representations are always in sync.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157135 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-19 23:34:59 +00:00
Peter Collingbourne
9012c57e18 Do not eliminate allocas whose alignment exceeds that of the
copied-in constant, as a subsequent user may rely on over alignment.
Fixes PR12885.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157134 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-19 22:52:10 +00:00
Hal Finkel
b8f2f29467 Add a FIXME about access to negative stack-pointer offsets on PPC32.
The current code will generate a prologue which starts with something like:
        mflr 0
        stw 31, -4(1)
        stw 0, 4(1)
        stwu 1, -16(1)

But under the PPC32 SVR4 ABI, access to negative offsets from R1 is not allowed.

This was pointed out by Peter Bergner.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157133 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-19 21:52:55 +00:00
Jakob Stoklund Olesen
ec096b4925 Remove the late DCE in RegisterCoalescer.
Dead code and joined copies are now eliminated on the fly, and there is
no need for a post pass.

This makes the coalescer work like other modern register allocator
passes: Code is changed on the fly, there is no pending list of changes
to be committed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157132 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-19 21:02:31 +00:00
Jakob Stoklund Olesen
ccce1233a2 Erase joined copies immediately.
The late dead code elimination is no longer necessary.

The test changes are cause by a register hint that can be either %rdi or
%rax. The choice depends on the use list order, which this patch changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157131 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-19 20:54:07 +00:00
Jakob Stoklund Olesen
5636660176 Fix an ancient bug in removeCopyByCommutingDef().
Before rewriting uses of one value in A to register B, check that there
are no tied uses. That would require multiple A values to be rewritten.

This bug can't bite in the current version of the code for a fairly
subtle reason: A tied use would have caused 2-addr to insert a copy
before the use. If the copy has been coalesced, it will be found by the
same loop changed by this patch, and the optimization is aborted.

This was exposed by 400.perlbench and lua after applying a patch that
deletes joined copies aggressively.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157130 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-19 20:54:03 +00:00
Nadav Rotem
87d35e8c71 On Haswell, perfer storing YMM registers using a single instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157129 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-19 20:30:08 +00:00
Nadav Rotem
4fc8a5de44 Add support for additional in-reg vbroadcast patterns
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157127 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-19 19:57:37 +00:00
Benjamin Kramer
9e7e04823c Disambiguate call to operator==.
clang++ and msvc happily had no problem with it but g++ refuses to compile.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157126 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-19 19:32:11 +00:00
Jakob Stoklund Olesen
03c8383324 Collect inflatable virtual registers on the fly.
There is no reason to defer the collection of virtual registers whose
register class may be replaced with a larger class.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157125 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-19 19:25:00 +00:00
Benjamin Kramer
96edb648e2 ValueMap: Use DenseMap's find_as mechanism to reduce use list churn.
Otherwise just looking up a value in the map requires creating a VH, adding it to the use lists and destroying it again.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157124 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-19 19:15:32 +00:00
Benjamin Kramer
4e4c3408a5 Move CallbackVHs dtor inline, it can be devirtualized in many cases. Move the other virtual methods out of line as they are only called from within Value.cpp anyway.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157123 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-19 19:15:25 +00:00
Craig Topper
5084c6b0a2 Tidy up some spacing and inconsistent use of pre/post increment. No functional change intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157122 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-19 19:14:18 +00:00
Benjamin Kramer
223f2a72da Remove extra semicolons.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157118 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-19 16:44:12 +00:00
Benjamin Kramer
ac5802bca0 Provide move semantics for TinyPtrVector and for DenseMap's rehash function.
This makes DenseMap<..., TinyPtrVector<...>> as cheap as it always should've been!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157113 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-19 13:28:54 +00:00
Stepan Dyatkovskiy
f4c261b137 Ordinary PR1255 patch: DifferenceEngine and CPPBackend adopted to the new SwitchInst methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157112 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-19 13:14:30 +00:00