Jakob Stoklund Olesen
d99d8cfdf0
Number SlotIndexes uniformly without looking at the number of defs on each instruction.
...
You can't really predict how many indexes will be needed from the number of
defs, so let's keep it simple.
Also remove an extra empty index that was inserted after each basic block. It
was intended for live-out ranges, but it was never used that way.
llvm-svn: 127014
2011-03-04 18:51:09 +00:00
Jakob Stoklund Olesen
61af2752b1
Symbolize the default instruction distance.
...
llvm-svn: 127013
2011-03-04 18:36:51 +00:00
Benjamin Kramer
0376064f8f
raw_ostream: If writing a string that is larger than the buffer, write it directly instead of doing many buffer-sized writes.
...
This caps the number of write(2) calls per string to a maximum of 2.
llvm-svn: 127010
2011-03-04 18:18:16 +00:00
Jakob Stoklund Olesen
728fffc159
Deferred SlotIndex renumbering was a good idea but never used.
...
llvm-svn: 127008
2011-03-04 18:08:32 +00:00
Jakob Stoklund Olesen
dfc9b0b15f
Add SlotIndex statistics.
...
llvm-svn: 127007
2011-03-04 18:08:29 +00:00
Jakob Stoklund Olesen
c3193f4aa8
Tweak debug output. No functional changes.
...
llvm-svn: 127006
2011-03-04 18:08:26 +00:00
Bruno Cardoso Lopes
a49a596acf
Fixes addc pattern when immediate cannot be represented with 16-bit. Patch by Akira Hatanaka
...
llvm-svn: 127005
2011-03-04 17:59:18 +00:00
Bruno Cardoso Lopes
5400401372
Remove (hopefully) all trailing whitespaces from the mips backend. Patch by Hatanaka, Akira
...
llvm-svn: 127003
2011-03-04 17:51:39 +00:00
Duncan Sands
f6c9de94f8
Revert commit 126684 "Use the correct shift amount type". It is only the correct
...
type after type legalization has completed. Before then it may simply not be big
enough to hold the shift amount, particularly on x86 which uses a very small type
for shifts (this issue broke stuff in the past which is why LegalizeTypes carefully
uses a large type for shift amounts).
llvm-svn: 127000
2011-03-04 14:28:59 +00:00
Kalle Raiskila
6e33c92ffb
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.
llvm-svn: 126998
2011-03-04 13:19:18 +00:00
Kalle Raiskila
72cfda1a29
Allow load from constant on SPU.
...
A 'load <4 x i32>* null' crashes llc before this fix.
llvm-svn: 126995
2011-03-04 12:00:11 +00:00
Nick Lewycky
3bc3a84ba8
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!
llvm-svn: 126991
2011-03-04 10:06:52 +00:00
Nick Lewycky
a5f309e983
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).
llvm-svn: 126988
2011-03-04 07:00:57 +00:00
Eli Friedman
7243ca7572
Followup to r126970: add 64-bit encoding tests for str with reg operand.
...
llvm-svn: 126987
2011-03-04 04:06:47 +00:00
Jakob Stoklund Olesen
c7bf5eaafb
DenseMap<uintptr_t,...> doesn't allow all values as keys.
...
Avoid colliding with the sentinels, hopefully unbreaking
llvm-gcc-x86_64-linux-selfhost.
llvm-svn: 126982
2011-03-04 02:48:56 +00:00
Andrew Trick
1478921dc0
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.
llvm-svn: 126981
2011-03-04 02:03:45 +00:00
Devang Patel
9dbcb14cd8
Add ArrayRef variant.
...
llvm-svn: 126978
2011-03-04 01:20:33 +00:00
Jakob Stoklund Olesen
3c64ea5ad2
Precompute block frequencies, pow() isn't free.
...
llvm-svn: 126975
2011-03-04 00:58:40 +00:00
Jakob Stoklund Olesen
5bc7a96cca
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.
llvm-svn: 126972
2011-03-04 00:15:36 +00:00
Eli Friedman
be07c34368
PR9377: Handle x86 str with register operand in a way consistent with gas.
...
llvm-svn: 126970
2011-03-04 00:10:17 +00:00
Bill Wendling
6e6a0422eb
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.
llvm-svn: 126969
2011-03-03 23:14:05 +00:00
Bob Wilson
c48ba54186
PR8053: Fix encoding of S bit in some ARM instructions.
...
Patch by Zonr Chang!
llvm-svn: 126967
2011-03-03 23:07:15 +00:00
Eli Friedman
26f5c96de3
Revert r123908; the code in question is completely untested and wrong.
...
llvm-svn: 126964
2011-03-03 22:33:23 +00:00
Joerg Sonnenberger
bb93506f95
Bug#9033: For the ELF assembler output, always quote the section name.
...
llvm-svn: 126963
2011-03-03 22:31:08 +00:00
Devang Patel
a7b5a00033
Fix typo.
...
llvm-svn: 126962
2011-03-03 21:49:41 +00:00
Devang Patel
3c2bd93f9e
Fix thinko in previous check-in.
...
Add comment.
llvm-svn: 126959
2011-03-03 20:08:10 +00:00
Devang Patel
4adbb350be
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.
...
llvm-svn: 126957
2011-03-03 20:02:02 +00:00
Jim Grosbach
e4ef37b298
Allow a target to choose whether to prefer the scavenger emergency spill slot
...
be next to the frame pointer or the stack pointer.
llvm-svn: 126956
2011-03-03 20:01:52 +00:00
Jan Sjödin
3c1fa9a68b
Split MCEELFStreamer and ELFObjectWriter into .h and .cpp files, so that other components can use them.
...
llvm-svn: 126942
2011-03-03 14:52:12 +00:00
Richard Osborne
2186cd4e47
Fix typo in comment.
...
llvm-svn: 126941
2011-03-03 14:21:22 +00:00
Richard Osborne
88d0d840f2
Optimize fprintf -> iprintf if there are no floating point arguments
...
and siprintf is available on the target.
llvm-svn: 126940
2011-03-03 14:20:22 +00:00
Justin Holewinski
396fdaee6d
PTX: Fix Emacs renaming a symbol
...
llvm-svn: 126938
2011-03-03 14:09:40 +00:00
Richard Osborne
021b589253
Optimize sprintf -> siprintf if there are no floating point arguments
...
and siprintf is available on the target.
llvm-svn: 126937
2011-03-03 14:09:28 +00:00
Justin Holewinski
86e749c620
PTX: Fix a couple of lint violations
...
llvm-svn: 126936
2011-03-03 13:34:29 +00:00
Richard Osborne
df829ddcb7
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.
llvm-svn: 126935
2011-03-03 13:17:51 +00:00
Tilmann Scheller
ab6450ec63
Use X86_thiscall calling convention for Win64 as well.
...
llvm-svn: 126934
2011-03-03 07:49:07 +00:00
Eli Friedman
f7eb4cce13
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.
llvm-svn: 126933
2011-03-03 07:24:36 +00:00
Bob Wilson
e24bee9ce8
TableGen should not ignore BX instructions for the ARM disassembler. pr9368.
...
llvm-svn: 126931
2011-03-03 07:19:52 +00:00
Bob Wilson
72ccdfe148
Add a readme entry for the redundant movw issue for pr9370.
...
llvm-svn: 126930
2011-03-03 06:39:09 +00:00
Jakob Stoklund Olesen
3511ad1023
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.
llvm-svn: 126926
2011-03-03 06:29:01 +00:00
Jakob Stoklund Olesen
d0930e03c1
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.
llvm-svn: 126925
2011-03-03 05:40:04 +00:00
Jakob Stoklund Olesen
2e6407e9aa
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.
llvm-svn: 126924
2011-03-03 05:18:19 +00:00
Jakob Stoklund Olesen
2a12e5adba
Optimize SlotIndex equality tests.
...
IndexListEntries have unique indexes, so it is not necessary to dereference
pointers to them.
llvm-svn: 126923
2011-03-03 05:18:15 +00:00
Jakob Stoklund Olesen
92d724fb69
Avoid comparing invalid slot indexes.
...
llvm-svn: 126922
2011-03-03 04:23:52 +00:00
Jakob Stoklund Olesen
2759a169ea
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.
llvm-svn: 126921
2011-03-03 03:41:29 +00:00
Bill Wendling
f13018b233
Check the ASM, not LLVM IR.
...
llvm-svn: 126918
2011-03-03 02:02:12 +00:00
Bob Wilson
42f80596ca
pr9367: Add missing predicated BLX instructions.
...
Patch by Jyun-Yan You, with some minor adjustments and a testcase from me.
llvm-svn: 126915
2011-03-03 01:41:01 +00:00
Bill Wendling
ee60338654
Testcase for r126913.
...
llvm-svn: 126914
2011-03-03 01:32:56 +00:00
Jakob Stoklund Olesen
09a1939164
Change the SplitEditor interface to a single instance can be shared for multiple splits.
...
llvm-svn: 126912
2011-03-03 01:29:13 +00:00
Jakob Stoklund Olesen
df789f852e
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.
llvm-svn: 126911
2011-03-03 01:29:10 +00:00