oota-llvm.git
13 years agoFix an overflow bug in MachineBranchProbabilityInfo. This pass relied on
Chandler Carruth [Mon, 14 Nov 2011 08:50:16 +0000 (08:50 +0000)]
Fix an overflow bug in MachineBranchProbabilityInfo. This pass relied on
the sum of the edge weights not overflowing uint32, and crashed when
they did. This is generally safe as BranchProbabilityInfo tries to
provide this guarantee. However, the CFG can get modified during codegen
in a way that grows the *sum* of the edge weights. This doesn't seem
unreasonable (imagine just adding more blocks all with the default
weight of 16), but it is hard to come up with a case that actually
triggers 32-bit overflow. Fortuately, the single-source GCC build is
good at this. The solution isn't very pretty, but its no worse than the
previous code. We're already summing all of the edge weights on each
query, we can sum them, check for an overflow, compute a scale, and sum
them again.

I've included a *greatly* reduced test case out of the GCC source that
triggers it. It's a pretty lame test, as it clearly is just barely
triggering the overflow. I'd like to have something that is much more
definitive, but I don't understand the fundamental pattern that triggers
an explosion in the edge weight sums.

The buggy code is duplicated within this file. I'll colapse them into
a single implementation in a subsequent commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144526 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd AVX2 version of instructions to load folding tables. Also add a bunch of missing...
Craig Topper [Mon, 14 Nov 2011 08:07:55 +0000 (08:07 +0000)]
Add AVX2 version of instructions to load folding tables. Also add a bunch of missing SSE/AVX instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144525 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd a cautionary note to this API. It was not at all obvious to me how
Chandler Carruth [Mon, 14 Nov 2011 06:51:49 +0000 (06:51 +0000)]
Add a cautionary note to this API. It was not at all obvious to me how
expensive the most useful interface to this analysis is.

Fun story -- it's also not correct. That's getting fixed in another
patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144523 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd neverHasSideEffects, mayLoad, and mayStore to many patternless SSE/AVX instructio...
Craig Topper [Mon, 14 Nov 2011 06:46:21 +0000 (06:46 +0000)]
Add neverHasSideEffects, mayLoad, and mayStore to many patternless SSE/AVX instructions. Remove MMX check from LowerVECTOR_SHUFFLE since MMX vector types won't go through it anyway.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144522 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd support for ARM halfword load/stores and signed byte loads with negative
Chad Rosier [Mon, 14 Nov 2011 04:09:28 +0000 (04:09 +0000)]
Add support for ARM halfword load/stores and signed byte loads with negative
offsets.
rdar://10412592

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144518 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoUse getVNInfoBefore() when it makes sense.
Jakob Stoklund Olesen [Mon, 14 Nov 2011 01:39:36 +0000 (01:39 +0000)]
Use getVNInfoBefore() when it makes sense.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144517 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTeach machine block placement to cope with unnatural loops. These don't
Chandler Carruth [Mon, 14 Nov 2011 00:00:35 +0000 (00:00 +0000)]
Teach machine block placement to cope with unnatural loops. These don't
get loop info structures associated with them, and so we need some way
to make forward progress selecting and placing basic blocks. The
technique used here is pretty brutal -- it just scans the list of blocks
looking for the first unplaced candidate. It keeps placing blocks like
this until the CFG becomes tractable.

The cost is somewhat unfortunate, it requires allocating a vector of all
basic block pointers eagerly. I have some ideas about how to simplify
and optimize this, but I'm trying to get the logic correct first.

Thanks to Benjamin Kramer for the reduced test case out of GCC. Sadly
there are other bugs that GCC is tickling that I'm reducing and working
on now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144516 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoUse kill slots instead of the previous slot in shrinkToUses.
Jakob Stoklund Olesen [Sun, 13 Nov 2011 23:53:25 +0000 (23:53 +0000)]
Use kill slots instead of the previous slot in shrinkToUses.

It's more natural to use the actual end points.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144515 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoCleanup some 80-columns violations and poor formatting. These snuck by
Chandler Carruth [Sun, 13 Nov 2011 22:50:09 +0000 (22:50 +0000)]
Cleanup some 80-columns violations and poor formatting. These snuck by
when I was reading through the code for style.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144513 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTerminate all dead defs at the dead slot instead of the 'next' slot.
Jakob Stoklund Olesen [Sun, 13 Nov 2011 22:42:13 +0000 (22:42 +0000)]
Terminate all dead defs at the dead slot instead of the 'next' slot.

This makes no difference for normal defs, but early clobber dead defs
now look like:

  [Slot_EarlyClobber; Slot_Dead)

instead of:

  [Slot_EarlyClobber; Slot_Register).

Live ranges for normal dead defs look like:

  [Slot_Register; Slot_Dead)

as before.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144512 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix comment for LegalizeTypeAction enum.
Craig Topper [Sun, 13 Nov 2011 22:11:24 +0000 (22:11 +0000)]
Fix comment for LegalizeTypeAction enum.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144511 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoSimplify early clobber slots a bit.
Jakob Stoklund Olesen [Sun, 13 Nov 2011 22:05:42 +0000 (22:05 +0000)]
Simplify early clobber slots a bit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144507 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoEnhance the assertion mechanisms in place to make it easier to catch
Chandler Carruth [Sun, 13 Nov 2011 21:39:51 +0000 (21:39 +0000)]
Enhance the assertion mechanisms in place to make it easier to catch
when we fail to place all the blocks of a loop. Currently this is
happening for unnatural loops, and this logic helps more immediately
point to the problem.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144504 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRename SlotIndexes to match how they are used.
Jakob Stoklund Olesen [Sun, 13 Nov 2011 20:45:27 +0000 (20:45 +0000)]
Rename SlotIndexes to match how they are used.

The old naming scheme (load/use/def/store) can be traced back to an old
linear scan article, but the names don't match how slots are actually
used.

The load and store slots are not needed after the deferred spill code
insertion framework was deleted.

The use and def slots don't make any sense because we are using
half-open intervals as is customary in C code, but the names suggest
closed intervals.  In reality, these slots were used to distinguish
early-clobber defs from normal defs.

The new naming scheme also has 4 slots, but the names match how the
slots are really used.  This is a purely mechanical renaming, but some
of the code makes a lot more sense now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144503 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd BLSI, BLSMSK, and BLSR to getTargetNodeName.
Craig Topper [Sun, 13 Nov 2011 17:31:07 +0000 (17:31 +0000)]
Add BLSI, BLSMSK, and BLSR to getTargetNodeName.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144502 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTeach MBP to force-merge layout successors for blocks with unanalyzable
Chandler Carruth [Sun, 13 Nov 2011 12:17:28 +0000 (12:17 +0000)]
Teach MBP to force-merge layout successors for blocks with unanalyzable
branches that also may involve fallthrough. In the case of blocks with
no fallthrough, we can still re-order the blocks profitably. For example
instruction decoding will in some cases continue past an indirect jump,
making laying out its most likely successor there profitable.

Note, no test case. I don't know how to write a test case that exercises
this logic, but it matches the described desired semantics in
discussions with Jakob and others. If anyone has a nice example of IR
that will trigger this, that would be lovely.

Also note, there are still assertion failures in real world code with
this. I'm digging into those next, now that I know this isn't the cause.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144499 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoHoist another gross nested loop into a helper method.
Chandler Carruth [Sun, 13 Nov 2011 11:42:26 +0000 (11:42 +0000)]
Hoist another gross nested loop into a helper method.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144498 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd a missing doxygen comment for a helper method.
Chandler Carruth [Sun, 13 Nov 2011 11:34:55 +0000 (11:34 +0000)]
Add a missing doxygen comment for a helper method.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144497 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoHoist a nested loop into its own method.
Chandler Carruth [Sun, 13 Nov 2011 11:34:53 +0000 (11:34 +0000)]
Hoist a nested loop into its own method.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144496 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRewrite #3 of machine block placement. This is based somewhat on the
Chandler Carruth [Sun, 13 Nov 2011 11:20:44 +0000 (11:20 +0000)]
Rewrite #3 of machine block placement. This is based somewhat on the
second algorithm, but only loosely. It is more heavily based on the last
discussion I had with Andy. It continues to walk from the inner-most
loop outward, but there is a key difference. With this algorithm we
ensure that as we visit each loop, the entire loop is merged into
a single chain. At the end, the entire function is treated as a "loop",
and merged into a single chain. This chain forms the desired sequence of
blocks within the function. Switching to a single algorithm removes my
biggest problem with the previous approaches -- they had different
behavior depending on which system triggered the layout. Now there is
exactly one algorithm and one basis for the decision making.

The other key difference is how the chain is formed. This is based
heavily on the idea Andy mentioned of keeping a worklist of blocks that
are viable layout successors based on the CFG. Having this set allows us
to consistently select the best layout successor for each block. It is
expensive though.

The code here remains very rough. There is a lot that needs to be done
to clean up the code, and to make the runtime cost of this pass much
lower. Very much WIP, but this was a giant chunk of code and I'd rather
folks see it sooner than later. Everything remains behind a flag of
course.

I've added a couple of tests to exercise the issues that this iteration
was motivated by: loop structure preservation. I've also fixed one test
that was exhibiting the broken behavior of the previous version.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144495 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoThe order in which the predicate is added differs between Thumb and ARM mode. Fix...
Chad Rosier [Sun, 13 Nov 2011 09:44:21 +0000 (09:44 +0000)]
The order in which the predicate is added differs between Thumb and ARM mode.  Fix predicate when in ARM mode and restore SelectIntrinsicCall.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144494 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTemporarily disable SelectIntrinsicCall when in ARM mode. This is causing failures.
Chad Rosier [Sun, 13 Nov 2011 05:14:43 +0000 (05:14 +0000)]
Temporarily disable SelectIntrinsicCall when in ARM mode. This is causing failures.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144492 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix comments.
Chad Rosier [Sun, 13 Nov 2011 04:25:02 +0000 (04:25 +0000)]
Fix comments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144490 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd support for emitting both signed- and zero-extend loads. Fix
Chad Rosier [Sun, 13 Nov 2011 02:23:59 +0000 (02:23 +0000)]
Add support for emitting both signed- and zero-extend loads.  Fix
SimplifyAddress to handle either a 12-bit unsigned offset or the ARM +/-imm8
offsets (addressing mode 3).  This enables a load followed by an integer
extend to be folded into a single load.

For example:
ldrb r1, [r0]       ldrb r1, [r0]
uxtb r2, r1     =>
mov  r3, r2         mov  r3, r1

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144488 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoPrune more RALinScan. RALinScan was also here!
NAKAMURA Takumi [Sun, 13 Nov 2011 01:33:10 +0000 (01:33 +0000)]
Prune more RALinScan. RALinScan was also here!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144487 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMore dead code elimination in VirtRegMap.
Jakob Stoklund Olesen [Sun, 13 Nov 2011 01:23:34 +0000 (01:23 +0000)]
More dead code elimination in VirtRegMap.

This thing is looking a lot like a virtual register map now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144486 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoStop tracking spill slot uses in VirtRegMap.
Jakob Stoklund Olesen [Sun, 13 Nov 2011 01:23:30 +0000 (01:23 +0000)]
Stop tracking spill slot uses in VirtRegMap.

Nobody cared, StackSlotColoring scans the instructions to find used stack
slots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144485 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRemove dead code and data from VirtRegMap.
Jakob Stoklund Olesen [Sun, 13 Nov 2011 01:02:04 +0000 (01:02 +0000)]
Remove dead code and data from VirtRegMap.

Most of this stuff was supporting the old deferred spill code insertion
mechanism.  Modern spillers just edit machine code in place.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144484 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoStop tracking unused registers in VirtRegMap.
Jakob Stoklund Olesen [Sun, 13 Nov 2011 00:39:45 +0000 (00:39 +0000)]
Stop tracking unused registers in VirtRegMap.

The information was only used by the register allocator in
StackSlotColoring.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144482 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRemove the -color-ss-with-regs option.
Jakob Stoklund Olesen [Sun, 13 Nov 2011 00:31:23 +0000 (00:31 +0000)]
Remove the -color-ss-with-regs option.

It was off by default.

The new register allocators don't have the problems that made it
necessary to reallocate registers during stack slot coloring.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144481 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDelete VirtRegRewriter.
Jakob Stoklund Olesen [Sun, 13 Nov 2011 00:16:01 +0000 (00:16 +0000)]
Delete VirtRegRewriter.

And there was much rejoicing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144480 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoSwitch PBQP to VRM's trivial rewriter.
Jakob Stoklund Olesen [Sun, 13 Nov 2011 00:02:24 +0000 (00:02 +0000)]
Switch PBQP to VRM's trivial rewriter.

The very complicated VirtRegRewriter is going away.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144479 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDelete the old spilling framework from LiveIntervalAnalysis.
Jakob Stoklund Olesen [Sat, 12 Nov 2011 23:57:05 +0000 (23:57 +0000)]
Delete the old spilling framework from LiveIntervalAnalysis.

This is dead code, all register allocators use InlineSpiller.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144478 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDelete the 'standard' spiller with used the old spilling framework.
Jakob Stoklund Olesen [Sat, 12 Nov 2011 23:29:02 +0000 (23:29 +0000)]
Delete the 'standard' spiller with used the old spilling framework.

The current register allocators all use the inline spiller.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144477 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoSwitch PBQP to the modern InlineSpiller framework.
Jakob Stoklund Olesen [Sat, 12 Nov 2011 23:17:52 +0000 (23:17 +0000)]
Switch PBQP to the modern InlineSpiller framework.

It is worth noting that the old spiller would split live ranges around
basic blocks. The new spiller doesn't do that.

PBQP should do its own live range splitting with
SplitEditor::splitSingleBlock() if desired.  See
RAGreedy::tryBlockSplit().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144476 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDelete the linear scan register allocator.
Jakob Stoklund Olesen [Sat, 12 Nov 2011 22:39:45 +0000 (22:39 +0000)]
Delete the linear scan register allocator.

RegAllocGreedy has been the default for six months now.

Deleting RegAllocLinearScan makes it possible to also delete
VirtRegRewriter and clean up the spiller code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144475 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRemove histogram tests.
Jakob Stoklund Olesen [Sat, 12 Nov 2011 22:39:40 +0000 (22:39 +0000)]
Remove histogram tests.

Counting the number of occurences of each opcode is not a useful test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144474 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRAGreedy is better about hinting now.
Jakob Stoklund Olesen [Sat, 12 Nov 2011 22:39:37 +0000 (22:39 +0000)]
RAGreedy is better about hinting now.

Or maybe we are just getting lucky.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144473 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoLinear scan is going away.
Jakob Stoklund Olesen [Sat, 12 Nov 2011 22:39:34 +0000 (22:39 +0000)]
Linear scan is going away.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144472 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoXFAIL test that depends on linear scan to remove dead code.
Jakob Stoklund Olesen [Sat, 12 Nov 2011 22:39:30 +0000 (22:39 +0000)]
XFAIL test that depends on linear scan to remove dead code.

Filed PR11364 to track the problem.  Should the register allocator
eliminate dead code?

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144471 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRemove obsolete test.
Jakob Stoklund Olesen [Sat, 12 Nov 2011 22:39:27 +0000 (22:39 +0000)]
Remove obsolete test.

This test was committed with a bugfix to RemoveCopyByCommutingDef, but
that optimization is no longer triggered by this test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144470 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRemove obsolete test.
Jakob Stoklund Olesen [Sat, 12 Nov 2011 22:39:24 +0000 (22:39 +0000)]
Remove obsolete test.

This test is for a very specific LocalRewriter bug.  LocalRewriter is
going away.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144469 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRemove obsolete test.
Jakob Stoklund Olesen [Sat, 12 Nov 2011 20:37:57 +0000 (20:37 +0000)]
Remove obsolete test.

I don't think this test does what is was supposed to do, and
LocalRewriter is going away anyway.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144463 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoEliminate more linear scan tests.
Jakob Stoklund Olesen [Sat, 12 Nov 2011 20:35:26 +0000 (20:35 +0000)]
Eliminate more linear scan tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144462 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoSwitch a couple -O0 tests to RABasic.
Jakob Stoklund Olesen [Sat, 12 Nov 2011 20:11:04 +0000 (20:11 +0000)]
Switch a couple -O0 tests to RABasic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144461 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoSwitch a few tests off linearscan.
Jakob Stoklund Olesen [Sat, 12 Nov 2011 19:53:52 +0000 (19:53 +0000)]
Switch a few tests off linearscan.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144460 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDelete old test of a VirtRegRewriter feature.
Jakob Stoklund Olesen [Sat, 12 Nov 2011 19:53:48 +0000 (19:53 +0000)]
Delete old test of a VirtRegRewriter feature.

This test doesn't expose the issue with RAGreedy.

I filed PR11363 to track the missing InlineSpiller feature.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144459 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRemove old test that doesn't make sense.
Jakob Stoklund Olesen [Sat, 12 Nov 2011 19:53:45 +0000 (19:53 +0000)]
Remove old test that doesn't make sense.

The test is checking that the output doesn't contains any 'mov '
strings. It does contain movl, though.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144458 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd more AVX2 shift lowering support. Move AVX2 variable shift to use patterns instea...
Craig Topper [Sat, 12 Nov 2011 09:58:49 +0000 (09:58 +0000)]
Add more AVX2 shift lowering support. Move AVX2 variable shift to use patterns instead of custom lowering code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144457 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDon't try to loop on iterators that are potentially invalidated inside the loop....
Nick Lewycky [Sat, 12 Nov 2011 03:09:12 +0000 (03:09 +0000)]
Don't try to loop on iterators that are potentially invalidated inside the loop. Fixes PR11361!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144454 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix typo.
Akira Hatanaka [Sat, 12 Nov 2011 02:38:12 +0000 (02:38 +0000)]
Fix typo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144453 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoImplement Mips64's handling of byval arguments in LowerCall.
Akira Hatanaka [Sat, 12 Nov 2011 02:34:50 +0000 (02:34 +0000)]
Implement Mips64's handling of byval arguments in LowerCall.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144452 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFixed the MCJIT so that it can emit not only instance
Sean Callanan [Sat, 12 Nov 2011 02:31:32 +0000 (02:31 +0000)]
Fixed the MCJIT so that it can emit not only instance
methods but also class methods for Objective-C.

Clang emits Objective-C method names with '\1' at the
beginning, and the JIT has pre-existing logic to try
prepending a '\1' when searching a module for an
instance method (that is, a method whose name begins
with '-').  I simply extended it to do the same thing
when it encountered a class method (a method whose
name begins with '+').

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144451 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoImplement Mips64's handling of byval arguments in LowerFormalArguments.
Akira Hatanaka [Sat, 12 Nov 2011 02:29:58 +0000 (02:29 +0000)]
Implement Mips64's handling of byval arguments in LowerFormalArguments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144449 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago64-bit arbitrary immediate pattern.
Akira Hatanaka [Sat, 12 Nov 2011 02:25:00 +0000 (02:25 +0000)]
64-bit arbitrary immediate pattern.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144448 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFunction for handling byval arguments.
Akira Hatanaka [Sat, 12 Nov 2011 02:20:46 +0000 (02:20 +0000)]
Function for handling byval arguments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144447 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoLLVMBuild: Add info for gtest.
Daniel Dunbar [Sat, 12 Nov 2011 02:11:04 +0000 (02:11 +0000)]
LLVMBuild: Add info for gtest.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144445 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agobuild: Attempt to rectify inconsistencies between CMake and LLVMBuild versions of...
Daniel Dunbar [Sat, 12 Nov 2011 02:10:57 +0000 (02:10 +0000)]
build: Attempt to rectify inconsistencies between CMake and LLVMBuild versions of explicit dependencies.
 - The hope is that we have a tool/test to verify these are accurate (and tight) soon.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144444 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMake sure scalarrepl picks the correct alloca when it rewrites a bitcast. Fixes...
Eli Friedman [Sat, 12 Nov 2011 02:07:50 +0000 (02:07 +0000)]
Make sure scalarrepl picks the correct alloca when it rewrites a bitcast.  Fixes PR11353.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144442 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoThe dwarf standard says that the only differences between a out-of-line
Rafael Espindola [Sat, 12 Nov 2011 01:57:54 +0000 (01:57 +0000)]
The dwarf standard says that the only differences between a out-of-line
instance and a concrete inlined instance are the use of DW_TAG_subprogram
instead of DW_TAG_inlined_subroutine and the who owns the tree.

We were also omitting DW_AT_inline from the abstract roots. To fix this,
make sure we mark abstract instance roots with DW_AT_inline even when
we have only out-of-line instances referring to them with DW_AT_abstract_origin.

FileCheck is not a very good tool for tests like this, maybe we should add
a -verify mode to llvm-dwarfdump.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144441 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoARM refactor simple immediate asm operand render methods.
Jim Grosbach [Sat, 12 Nov 2011 00:58:43 +0000 (00:58 +0000)]
ARM refactor simple immediate asm operand render methods.

These immediate operands all use the same simple logic for rendering to
MCInst, so have them share the method for doing so.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144439 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDon't try to form pre/post-indexed loads/stores until after LegalizeDAG runs. Fixes...
Eli Friedman [Sat, 12 Nov 2011 00:35:34 +0000 (00:35 +0000)]
Don't try to form pre/post-indexed loads/stores until after LegalizeDAG runs.  Fixes PR11029.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144438 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRe-apply 144430, this time with the associated isel and disassmbler bits.
Jim Grosbach [Sat, 12 Nov 2011 00:31:53 +0000 (00:31 +0000)]
Re-apply 144430, this time with the associated isel and disassmbler bits.

Original commit msg: 'ARM assembly parsing for VST1 two-register encoding.'

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144437 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agobuild/Make: Define a TARGET_NATIVE_ARCH variable to be a bit more precise than
Daniel Dunbar [Sat, 12 Nov 2011 00:18:02 +0000 (00:18 +0000)]
build/Make: Define a TARGET_NATIVE_ARCH variable to be a bit more precise than
ARCH, which gets tested in many more contexts.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144434 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoSome cleanup and bulletproofing for node replacement in LegalizeDAG. To maintain...
Eli Friedman [Fri, 11 Nov 2011 23:58:27 +0000 (23:58 +0000)]
Some cleanup and bulletproofing for node replacement in LegalizeDAG.  To maintain LegalizeDAG invariants, whenever we a node is replaced, we must attempt to delete it, and if it still
has uses after it is replaced (which can happen in rare cases due to CSE), we must revisit it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144432 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoOops. Missed the isel half of this. revert while I sort that out.
Jim Grosbach [Fri, 11 Nov 2011 23:51:31 +0000 (23:51 +0000)]
Oops. Missed the isel half of this. revert while I sort that out.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144431 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoARM assembly parsing for VST1 two-register encoding.
Jim Grosbach [Fri, 11 Nov 2011 23:45:47 +0000 (23:45 +0000)]
ARM assembly parsing for VST1 two-register encoding.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144430 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoARM optional size suffix for VLDR/VSTR syntax.
Jim Grosbach [Fri, 11 Nov 2011 23:34:43 +0000 (23:34 +0000)]
ARM optional size suffix for VLDR/VSTR syntax.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144427 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd support in fast-isel for selecting memset/memcpy/memmove intrinsics.
Chad Rosier [Fri, 11 Nov 2011 23:31:03 +0000 (23:31 +0000)]
Add support in fast-isel for selecting memset/memcpy/memmove intrinsics.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144426 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoLoosen test by using REs. Approved by Devang.
Chad Rosier [Fri, 11 Nov 2011 23:25:38 +0000 (23:25 +0000)]
Loosen test by using REs.  Approved by Devang.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144425 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoCMake: Fix CMake build for new Mips tblgen file.
Daniel Dunbar [Fri, 11 Nov 2011 23:12:56 +0000 (23:12 +0000)]
CMake: Fix CMake build for new Mips tblgen file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144423 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoARM vldm and vstm VFP instructions can take a data type suffix.
Jim Grosbach [Fri, 11 Nov 2011 23:08:10 +0000 (23:08 +0000)]
ARM vldm and vstm VFP instructions can take a data type suffix.

It's ignored by the assembler when present, but is legal syntax. Other
instructions have something similar, but for some mnemonics it's
only sometimes not significant, so this quick check in the parser will
need refactored into something more robust soon-ish. This gets some
basics working in the meantime.

Partial for rdar://10435264

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144422 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agobuild/Make: Change llvm-config-2 to be compiled as a build tool.
Daniel Dunbar [Fri, 11 Nov 2011 22:59:49 +0000 (22:59 +0000)]
build/Make: Change llvm-config-2 to be compiled as a build tool.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144421 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agollvm-config-2: Detect when we are running out of a BuildTools development tree, so...
Daniel Dunbar [Fri, 11 Nov 2011 22:59:47 +0000 (22:59 +0000)]
llvm-config-2: Detect when we are running out of a BuildTools development tree, so that we can always provide library/include information for the real build directory.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144420 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agocross-build/Make: Update cross build to properly forward ARCH and
Daniel Dunbar [Fri, 11 Nov 2011 22:59:45 +0000 (22:59 +0000)]
cross-build/Make: Update cross build to properly forward ARCH and
TARGETS_TO_BUILD variables to build tools submake, and also tweak echo command
to indicate when we are compiling/etc build tools.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144419 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agobuild/Make: Eliminate BUILD_COMPONENT variable, which is unused.
Daniel Dunbar [Fri, 11 Nov 2011 22:59:42 +0000 (22:59 +0000)]
build/Make: Eliminate BUILD_COMPONENT variable, which is unused.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144418 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoLLVMBuild: Add description files for the LLVM tools.
Daniel Dunbar [Fri, 11 Nov 2011 22:59:39 +0000 (22:59 +0000)]
LLVMBuild: Add description files for the LLVM tools.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144417 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoLLVMBuild: Alphabetize required_libraries lists.
Daniel Dunbar [Fri, 11 Nov 2011 22:59:23 +0000 (22:59 +0000)]
LLVMBuild: Alphabetize required_libraries lists.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144416 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTarget/LLVMBuild: Order components alphabetically.
Daniel Dunbar [Fri, 11 Nov 2011 22:59:16 +0000 (22:59 +0000)]
Target/LLVMBuild: Order components alphabetically.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144415 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMips MC object code emission improvements:
Bruno Cardoso Lopes [Fri, 11 Nov 2011 22:58:42 +0000 (22:58 +0000)]
Mips MC object code emission improvements:

"With this patch we can now generate runnable Mips code through LLVM
direct object emission. We have run numerous simple programs, both C
and C++ and with -O0 and -O3 from the output. The code is not production
ready, but quite useful for experimentation." Patch and message by
Jack Carter

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144414 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd an option '--enable-libcpp' that will have the compiler pass on
Eric Christopher [Fri, 11 Nov 2011 22:51:42 +0000 (22:51 +0000)]
Add an option '--enable-libcpp' that will have the compiler pass on
options to use libc++ as the default c++ library.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144413 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoNuke no longer accurate comment.
Jim Grosbach [Fri, 11 Nov 2011 22:30:06 +0000 (22:30 +0000)]
Nuke no longer accurate comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144411 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoPreserve MachineMemOperands in ARMLoadStoreOptimizer.
Andrew Trick [Fri, 11 Nov 2011 22:18:09 +0000 (22:18 +0000)]
Preserve MachineMemOperands in ARMLoadStoreOptimizer.

Fixes PR8113.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144409 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoARM allow Q registers in vldm/vstm register lists.
Jim Grosbach [Fri, 11 Nov 2011 21:27:40 +0000 (21:27 +0000)]
ARM allow Q registers in vldm/vstm register lists.

rdar://9672822

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144407 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agobuild/Make: Switch back to llvm-config for now, I foolishly forgot to think
Daniel Dunbar [Fri, 11 Nov 2011 20:41:06 +0000 (20:41 +0000)]
build/Make: Switch back to llvm-config for now, I foolishly forgot to think
about cross compiles.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144406 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd a custom safepoint method, in order for language implementers to decide which...
Nicolas Geoffray [Fri, 11 Nov 2011 18:32:52 +0000 (18:32 +0000)]
Add a custom safepoint method, in order for language implementers to decide which machine instruction gets to be a safepoint.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144399 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMove X86 specific test in X86 directory.
Devang Patel [Fri, 11 Nov 2011 18:13:19 +0000 (18:13 +0000)]
Move X86 specific test in X86 directory.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144395 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMove X86 specific test in X86 directory.
Devang Patel [Fri, 11 Nov 2011 18:10:38 +0000 (18:10 +0000)]
Move X86 specific test in X86 directory.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144394 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRemove FIXME comment that should have been removed with r144351.
Bob Wilson [Fri, 11 Nov 2011 17:34:14 +0000 (17:34 +0000)]
Remove FIXME comment that should have been removed with r144351.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144392 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoallow non-device function calls in PTX when natively handling device-side printf
Dan Bailey [Fri, 11 Nov 2011 14:45:12 +0000 (14:45 +0000)]
allow non-device function calls in PTX when natively handling device-side printf

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144388 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoadd rules in tabgen for PTX COPY_ADDRESS of frameindex
Dan Bailey [Fri, 11 Nov 2011 14:45:06 +0000 (14:45 +0000)]
add rules in tabgen for PTX COPY_ADDRESS of frameindex

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144387 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoClients are responsible for initializing the targets, remove it from the disassembler...
Benjamin Kramer [Fri, 11 Nov 2011 13:20:40 +0000 (13:20 +0000)]
Clients are responsible for initializing the targets, remove it from the disassembler API.

This will break users of the LLVMCreateDisasm API (not that I know of any). They have to call the
LLVMInitializeAll* functions from llvm-c/Target.h themselves now. edis' C API in all its horribleness
should be unaffected.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144385 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRemove the unnecessary dependency on libARMCodeGen from libARMDisassembler.
Benjamin Kramer [Fri, 11 Nov 2011 12:39:41 +0000 (12:39 +0000)]
Remove the unnecessary dependency on libARMCodeGen from libARMDisassembler.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144384 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRemove the unnecessary dependency on libMBlazeCodeGen from libMBlazeDisassembler.
Benjamin Kramer [Fri, 11 Nov 2011 12:39:35 +0000 (12:39 +0000)]
Remove the unnecessary dependency on libMBlazeCodeGen from libMBlazeDisassembler.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144383 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd lowering for AVX2 shift instructions.
Craig Topper [Fri, 11 Nov 2011 07:39:23 +0000 (07:39 +0000)]
Add lowering for AVX2 shift instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144380 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRename variables to avoid confusion. No functionallity change intended.
Chad Rosier [Fri, 11 Nov 2011 06:27:41 +0000 (06:27 +0000)]
Rename variables to avoid confusion.  No functionallity change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144377 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd support for using immediates with select instructions.
Chad Rosier [Fri, 11 Nov 2011 06:20:39 +0000 (06:20 +0000)]
Add support for using immediates with select instructions.
rdar://10412592

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144376 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDo not try to detect DAG combine patterns for integer multiply-add/sub if value
Akira Hatanaka [Fri, 11 Nov 2011 04:18:21 +0000 (04:18 +0000)]
Do not try to detect DAG combine patterns for integer multiply-add/sub if value
type is not i32. MIPS does not have 64-bit integer multiply-add/sub
instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144373 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago64-bit atomic instructions.
Akira Hatanaka [Fri, 11 Nov 2011 04:14:30 +0000 (04:14 +0000)]
64-bit atomic instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144372 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoModify LowerFRAMEADDR. Use 64-bit register FP_64 when ABI is N64.
Akira Hatanaka [Fri, 11 Nov 2011 04:11:56 +0000 (04:11 +0000)]
Modify LowerFRAMEADDR. Use 64-bit register FP_64 when ABI is N64.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144371 91177308-0d34-0410-b5e6-96231b3b80d8