summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* Delete this code, which is no longer needed.Dan Gohman2010-04-121-4/+0
| | | | llvm-svn: 101033
* Move the EliminateIVUsers call back out to its original location. Now thatDan Gohman2010-04-121-10/+4
| | | | | | | | a ScalarEvolution bug with overflow handling is fixed, the normal analysis code will automatically decline to operate on the icmp instructions which are responsible for the loop exit. llvm-svn: 101032
* Use RecursivelyDeleteTriviallyDeadInstructions in EliminateIVComparisons,Dan Gohman2010-04-121-3/+12
| | | | | | | | instead of deleting just the user. This makes it more consistent with other code in IndVarSimplify, and theoretically can eliminate more users earlier. llvm-svn: 101027
* Verify function prototypes before trying to optimize functions. We alsoEric Christopher2010-04-121-2/+48
| | | | | | | | | | need TargetData, just return false if we don't have it. Update testcases accordingly. Fixes PR6807. llvm-svn: 101011
* Re-apply r101000, with a fix: Don't eliminate an icmp which is part ofDan Gohman2010-04-121-1/+45
| | | | | | | | the loop exit test. This usually doesn't come up for a variety of reasons, but it isn't impossible, so make IndVarSimplify handle it conservatively. llvm-svn: 101008
* Revert 101000, which is breaking self-host builds.Dan Gohman2010-04-121-38/+0
| | | | llvm-svn: 101002
* Teach IndVarSimplify how to eliminate comparisons involving inductionDan Gohman2010-04-111-0/+38
| | | | | | | | | | | | | variables. For example, with code like this: for (i=0;i<n;++i) if (i<n) x[i] = 0; IndVarSimplify will now recognize that i is always less than n inside the loop, and eliminate the if. llvm-svn: 101000
* Rename isLoopGuardedByCond to isLoopEntryGuardedByCond, to emphasiseDan Gohman2010-04-111-1/+1
| | | | | | | that it's only testing for the entry condition, not full loop-invariant conditions. llvm-svn: 100979
* Implement support for varargs functions without any fixedChris Lattner2010-04-101-15/+0
| | | | | | | | parameters in the CBE by implicitly adding a fixed argument. This allows eliminating a work-around from DAE. Patch by Sylvere Teissier! llvm-svn: 100944
* fix PR6743, a case where we'd delete an instruction before using itChris Lattner2010-04-101-1/+3
| | | | | | in some cases. llvm-svn: 100937
* fix PR6760, a missing check in heap SRoA.Chris Lattner2010-04-101-1/+2
| | | | llvm-svn: 100936
* When determining a canonical insert position, don't climb deeperDan Gohman2010-04-091-33/+73
| | | | | | | | into adjacent loops. Also, ensure that the insert position is dominated by the loop latch of any loop in the post-inc set which has a latch. llvm-svn: 100906
* suck the propagating "has dynamic libs" check into a single makefile Chris Lattner2010-04-091-2/+2
| | | | | | variable TARGET_HAS_DYNAMIC_LIBS llvm-svn: 100896
* add minix support, patch by Kees van Reeuwijk! PR6797Chris Lattner2010-04-091-1/+1
| | | | llvm-svn: 100895
* Adding IPSCCP and Internalize passes to the C-bindingsWesley Peck2010-04-091-0/+9
| | | | llvm-svn: 100893
* When looking for loop-invariant users, look through no-op instructions,Dan Gohman2010-04-091-3/+11
| | | | | | | so that an unfortunately placed bitcast doesn't pin a value in a register. llvm-svn: 100883
* performance: cache result of looking up userGabor Greif2010-04-091-4/+6
| | | | llvm-svn: 100862
* Minor code simplification.Dan Gohman2010-04-091-9/+5
| | | | llvm-svn: 100859
* const-ize a predicateGabor Greif2010-04-091-2/+2
| | | | llvm-svn: 100856
* Refactor the code for computing the insertion point for an expression intoDan Gohman2010-04-091-8/+29
| | | | | | a separate function. llvm-svn: 100845
* fix a SCCP miscompilation that could happen when aChris Lattner2010-04-091-3/+10
| | | | | | | | | forced constant is changed to a constant, we would end up adding the instruction to the wrong worklist, preventing it from being properly revisited. This fixes rdar://7832370 llvm-svn: 100837
* Avoid allocating a value of zero in a register if the initial formulaDan Gohman2010-04-081-2/+6
| | | | | | inputs happen to negate each other. llvm-svn: 100828
* Add variants of ult, ule, etc. which take a uint64_t RHS, for convenience.Dan Gohman2010-04-082-3/+3
| | | | llvm-svn: 100824
* When expanding expressions which are using post-inc mode for multiple loops,Dan Gohman2010-04-081-0/+16
| | | | | | ensure that the expansion is dominated by the increments of those loops. llvm-svn: 100748
* Say bitcast instead of bitconvert.Dan Gohman2010-04-071-1/+1
| | | | llvm-svn: 100720
* Add support for stpncpy_chk.Eric Christopher2010-04-071-6/+6
| | | | llvm-svn: 100710
* rename llvm::llvm_report_error -> llvm::report_fatal_errorChris Lattner2010-04-071-1/+1
| | | | llvm-svn: 100709
* Generalize IVUsers to track arbitrary expressions rather than expressionsDan Gohman2010-04-072-57/+104
| | | | | | | | | | | | | | | explicitly split into stride-and-offset pairs. Also, add the ability to track multiple post-increment loops on the same expression. This refines the concept of "normalizing" SCEV expressions used for to post-increment uses, and introduces a dedicated utility routine for normalizing and denormalizing expressions. This fixes the expansion of expressions which are post-increment users of more than one loop at a time. More broadly, this takes LSR another step closer to being able to reason about more than one loop at a time. llvm-svn: 100699
* fix 80-col violationsGabor Greif2010-04-071-13/+17
| | | | llvm-svn: 100677
* performance: get rid of repeated dereferencing of use_iterator by caching ↵Gabor Greif2010-04-061-5/+7
| | | | | | its result llvm-svn: 100550
* make more two predicates constantGabor Greif2010-04-061-15/+15
| | | | llvm-svn: 100549
* performance: get rid of repeated dereferencing of use_iterator by caching ↵Gabor Greif2010-04-061-21/+28
| | | | | | its result llvm-svn: 100547
* const-ize predicate ValueIsOnlyUsedLocallyOrStoredToOneGlobalGabor Greif2010-04-061-9/+10
| | | | llvm-svn: 100546
* use CallSite to access calls vs. invokes uniformlyGabor Greif2010-04-061-5/+6
| | | | | | and remove assumptions about operand order llvm-svn: 100544
* fix a really nasty bug that Evan was tracking in SCCP. When resolvingChris Lattner2010-04-051-29/+32
| | | | | | | | | | | | | | | | | | undefs in branches/switches, we have two cases: a branch on a literal undef or a branch on a symbolic value which is undef. If we have a literal undef, the code was correct: forcing it to a constant is the right thing to do. If we have a branch on a symbolic value that is undef, we should force the symbolic value to a constant, which then makes the successor block live. Forcing the condition of the branch to being a constant isn't safe if later paths become live and the value becomes overdefined. This is the case that 'forcedconstant' is designed to handle, so just use it. This fixes rdar://7765019 but there is no good testcase for this, the one I have is too insane to be useful in the future. llvm-svn: 100478
* some code cleanups, use SwitchInst::findCaseValue, reduce indentationChris Lattner2010-04-051-62/+63
| | | | llvm-svn: 100468
* Code clean up.Evan Cheng2010-04-052-20/+18
| | | | llvm-svn: 100467
* Reapply address space patch after fixing an issue in MemCopyOptimizer.Mon P Wang2010-04-046-75/+127
| | | | | | | Added support for address spaces and added a isVolatile field to memcpy, memmove, and memset, e.g., llvm.memcpy.i32(i8*, i8*, i32, i32) -> llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1) llvm-svn: 100304
* require that the branch being controlled by the IV Chris Lattner2010-04-031-2/+9
| | | | | | | | exits the loop. With this information we can guarantee the iteration count of the loop is bounded by the compare. I think this xforms is finally safe now. llvm-svn: 100285
* add integer overflow check for the fp induction variable Chris Lattner2010-04-031-16/+83
| | | | | | | | | | | | checker. Amusingly, we already had tests that we should have rejects because they would be miscompiled in the testsuite. The remaining issue with this is that we don't check that the branch causes us to exit the loop if it fails, so we don't actually know if we remain in bounds. llvm-svn: 100284
* add a comment and fix some consistency issues, convertingChris Lattner2010-04-031-15/+25
| | | | | | | | | to a signed vs unsigned value depending on the sign of the constant fp means that we can't distinguish between a truly negative number and a positive number so large the 32nd bit is set. So, do don't this! llvm-svn: 100283
* fix PR6761, a miscompilation due to the fp->int IV conversionChris Lattner2010-04-031-2/+2
| | | | | | stuff. More bugs remain though. llvm-svn: 100282
* just eliminate the uitofp checks. This code isn't doingChris Lattner2010-04-031-26/+5
| | | | | | | the required validity checks in the first place, and supporting a condition large enough to require the 32'nd bit isn't worth it. llvm-svn: 100280
* rename PH -> PN to be consistent with WeakPN and the restChris Lattner2010-04-031-20/+20
| | | | | | of llvm. llvm-svn: 100276
* improve comment and drop a dead check. If PH hadChris Lattner2010-04-031-4/+8
| | | | | | | no uses, it would have been deleted by RecursivelyDeleteTriviallyDeadInstructions llvm-svn: 100275
* strength reduce a ridiculous use of APInt.Chris Lattner2010-04-031-2/+1
| | | | llvm-svn: 100274
* rename stuff improve comment grammar.Chris Lattner2010-04-031-22/+21
| | | | llvm-svn: 100273
* simplify some code and resolve a fixme.Chris Lattner2010-04-031-4/+2
| | | | llvm-svn: 100272
* There is no guarantee that the increment and the branchChris Lattner2010-04-031-41/+28
| | | | | | | | | are in the same block. Insert the new increment in the correct location. Also, more cleanups. llvm-svn: 100271
* first half of a pass through IndVarSimplify::HandleFloatingPointIV,Chris Lattner2010-04-031-47/+35
| | | | | | | | this cleans up a bunch of code and also fixes several crashes and miscompiles. More to come unfortunately, this optimization is quite broken. llvm-svn: 100270
OpenPOWER on IntegriCloud