diff options
author | Dan Gohman <gohman@apple.com> | 2009-06-24 01:18:18 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-06-24 01:18:18 +0000 |
commit | 423ed6c6dc35767b32747344561b0fa2791e0fd1 (patch) | |
tree | 0e7c7275525d07b2805e5da9b929fb820a2fd24b /include | |
parent | d2e271bb2000bc391c4dd6becb6961f7669ae56a (diff) | |
download | external_llvm-423ed6c6dc35767b32747344561b0fa2791e0fd1.zip external_llvm-423ed6c6dc35767b32747344561b0fa2791e0fd1.tar.gz external_llvm-423ed6c6dc35767b32747344561b0fa2791e0fd1.tar.bz2 |
Extend ScalarEvolution's multiple-exit support to compute exact
trip counts in more cases.
Generalize ScalarEvolution's isLoopGuardedByCond code to recognize
And and Or conditions, splitting the code out into an
isNecessaryCond helper function so that it can evaluate Ands and Ors
recursively, and make SCEVExpander be much more aggressive about
hoisting instructions out of loops.
test/CodeGen/X86/pr3495.ll has an additional instruction now, but
it appears to be due to an arbitrary register allocation difference.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74048 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Analysis/ScalarEvolution.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/llvm/Analysis/ScalarEvolution.h b/include/llvm/Analysis/ScalarEvolution.h index cc9f9cc..4286ec3 100644 --- a/include/llvm/Analysis/ScalarEvolution.h +++ b/include/llvm/Analysis/ScalarEvolution.h @@ -334,6 +334,12 @@ namespace llvm { /// found. BasicBlock* getPredecessorWithUniqueSuccessorForBB(BasicBlock *BB); + /// isNecessaryCond - Test whether the given CondValue value is a condition + /// which is at least as strict as the one described by Pred, LHS, and RHS. + bool isNecessaryCond(Value *Cond, ICmpInst::Predicate Pred, + const SCEV *LHS, const SCEV *RHS, + bool Inverse); + /// getConstantEvolutionLoopExitValue - If we know that the specified Phi is /// in the header of its containing loop, we know the loop executes a /// constant number of times, and the PHI node is just a recurrence |