summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove the X86 and PowerPC Simple instruction selectors; their time hasNate Begeman2005-08-181-3924/+0
| | | | | | passed. llvm-svn: 22886
* MFLR doesn't take an operand, the LR register is implicitChris Lattner2005-08-181-1/+1
| | | | llvm-svn: 22882
* Update to use the new MathExtras.h support for log2 computation.Chris Lattner2005-08-021-73/+32
| | | | | | Patch contributed by Jim Laskey! llvm-svn: 22594
* Support building non-PICNate Begeman2005-07-211-2/+2
| | | | | | | | Remove the LoadHiAddr pseudo-instruction. Optimization of stores to and loads from statics. Force JIT to use new non-PIC codepaths. llvm-svn: 22494
* core changes for varargsAndrew Lenharth2005-06-181-30/+14
| | | | llvm-svn: 22254
* Convert tabs to spacesMisha Brukman2005-04-221-1/+1
| | | | llvm-svn: 21452
* Remove trailing whitespaceMisha Brukman2005-04-211-170/+170
| | | | llvm-svn: 21425
* Add the necessary support to codegen condition register logical ops withNate Begeman2005-04-141-7/+9
| | | | | | | register allocated condition registers. Make sure that the printed output is gas compatible. llvm-svn: 21295
* rename getPPCOpcodeForSetCCNumber -> getPPCOpcodeForSetCCOpode to be moreChris Lattner2005-04-101-21/+21
| | | | | | | | | correct. Remove the EmitComparison retvalue, as it is always the first arg. Fix a place where we incorrectly passed in the setcc opcode instead of the setcc number, causing us to miscompile crafty. Crafty now works! llvm-svn: 21195
* Fix CodeGen/Generic/2005-05-09-GlobalInPHI.ll, which was reduced from 254.gap.Chris Lattner2005-04-091-0/+16
| | | | | | | | This caused the "use before a def" assertion on some programs. With this patch, 254.gap now passes with the PPC backend. llvm-svn: 21191
* Fix a crash on 173.applu by asking for a constant bigger than 32-bits.Chris Lattner2005-04-091-1/+1
| | | | llvm-svn: 21185
* Switch this instruction selector over to using liveins and liveouts, eliminatingChris Lattner2005-04-091-8/+26
| | | | | | implicit defs on entry to the function. yaay :) llvm-svn: 21184
* Fix some shift bugsNate Begeman2005-04-061-3/+12
| | | | llvm-svn: 21126
* Rename canUseAsImmediateForOpcode to getImmediateForOpcode to betterNate Begeman2005-04-051-4/+4
| | | | | | | | | indicate that it is not a boolean function. Properly emit the pseudo instruction for conditional branch, so that we can fix up conditional branches whose displacements are too large. Reserve the right amount of opcode space for said pseudo instructions. llvm-svn: 21094
* Fix calls whose arguments fit entirely in registers to not break the Chain.Nate Begeman2005-03-301-4/+0
| | | | | | | Implement SINT_TO_FP and UINT_TO_FP Remove some dead code from the simple ISel llvm-svn: 20944
* Pattern ISel: fix argument loading for i64s (thanks chris)Nate Begeman2005-03-281-2/+13
| | | | | | Simple ISel: fix i64 subtract llvm-svn: 20903
* Remove fake instruction 'subc' (mnemonic for subfc).Nate Begeman2005-03-281-1/+1
| | | | | | More pattern isel updates llvm-svn: 20902
* Correct a documention linkNate Begeman2005-03-261-2/+2
| | | | llvm-svn: 20840
* Fix an incorrect argument being passed to BuildMI for indirect calls.Nate Begeman2005-03-241-1/+1
| | | | llvm-svn: 20821
* Commit Gabor Greif's patch to use iterators in lowering intrinsics.Nate Begeman2005-03-241-7/+8
| | | | llvm-svn: 20816
* eliminate dead variables, patch contributed by Gabor Greif!Chris Lattner2005-03-241-2/+0
| | | | llvm-svn: 20812
* Implement more of the PPC32 Pattern ISel:Nate Begeman2005-03-241-6/+4
| | | | | | | | | | | | | 1) dynamic stack alloc 2) loads 3) shifts 4) subtract 5) immediate form of add, and, or, xor 6) change flag from -pattern-isel to -enable-ppc-pattern-isel Remove dead arguments from getGlobalBaseReg in the simple ISel llvm-svn: 20810
* We may be adding functions to the Module during initialization, soMisha Brukman2005-03-211-2/+2
| | | | | | conservatively, it's modified llvm-svn: 20735
* This mega patch converts us from using Function::a{iterator|begin|end} toChris Lattner2005-03-151-1/+1
| | | | | | | | using Function::arg_{iterator|begin|end}. Likewise Module::g* -> Module::global_*. This patch is contributed by Gabor Greif, thanks! llvm-svn: 20597
* Fix a crash handling 'undef bool', fixing an llc crash on 186.craftyChris Lattner2005-03-081-1/+1
| | | | llvm-svn: 20523
* Fix Regression/CodeGen/PowerPC/2005-01-14-UndefLong.llChris Lattner2005-01-141-0/+2
| | | | llvm-svn: 19557
* Fix: Regression/CodeGen/PowerPC/2005-01-14-SetSelectCrash.llChris Lattner2005-01-141-1/+2
| | | | llvm-svn: 19555
* This hunk:Chris Lattner2005-01-021-2/+2
| | | | | | | | | | | - unsigned TrueValue = getReg(TrueVal, BB, BB->begin()); + unsigned TrueValue = getReg(TrueVal); Fixes the PPC regressions from last night. The other hunk is just a clarity improvement. llvm-svn: 19263
* Fix a FIXME: Select instructions on longs were miscompiled.Chris Lattner2005-01-011-19/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While we're at it, improve codegen of select instructions. For this testcase: int %test(bool %C, int %A, int %B) { %D = select bool %C, int %A, int %B ret int %D } We used to generate this code: _test: cmpwi cr0, r3, 0 bne .LBB_test_2 ; .LBB_test_1: ; b .LBB_test_3 ; .LBB_test_2: ; or r5, r4, r4 .LBB_test_3: ; or r3, r5, r5 blr Now we emit: _test: cmpwi cr0, r3, 0 bne .LBB_test_2 ; .LBB_test_1: ; or r4, r5, r5 .LBB_test_2: ; or r3, r4, r4 blr -Chris llvm-svn: 19214
* Fix several bugs in 'op x, imm' handling. Foremost is that we now emitChris Lattner2004-11-301-14/+10
| | | | | | | | | | | | | | addi r3, r3, -1 instead of addi r3, r3, 1 for 'sub int X, 1'. Secondarily, this fixes several cases where we could crash given an unsigned constant. And fixes a couple of minor missed optimization cases, such as xor X, ~0U -> not X llvm-svn: 18379
* Fix CodeGen/PowerPC/2004-11-30-shr-var-crash.llChris Lattner2004-11-301-1/+1
| | | | llvm-svn: 18376
* Fix test/Regression/CodeGen/PowerPC/2004-11-29-ShrCrash.llChris Lattner2004-11-301-1/+3
| | | | llvm-svn: 18374
* Fix test/Regression/CodeGen/PowerPC/2004-11-30-shift-crash.llChris Lattner2004-11-301-1/+6
| | | | llvm-svn: 18371
* Remove the ISel->AsmPrinter link via the TargetMachine that was put inNate Begeman2004-11-271-15/+0
| | | | | | | | place to help bring up the PowerPC back end on Darwin. This code is no longer serves any purpose now that the AsmPrinter does the right thing all the time printing GlobalValues. --Cruft. llvm-svn: 18267
* Enable optimization suggested by Chris Lattner to not emit reloc stubs forNate Begeman2004-11-251-1/+1
| | | | | | | | | | | | | | | | | | | static global variables whose addresses are taken. This allows us to convert the following code for taking the address of a static function foo addis r2, r30, ha16(Ll1__2E_foo_2$non_lazy_ptr-"L00001$pb") lwz r3, lo16(Ll1__2E_foo_2$non_lazy_ptr-"L00001$pb")(r2) which also includes linker stub code emitted at the end of the .s file not shown here, and replace it with this: addis r2, r30, ha16(l1__2E_foo_2-"L00001$pb") la r3, lo16(l1__2E_foo_2-"L00001$pb")(r2) which in addition to not needing linker help, also has no load instruction. For those not up on PowerPC mnemonics, la is shorthand for add immediate. llvm-svn: 18239
* Add the same optimization that we do loading from fixed alloca slots toNate Begeman2004-11-241-0/+12
| | | | | | storing to fixed alloca slots. llvm-svn: 18221
* Simplify code a bitChris Lattner2004-11-231-1/+1
| | | | llvm-svn: 18146
* LA is really addi. Be consistent with operand ordering to avoid confusing ↵Chris Lattner2004-11-231-4/+6
| | | | | | the code emitter llvm-svn: 18138
* Fix Shootout-C++/wc, which was broken by my recent changes to emit fewerNate Begeman2004-11-211-5/+6
| | | | | | | | | reg-reg copies. The necessary conditions for this bug are a GEP that is used outside the basic block in which it is defined, whose components other than the pointer are all constant zero, and where the use is selected before the definition (backwards branch to successsor block). llvm-svn: 18084
* Eliminate another 6k register copies that the register allocator would justNate Begeman2004-11-191-8/+14
| | | | | | coalesce out of hbd. Speeds up compilation by 2% (0.6s) llvm-svn: 17987
* Generate fewer reg-reg copies for the register allocator to deal with.Nate Begeman2004-11-191-64/+39
| | | | | | This eliminates over 2000 in hbd alone. llvm-svn: 17973
* Eliminate another common source of moves that the register allocatorNate Begeman2004-11-181-5/+4
| | | | | | | shouldn't be forced to coalesce for us: folded GEP operations. This too fires thousands of times across the testsuite. llvm-svn: 17947
* When accessing the base register for global variables, use the registerNate Begeman2004-11-181-19/+13
| | | | | | | directly rather than making a copy for the register allocator to coalesce. This kills thousands of live intervals across the testsuite. llvm-svn: 17946
* Clean up and fix cast codegen by removing cases that are handled elsewhere,Nate Begeman2004-11-181-19/+8
| | | | | | | and properly emitting signed short to unsigned int. This fixes the last regression vs. the CBE, MultiSource/Applications/hbd. llvm-svn: 17942
* Put int the getReg cast optimization from x86 so that we generate fewerNate Begeman2004-11-081-0/+8
| | | | | | move instructions for the register allocator to coalesce. llvm-svn: 17608
* Disable bogus cast elimination when the cast is used by a setcc instruction.Nate Begeman2004-11-071-4/+4
| | | | llvm-svn: 17583
* Thanks to sabre for pointing out that we were incorrectly codegen'ingNate Begeman2004-11-041-1/+4
| | | | | | | | | int test(int x) { return 32768 - x; } Fixed by teaching the function that checks a constant's validity to be used as an immediate argument about subtract-from instructions. llvm-svn: 17476
* Fix treecc. Also fix a latent bug in emitBinaryConstOperation that wouldNate Begeman2004-10-261-64/+46
| | | | | | allow and const, 0 to be incorrectly codegen'd into a rlwinm instruction. llvm-svn: 17234
* Implement more complete and correct codegen for bitfield inserts, as testedNate Begeman2004-10-241-89/+236
| | | | | | | by the recently committed rlwimi.ll test file. Also commit initial code for bitfield extract, although it is turned off until fully debugged. llvm-svn: 17207
* Kill casts from integer types to unsigned byte, when the cast was only usedNate Begeman2004-10-231-0/+13
| | | | | | | | as the shift amount operand to a shift instruction. This was causing us to emit unnecessary clear operations for code such as: int foo(int x) { return 1 << x; } llvm-svn: 17175
OpenPOWER on IntegriCloud