summaryrefslogtreecommitdiffstats
path: root/llvm
Commit message (Collapse)AuthorAgeFilesLines
* Fix a fixme in CondPropagate.cpp by moving a PhiNode optimization intoNate Begeman2005-08-049-62/+48
| | | | | | | | BasicBlock's removePredecessor routine. This requires shuffling around the definition and implementation of hasContantValue from Utils.h,cpp into Instructions.h,cpp llvm-svn: 22664
* add a testcase nate requestedChris Lattner2005-08-041-0/+33
| | | | llvm-svn: 22663
* Modify how immediates are removed from base expressions to deal with the factChris Lattner2005-08-041-26/+41
| | | | | | | | | | | | | that the symbolic evaluator is not always able to use subtraction to remove expressions. This makes the code faster, and fixes the last crash on 178.galgel. Finally, add a statistic to see how many phi nodes are inserted. On 178.galgel, we get the follow stats: 2562 loop-reduce - Number of PHIs inserted 3927 loop-reduce - Number of GEPs strength reduced llvm-svn: 22662
* Fix a fixme in LegalizeDAGNate Begeman2005-08-041-7/+2
| | | | llvm-svn: 22661
* Hack to naturally align doubles in the constant pool. Remove this once weNate Begeman2005-08-041-1/+6
| | | | | | know what The Right Thing To Do is. llvm-svn: 22660
* Use the new subtarget support to automatically choose the correct ABINate Begeman2005-08-046-18/+35
| | | | | | and asm printer for PowerPC if one is not specified. llvm-svn: 22659
* * Refactor some code into a new BasedUser::RewriteInstructionToUseNewBaseChris Lattner2005-08-041-16/+48
| | | | | | | | method. * Fix a crash on 178.galgel, where we would insert expressions before PHI nodes instead of into the PHI node predecessor blocks. llvm-svn: 22657
* This should not run lli, that is for llvm-test.Chris Lattner2005-08-041-1/+1
| | | | llvm-svn: 22656
* None of these tests should require a working lli, they are codegen tests,Chris Lattner2005-08-044-5/+4
| | | | | | not execution tests. llvm-svn: 22655
* Fix a case that caused this to crash on 178.galgelChris Lattner2005-08-041-0/+6
| | | | llvm-svn: 22653
* Teach LSR about loop-variant expressions, such as loops like this:Chris Lattner2005-08-041-68/+93
| | | | | | | | | | | | | | for (i = 0; i < N; ++i) A[i][foo()] = 0; here we still want to strength reduce the A[i] part, even though foo() is l-v. This also simplifies some of the 'CanReduce' logic. This implements Transforms/LoopStrengthReduce/ops_after_indvar.ll llvm-svn: 22652
* This testcase now passesChris Lattner2005-08-041-1/+0
| | | | llvm-svn: 22651
* Remove some more dead code.Nate Begeman2005-08-041-20/+0
| | | | llvm-svn: 22650
* Refactor this code substantially with the following improvements:Chris Lattner2005-08-041-138/+38
| | | | | | | | | | | 1. We only analyze instructions once, guaranteed 2. AnalyzeGetElementPtrUsers has been ripped apart and replaced with something much simpler. The next step is to handle expressions that are not all indvar+loop-invariant values (e.g. handling indvar+loopvariant). llvm-svn: 22649
* No, IDEFs shouldn't be JITedAndrew Lenharth2005-08-042-3/+6
| | | | llvm-svn: 22648
* * Unbreak release buildMisha Brukman2005-08-041-3/+6
| | | | | | * Add comments to #endif pragmas for readability llvm-svn: 22647
* * Unbreak optimized build (noticed by Eric van Riet Paap)Misha Brukman2005-08-041-3/+5
| | | | | | * Comment #endif clauses for readability llvm-svn: 22646
* Add Subtarget support to PowerPC. Next up, using it.Nate Begeman2005-08-046-10/+116
| | | | llvm-svn: 22644
* refactor some codeChris Lattner2005-08-041-34/+45
| | | | llvm-svn: 22643
* this is not implemented by lsr yetChris Lattner2005-08-041-0/+1
| | | | llvm-svn: 22642
* invert to if's to make the logic simplerChris Lattner2005-08-041-14/+11
| | | | llvm-svn: 22641
* When processing outer loops and we find uses of an IV in inner loops, makeChris Lattner2005-08-041-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sure to handle the use, just don't recurse into it. This permits us to generate this code for a simple nested loop case: .LBB_foo_0: ; entry stwu r1, -48(r1) stw r29, 44(r1) stw r30, 40(r1) mflr r11 stw r11, 56(r1) lis r2, ha16(L_A$non_lazy_ptr) lwz r30, lo16(L_A$non_lazy_ptr)(r2) li r29, 1 .LBB_foo_1: ; no_exit.0 bl L_bar$stub li r2, 1 or r3, r30, r30 .LBB_foo_2: ; no_exit.1 lfd f0, 8(r3) stfd f0, 0(r3) addi r4, r2, 1 addi r3, r3, 8 cmpwi cr0, r2, 100 or r2, r4, r4 bne .LBB_foo_2 ; no_exit.1 .LBB_foo_3: ; loopexit.1 addi r30, r30, 800 addi r2, r29, 1 cmpwi cr0, r29, 100 or r29, r2, r2 bne .LBB_foo_1 ; no_exit.0 .LBB_foo_4: ; return lwz r11, 56(r1) mtlr r11 lwz r30, 40(r1) lwz r29, 44(r1) lwz r1, 0(r1) blr instead of this: _foo: .LBB_foo_0: ; entry stwu r1, -48(r1) stw r28, 44(r1) ;; uses an extra register. stw r29, 40(r1) stw r30, 36(r1) mflr r11 stw r11, 56(r1) li r30, 1 li r29, 0 or r28, r29, r29 .LBB_foo_1: ; no_exit.0 bl L_bar$stub mulli r2, r28, 800 ;; unstrength-reduced multiply lis r3, ha16(L_A$non_lazy_ptr) ;; loop invariant address computation lwz r3, lo16(L_A$non_lazy_ptr)(r3) add r2, r2, r3 mulli r4, r29, 800 ;; unstrength-reduced multiply addi r3, r3, 8 add r3, r4, r3 li r4, 1 .LBB_foo_2: ; no_exit.1 lfd f0, 0(r3) stfd f0, 0(r2) addi r5, r4, 1 addi r2, r2, 8 ;; multiple stride 8 IV's addi r3, r3, 8 cmpwi cr0, r4, 100 or r4, r5, r5 bne .LBB_foo_2 ; no_exit.1 .LBB_foo_3: ; loopexit.1 addi r28, r28, 1 ;;; Many IV's with stride 1 addi r29, r29, 1 addi r2, r30, 1 cmpwi cr0, r30, 100 or r30, r2, r2 bne .LBB_foo_1 ; no_exit.0 .LBB_foo_4: ; return lwz r11, 56(r1) mtlr r11 lwz r30, 36(r1) lwz r29, 40(r1) lwz r28, 44(r1) lwz r1, 0(r1) blr llvm-svn: 22640
* Teach loop-reduce to see into nested loops, to pull out immediate valuesChris Lattner2005-08-031-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pushed down by SCEV. In a nested loop case, this allows us to emit this: lis r3, ha16(L_A$non_lazy_ptr) lwz r3, lo16(L_A$non_lazy_ptr)(r3) add r2, r2, r3 li r3, 1 .LBB_foo_2: ; no_exit.1 lfd f0, 8(r2) ;; Uses offset of 8 instead of 0 stfd f0, 0(r2) addi r4, r3, 1 addi r2, r2, 8 cmpwi cr0, r3, 100 or r3, r4, r4 bne .LBB_foo_2 ; no_exit.1 instead of this: lis r3, ha16(L_A$non_lazy_ptr) lwz r3, lo16(L_A$non_lazy_ptr)(r3) add r2, r2, r3 addi r3, r3, 8 li r4, 1 .LBB_foo_2: ; no_exit.1 lfd f0, 0(r3) stfd f0, 0(r2) addi r5, r4, 1 addi r2, r2, 8 addi r3, r3, 8 cmpwi cr0, r4, 100 or r4, r5, r5 bne .LBB_foo_2 ; no_exit.1 llvm-svn: 22639
* improve debug outputChris Lattner2005-08-031-4/+9
| | | | llvm-svn: 22638
* Scalar SSE: load +0.0 -> xorps/xorpdNate Begeman2005-08-032-80/+133
| | | | | | | Scalar SSE: a < b ? c : 0.0 -> cmpss, andps Scalar SSE: float -> i16 needs to be promoted llvm-svn: 22637
* this now passesChris Lattner2005-08-031-2/+0
| | | | llvm-svn: 22636
* Move from Stage 0 to Stage 1.Chris Lattner2005-08-031-31/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Only emit one PHI node for IV uses with identical bases and strides (after moving foldable immediates to the load/store instruction). This implements LoopStrengthReduce/dont_insert_redundant_ops.ll, allowing us to generate this PPC code for test1: or r30, r3, r3 .LBB_test1_1: ; Loop li r2, 0 stw r2, 0(r30) stw r2, 4(r30) bl L_pred$stub addi r30, r30, 8 cmplwi cr0, r3, 0 bne .LBB_test1_1 ; Loop instead of this code: or r30, r3, r3 or r29, r3, r3 .LBB_test1_1: ; Loop li r2, 0 stw r2, 0(r29) stw r2, 4(r30) bl L_pred$stub addi r30, r30, 8 ;; Two iv's with step of 8 addi r29, r29, 8 cmplwi cr0, r3, 0 bne .LBB_test1_1 ; Loop llvm-svn: 22635
* Alpha ABI specifies stack is always 16 byte alligned, and gcc does it, so I ↵Andrew Lenharth2005-08-031-1/+1
| | | | | | will too llvm-svn: 22634
* Rename IVUse to IVUsersOfOneStride, use a struct instead of a pair toChris Lattner2005-08-031-25/+41
| | | | | | | unify some parallel vectors and get field names more descriptive than "first" and "second". This isn't lisp afterall :) llvm-svn: 22633
* Fix a nasty dangling pointer issue. The ScalarEvolution pass would keep aChris Lattner2005-08-031-1/+3
| | | | | | | | | map from instruction* to SCEVHandles. When we delete instructions, we have to tell it about it. We would run into nasty cases where new instructions were reallocated at old instruction addresses and get the old map values. Bad bad bad :( llvm-svn: 22632
* Fix this to test the BE we care aboutChris Lattner2005-08-031-1/+1
| | | | llvm-svn: 22631
* Fix an obvious bug in the Log2 stuff that broke ↵Chris Lattner2005-08-031-1/+1
| | | | | | | | SingleSource/UnitTests/2005-05-12-Int64ToFP last night. llvm-svn: 22630
* Fix PR611, codegen'ing SREM of FP operands to fmod or fmodf instead ofChris Lattner2005-08-032-6/+14
| | | | | | the sequence used for integer ops llvm-svn: 22629
* The correct fix for PR612, which also fixesChris Lattner2005-08-031-2/+12
| | | | | | Transforms/LowerInvoke/2005-08-03-InvokeWithPHIUse.ll llvm-svn: 22628
* new testcase for PR612Chris Lattner2005-08-031-0/+16
| | | | llvm-svn: 22627
* When inserting code, make sure not to insert it before PHI nodes. ThisChris Lattner2005-08-031-1/+3
| | | | | | fixes PR612 and Transforms/LowerInvoke/2005-08-03-InvokeWithPHI.ll llvm-svn: 22626
* new testcase for PR612Chris Lattner2005-08-031-0/+20
| | | | llvm-svn: 22625
* Add a couple rlwinm tests for bitfield clearsNate Begeman2005-08-031-0/+17
| | | | llvm-svn: 22624
* Update rlwimi tests to catch all the cases we care aboutNate Begeman2005-08-032-2/+42
| | | | llvm-svn: 22623
* Testcase that used to crash simplifycfgChris Lattner2005-08-031-0/+94
| | | | llvm-svn: 22622
* Fix Transforms/SimplifyCFG/2005-08-03-PHIFactorCrash.ll, a problem thatChris Lattner2005-08-031-2/+3
| | | | | | occurred while bugpointing another testcase llvm-svn: 22621
* add support for Graphviz when viewing CFGsChris Lattner2005-08-031-0/+20
| | | | llvm-svn: 22620
* Fix grammar: apostrophe-s ('s) is possessive, not plural; also iff vs. if.Misha Brukman2005-08-031-4/+4
| | | | llvm-svn: 22619
* Wrap comments to 80 cols, fix code sequence for CountLeadingZeros_64 onChris Lattner2005-08-031-19/+20
| | | | | | non-ppc GCC 4.0 machines. Patch by Jim Laskey! llvm-svn: 22618
* minor capitalization thing, patch by Jim LaskeyChris Lattner2005-08-031-1/+1
| | | | llvm-svn: 22617
* Fix another bug in the clz patch that caused miscompilations when !gcc4Chris Lattner2005-08-031-2/+2
| | | | llvm-svn: 22616
* Finally, add the required constraint checks to fix ↵Chris Lattner2005-08-031-2/+29
| | | | | | | | Transforms/SimplifyCFG/2005-08-01-PHIUpdateFail.ll the right way llvm-svn: 22615
* un-xfail thisChris Lattner2005-08-031-1/+0
| | | | llvm-svn: 22614
* Simplify some code, add the correct pred checksChris Lattner2005-08-031-16/+25
| | | | llvm-svn: 22613
* Refactor code out of PropagatePredecessorsForPHIs, turning it into a pure ↵Chris Lattner2005-08-031-37/+36
| | | | | | function with no side-effects llvm-svn: 22612
OpenPOWER on IntegriCloud