summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Change the isel to not break out of the big giant switch. Instead, theChris Lattner2005-09-031-59/+61
| | | | | | switch should never be exited, so its bottom is now unreachable. llvm-svn: 23234
* Implement dynamic allocas correctly. In particular, because we were copyingChris Lattner2005-09-011-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | directly out of R1 (without using a CopyFromReg, which uses a chain), multiple allocas were getting CSE'd together, producing bogus code. For this: int %foo(bool %X, int %A, int %B) { br bool %X, label %T, label %F F: %G = alloca int %H = alloca int store int %A, int* %G store int %B, int* %H %R = load int* %G ret int %R T: ret int 0 } We were generating: _foo: stwu r1, -16(r1) stw r31, 4(r1) or r31, r1, r1 stw r1, 12(r31) cmpwi cr0, r3, 0 bne cr0, .LBB_foo_2 ; T .LBB_foo_1: ; F li r2, 16 subf r2, r2, r1 ;; One alloca or r1, r2, r2 or r3, r1, r1 or r1, r2, r2 or r2, r1, r1 stw r4, 0(r3) stw r5, 0(r2) lwz r3, 0(r3) lwz r1, 12(r31) lwz r31, 4(r31) lwz r1, 0(r1) blr .LBB_foo_2: ; T li r3, 0 lwz r1, 12(r31) lwz r31, 4(r31) lwz r1, 0(r1) blr Now we generate: _foo: stwu r1, -16(r1) stw r31, 4(r1) or r31, r1, r1 stw r1, 12(r31) cmpwi cr0, r3, 0 bne cr0, .LBB_foo_2 ; T .LBB_foo_1: ; F or r2, r1, r1 li r3, 16 subf r2, r3, r2 ;; Alloca 1 or r1, r2, r2 or r2, r1, r1 or r6, r1, r1 subf r3, r3, r6 ;; Alloca 2 or r1, r3, r3 or r3, r1, r1 stw r4, 0(r2) stw r5, 0(r3) lwz r3, 0(r2) lwz r1, 12(r31) lwz r31, 4(r31) lwz r1, 0(r1) blr .LBB_foo_2: ; T li r3, 0 lwz r1, 12(r31) lwz r31, 4(r31) lwz r1, 0(r1) blr This fixes Povray and SPASS with the dag isel, the last two failing cases. Tommorow we will hopefully turn it on by default! :) llvm-svn: 23190
* Fix a bug where we were useing HA to get the high part, which seems like itChris Lattner2005-09-011-11/+10
| | | | | | | | | | could cause a miscompile. Fixing this didn't fix the two programs that fail though. :( This also changes the implementation to follow the pattern selector more closely, causing us to select 0 to li instead of lis. llvm-svn: 23189
* Do not select the operands being passed into SelectCC. IT does this itselfChris Lattner2005-09-011-4/+2
| | | | | | and selecting early prevents folding immediates into the cmpw* instructions llvm-svn: 23188
* Move FCTIWZ handling out of the instruction selectors and into legalization,Chris Lattner2005-08-311-13/+4
| | | | | | getting them out of the business of making stack slots. llvm-svn: 23180
* Remove dead codeChris Lattner2005-08-311-38/+0
| | | | llvm-svn: 23179
* add assert zext/sext to the dag iselChris Lattner2005-08-311-0/+3
| | | | llvm-svn: 23171
* Fix 'ret long' to return the high and lo parts in the right registers. ThisChris Lattner2005-08-311-9/+7
| | | | | | fixes crafty and probably others. llvm-svn: 23167
* now that physregs can exist in the same dag with multiple types, remove someChris Lattner2005-08-301-27/+8
| | | | | | ugly hacks llvm-svn: 23162
* Fix type mismatches when passing f32 values to callsChris Lattner2005-08-301-2/+7
| | | | llvm-svn: 23159
* Fix some indentation (first hunks).Chris Lattner2005-08-301-30/+20
| | | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 23155
* Fix a problem Nate found where we swapped the operands of SHL/SHR_PARTS. ThisChris Lattner2005-08-301-4/+4
| | | | | | fixes fourinarow llvm-svn: 23153
* codegen ADD_PARTS correctly: put the results in the right registers! ThisChris Lattner2005-08-301-1/+1
| | | | | | fixes fhourstones llvm-svn: 23152
* add operands in the right order, fixing McCat/18-imp with the dag iselChris Lattner2005-08-301-3/+3
| | | | llvm-svn: 23150
* Make sure the selector emits register register copies with flag operandsChris Lattner2005-08-301-10/+20
| | | | | | | | | linking them to calls when appropriate, this prevents the scheduler from pulling these copies away from the call. This fixes Ptrdist/yacr2 llvm-svn: 23143
* The first operand to AND does not always have more than two operands. ThisChris Lattner2005-08-301-1/+2
| | | | | | fixes MediaBench/toast with the dag selector llvm-svn: 23141
* emit FMR instructions to convert f64<->f32 instructions, so things likeChris Lattner2005-08-301-8/+15
| | | | | | STOREs, know the right type to store. llvm-svn: 23139
* fix a crash in cfracChris Lattner2005-08-291-2/+2
| | | | llvm-svn: 23137
* Implement DYNAMIC_STACKALLOC, wrap some long linesChris Lattner2005-08-291-2/+35
| | | | llvm-svn: 23136
* Fix a dumb bug of mine where we were mishandling the PPC ABI (undef handling).Chris Lattner2005-08-291-15/+16
| | | | | | This fixes voronoi and bh in Olden, allowing all of olden to pass! llvm-svn: 23133
* Fix a bug the last patch exposed in treeadd among othersChris Lattner2005-08-291-1/+1
| | | | llvm-svn: 23127
* A hack to fix a problem folding immedaites. This fixes Olden/power.Chris Lattner2005-08-291-4/+8
| | | | llvm-svn: 23126
* Fix order of operands for copytoreg node when emitting calls. This fixesChris Lattner2005-08-291-1/+1
| | | | | | | Olden/msFix order of operands for copytoreg node when emitting calls. This fixes Olden/mstt. llvm-svn: 23125
* add operands in the correct orderChris Lattner2005-08-291-2/+2
| | | | llvm-svn: 23123
* Fix a bug in FP_EXTEND, implement FP_TO_SINTChris Lattner2005-08-281-3/+15
| | | | llvm-svn: 23121
* fix an assertion failure in treeaddChris Lattner2005-08-281-2/+2
| | | | llvm-svn: 23120
* implement SELECT_CC fully for the DAG->DAG isel!Chris Lattner2005-08-261-2/+11
| | | | llvm-svn: 23101
* Make fsel emission work with both the pattern and dag-dag selectors, byChris Lattner2005-08-261-1/+8
| | | | | | | | 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. llvm-svn: 23091
* implement the fold for:Chris Lattner2005-08-261-0/+21
| | | | | | | | | | | | | | | | 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 llvm-svn: 23089
* Changes to adjust to new ReplaceAllUsesWith syntax. Change FP_EXTEND toChris Lattner2005-08-261-13/+15
| | | | | | just return its input, instead of emitting an explicit copy. llvm-svn: 23088
* now that fsel is formed during legalization, this code is deadChris Lattner2005-08-261-12/+0
| | | | llvm-svn: 23084
* Change ConstantPoolSDNode to actually hold the Constant itself instead ofChris Lattner2005-08-261-6/+3
| | | | | | | | 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. llvm-svn: 23081
* Fix some warnings in an optimized buildChris Lattner2005-08-261-2/+2
| | | | llvm-svn: 23080
* Fix a huge annoyance: SelectNodeTo took types before the opcode unlikeChris Lattner2005-08-261-75/+75
| | | | | | every other SD API. Fix it to take the opcode before the types. llvm-svn: 23079
* SUBFIC produces two results, not one.Nate Begeman2005-08-261-4/+4
| | | | llvm-svn: 23073
* Implement SHL_PARTS and SRL_PARTSNate Begeman2005-08-261-0/+38
| | | | llvm-svn: 23072
* Emit the lo/hi parts in the right order :)Chris Lattner2005-08-251-1/+1
| | | | llvm-svn: 23068
* implement support for 64-bit add/sub, fix a broken assertion for 64-bitChris Lattner2005-08-251-2/+58
| | | | | | | return. Allow the udiv breaker-upper to work with any non-zero constant operand. llvm-svn: 23066
* Finish implementing SDIV/UDIV by copying over the majik constant code fromChris Lattner2005-08-251-3/+180
| | | | | | ISelPattern llvm-svn: 23062
* Implement setcc correctly for G5 and non-G5 systemsChris Lattner2005-08-251-11/+17
| | | | llvm-svn: 23060
* implement setcc on the G5. We're still missing the non-g5 specific bits, butChris Lattner2005-08-251-0/+121
| | | | | | they will come later. llvm-svn: 23059
* Add support for sdiv by 2^k and -2^k. Producing code like:Chris Lattner2005-08-251-1/+27
| | | | | | | | | _test: srawi r2, r3, 2 addze r3, r2 blr llvm-svn: 23052
* Implement support for taking the address of constant pool indices, whichChris Lattner2005-08-251-0/+10
| | | | | | | is used by the int -> FP code among other things. This gets 2005-05-12-Int64ToFP past that failure, to dying on lack of support for add_parts llvm-svn: 23042
* Add support for FP constants, fixing UnitTests/2004-02-02-NegativeZeroChris Lattner2005-08-251-6/+25
| | | | llvm-svn: 23038
* Fully implement frame index, so that we can pass the address of alloca'sChris Lattner2005-08-251-4/+12
| | | | | | around to functions and stuff llvm-svn: 23036
* implement unconditional branches, fixing UnitTests/2003-05-02-DependentPHI.cChris Lattner2005-08-251-1/+4
| | | | llvm-svn: 23034
* Fix a broken assertionChris Lattner2005-08-251-1/+1
| | | | llvm-svn: 23032
* Split IMPLICIT_DEF into IMPLICIT_DEF_GPR and IMPLICIT_DEF_FP, so that theChris Lattner2005-08-241-1/+6
| | | | | | | instructions take a consistent reg class. Implement ISD::UNDEF in the dag->dag selector to generate this, fixing UnitTests/2003-07-06-IntOverflow. llvm-svn: 23028
* implement support for callsChris Lattner2005-08-241-3/+99
| | | | llvm-svn: 23026
* Remove unused statisticNate Begeman2005-08-241-3/+5
| | | | | | Prefer 'neg X' to 'subfic 0, X' since neg does not set XER[CA] llvm-svn: 23001
OpenPOWER on IntegriCloud