Commit Graph

70646 Commits

Author SHA1 Message Date
Kalle Raiskila
31cbac1cfe Allow vector shifts (shl,lshr,ashr) on SPU.
There was a previous implementation with patterns that would 
have matched e.g. 
	shl <v4i32> <i32>,
but this is not valid LLVM IR so they never were selected.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126998 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-04 13:19:18 +00:00
Kalle Raiskila
7f5de8b4c6 Allow load from constant on SPU.
A 'load <4 x i32>* null' crashes llc before this fix.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126995 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-04 12:00:11 +00:00
Nick Lewycky
786792784e Fold "icmp pred (srem X, Y), Y" like we do for urem. Handle signed comparisons
in the urem case, though not the other way around. This is enough to get #3 from
PR9343!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126991 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-04 10:06:52 +00:00
Nick Lewycky
3a73e343d0 Teach instruction simplify to use constant ranges to solve problems of the form
"icmp pred %X, CI" and a number of examples where "%X = binop %Y, CI2".

Some of these cases (div and rem) used to make it through opt -O2, but the
others are probably now making code elsewhere redundant (probably instcombine).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126988 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-04 07:00:57 +00:00
Eli Friedman
86d822df6d Followup to r126970: add 64-bit encoding tests for str with reg operand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126987 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-04 04:06:47 +00:00
Jakob Stoklund Olesen
2bc2a08b1b DenseMap<uintptr_t,...> doesn't allow all values as keys.
Avoid colliding with the sentinels, hopefully unbreaking
llvm-gcc-x86_64-linux-selfhost.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126982 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-04 02:48:56 +00:00
Andrew Trick
a0807f57ca Minor pre-RA-sched fixes and cleanup.
Fix the PendingQueue, then disable it because it's not required for
the current schedulers' heuristics.
Fix the logic for the unused list-ilp scheduler.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126981 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-04 02:03:45 +00:00
Devang Patel
566bd12e54 Add ArrayRef variant.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126978 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-04 01:20:33 +00:00
Jakob Stoklund Olesen
40a42a2cca Precompute block frequencies, pow() isn't free.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126975 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-04 00:58:40 +00:00
Jakob Stoklund Olesen
13ba2dab63 Use an IndexedMap instead of a DenseMap for the live-out cache.
This speeds up updateSSA() so it only accounts for 5% of the live range
splitting time.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126972 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-04 00:15:36 +00:00
Eli Friedman
ac39bd534b PR9377: Handle x86 str with register operand in a way consistent with gas.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126970 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-04 00:10:17 +00:00
Bill Wendling
e7147dba73 There are times when the landing pad won't have a call to 'eh.selector' in
it. It's been assumed up til now that it would be in its immediate
successor. However, this isn't necessarily the case. It could be in one of its
successor's successors.

Modify the code to more thoroughly check for an 'eh.selector' call in
successors. It only looks at a successor if we get there as a result of an
unconditional branch.

Testcase ObjC/exceptions-4.m in r126968.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126969 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-03 23:14:05 +00:00
Bob Wilson
58f04fd22a PR8053: Fix encoding of S bit in some ARM instructions.
Patch by Zonr Chang!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126967 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-03 23:07:15 +00:00
Eli Friedman
81c5ef8649 Revert r123908; the code in question is completely untested and wrong.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126964 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-03 22:33:23 +00:00
Joerg Sonnenberger
ea83b13350 Bug#9033: For the ELF assembler output, always quote the section name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126963 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-03 22:31:08 +00:00
Devang Patel
bbd0f45b47 Fix typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126962 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-03 21:49:41 +00:00
Devang Patel
6f676be5ff Fix thinko in previous check-in.
Add comment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126959 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-03 20:08:10 +00:00
Devang Patel
cb3a65755e llvm::Function argument count is not a good indicator of how many arugments does the function have at source level. If we need more space, just resize vector conservatively. This vector is only used once per function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126957 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-03 20:02:02 +00:00
Jim Grosbach
0f657b156f Allow a target to choose whether to prefer the scavenger emergency spill slot
be next to the frame pointer or the stack pointer.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126956 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-03 20:01:52 +00:00
Jan Sjödin
24b17c6730 Split MCEELFStreamer and ELFObjectWriter into .h and .cpp files, so that other components can use them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126942 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-03 14:52:12 +00:00
Richard Osborne
ea2578c63f Fix typo in comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126941 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-03 14:21:22 +00:00
Richard Osborne
022708f221 Optimize fprintf -> iprintf if there are no floating point arguments
and siprintf is available on the target.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126940 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-03 14:20:22 +00:00
Justin Holewinski
43b4e23bac PTX: Fix Emacs renaming a symbol
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126938 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-03 14:09:40 +00:00
Richard Osborne
419454ad37 Optimize sprintf -> siprintf if there are no floating point arguments
and siprintf is available on the target.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126937 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-03 14:09:28 +00:00
Justin Holewinski
12785e87e8 PTX: Fix a couple of lint violations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126936 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-03 13:34:29 +00:00
Richard Osborne
3649824bec Optimize printf -> iprintf if there are no floating point arguments
and iprintf is available on the target. Currently iprintf is only
marked as being available on the XCore.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126935 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-03 13:17:51 +00:00
Tilmann Scheller
49d7999b89 Use X86_thiscall calling convention for Win64 as well.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126934 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-03 07:49:07 +00:00
Eli Friedman
78c1e1781c PR9352: Always emit a relocation for weak symbols. Not emitting relocations
for calls to weak symbols with a definition has the appearance of working
with LLVM-generated code because weak symbol definitions are put in their
own sections.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126933 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-03 07:24:36 +00:00
Bob Wilson
1473f35c47 TableGen should not ignore BX instructions for the ARM disassembler. pr9368.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126931 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-03 07:19:52 +00:00
Bob Wilson
acc9e7315c Add a readme entry for the redundant movw issue for pr9370.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126930 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-03 06:39:09 +00:00
Jakob Stoklund Olesen
2c11eb333c Renumber slot indexes uniformly instead of spacing according to the number of defs.
There are probably much larger speedups to be had by renumbering locally instead
of looping over the whole function. For now, the greedy register allocator is
25% faster.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126926 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-03 06:29:01 +00:00
Jakob Stoklund Olesen
f37712f486 Represent sentinel slot indexes with a null pointer.
This is much faster than using a pointer to a ManagedStatic object accessed with
a function call. The greedy register allocator is 5% faster overall just from
the SlotIndex default constructor savings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126925 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-03 05:40:04 +00:00
Jakob Stoklund Olesen
a97ff8a027 Avoid comparing invalid slot indexes, and assert that it doesn't happen.
The SlotIndex created by the default construction does not represent a position
in the function, and it doesn't make sense to compare it to other indexes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126924 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-03 05:18:19 +00:00
Jakob Stoklund Olesen
acf9f48c5e Optimize SlotIndex equality tests.
IndexListEntries have unique indexes, so it is not necessary to dereference
pointers to them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126923 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-03 05:18:15 +00:00
Jakob Stoklund Olesen
b64f669b66 Avoid comparing invalid slot indexes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126922 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-03 04:23:52 +00:00
Jakob Stoklund Olesen
36d61863bc Cache basic block bounds instead of asking SlotIndexes::getMBBRange all the time.
This speeds up the greedy register allocator by 15%.
DenseMap is not as fast as one might hope.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126921 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-03 03:41:29 +00:00
Bill Wendling
f27a40a971 Check the ASM, not LLVM IR.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126918 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-03 02:02:12 +00:00
Bob Wilson
181d3fe727 pr9367: Add missing predicated BLX instructions.
Patch by Jyun-Yan You, with some minor adjustments and a testcase from me.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126915 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-03 01:41:01 +00:00
Bill Wendling
cb1c195f53 Testcase for r126913.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126914 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-03 01:32:56 +00:00
Jakob Stoklund Olesen
bece06f0c6 Change the SplitEditor interface to a single instance can be shared for multiple splits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126912 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-03 01:29:13 +00:00
Jakob Stoklund Olesen
8701768ae2 Only run the updateSSA loop when we have actually seen multiple values.
When only a single value has been seen, new PHIDefs are never needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126911 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-03 01:29:10 +00:00
Jakob Stoklund Olesen
c29d9b3495 Fix PHI handling in LiveIntervals::shrinkToUses().
We need to wait until we meet a PHIDef in its defining block before resurrecting
PHIKills in the predecessors.

This should unbreak the llvm-gcc-build-x86_64-darwin10-x-mingw32-x-armeabi bot.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126905 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-03 00:20:51 +00:00
Stuart Hastings
44456e86c8 Test case for r126864. Radar 9056407.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126900 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-02 23:41:40 +00:00
Bob Wilson
254c63e336 Avoid exponential blow-up when printing DAGs.
David Greene changed CannotYetSelect() to print the full DAG including multiple
copies of operands reached through different paths in the DAG.  Unfortunately
this blows up exponentially in some cases.  The depth limit of 100 is way too
high to prevent this -- I'm seeing a message string of 150MB with a depth of
only 40 in one particularly bad case, even though the DAG has less than 200
nodes.  Part of the problem is that the printing code is following chain
operands, so if you fail to select an operation with a chain, the printer will
follow all the chained operations back to the entry node.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126899 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-02 23:38:06 +00:00
Jakob Stoklund Olesen
a2cae58411 Turn the Edit member into a pointer so it can change dynamically.
No functional change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126898 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-02 23:31:50 +00:00
Stuart Hastings
621c65e089 Test case for r126672. Radar 9055247.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126896 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-02 23:24:44 +00:00
Kevin Enderby
d39647d913 Fixes an assertion failure while disassembling ARM rsbs reg/reg form.
Patch by Ted Kremenek!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126895 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-02 23:08:33 +00:00
Jakob Stoklund Olesen
4670353a21 Transfer simply defined values directly without recomputing liveness and SSA.
Values that map to a single new value in a new interval after splitting don't
need new PHIDefs, and if the parent value was never rematerialized the live
range will be the same.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126894 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-02 23:05:19 +00:00
Jakob Stoklund Olesen
e2dc0c978e Extract a method. No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126893 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-02 23:05:16 +00:00
Renato Golin
e89a05337a Fixing a bug when printing fpu text to object file. Patch by Mans Rullgard.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126882 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-02 21:20:09 +00:00