summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar
Commit message (Collapse)AuthorAgeFilesLines
* Introduce ImmutableCallSite, useful for contexts where no mutationGabor Greif2010-04-011-1/+1
| | | | | | | | | is necessary. Inherits from new templated baseclass CallSiteBase<> which is highly customizable. Base CallSite on it too, in a configuration that allows full mutation. Adapt some call sites in analyses to employ ImmutableCallSite. llvm-svn: 100100
* Fix a nasty dangling-pointer heisenbug that couldDale Johannesen2010-03-311-1/+5
| | | | | | | | | | | | | | | | | | generate wrong code pretty much anywhere AFAICT. A case that hits the bug reproducibly is impossible, but the situation was like this: Addr = ... Store -> Addr Addr2 = GEP , 0, 0 Store -> Addr2 Handling the first store, the code changed replaced Addr with a sunkaddr and deleted Addr, but not its table entry. Code in OptimizedBlock replaced Addr2 with a bitcast; if that happened to reuse the memory of Addr, the old table entry was erroneously found when handling the second store. llvm-svn: 100044
* Revert Mon Ping's change 99928, since it broke all the llvm-gcc buildbots.Bob Wilson2010-03-303-77/+39
| | | | llvm-svn: 99948
* Added support for address spaces and added a isVolatile field to memcpy, ↵Mon P Wang2010-03-303-39/+77
| | | | | | | | | memmove, and memset, e.g., llvm.memcpy.i32(i8*, i8*, i32, i32) -> llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1) A update of langref will occur in a subsequent checkin. llvm-svn: 99928
* Remove another memory leak from ABCD by using Edges by value instead ofJeffrey Yasskin2010-03-271-29/+21
| | | | | | | pointer. There was also a SmallPtrSet whose settiness wasn't being used, so I changed it to a SmallVector. llvm-svn: 99713
* In ABCD, change the non-null Bound*s to Bound&s.Jeffrey Yasskin2010-03-271-79/+74
| | | | llvm-svn: 99711
* Fix a memory leak in ABCD by giving ownership of Bound objects to theJeffrey Yasskin2010-03-271-68/+76
| | | | | | MemoizedResultChart. llvm-svn: 99710
* Ignore debug intrinsics in yet more places.Dan Gohman2010-03-261-1/+4
| | | | llvm-svn: 99580
* rename use_const_iterator to const_use_iterator for consistency's sakeGabor Greif2010-03-254-4/+4
| | | | llvm-svn: 99564
* fix PR6642, GVN forwarding from memset to load of the base of the memset.Chris Lattner2010-03-251-7/+7
| | | | llvm-svn: 99488
* Move OptChkCall off LibCallOptimization into StrCpyOpt.Evan Cheng2010-03-241-7/+6
| | | | llvm-svn: 99418
* Finally land the InvokeInst operand reordering.Gabor Greif2010-03-242-2/+3
| | | | | | | | | | | | I have audited all getOperandNo calls now, fixing hidden assumptions. CallSite related uglyness will be eliminated successively. Note this patch has a long and griveous history, for all the back-and-forths have a look at CallSite.h's log. llvm-svn: 99399
* increase const goodness and remove pointless getUser() callsGabor Greif2010-03-241-7/+9
| | | | llvm-svn: 99395
* Skip debugging intrinsics when sinking unused invariants.Bill Wendling2010-03-231-10/+24
| | | | llvm-svn: 99324
* Teach simplify libcall to transform __strcpy_chk to __memcpy_chk to enable ↵Evan Cheng2010-03-231-5/+20
| | | | | | optimizations down stream. llvm-svn: 99282
* backing out r99170 because it still fails on clang-x86_64-darwin10-fntGabor Greif2010-03-221-1/+1
| | | | llvm-svn: 99171
* Now that hopefully all direct accesses to InvokeInst operands are fixedGabor Greif2010-03-221-1/+1
| | | | | | we can reapply the InvokeInst operand reordering patch. (see r98957). llvm-svn: 99170
* Clear the SCEVExpander's insertion point after making deletions,Dan Gohman2010-03-201-0/+4
| | | | | | | | | | | | | | so that the SCEVExpander doesn't retain a dangling pointer as its insert position. The dangling pointer in this case wasn't ever used to insert new instructions, but it was causing trouble with SCEVExpander's code for automatically advancing its insert position past debug intrinsics. This fixes use-after-free errors that valgrind noticed in test/Transforms/IndVarSimplify/2007-06-06-DeleteDanglesPtr.ll and test/Transforms/IndVarSimplify/exit_value_tests.ll. llvm-svn: 99036
* back out r98957, it broke ↵Gabor Greif2010-03-191-1/+1
| | | | | | http://smooshlab.apple.com:8010/builders/clang-x86_64-darwin10-fnt/builds/703 in the nightly test suite llvm-svn: 98958
* Recommit r80858 again (which has been backed out in r80871).Gabor Greif2010-03-191-1/+1
| | | | | | | | | | | This time I did a self-hosted bootstrap on Linux x86-64, with no problems. Let's see how darwin 64-bit self-hosting goes. At the first sign of failure I'll back this out. Maybe the valgrind bots give me a hint of what may be wrong (it at all). llvm-svn: 98957
* str[r]chr returns its pointer argument so we cannot mark it as nocapture. ↵Benjamin Kramer2010-03-161-1/+0
| | | | | | Thanks to Duncan for spotting my mistake. llvm-svn: 98671
* Mark str[r]chr readonly.Benjamin Kramer2010-03-161-1/+10
| | | | llvm-svn: 98663
* Skip debug info intrinsics.Devang Patel2010-03-151-0/+4
| | | | llvm-svn: 98584
* In "empty" bb, the return instruction may not be first instruction, if dbg ↵Devang Patel2010-03-151-1/+1
| | | | | | value intrinsics are present in this bb. Use terminator to find return instructions. llvm-svn: 98565
* Skip over debug info when trying to merge two return BBs.Bill Wendling2010-03-141-4/+9
| | | | llvm-svn: 98491
* Factor checked library call optimization into a common helper class and use itBenjamin Kramer2010-03-121-96/+19
| | | | | | to unify the almost identical code in CodeGenPrepare and InstCombineCalls. llvm-svn: 98338
* Whoops this already existed.Nate Begeman2010-03-111-4/+0
| | | | llvm-svn: 98297
* Add a handful of additional useful pass manager things to the C APINate Begeman2010-03-111-0/+15
| | | | llvm-svn: 98296
* stpcpy is so similar to strcpy, it doesn't deserve a complete copy of the ↵Benjamin Kramer2010-03-111-15/+3
| | | | | | __strcpy_chk -> strcpy code. llvm-svn: 98284
* Lower stpcpy_chk when possible.Eric Christopher2010-03-111-6/+9
| | | | llvm-svn: 98274
* Do some final lowering in CodeGenPrepare of _chk calls similar toEric Christopher2010-03-111-0/+134
| | | | | | | | that in InstCombineCalls. More call lowering needed. llvm-svn: 98228
* Add a DominatorTree argument to isLCSSA so that it doesn't have toDan Gohman2010-03-103-4/+3
| | | | | | | compute a set of reachable blocks for itself each time it is called, which is fairly frequently. llvm-svn: 98179
* Migrate _chk call lowering from SimplifyLibCalls to InstCombine. StubEric Christopher2010-03-061-134/+0
| | | | | | | | out the remainder of the calls that we should lower in some way and move the tests to the new correct directory. Fix up tests that are now optimized more than they were before by -instcombine. llvm-svn: 97875
* Move SimplifyLibCalls's LibCall builders to a separate file so theyEric Christopher2010-03-051-386/+33
| | | | | | | | can be used in more places. Add an argument for the TargetData that most of them need. Update for the getInt8PtrTy() change. Should be no functionality change. llvm-svn: 97844
* Safely turn memset_chk etc. to non-chk variant if the known object size is ↵Evan Cheng2010-03-051-13/+19
| | | | | | >= memset / memcpy / memmove size. llvm-svn: 97828
* fix a nice subtle reassociate bug which would only occurChris Lattner2010-03-051-5/+21
| | | | | | | in a very specific use pattern embodied in the carefully reduced testcase. llvm-svn: 97794
* Move GetStringLength and helper from SimplifyLibCalls to ValueTracking.Eric Christopher2010-03-051-124/+0
| | | | | | No functionality change. llvm-svn: 97793
* Make SCEVExpander and LSR more aggressive about hoisting expressions outDan Gohman2010-03-031-4/+24
| | | | | | of loops. llvm-svn: 97642
* Non-affine post-inc SCEV expansions have more code which must beDan Gohman2010-03-021-2/+6
| | | | | | | emitted after the increment. Make sure the insert position reflects this. This fixes PR6453. llvm-svn: 97537
* Don't attempt load PRE when there is no real redundancy (i.e., the load is inBob Wilson2010-03-021-4/+6
| | | | | | a loop and is itself the only dependency). llvm-svn: 97526
* When GVN needs to split critical edges for load PRE, check all of theBob Wilson2010-03-011-1/+4
| | | | | | | | predecessors before returning. Otherwise, if multiple predecessor edges need splitting, we only get one of them per iteration. This makes a small but measurable compile time improvement with -enable-full-load-pre. llvm-svn: 97521
* MemoryDepAnalysis is not used if redundant load processing is disabled.Evan Cheng2010-03-011-1/+1
| | | | llvm-svn: 97512
* Spelling fixes.Dan Gohman2010-03-012-17/+17
| | | | llvm-svn: 97453
* Revert r97245 which seems to be causing performance problems.Bob Wilson2010-02-281-6/+5
| | | | llvm-svn: 97366
* fix grammaro's pointed out by danielChris Lattner2010-02-271-2/+2
| | | | llvm-svn: 97313
* fix PR6414, a nondeterminism issue in IPSCCP which was becauseChris Lattner2010-02-271-1/+15
| | | | | | of a subtle interation in a loop operating in densemap order. llvm-svn: 97288
* Move the EnableFullLoadPRE flag from a separate command-line option to anBob Wilson2010-02-261-5/+6
| | | | | | argument of createGVNPass and set it automatically for -O3. llvm-svn: 97245
* Remove unused "NoPRE" parameter in GVN and createGVNPass().Bob Wilson2010-02-261-5/+4
| | | | llvm-svn: 97235
* Make LoopSimplify change conditional branches in loop exiting blocksDan Gohman2010-02-251-12/+17
| | | | | | | | | | | | which branch on undef to branch on a boolean constant for the edge exiting the loop. This helps ScalarEvolution compute trip counts for loops. Teach ScalarEvolution to recognize single-value PHIs, when safe, and ForgetSymbolicName to forget such single-value PHI nodes as apprpriate in ForgetSymbolicName. llvm-svn: 97126
* Reapply r97010, the speculative revert failed.Daniel Dunbar2010-02-241-6/+1
| | | | llvm-svn: 97036
OpenPOWER on IntegriCloud