summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* Silence compiler warning about use of uninitialized variables (in reality theseNick Lewycky2009-02-271-1/+1
| | | | | | are always set by reference on the path that uses them.) No functional change. llvm-svn: 65621
* Fix compiler warning about uninitialized variables. No functional change.Nick Lewycky2009-02-271-1/+1
| | | | llvm-svn: 65620
* Ignore dbg info intrinsics when folding conditional branch to Zhou Sheng2009-02-261-1/+5
| | | | | | conditional branch predecessors. llvm-svn: 65509
* Fix PR3667Chris Lattner2009-02-251-1/+1
| | | | llvm-svn: 65464
* Don't block basic block with only SwitchInst to fold into predecessors.Zhou Sheng2009-02-251-1/+5
| | | | llvm-svn: 65456
* Rename ScalarEvolution's getIterationCount to getBackedgeTakenCount,Dan Gohman2009-02-243-45/+44
| | | | | | | | | to more accurately describe what it does. Expand its doxygen comment to describe what the backedge-taken count is and how it differs from the actual iteration count of the loop. Adjust names and comments in associated code accordingly. llvm-svn: 65382
* Fix a ValueTracking rule: RHS means operand 1, not 0. Add a simpleDan Gohman2009-02-241-1/+6
| | | | | | | ashr instcombine to help expose this code. And apply the fix to SelectionDAG's copy of this code too. llvm-svn: 65364
* Generalize the ChangeCompareStride code, in preparation forDan Gohman2009-02-241-94/+96
| | | | | | handling non-constant strides. No functionality change. llvm-svn: 65363
* Preserve the DominanceFrontier analysis in the LoopDeletion pass.Dan Gohman2009-02-241-2/+7
| | | | llvm-svn: 65359
* While folding unconditional return move DbgRegionEndInst into the ↵Devang Patel2009-02-242-23/+10
| | | | | | | | | | | 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-231-34/+12
| | | | | | | | | 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
* LoopDeletion needs to inform ScalarEvolution when a loop is deleted,Dan Gohman2009-02-231-1/+4
| | | | | | | | so that ScalarEvolution doesn't hang onto a dangling Loop*, which could be a problem if another Loop happens to get allocated at the same address. llvm-svn: 65323
* IndVarSimplify preserves ScalarEvolution. In theDan Gohman2009-02-231-0/+1
| | | | | | | -std-compile-opts sequence, this avoids the need for ScalarEvolution to be rerun before LoopDeletion. llvm-svn: 65318
* Should reset DBI_Prev if DBI_Next == 0.Zhou Sheng2009-02-231-0/+2
| | | | llvm-svn: 65314
* Changed option name from inline-threshold to basic-inline-threshold becauseMon P Wang2009-02-231-1/+1
| | | | | | inline-threshold option is used by the inliner. llvm-svn: 65309
* fix some typos that Duncan noticedChris Lattner2009-02-231-3/+3
| | | | llvm-svn: 65306
* Revert the part of 64623 that attempted to align the source in aDan Gohman2009-02-221-1/+1
| | | | | | | | | | | | | | | memcpy to match the alignment of the destination. It isn't necessary for making loads and stores handled like the SSE loadu/storeu intrinsics, and it was causing a performance regression in MultiSource/Applications/JM/lencod. The problem appears to have been a memcpy that copies from some highly aligned array into an alloca; the alloca was then being assigned a large alignment, which required codegen to perform dynamic stack-pointer re-alignment, which forced the enclosing function to have a frame pointer, which led to increased spilling. llvm-svn: 65289
* Properly parenthesize this expression, fixing a real bug in the newDan Gohman2009-02-221-1/+1
| | | | | | -full-lsr code, as well as a GCC warning. llvm-svn: 65288
* Only try to sink immediate when TLI is not null. It needs to check if ↵Evan Cheng2009-02-221-1/+1
| | | | | | immediate would fit in target addressing field. llvm-svn: 65268
* Don't sign extend the char when expanding char -> int duringNick Lewycky2009-02-211-2/+2
| | | | | | load(bitcast(char[4] to i32*)) evaluation. llvm-svn: 65246
* Add AddrModeMatcher.cppEvan Cheng2009-02-211-0/+1
| | | | llvm-svn: 65228
* Teach LSR sink to sink the immediate portion of the common expression back ↵Evan Cheng2009-02-211-17/+82
| | | | | | into uses if they fit in address modes of all the uses. llvm-svn: 65215
* rename a function to indicate that it checks for profitability as wellChris Lattner2009-02-211-9/+36
| | | | | | | | 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
* Fix strange logic in CollectIVUsers used to determine whether all uses areEvan Cheng2009-02-201-1/+8
| | | | | | | addresses, part 1. This fixes an obvious logic bug. Previously if the only in-loop use is a PHI, it would return AllUsesAreAddresses as true. llvm-svn: 65178
* Simplify code and reduce indentation. No functionality change.Dan Gohman2009-02-201-80/+70
| | | | llvm-svn: 65167
* Fix 80-column violations.Dan Gohman2009-02-201-4/+5
| | | | llvm-svn: 65159
* It's not necessary to check if Base is null here.Dan Gohman2009-02-201-2/+1
| | | | llvm-svn: 65157
* Add a comment about how Imm can be used for loop-variant values.Dan Gohman2009-02-201-1/+2
| | | | llvm-svn: 65147
* Factor address mode matcher out of codegen prepare to make it available to ↵Evan Cheng2009-02-202-643/+594
| | | | | | other passes, e.g. loop strength reduction. llvm-svn: 65134
* Just roll back the previous change to -mem2reg.Zhou Sheng2009-02-201-26/+0
| | | | | | Will re-think about this according to Chris's comments. llvm-svn: 65126
* patch to update the line number information in pass -mem2reg.Zhou Sheng2009-02-201-0/+26
| | | | | | | | Currently this pass will delete the variable declaration info, and keep the line number info. But the kept line number info is not updated, and some is redundant or not correct, this patch just updates those info. llvm-svn: 65123
* Implement "superhero" strength reduction, or full strengthDan Gohman2009-02-201-109/+344
| | | | | | | | | | | | | | | | | 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 DEBUG() instead of passing *DOUT to WriteAsOperand,Dan Gohman2009-02-191-17/+7
| | | | | | | since the latter just passes a null reference when debugging is not enabled. llvm-svn: 65060
* Make the debug output of LSR less cryptic and more informative.Dan Gohman2009-02-191-29/+46
| | | | llvm-svn: 65057
* In theory the aliasee may have dead constant usersDuncan Sands2009-02-181-0/+1
| | | | | | | | here. Since we only do the transform if there is one use, strip off any such users in the hope of making the transform fire more often. llvm-svn: 64926
* Use a sign-extend instead of a zero-extend when promoting aDan Gohman2009-02-181-15/+39
| | | | | | | | | | | | 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
* Simplify by using dyn_cast instead of isa and cast.Dan Gohman2009-02-181-6/+5
| | | | llvm-svn: 64917
* Add explicit keywords.Dan Gohman2009-02-181-2/+2
| | | | llvm-svn: 64915
* Eliminate several more unnecessary intptr_t casts.Dan Gohman2009-02-181-1/+1
| | | | llvm-svn: 64888
* Fix a corner case in the new indvars promotion logic: if thereDan Gohman2009-02-181-19/+25
| | | | | | | | | | 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
* Fix a typo in a comment.Dan Gohman2009-02-181-1/+1
| | | | llvm-svn: 64859
* If an alias is dead and so is its aliasee, then globaldce wouldDuncan Sands2009-02-171-8/+16
| | | | | | | crash because the alias would still be using the aliasee when the aliasee was deleted. llvm-svn: 64844
* LoopIndexSplit doesn't actually use ScalarEvolution.Dan Gohman2009-02-171-4/+1
| | | | llvm-svn: 64811
* Add a method to ScalarEvolution for telling it when a loop has beenDan Gohman2009-02-171-9/+16
| | | | | | | | | | | modified in a way that may effect the trip count calculation. Change IndVars to use this method when it rewrites pointer or floating-point induction variables instead of using a doInitialization method to sneak these changes in before ScalarEvolution has a chance to see the loop. This eliminates the need for LoopPass to depend on ScalarEvolution. llvm-svn: 64810
* commit a tweaked version of Daniel's patch for PR3599. We nowChris Lattner2009-02-171-26/+29
| | | | | | | 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
* Delete trailing whitespace.Dan Gohman2009-02-171-34/+34
| | | | llvm-svn: 64784
* This transform also applies to private linkage.Duncan Sands2009-02-171-2/+2
| | | | llvm-svn: 64773
* Fix 80-column violation.Dan Gohman2009-02-171-1/+2
| | | | llvm-svn: 64766
* Strengthen the "non-constant stride must dominate loop preheader" check.Evan Cheng2009-02-171-9/+4
| | | | llvm-svn: 64703
* Simplify; fix some 80-column violations.Dan Gohman2009-02-171-6/+7
| | | | llvm-svn: 64702
OpenPOWER on IntegriCloud