aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* Revert rev. 66167. Devang Patel2009-03-061-0/+1
| | | | | | | We are still not out of woods yet. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66232 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not let debug info prevert globalopt from shriking a global vars to boolean.Devang Patel2009-03-061-0/+65
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66224 91177308-0d34-0410-b5e6-96231b3b80d8
* GlobalOpt only process non constant local GVs while optimizing global vars.Devang Patel2009-03-051-1/+0
| | | | | | | | | | | | | If non constant local GV named A is used by a constant local GV named B (e.g. llvm.dbg.variable) and B is not used by anyone else then eliminate A as well as B. In other words, debug info should not interfere in removal of unused GV. --This life, and those below, will be ignored-- M test/Transforms/GlobalOpt/2009-03-03-dbg.ll M lib/Transforms/IPO/GlobalOpt.cpp git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66167 91177308-0d34-0410-b5e6-96231b3b80d8
* Should have XFAILed this test.Bill Wendling2009-03-041-0/+54
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66086 91177308-0d34-0410-b5e6-96231b3b80d8
* Temporarily revert r65994. It was causing rdar://6646455.Bill Wendling2009-03-041-52/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66083 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR3720 by properly propagating alignment information from memcpy/memmove Chris Lattner2009-03-041-0/+19
| | | | | | | onto element accesses. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66053 91177308-0d34-0410-b5e6-96231b3b80d8
* If a global constant is dead then global's debug info should not prevent the ↵Devang Patel2009-03-041-0/+52
| | | | | | optimizer in deleting the global. And while deleting global, delete global's debug info also. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65994 91177308-0d34-0410-b5e6-96231b3b80d8
* If branch conditions' one successor is dominating another non-latch ↵Devang Patel2009-03-021-0/+64
| | | | | | successor then this loop's iteration space can not be restricted. In this example block bb5 is always executed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65902 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR3694: add an instcombine micro-optimization that helpsDuncan Sands2009-03-021-0/+14
| | | | | | | clean up when using variable length arrays in llvm-gcc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65832 91177308-0d34-0410-b5e6-96231b3b80d8
* adjust for asmprinter change.Chris Lattner2009-03-011-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65741 91177308-0d34-0410-b5e6-96231b3b80d8
* adjust for asmprinter change.Chris Lattner2009-03-011-3/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65740 91177308-0d34-0410-b5e6-96231b3b80d8
* adjust test to make it more robustChris Lattner2009-03-011-2/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65739 91177308-0d34-0410-b5e6-96231b3b80d8
* Ignore dbg info intrinsics when folding conditional branch to Zhou Sheng2009-02-261-0/+70
| | | | | | | conditional branch predecessors. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65509 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR3667Chris Lattner2009-02-251-0/+38
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65464 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't block basic block with only SwitchInst to fold into predecessors.Zhou Sheng2009-02-251-0/+116
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65456 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a testcase for the problem fixed in r65289.Dan Gohman2009-02-241-0/+29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65365 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a ValueTracking rule: RHS means operand 1, not 0. Add a simpleDan Gohman2009-02-241-0/+8
| | | | | | | | ashr instcombine to help expose this code. And apply the fix to SelectionDAG's copy of this code too. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65364 91177308-0d34-0410-b5e6-96231b3b80d8
* While folding unconditional return move DbgRegionEndInst into the ↵Devang Patel2009-02-241-2/+4
| | | | | | | | | | | | | predecessor, instead of removing it. This fixes following tests from llvmgcc42 testsuite. gcc.c-torture/execute/20000605-3.c gcc.c-torture/execute/20020619-1.c gcc.c-torture/execute/20030920-1.c gcc.c-torture/execute/loop-ivopts-1.c git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65353 91177308-0d34-0410-b5e6-96231b3b80d8
* Back out the change in 64918 that used sign-extensions when promotingDan Gohman2009-02-233-7/+3
| | | | | | | | | | trip counts that use signed comparisons. It's not obviously the best approach for preserving trip count information, and at any rate there isn't anything in the tree right now that makes use of that, so for now always using zero-extensions is preferable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65347 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't sign extend the char when expanding char -> int duringNick Lewycky2009-02-211-0/+12
| | | | | | | load(bitcast(char[4] to i32*)) evaluation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65246 91177308-0d34-0410-b5e6-96231b3b80d8
* rename a function to indicate that it checks for profitability as wellChris Lattner2009-02-211-0/+278
| | | | | | | | | as legality. Make load sinking and gep sinking more careful: we only do it when it won't pessimize loads from the stack. This has the added benefit of not producing code that is unanalyzable to SROA. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65209 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement "superhero" strength reduction, or full strengthDan Gohman2009-02-201-1/+1
| | | | | | | | | | | | | | | | | | reduction of address calculations down to basic pointer arithmetic. This is currently off by default, as it needs a few other features before it becomes generally useful. And even when enabled, full strength reduction is only performed when it doesn't increase register pressure, and when several other conditions are true. This also factors out a bunch of exisiting LSR code out of StrengthReduceStridedIVUsers into separate functions, and tidies up IV insertion. This actually decreases register pressure even in non-superhero mode. The change in iv-users-in-other-loops.ll is an example of this; there are two more adds because there are two fewer leas, and there is less spilling. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65108 91177308-0d34-0410-b5e6-96231b3b80d8
* Use a sign-extend instead of a zero-extend when promoting aDan Gohman2009-02-183-4/+37
| | | | | | | | | | | | | trip count value when the original loop iteration condition is signed and the canonical induction variable won't undergo signed overflow. This isn't required for correctness; it just preserves more information about original loop iteration values. Add a getTruncateOrSignExtend method to ScalarEvolution, following getTruncateOrZeroExtend. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64918 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a test for r61358, which I forgot to add way back when.Owen Anderson2009-02-181-0/+193
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64904 91177308-0d34-0410-b5e6-96231b3b80d8
* Change the argument type in this test to something less convoluted,Dan Gohman2009-02-181-1/+1
| | | | | | | since it isn't actually used. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64883 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a corner case in the new indvars promotion logic: if thereDan Gohman2009-02-181-0/+38
| | | | | | | | | | | are multiple IV's in a loop, some of them may under go signed or unsigned wrapping even if the IV that's used in the loop exit condition doesn't. Restrict sign-extension-elimination and zero-extension-elimination to only those that operate on the original loop-controlling IV. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64866 91177308-0d34-0410-b5e6-96231b3b80d8
* If an alias is dead and so is its aliasee, then globaldce wouldDuncan Sands2009-02-171-0/+4
| | | | | | | | crash because the alias would still be using the aliasee when the aliasee was deleted. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64844 91177308-0d34-0410-b5e6-96231b3b80d8
* commit a tweaked version of Daniel's patch for PR3599. We nowChris Lattner2009-02-171-0/+23
| | | | | | | | eliminate all the extensions and all but the one required truncate from the testcase, but the or/and/shift stuff still isn't zapped. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64809 91177308-0d34-0410-b5e6-96231b3b80d8
* Strengthen the "non-constant stride must dominate loop preheader" check.Evan Cheng2009-02-171-0/+32
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64703 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix EnforceKnownAlignment so that it doesn't ever reduce the alignmentDan Gohman2009-02-161-0/+18
| | | | | | | of an alloca or global variable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64693 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename IndVarsSimplify to IndVarSimplify, to be consistent withDan Gohman2009-02-1645-0/+0
| | | | | | | the name used in the code that these tests are for. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64624 91177308-0d34-0410-b5e6-96231b3b80d8
* Change these tests to use regular loads instead of llvm.x86.sse2.loadu.dq.Dan Gohman2009-02-161-4/+1
| | | | | | | | | Enhance instcombine to use the preferred field of GetOrEnforceKnownAlignment in more cases, so that regular IR operations are optimized in the same way that the intrinsics currently are. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64623 91177308-0d34-0410-b5e6-96231b3b80d8
* If the target of an alias has internal linkage, then theDuncan Sands2009-02-152-0/+22
| | | | | | | | | alias can be morphed into the target. Implement this transform, and fix a crash in the existing transform at the same time. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64583 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix pr3571: If stride is a value defined by an instruction, make sure it ↵Evan Cheng2009-02-151-0/+27
| | | | | | dominates the loop preheader. When IV users are strength reduced, the stride is inserted into the preheader. It could create a use before def situation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64579 91177308-0d34-0410-b5e6-96231b3b80d8
* Extend the IndVarSimplify support for promoting induction variables:Dan Gohman2009-02-141-0/+38
| | | | | | | | | | - Test for signed and unsigned wrapping conditions, instead of just testing for non-negative induction ranges. - Handle loops with GT comparisons, in addition to LT comparisons. - Support more cases of induction variables that don't start at 0. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64532 91177308-0d34-0410-b5e6-96231b3b80d8
* Mark strto* as readonly when the endptr is null.Nick Lewycky2009-02-131-4/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64460 91177308-0d34-0410-b5e6-96231b3b80d8
* On strtod and friends, mark 'endptr' nocapture in the function prototype, andNick Lewycky2009-02-131-0/+13
| | | | | | | mark the first argument nocapture if endptr=NULL for each particular call. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64453 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply r64300:Nick Lewycky2009-02-131-2/+2
| | | | | | | | | | Make sure the SCC pass manager initializes any contained function pass managers. Without this, simplify-libcalls would add nocapture attributes when run on its own, but not when run as part of -std-compile-opts or similar. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64443 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach IndVarSimplify to optimize code using the C "int" type forDan Gohman2009-02-121-0/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | loop induction on LP64 targets. When the induction variable is used in addressing, IndVars now is usually able to inserst a 64-bit induction variable and eliminates the sign-extending cast. This is also useful for code using C "short" types for induction variables on targets with 32-bit addressing. Inserting a wider induction variable is easy; the tricky part is determining when trunc(sext(i)) expressions are no-ops. This requires range analysis of the loop trip count. A common case is when the original loop iteration starts at 0 and exits when the induction variable is signed-less-than a fixed value; this case is now handled. This replaces IndVarSimplify's OptimizeCanonicalIVType. It was doing the same optimization, but it was limited to loops with constant trip counts, because it was running after the loop rewrite, and the information about the original induction variable is lost by that point. Rename ScalarEvolution's executesAtLeastOnce to isLoopGuardedByCond, generalize it to be able to test for ICMP_NE conditions, and move it to be a public function so that IndVars can use it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64407 91177308-0d34-0410-b5e6-96231b3b80d8
* Add suppport for ConstantExprs of shufflevectors whose result type is not ↵Nate Begeman2009-02-121-0/+14
| | | | | | | | | equal to the type of the vectors being shuffled. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64401 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a nasty bug (PR3550) where the inline pass could incorrectly mark Chris Lattner2009-02-121-0/+35
| | | | | | | | calls with the tail marker when inlining them through an invoke. Patch, testcase, and perfect analysis by Jay Foad! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64364 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r64300 and r64301. These were causing the following errors respectively:Bill Wendling2009-02-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During llvm-gcc bootstrap: Undefined symbols: "llvm::FPPassManager::doFinalization(llvm::Module&)", referenced from: (anonymous namespace)::CGPassManager::doFinalization(llvm::CallGraph&, llvm::Module&) in libLLVMipa.a(CallGraphSCCPass.o) "llvm::FPPassManager::doInitialization(llvm::Module&)", referenced from: (anonymous namespace)::CGPassManager::doInitialization(llvm::CallGraph&, llvm::Module&) in libLLVMipa.a(CallGraphSCCPass.o) ld: symbol(s) not found collect2: ld returned 1 exit status make[3]: *** [/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore.roots/llvmCore~obj/obj-llvm/Release/bin/opt] Error 1 During an LLVM release build: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/Release/bin/tblgen -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target/X86 -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/include -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/include -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target -gen-register-desc -o /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Target/X86/Release/X86GenRegisterInfo.inc.tmp /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target/X86/X86.td llvm[3]: Building X86.td instruction names with tblgen /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/Release/bin/tblgen -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target/X86 -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/include -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/include -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target -gen-instr-enums -o /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Target/X86/Release/X86GenInstrNames.inc.tmp /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target/X86/X86.td llvm[3]: Building X86.td instruction information with tblgen /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/Release/bin/tblgen -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target/X86 -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/include -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/include -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target -gen-instr-desc -o /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Target/X86/Release/X86GenInstrInfo.inc.tmp /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target/X86/X86.td llvm[3]: Building X86.td assembly writer with tblgen /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/Release/bin/tblgen -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target/X86 -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/include -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/include -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target -gen-asm-writer -o /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Target/X86/Release/X86GenAsmWriter.inc.tmp /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target/X86/X86.td llvm[3]: Compiling InstructionCombining.cpp for Release build if /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmgcc42.roots/llvmgcc42~dst/Developer/usr/bin/llvm-g++-4.2 -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/include -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Transforms/Scalar -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/include -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Transforms/Scalar -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -O3 -fno-exceptions -Woverloaded-virtual -pedantic -Wall -W -Wwrite-strings -Wno-long-long -Wunused -Wno-unused-parameter -fstrict-aliasing -Wstrict-aliasing -c -MMD -MP -MF "/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Transforms/Scalar/Release/InstructionCombining.d.tmp" -MT "/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Transforms/Scalar/Release/InstructionCombining.lo" -MT "/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Transforms/Scalar/Release/InstructionCombining.o" -MT "/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Transforms/Scalar/Release/InstructionCombining.d" /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Transforms/Scalar/InstructionCombining.cpp -o /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Transforms/Scalar/Release/InstructionCombining.o ; \ then /bin/mv -f "/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Transforms/Scalar/Release/InstructionCombining.d.tmp" "/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Trans git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64311 91177308-0d34-0410-b5e6-96231b3b80d8
* Make sure the SCC pass manager initializes any containedDuncan Sands2009-02-111-0/+12
| | | | | | | | | function pass managers. Without this, simplify-libcalls would add nocapture attributes when run on its own, but not when run as part of -std-compile-opts or similar. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64300 91177308-0d34-0410-b5e6-96231b3b80d8
* If llvm.dbg.region.end is disappearing then remove corresponding ↵Devang Patel2009-02-111-0/+1
| | | | | | llvm.dbg.func.start also. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64278 91177308-0d34-0410-b5e6-96231b3b80d8
* Ignore dbg intrinsic while folding unconditional branch.Devang Patel2009-02-101-0/+70
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64242 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not clone llvm.dbg.func.start and corresponding llvm.dbg.region.end ↵Devang Patel2009-02-101-0/+86
| | | | | | during inlining. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64209 91177308-0d34-0410-b5e6-96231b3b80d8
* Enable scalar replacement of AllocaInst whose one of the user is dbg info.Devang Patel2009-02-101-0/+105
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64207 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR 3471, and some cleanups.Dale Johannesen2009-02-091-0/+33
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64177 91177308-0d34-0410-b5e6-96231b3b80d8
* Instrcombine should not change load(cast p) to cast(load p) if the castMon P Wang2009-02-071-0/+19
| | | | | | | changes the address space of the pointer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64035 91177308-0d34-0410-b5e6-96231b3b80d8
* Ignore DbgInfoIntrinsics.Devang Patel2009-02-061-0/+71
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63923 91177308-0d34-0410-b5e6-96231b3b80d8