aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/PowerPC/PPC32ISelSimple.cpp
AgeCommit message (Collapse)Author
2005-08-18Remove the X86 and PowerPC Simple instruction selectors; their time hasNate Begeman
passed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22886 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-18MFLR doesn't take an operand, the LR register is implicitChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22882 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-02Update to use the new MathExtras.h support for log2 computation.Chris Lattner
Patch contributed by Jim Laskey! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22594 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-21Support building non-PICNate Begeman
Remove the LoadHiAddr pseudo-instruction. Optimization of stores to and loads from statics. Force JIT to use new non-PIC codepaths. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22494 91177308-0d34-0410-b5e6-96231b3b80d8
2005-06-18core changes for varargsAndrew Lenharth
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22254 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-22Convert tabs to spacesMisha Brukman
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21452 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-21Remove trailing whitespaceMisha Brukman
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21425 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-14Add the necessary support to codegen condition register logical ops withNate Begeman
register allocated condition registers. Make sure that the printed output is gas compatible. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21295 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-10rename getPPCOpcodeForSetCCNumber -> getPPCOpcodeForSetCCOpode to be moreChris Lattner
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! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21195 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-09Fix CodeGen/Generic/2005-05-09-GlobalInPHI.ll, which was reduced from 254.gap.Chris Lattner
This caused the "use before a def" assertion on some programs. With this patch, 254.gap now passes with the PPC backend. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21191 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-09Fix a crash on 173.applu by asking for a constant bigger than 32-bits.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21185 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-09Switch this instruction selector over to using liveins and liveouts, eliminatingChris Lattner
implicit defs on entry to the function. yaay :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21184 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-06Fix some shift bugsNate Begeman
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21126 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-05Rename canUseAsImmediateForOpcode to getImmediateForOpcode to betterNate Begeman
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21094 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-30Fix calls whose arguments fit entirely in registers to not break the Chain.Nate Begeman
Implement SINT_TO_FP and UINT_TO_FP Remove some dead code from the simple ISel git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20944 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-28Pattern ISel: fix argument loading for i64s (thanks chris)Nate Begeman
Simple ISel: fix i64 subtract git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20903 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-28Remove fake instruction 'subc' (mnemonic for subfc).Nate Begeman
More pattern isel updates git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20902 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-26Correct a documention linkNate Begeman
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20840 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-24Fix an incorrect argument being passed to BuildMI for indirect calls.Nate Begeman
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20821 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-24Commit Gabor Greif's patch to use iterators in lowering intrinsics.Nate Begeman
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20816 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-24eliminate dead variables, patch contributed by Gabor Greif!Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20812 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-24Implement more of the PPC32 Pattern ISel:Nate Begeman
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20810 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-21We may be adding functions to the Module during initialization, soMisha Brukman
conservatively, it's modified git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20735 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-15This mega patch converts us from using Function::a{iterator|begin|end} toChris Lattner
using Function::arg_{iterator|begin|end}. Likewise Module::g* -> Module::global_*. This patch is contributed by Gabor Greif, thanks! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20597 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-08Fix a crash handling 'undef bool', fixing an llc crash on 186.craftyChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20523 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-14Fix Regression/CodeGen/PowerPC/2005-01-14-UndefLong.llChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19557 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-14Fix: Regression/CodeGen/PowerPC/2005-01-14-SetSelectCrash.llChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19555 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-02This hunk:Chris Lattner
- 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19263 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-01Fix a FIXME: Select instructions on longs were miscompiled.Chris Lattner
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19214 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-30Fix several bugs in 'op x, imm' handling. Foremost is that we now emitChris Lattner
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18379 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-30Fix CodeGen/PowerPC/2004-11-30-shr-var-crash.llChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18376 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-30Fix test/Regression/CodeGen/PowerPC/2004-11-29-ShrCrash.llChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18374 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-30Fix test/Regression/CodeGen/PowerPC/2004-11-30-shift-crash.llChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18371 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-27Remove the ISel->AsmPrinter link via the TargetMachine that was put inNate Begeman
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18267 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-25Enable optimization suggested by Chris Lattner to not emit reloc stubs forNate Begeman
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18239 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-24Add the same optimization that we do loading from fixed alloca slots toNate Begeman
storing to fixed alloca slots. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18221 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-23Simplify code a bitChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18146 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-23LA is really addi. Be consistent with operand ordering to avoid confusing ↵Chris Lattner
the code emitter git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18138 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-21Fix Shootout-C++/wc, which was broken by my recent changes to emit fewerNate Begeman
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). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18084 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-19Eliminate another 6k register copies that the register allocator would justNate Begeman
coalesce out of hbd. Speeds up compilation by 2% (0.6s) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17987 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-19Generate fewer reg-reg copies for the register allocator to deal with.Nate Begeman
This eliminates over 2000 in hbd alone. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17973 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-18Eliminate another common source of moves that the register allocatorNate Begeman
shouldn't be forced to coalesce for us: folded GEP operations. This too fires thousands of times across the testsuite. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17947 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-18When accessing the base register for global variables, use the registerNate Begeman
directly rather than making a copy for the register allocator to coalesce. This kills thousands of live intervals across the testsuite. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17946 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-18Clean up and fix cast codegen by removing cases that are handled elsewhere,Nate Begeman
and properly emitting signed short to unsigned int. This fixes the last regression vs. the CBE, MultiSource/Applications/hbd. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17942 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-08Put int the getReg cast optimization from x86 so that we generate fewerNate Begeman
move instructions for the register allocator to coalesce. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17608 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-07Disable bogus cast elimination when the cast is used by a setcc instruction.Nate Begeman
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17583 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-04Thanks to sabre for pointing out that we were incorrectly codegen'ingNate Begeman
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17476 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-26Fix treecc. Also fix a latent bug in emitBinaryConstOperation that wouldNate Begeman
allow and const, 0 to be incorrectly codegen'd into a rlwinm instruction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17234 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-24Implement more complete and correct codegen for bitfield inserts, as testedNate Begeman
by the recently committed rlwimi.ll test file. Also commit initial code for bitfield extract, although it is turned off until fully debugged. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17207 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-23Kill casts from integer types to unsigned byte, when the cast was only usedNate Begeman
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; } git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17175 91177308-0d34-0410-b5e6-96231b3b80d8