Commit Graph

771 Commits

Author SHA1 Message Date
Chris Lattner
8346bb6c29 Remove dead code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23179 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-31 20:25:15 +00:00
Chris Lattner
bc11c3482c Move SHL,SHR i64 -> legalizer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23178 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-31 20:23:54 +00:00
Chris Lattner
c22af9e5df Remove code that is now dead from the pattern isel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23177 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-31 19:11:36 +00:00
Chris Lattner
eb9b62e35e lower sra_parts on the dag, implementing it for the dag isel, and exposing
the ops to dag optimization.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23176 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-31 19:09:57 +00:00
Chris Lattner
99296ffd36 add assert zext/sext to the dag isel
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23171 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-31 18:08:46 +00:00
Chris Lattner
5dd7fea3f2 Handle AssertSext/AssertZext nodes, fixing the regressions last night.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23170 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-31 17:48:04 +00:00
Nate Begeman
49296f1f48 Enable generation of AssertSext and AssertZext in the PPC backend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23168 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-31 01:58:39 +00:00
Chris Lattner
7a49fdcd11 Fix 'ret long' to return the high and lo parts in the right registers. This
fixes crafty and probably others.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23167 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-31 01:34:29 +00:00
Chris Lattner
eb80fe8ff6 now that physregs can exist in the same dag with multiple types, remove some
ugly hacks


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23162 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-30 22:59:48 +00:00
Chris Lattner
2ea0c66ae5 Fix type mismatches when passing f32 values to calls
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23159 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-30 21:28:19 +00:00
Chris Lattner
1368721d53 Fix some indentation (first hunks).
Remove code (last hunk) that miscompiled immediate and's, such as
  and uint %tmp.30, 4294958079

into

 andi. r8, r8, 56319
 andis. r8, r8, 65535

instead of:

 li r9, -9217
 and r8, r8, r9

The first always generates zero.

This fixes espresso.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23155 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-30 18:37:48 +00:00
Chris Lattner
b551ba7661 Fix a problem Nate found where we swapped the operands of SHL/SHR_PARTS. This
fixes fourinarow


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23153 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-30 17:42:59 +00:00
Chris Lattner
14b86c72a2 codegen ADD_PARTS correctly: put the results in the right registers! This
fixes fhourstones


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23152 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-30 17:40:13 +00:00
Chris Lattner
2501d5e29c add operands in the right order, fixing McCat/18-imp with the dag isel
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23150 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-30 17:13:58 +00:00
Chris Lattner
31ce12f4f5 Make sure the selector emits register register copies with flag operands
linking them to calls when appropriate, this prevents the scheduler from
pulling these copies away from the call.

This fixes Ptrdist/yacr2


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23143 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-30 01:57:02 +00:00
Chris Lattner
15055733f8 The first operand to AND does not always have more than two operands. This
fixes MediaBench/toast with the dag selector


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23141 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-30 00:59:16 +00:00
Chris Lattner
6de08f4377 Fix a bug in my patch for legalizing to fsel. It cannot handle seteq/setne,
which I failed to include when I moved the code over.  This fixes
MallocBench/gs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23140 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-30 00:45:18 +00:00
Chris Lattner
8f838720ad emit FMR instructions to convert f64<->f32 instructions, so things like
STOREs, know the right type to store.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23139 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-30 00:30:43 +00:00
Chris Lattner
915fb302b1 Fix some really strange indentation that xcode likes to use.
no xcode, this is not right:

   if (!foo) break;
     X;


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23138 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-30 00:19:00 +00:00
Chris Lattner
8bbcc20a9d fix a crash in cfrac
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23137 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-29 23:49:25 +00:00
Chris Lattner
9c2dece8e2 Implement DYNAMIC_STACKALLOC, wrap some long lines
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23136 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-29 23:30:11 +00:00
Chris Lattner
7107c10501 Fix a dumb bug of mine where we were mishandling the PPC ABI (undef handling).
This fixes voronoi and bh in Olden, allowing all of olden to pass!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23133 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-29 22:22:57 +00:00
Chris Lattner
efa6abcb95 Fix a bug the last patch exposed in treeadd among others
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23127 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-29 01:07:02 +00:00
Chris Lattner
2fef809b5b A hack to fix a problem folding immedaites. This fixes Olden/power.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23126 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-29 01:01:01 +00:00
Chris Lattner
2a06a5ef36 Fix order of operands for copytoreg node when emitting calls. This fixes
Olden/msFix order of operands for copytoreg node when emitting calls.  This fixes
Olden/mstt.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23125 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-29 00:26:57 +00:00
Chris Lattner
b9efd14568 add operands in the correct order
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23123 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-29 00:02:01 +00:00
Chris Lattner
c8a89a1fcb Fix a bug in FP_EXTEND, implement FP_TO_SINT
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23121 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-28 23:59:09 +00:00
Chris Lattner
528f58e813 fix an assertion failure in treeadd
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23120 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-28 23:39:22 +00:00
Chris Lattner
e3f1c97734 The condition register being branched on may not be cr0, as such, print it.
This fixes: UnitTests/2005-07-17-INT-To-FP.c


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23112 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 23:42:05 +00:00
Chris Lattner
f48e83ded0 Propagate cr# from COND_BRANCH to the actual branch instruction as appropriate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23111 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 23:41:27 +00:00
Chris Lattner
28b9cc2d13 allow code using mtcrf to assemble
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23107 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 22:05:54 +00:00
Nate Begeman
a0df5d8da5 Remove operand type 'crbit', since it is no longer used
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23106 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 22:04:17 +00:00
Chris Lattner
82972705df teach getClass what a condition reg is
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23105 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 21:51:29 +00:00
Chris Lattner
5087daac23 Minor cleanups:
* avoid calling getClass() multiple times (it is relatively expensive)
  * Allow -disable-fp-elim to turn of frame pointer elimination.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23104 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 21:49:18 +00:00
Chris Lattner
8a2d3ca7df implement SELECT_CC fully for the DAG->DAG isel!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23101 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 21:23:58 +00:00
Chris Lattner
0bbea95433 Make fsel emission work with both the pattern and dag-dag selectors, by
giving it a non-instruction opcode.  The dag->dag selector used to not
select the operands of the fsel, because it thought that whole tree was
already selected.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23091 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 20:25:03 +00:00
Chris Lattner
13794f5d01 implement the fold for:
bool %test(int %X, int %Y) {
        %C = setne int %X, 0
        ret bool %C
}

to:

_test:
        addic r2, r3, -1
        subfe r3, r2, r3
        blr


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23089 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 18:46:49 +00:00
Chris Lattner
52987f4f65 Changes to adjust to new ReplaceAllUsesWith syntax. Change FP_EXTEND to
just return its input, instead of emitting an explicit copy.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23088 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 18:37:23 +00:00
Nate Begeman
60675f7562 Remove some code made dead by the fsel patch
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23085 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 17:45:06 +00:00
Chris Lattner
28b9be300c now that fsel is formed during legalization, this code is dead
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23084 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 17:40:39 +00:00
Chris Lattner
0b1e4e508b implement the other half of the select_cc -> fsel lowering, which handles
when the RHS of the comparison is 0.0.  Turn this on by default.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23083 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 17:36:52 +00:00
Chris Lattner
5839bf2b3b Change ConstantPoolSDNode to actually hold the Constant itself instead of
putting it into the constant pool.  This allows the isel machinery to
create constants that it will end up deciding are not needed, without them
ending up in the resultant function constant pool.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23081 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 17:15:30 +00:00
Chris Lattner
95e0682a42 Fix some warnings in an optimized build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23080 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 16:38:51 +00:00
Chris Lattner
2bb06cdf27 Fix a huge annoyance: SelectNodeTo took types before the opcode unlike
every other SD API.  Fix it to take the opcode before the types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23079 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 16:36:26 +00:00
Nate Begeman
6718f11feb Fix JIT encoding of conditional branches
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23076 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 04:11:42 +00:00
Chris Lattner
e4bc9ea0a5 add initial support for converting select_cc -> fsel in the legalizer
instead of in the backend.  This currently handles fsel cases with registers,
but doesn't have the 0.0 and -0.0 optimization enabled yet.

Once this is finished, special hack for fp immediates can go away.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23075 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 00:52:45 +00:00
Nate Begeman
bb22df31d9 SUBFIC produces two results, not one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23073 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 00:34:06 +00:00
Nate Begeman
6660cd65cf Implement SHL_PARTS and SRL_PARTS
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23072 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 00:28:00 +00:00
Chris Lattner
b20c318df0 Emit the lo/hi parts in the right order :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23068 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-25 23:36:49 +00:00
Chris Lattner
a9317ed361 implement support for 64-bit add/sub, fix a broken assertion for 64-bit
return.  Allow the udiv breaker-upper to work with any non-zero constant
operand.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23066 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-25 23:21:06 +00:00