summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* 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. llvm-svn: 65994
* 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. llvm-svn: 65902
* Fix PR3694: add an instcombine micro-optimization that helpsDuncan Sands2009-03-021-0/+14
| | | | | | clean up when using variable length arrays in llvm-gcc. llvm-svn: 65832
* adjust for asmprinter change.Chris Lattner2009-03-011-2/+2
| | | | llvm-svn: 65741
* adjust for asmprinter change.Chris Lattner2009-03-011-3/+5
| | | | llvm-svn: 65740
* adjust test to make it more robustChris Lattner2009-03-011-2/+4
| | | | llvm-svn: 65739
* Ignore dbg info intrinsics when folding conditional branch to Zhou Sheng2009-02-261-0/+70
| | | | | | conditional branch predecessors. llvm-svn: 65509
* Fix PR3667Chris Lattner2009-02-251-0/+38
| | | | llvm-svn: 65464
* Don't block basic block with only SwitchInst to fold into predecessors.Zhou Sheng2009-02-251-0/+116
| | | | llvm-svn: 65456
* Add a testcase for the problem fixed in r65289.Dan Gohman2009-02-241-0/+29
| | | | llvm-svn: 65365
* 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. llvm-svn: 65364
* 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 llvm-svn: 65353
* 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. llvm-svn: 65347
* Don't sign extend the char when expanding char -> int duringNick Lewycky2009-02-211-0/+12
| | | | | | load(bitcast(char[4] to i32*)) evaluation. llvm-svn: 65246
* 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. llvm-svn: 65209
* 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. llvm-svn: 65108
* 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. llvm-svn: 64918
* Add a test for r61358, which I forgot to add way back when.Owen Anderson2009-02-181-0/+193
| | | | llvm-svn: 64904
* Change the argument type in this test to something less convoluted,Dan Gohman2009-02-181-1/+1
| | | | | | since it isn't actually used. llvm-svn: 64883
* 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. llvm-svn: 64866
* 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. llvm-svn: 64844
* 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. llvm-svn: 64809
* Strengthen the "non-constant stride must dominate loop preheader" check.Evan Cheng2009-02-171-0/+32
| | | | llvm-svn: 64703
* Fix EnforceKnownAlignment so that it doesn't ever reduce the alignmentDan Gohman2009-02-161-0/+18
| | | | | | of an alloca or global variable. llvm-svn: 64693
* Rename IndVarsSimplify to IndVarSimplify, to be consistent withDan Gohman2009-02-1645-0/+0
| | | | | | the name used in the code that these tests are for. llvm-svn: 64624
* 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. llvm-svn: 64623
* 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. llvm-svn: 64583
* 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. llvm-svn: 64579
* 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. llvm-svn: 64532
* Mark strto* as readonly when the endptr is null.Nick Lewycky2009-02-131-4/+5
| | | | llvm-svn: 64460
* 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. llvm-svn: 64453
* 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. llvm-svn: 64443
* 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. llvm-svn: 64407
* 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. llvm-svn: 64401
* 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! llvm-svn: 64364
* 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 llvm-svn: 64311
* 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. llvm-svn: 64300
* If llvm.dbg.region.end is disappearing then remove corresponding ↵Devang Patel2009-02-111-0/+1
| | | | | | llvm.dbg.func.start also. llvm-svn: 64278
* Ignore dbg intrinsic while folding unconditional branch.Devang Patel2009-02-101-0/+70
| | | | llvm-svn: 64242
* Do not clone llvm.dbg.func.start and corresponding llvm.dbg.region.end ↵Devang Patel2009-02-101-0/+86
| | | | | | during inlining. llvm-svn: 64209
* Enable scalar replacement of AllocaInst whose one of the user is dbg info.Devang Patel2009-02-101-0/+105
| | | | llvm-svn: 64207
* Fix PR 3471, and some cleanups.Dale Johannesen2009-02-091-0/+33
| | | | llvm-svn: 64177
* 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. llvm-svn: 64035
* Ignore DbgInfoIntrinsics.Devang Patel2009-02-061-0/+71
| | | | llvm-svn: 63923
* fix PR3489, use bits instead of bytes.Chris Lattner2009-02-061-0/+20
| | | | llvm-svn: 63916
* Ignore dbg intrinsics while propagating conditional expression info. Take 2.Devang Patel2009-02-051-0/+45
| | | | llvm-svn: 63898
* Revert rev. 63876. It is causing llvm-gcc bootstrap failure.Devang Patel2009-02-051-45/+0
| | | | llvm-svn: 63888
* Remove dead blocks in the end.Devang Patel2009-02-051-0/+1
| | | | llvm-svn: 63880
* Ignore dbg intrinsics while propagating conditional expression info.Devang Patel2009-02-051-0/+45
| | | | llvm-svn: 63876
* Ignore dbg intrinsics while folding switch instruction.Devang Patel2009-02-051-0/+58
| | | | llvm-svn: 63802
OpenPOWER on IntegriCloud