summaryrefslogtreecommitdiffstats
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* Factor the code for collecting IV users out of LSR into an IVUsers class,Dan Gohman2009-05-128-14/+166
| | | | | | | | | | | | | | | | | | | | | | | | | and generalize it so that it can be used by IndVarSimplify. Implement the base IndVarSimplify transformation code using IVUsers. This removes TestOrigIVForWrap and associated code, as ScalarEvolution now has enough builtin overflow detection and folding logic to handle all the same cases, and more. Run "opt -iv-users -analyze -disable-output" on your favorite loop for an example of what IVUsers does. This lets IndVarSimplify eliminate IV casts and compute trip counts in more cases. Also, this happens to finally fix the remaining testcases in PR1301. Now that IndVarSimplify is being more aggressive, it occasionally runs into the problem where ScalarEvolutionExpander's code for avoiding duplicate expansions makes it difficult to ensure that all expanded instructions dominate all the instructions that will use them. As a temporary measure, IndVarSimplify now uses a FixUsesBeforeDefs function to fix up instructions inserted by SCEVExpander. Fortunately, this code is contained, and can be easily removed once a more comprehensive solution is available. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71535 91177308-0d34-0410-b5e6-96231b3b80d8
* When forgetting SCEVs for loop PHIs, don't forget SCEVUnknown values.Dan Gohman2009-05-121-0/+32
| | | | | | | | | | These values aren't analyzable, so they don't care if more information about the loop trip count can be had. Also, SCEVUnknown is used for a PHI while the PHI itself is being analyzed, so it needs to be left in the Scalars map. This fixes a variety of subtle issues. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71533 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach LSR to optimize more loop exit compares, i.e. change them to use ↵Evan Cheng2009-05-113-2/+136
| | | | | | | | | postinc iv value. Previously LSR would only optimize those which are in the loop latch block. However, if LSR can prove it is safe (and profitable), it's now possible to change those not in the latch blocks to use postinc values. Also, if the compare is the only use, LSR would place the iv increment instruction before the compare instead in the latch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71485 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR4188. TailMerging can't tolerate inexactDale Johannesen2009-05-111-0/+23
| | | | | | | | sucessor info. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71478 91177308-0d34-0410-b5e6-96231b3b80d8
* Make this grep line a little more specific so that it doesn'tDan Gohman2009-05-111-1/+1
| | | | | | | accidentally match something unrelated. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71458 91177308-0d34-0410-b5e6-96231b3b80d8
* When scalarizing a vector BITCAST, check whether the operand has vectorDan Gohman2009-05-111-0/+29
| | | | | | | | | type, rather than assume that it does. If the operand is not vector, it shouldn't be run through ScalarizeVectorOp. This fixes one of the testcases in PR3886. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71453 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert a subtract into a negate and an add when it helps x86Dan Gohman2009-05-111-0/+25
| | | | | | | address folding. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71446 91177308-0d34-0410-b5e6-96231b3b80d8
* Reverse a loop that is counting up to a maximum toDale Johannesen2009-05-114-5/+11
| | | | | | | | | | count down to 0 instead, under very restricted circumstances. Adjust 4 testcases in which this optimization fires. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71439 91177308-0d34-0410-b5e6-96231b3b80d8
* Make MDNode use CallbackVH. Also change MDNode to store Value* instead ofNick Lewycky2009-05-101-1/+1
| | | | | | | | Constant* in preperation of a future change to support holding non-Constants in an MDNode. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71407 91177308-0d34-0410-b5e6-96231b3b80d8
* Add MSP430 test for PR4136Anton Korobeynikov2009-05-102-0/+37
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71392 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow scalar evolution to compute iteration counts for loops with a Eli Friedman2009-05-091-0/+27
| | | | | | | | pointer-based condition. This fixes PR3171. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71354 91177308-0d34-0410-b5e6-96231b3b80d8
* Enable loop bb placement optimization.Evan Cheng2009-05-081-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71291 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix bogus overflow checks by replacing them with actualDan Gohman2009-05-081-0/+10
| | | | | | | overflow checks. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71284 91177308-0d34-0410-b5e6-96231b3b80d8
* Use .td for tablegen files, not .ll.Dan Gohman2009-05-082-0/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71277 91177308-0d34-0410-b5e6-96231b3b80d8
* Fold trunc casts into add-recurrence expressions, allowing theDan Gohman2009-05-081-0/+24
| | | | | | | | add-recurrence to be exposed. Add a new SCEV folding rule to help simplify expressions in the presence of these extra truncs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71264 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR4152: asm constraint validation happens before dag combine, so weChris Lattner2009-05-081-0/+17
| | | | | | | | need to work a bit to combine things like (x+c1+c2) into x+c3. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71232 91177308-0d34-0410-b5e6-96231b3b80d8
* fix RewriteStoreUserOfWholeAlloca to use the correct type sizeChris Lattner2009-05-081-0/+12
| | | | | | | | | | method, fixing a crash on PR4146. While the store will ultimately overwrite the "padded size" number of bits in memory, the stored value may be a subset of this size. This function only wants to handle the case where all bits are stored. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71224 91177308-0d34-0410-b5e6-96231b3b80d8
* Optimize code placement in loop to eliminate unconditional branches or move ↵Evan Cheng2009-05-081-0/+134
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | unconditional branch to the outside of the loop. e.g. /// A: /// ... /// <fallthrough to B> /// /// B: --> loop header /// ... /// jcc <cond> C, [exit] /// /// C: /// ... /// jmp B /// /// ==> /// /// A: /// ... /// jmp B /// /// C: --> new loop header /// ... /// <fallthough to B> /// /// B: /// ... /// jcc <cond> C, [exit] git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71209 91177308-0d34-0410-b5e6-96231b3b80d8
* PR4123: don't crash when inlining a call which uses its own result.Eli Friedman2009-05-081-0/+20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71199 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix pr4100. Do not remove no-op copies when they are dead. The registerBob Wilson2009-05-071-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | scavenger gets confused about register liveness if it doesn't see them. I'm not thrilled with this solution, but it only comes up when there are dead copies in the code, which is something that hopefully doesn't happen much. Here is what happens in pr4100: As shown in the following excerpt from the debug output of llc, the source of a move gets reloaded from the stack, inserting a new load instruction before the move. Since that source operand is a kill, the physical register is free to be reused for the destination of the move. The move ends up being a no-op, copying R3 to R3, so it is deleted. But, it leaves behind the load to reload %reg1028 into R3, and that load is not updated to show that it's destination operand (R3) is dead. The scavenger gets confused by that load because it thinks that R3 is live. Starting RegAlloc of: %reg1025<def,dead> = MOVr %reg1028<kill>, 14, %reg0, %reg0 Regs have values: Reloading %reg1028 into R3 Last use of R3[%reg1028], removing it from live set Assigning R3 to %reg1025 Register R3 [%reg1025] is never used, removing it from live set Alternative solutions might be either marking the load as dead, or zapping the load along with the no-op copy. I couldn't see an easy way to do either of those, though. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71196 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert 71165. It did more than just revert 71158 and it introducedDan Gohman2009-05-071-0/+18
| | | | | | | several regressions. The problem due to 71158 is now fixed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71176 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r70876 and add a testcase (@c7) showing the problem:Duncan Sands2009-05-071-9/+18
| | | | | | | | | | | | bits captured, but the pointer marked nocapture. In fact I now recall that this problem is why only readnone functions returning void were considered before! However keep a small fix that was also in r70876: a readnone function returning void can result in bits being captured if it unwinds, so test for this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71168 91177308-0d34-0410-b5e6-96231b3b80d8
* Temporarily revert r71158. It was causing a failure during a full bootstrap:Bill Wendling2009-05-071-18/+0
| | | | | | | | | | | | | | | | | | | | | | | checking for bcopy... no checking for getc_unlocked... Assertion failed: (0 && "Unknown SCEV kind!"), function operator(), file /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore.roots/llvmCore~obj/src/lib/Analysis/ScalarEvolution.cpp, line 511. /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmgcc42.roots/llvmgcc42~obj/src/libdecnumber/decUtility.c:360: internal compiler error: Abort trap Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://developer.apple.com/bugreporter> for instructions. make[4]: *** [decUtility.o] Error 1 make[4]: *** Waiting for unfinished jobs.... Assertion failed: (0 && "Unknown SCEV kind!"), function operator(), file /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore.roots/llvmCore~obj/src/lib/Analysis/ScalarEvolution.cpp, line 511. /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmgcc42.roots/llvmgcc42~obj/src/libdecnumber/decNumber.c:5591: internal compiler error: Abort trap Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://developer.apple.com/bugreporter> for instructions. make[4]: *** [decNumber.o] Error 1 make[3]: *** [all-stage2-libdecnumber] Error 2 make[3]: *** Waiting for unfinished jobs.... git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71165 91177308-0d34-0410-b5e6-96231b3b80d8
* Constant-fold ptrtoint+add+inttoptr to gep when the pointer is anDan Gohman2009-05-071-0/+18
| | | | | | | | array and the add is within range. This helps simplify expressions expanded by ScalarEvolutionExpander. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71158 91177308-0d34-0410-b5e6-96231b3b80d8
* THis doesn't fail.Bill Wendling2009-05-071-1/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71142 91177308-0d34-0410-b5e6-96231b3b80d8
* Temporarily revert r71010. It was causing massive failures during self-hosting.Bill Wendling2009-05-072-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71138 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not use register as base ptr of pre- and post- inc/dec load / store nodes.Evan Cheng2009-05-061-0/+11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71098 91177308-0d34-0410-b5e6-96231b3b80d8
* Nounwind is not valid for function return values.Duncan Sands2009-05-061-1/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71082 91177308-0d34-0410-b5e6-96231b3b80d8
* OCaml parameter attribute bindings from PR2752.Duncan Sands2009-05-061-1/+11
| | | | | | | Incomplete, but better than nothing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71081 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR3754: don't mark functions that wrap MallocInst withDuncan Sands2009-05-061-0/+7
| | | | | | | | | the readnone. Since MallocInst is scheduled for deletion it doesn't seem worth doing anything more subtle, such as having mayWriteToMemory return true for MallocInst. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71077 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow readonly functions to unwind exceptions. TeachDuncan Sands2009-05-061-2/+2
| | | | | | | | | the optimizers about this. For example, a readonly function with no uses cannot be removed unless it is also marked nounwind. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71071 91177308-0d34-0410-b5e6-96231b3b80d8
* Renamed Spiller classes (plus uses and related files) to VirtRegRewriter.Lang Hames2009-05-061-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71057 91177308-0d34-0410-b5e6-96231b3b80d8
* The 'forward_as' property did not use its second argument.Mikhail Glushenkov2009-05-061-0/+18
| | | | | | See PR4159 for details. Patch by Martin Nowack! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71054 91177308-0d34-0410-b5e6-96231b3b80d8
* Quotes should be printed before private prefix; some code clean up.Evan Cheng2009-05-051-0/+13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71032 91177308-0d34-0410-b5e6-96231b3b80d8
* If a MachineBasicBlock has multiple ways of reaching another block,Dan Gohman2009-05-051-0/+23
| | | | | | | | | allow it to have multiple CFG edges to that block. This is needed to allow MachineBasicBlock::isOnlyReachableByFallthrough to work correctly. This fixes PR4126. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71018 91177308-0d34-0410-b5e6-96231b3b80d8
* Temporarily reverting r71008. It was causing this failure:Bill Wendling2009-05-051-122/+0
| | | | | | | | | | | | | | Running /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/test/ CodeGen/X86/dg.exp ... FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/test/ CodeGen/X86/change-compare-stride-1.ll Failed with exit(1) at line 2 while running: grep {cmpq $-478,} change-compare-stride-1.ll.tmp child process exited abnormally git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71013 91177308-0d34-0410-b5e6-96231b3b80d8
* Enable stack coloring with regs at -O3.Evan Cheng2009-05-051-0/+361
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71010 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle overflow of 64-bit loop conditions.David Greene2009-05-051-0/+122
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71008 91177308-0d34-0410-b5e6-96231b3b80d8
* Add basic support for code generation of Chris Lattner2009-05-051-0/+8
| | | | | | | addrspace(257) -> FS relative on x86. Patch by Zoltan Varga! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70992 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow multiclass def names to contain "#NAME"" where TableGen replacesDavid Greene2009-05-051-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #NAME# with the name of the defm instantiating the multiclass. This is useful for AVX instruction naming where a "V" prefix is standard throughout the ISA. For example: multiclass SSE_AVX_Inst<...> { def SS : Instr<...>; def SD : Instr<...>; def PS : Instr<...>; def PD : Instr<...>; def V#NAME#SS : Instr<...>; def V#NAME#SD : Instr<...>; def V#NAME#PS : Instr<...>; def V#NAME#PD : Instr<...>; } defm ADD : SSE_AVX_Inst<...>; Results in ADDSS ADDSD ADDPS ADDPD VADDSS VADDSD VADDPS VADDPD git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70979 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix incorrect code generation with ENV.Mikhail Glushenkov2009-05-051-0/+16
| | | | | | See PR4157 for details. Patch by Martin Nowack! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70973 91177308-0d34-0410-b5e6-96231b3b80d8
* X86FastISel doesn't support the -tailcallopt ABI.Dan Gohman2009-05-041-0/+13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70902 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix code emission for conditional branches.Anton Korobeynikov2009-05-041-0/+28
| | | | | | Patch by Collin Winter! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70898 91177308-0d34-0410-b5e6-96231b3b80d8
* Restore minor deletion.Mike Stump2009-05-045-5/+84
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70892 91177308-0d34-0410-b5e6-96231b3b80d8
* Previously, RecursivelyDeleteDeadInstructions provided an optionDan Gohman2009-05-024-3/+5
| | | | | | | | | | | | | | | | | | | of returning a list of pointers to Values that are deleted. This was unsafe, because the pointers in the list are, by nature of what RecursivelyDeleteDeadInstructions does, always dangling. Replace this with a simple callback mechanism. This may eventually be removed if all clients can reasonably be expected to use CallbackVH. Use this to factor out the dead-phi-cycle-elimination code from LSR utility function, and generalize it to use the RecursivelyDeleteTriviallyDeadInstructions utility function. This makes LSR more aggressive about eliminating dead PHI cycles; adjust tests to either be less trivial or to simply expect fewer instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70636 91177308-0d34-0410-b5e6-96231b3b80d8
* 'The attached patch fixes an issue where llc -march=cpp fails withChris Lattner2009-05-011-0/+13
| | | | | | | | | | "Invalid primitive type" on input containing the x86_fp80 type.' Patch by Collin Winter! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70610 91177308-0d34-0410-b5e6-96231b3b80d8
* When printing a SCEVUnknown with pointer type, don't print anDan Gohman2009-05-011-1/+1
| | | | | | | | | artificial "ptrtoint", as it tends to clutter up complicated expressions. The cast operators now print both source and destination types, which is usually sufficient. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70554 91177308-0d34-0410-b5e6-96231b3b80d8
* Extend ScalarEvolution's getBackedgeTakenCount to be able toDan Gohman2009-04-303-1/+106
| | | | | | | | | | | | | compute an upper-bound value for the trip count, in addition to the actual trip count. Use this to allow getZeroExtendExpr and getSignExtendExpr to fold casts in more cases. This may eventually morph into a more general value-range analysis capability; there are certainly plenty of places where more complete value-range information would allow more folding. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70509 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't try to mix integers and pointers in an icmp instructionDan Gohman2009-04-301-0/+1
| | | | | | | in getSCEVAtScope. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70495 91177308-0d34-0410-b5e6-96231b3b80d8
* Mark MOV8mr_NOREX and MOV8rm_NOREX as mayStore / mayLoad respectively.Evan Cheng2009-04-301-0/+117
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70461 91177308-0d34-0410-b5e6-96231b3b80d8