Evan Cheng
190ff7fa88
Disable auto-detection of AVX support since AVX codegen support is not ready.
...
llvm-svn: 121677
2010-12-13 04:23:53 +00:00
Chris Lattner
003b79e2d3
don't bother handling non-canonical icmp's
...
llvm-svn: 121676
2010-12-13 04:18:32 +00:00
Chris Lattner
9bd0b12342
inline a function, making the result much simpler.
...
llvm-svn: 121675
2010-12-13 04:15:19 +00:00
Chris Lattner
25b642edfd
Fix my previous patch to handle a degenerate case that the llvm-gcc
...
bootstrap buildbot tripped over.
llvm-svn: 121674
2010-12-13 03:43:57 +00:00
Chris Lattner
9b089512e9
convert some methods to be static functions
...
llvm-svn: 121673
2010-12-13 03:30:12 +00:00
Chris Lattner
46cc5158bb
zap two more std::sorts.
...
llvm-svn: 121672
2010-12-13 03:24:30 +00:00
Chris Lattner
a21c02e807
fix a fairly serious oversight with switch formation from
...
or'd conditions. Previously we'd compile something like this:
int crud (unsigned char c) {
return c == 62 || c == 34 || c == 92;
}
into:
switch i8 %c, label %lor.rhs [
i8 62, label %lor.end
i8 34, label %lor.end
]
lor.rhs: ; preds = %entry
%cmp8 = icmp eq i8 %c, 92
br label %lor.end
lor.end: ; preds = %entry, %entry, %lor.rhs
%0 = phi i1 [ true, %entry ], [ %cmp8, %lor.rhs ], [ true, %entry ]
%lor.ext = zext i1 %0 to i32
ret i32 %lor.ext
which failed to merge the compare-with-92 into the switch. With this patch
we simplify this all the way to:
switch i8 %c, label %lor.rhs [
i8 62, label %lor.end
i8 34, label %lor.end
i8 92, label %lor.end
]
lor.rhs: ; preds = %entry
br label %lor.end
lor.end: ; preds = %entry, %entry, %entry, %lor.rhs
%0 = phi i1 [ true, %entry ], [ false, %lor.rhs ], [ true, %entry ], [ true, %entry ]
%lor.ext = zext i1 %0 to i32
ret i32 %lor.ext
which is much better for codegen's switch lowering stuff. This kicks in 33 times
on 176.gcc (for example) cutting 103 instructions off the generated code.
llvm-svn: 121671
2010-12-13 03:18:54 +00:00
Chris Lattner
6d4df726a6
simplify code and reduce indentation
...
llvm-svn: 121670
2010-12-13 02:38:13 +00:00
Chris Lattner
134d892049
convert an std::sort to array_pod_sort.
...
llvm-svn: 121669
2010-12-13 02:00:58 +00:00
Chris Lattner
153b680cdd
move the "br (X == 0 | X == 1), T, F" -> switch optimization to a new
...
location in simplifycfg. In the old days, SimplifyCFG was never run on
the entry block, so we had to scan over all preds of the BB passed into
simplifycfg to do this xform, now we can just check blocks ending with
a condbranch. This avoids a scan over all preds of every simplified
block, which should be a significant compile-time perf win on functions
with lots of edges. No functionality change.
llvm-svn: 121668
2010-12-13 01:57:34 +00:00
Chris Lattner
644a93e06b
reduce indentation and generally simplify code, no functionality change.
...
llvm-svn: 121667
2010-12-13 01:47:07 +00:00
Chris Lattner
859fad7373
use getFirstNonPHIOrDbg to simplify this code.
...
llvm-svn: 121664
2010-12-13 01:28:06 +00:00
Chris Lattner
6df4d5d88e
reduce indentation by using continue, no functionality change.
...
llvm-svn: 121662
2010-12-13 01:11:17 +00:00
Chris Lattner
72f03b62a9
add a note
...
llvm-svn: 121656
2010-12-13 00:15:25 +00:00
Wesley Peck
f842b79b4b
Missed some ADDI <-> ADDIK conversions in 121649.
...
llvm-svn: 121652
2010-12-12 22:53:14 +00:00
Wesley Peck
95cebfc460
MBlaze delay slot filler was not capable of using ADDK and variants to fill delay slots. This broke several test cases when 121649 was committed. This fixes the regression.
...
llvm-svn: 121650
2010-12-12 22:22:49 +00:00
Wesley Peck
38688d020c
The ADD and ADDK (and all variants) instructions where flip-flopped in the MBlaze backend. This bug fix makes 64-bit math work on the MBlaze backend.
...
llvm-svn: 121649
2010-12-12 22:02:31 +00:00
Tobias Grosser
cd3d63e102
Remove useless dynamic_cast<>().
...
Thanks Peter for pointing me to something that should have never been
committed to the llvm code base.
llvm-svn: 121648
2010-12-12 21:58:28 +00:00
Wesley Peck
7274c73974
1. Change MBlaze indirect branches to use absolute branch BRALD instead of pc relative branch BRLD.
...
2. Make sure that the MBlaze stack is aligned to 4-byte boundaries.
3. Determine frame indexes that should be placed in the callers stack frame, as per the MBlaze ABI, and place them in the correct locations.
llvm-svn: 121639
2010-12-12 20:52:31 +00:00
Duncan Sands
47a4bbd31d
Catch attempts to remove a deleted node from the CSE maps. Better to
...
catch this here rather than later after accessing uninitialized memory
etc. Fires when compiling the testcase in PR8237.
llvm-svn: 121635
2010-12-12 13:22:50 +00:00
Benjamin Kramer
a638216447
Generalize the and-icmp-select instcombine further by allowing selects of the form
...
(x & 2^n) ? 2^m+C : C
we can offset both arms by C to get the "(x & 2^n) ? 2^m : 0" form, optimize the
select to a shift and apply the offset afterwards.
llvm-svn: 121609
2010-12-11 10:49:22 +00:00
Benjamin Kramer
5a1721f4ac
Factor the (x & 2^n) ? 2^m : 0 instcombine into its own method and generalize it
...
to catch cases where n != m with a shift.
llvm-svn: 121608
2010-12-11 09:42:59 +00:00
Evan Cheng
b6773d7e1f
(or (and (shl A, #shamt), mask), B) => ARMbfi B, A, ~mask where lsb(mask) == #shamt. rdar://8752056
...
llvm-svn: 121606
2010-12-11 04:11:38 +00:00
Jakob Stoklund Olesen
a523d5f048
Add named timer groups for the different stages of register allocation.
...
llvm-svn: 121604
2010-12-11 00:19:56 +00:00
Jakob Stoklund Olesen
ef80efea1d
Move MRI into RegAllocBase. Clean up debug output a bit.
...
llvm-svn: 121599
2010-12-10 23:49:00 +00:00
Jim Grosbach
98dcdf10c2
Add FIXME
...
llvm-svn: 121598
2010-12-10 23:41:10 +00:00
Nick Lewycky
46a6ed1f0f
Remove extraneous close parenthesis.
...
Fix build breakage.
llvm-svn: 121596
2010-12-10 23:14:35 +00:00
Nick Lewycky
9afbedbc48
Move variable that's unused in an NDEBUG build inside the DEBUG() macro, fixing
...
lib/CodeGen/RegAllocGreedy.cpp:233: error: unused variable 'TRC' [-Wunused-variable]
llvm-svn: 121594
2010-12-10 23:05:10 +00:00
Owen Anderson
47a78db79b
Attempt to get Thumb2 branch fixups working properly.
...
llvm-svn: 121593
2010-12-10 23:02:28 +00:00
Jakob Stoklund Olesen
6cd6e644e7
Force the greedy register allocator to always use the inline spiller.
...
Soon, RegAllocGreedy will start splitting live ranges, and then deferred
spilling won't work anyway.
llvm-svn: 121591
2010-12-10 22:54:44 +00:00
Jakob Stoklund Olesen
cbd4bac09d
Rip out live range splitting support from the inline spiller.
...
The spiller should only spill. The register allocator will drive live range
splitting, it has the needed information about register pressure and
interferences.
llvm-svn: 121590
2010-12-10 22:54:40 +00:00
Owen Anderson
8424ab65e2
Fix merge error in my last fix to Thumb2 vldr fixups.
...
llvm-svn: 121588
2010-12-10 22:53:48 +00:00
Owen Anderson
f310c92333
Fixups for Thumb2 vldr's need to have the effective PC aligned as well.
...
llvm-svn: 121587
2010-12-10 22:46:47 +00:00
Bill Wendling
7f1cea7009
The MCFixupKindInfo table needs to be in the order that the enums were
...
declared. Add a note specifying this and spruce up the list a bit.
llvm-svn: 121586
2010-12-10 22:37:19 +00:00
Owen Anderson
e85fabac75
Provide the necessary post-encoder hook for Thumb2 encodings of VMOV and friends.
...
llvm-svn: 121585
2010-12-10 22:32:08 +00:00
Jakob Stoklund Olesen
5ab6552845
Use AllocationOrder in RegAllocGreedy, fix a bug in the hint calculation.
...
llvm-svn: 121584
2010-12-10 22:21:05 +00:00
Bob Wilson
d30768fe3e
Add float patterns for Neon vld1-lane/dup and vst1-lane operations.
...
llvm-svn: 121583
2010-12-10 22:13:32 +00:00
Bob Wilson
ae683e722f
Remove unused arguments.
...
llvm-svn: 121582
2010-12-10 22:13:24 +00:00
Owen Anderson
aaf97da84b
Fix encoding of Thumb1 LDRB and STRB.
...
llvm-svn: 121581
2010-12-10 22:11:13 +00:00
Jim Grosbach
d7f424dec3
Trailing whitespace.
...
llvm-svn: 121580
2010-12-10 21:57:34 +00:00
Owen Anderson
44ad90c850
Fix Thumb2 encodings of STREX and LDREX.
...
llvm-svn: 121579
2010-12-10 21:52:38 +00:00
Dan Gohman
18e2a55c07
Revert r121520, which may have introduced miscompilations.
...
llvm-svn: 121573
2010-12-10 21:48:28 +00:00
Jim Grosbach
82dd80c956
Correct encoding of rotation immediate for Thumb2 instructions. rdar://8755999
...
llvm-svn: 121525
2010-12-10 21:24:18 +00:00
Jim Grosbach
63853d61e1
Fix encoding of 'U' bit for Thumb2 STRD/LDRD instructions. rdar://8755726
...
llvm-svn: 121524
2010-12-10 21:05:07 +00:00
Jim Grosbach
467e860805
More trivial cleanup. No need to define the EncoderMethod property type. Can
...
just assign to it.
llvm-svn: 121523
2010-12-10 20:53:44 +00:00
Jim Grosbach
5696d964ca
Tidy up.
...
llvm-svn: 121522
2010-12-10 20:51:35 +00:00
Jim Grosbach
401391235f
Trailing whitespace.
...
llvm-svn: 121521
2010-12-10 20:47:29 +00:00
Dan Gohman
d1bf1d8013
Implement PartialAlias checking in BasicAA.
...
llvm-svn: 121520
2010-12-10 20:47:03 +00:00
Jakob Stoklund Olesen
ea59381fc8
Fix miscompilation caused by trivial logic error in the reassignVReg()
...
interference check.
llvm-svn: 121519
2010-12-10 20:45:04 +00:00
Dan Gohman
b0fa0f7849
Minimally update this code to handle PartialAlias.
...
llvm-svn: 121518
2010-12-10 20:14:49 +00:00