File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
llvm/lib/Transforms/Utils Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 18
18
#include " llvm/Analysis/LoopIterator.h"
19
19
#include " llvm/Analysis/ScalarEvolution.h"
20
20
#include " llvm/Analysis/ScalarEvolutionExpressions.h"
21
+ #include " llvm/Analysis/ScalarEvolutionPatternMatch.h"
21
22
#include " llvm/Analysis/TargetTransformInfo.h"
22
23
#include " llvm/IR/BasicBlock.h"
23
24
#include " llvm/IR/Dominators.h"
45
46
46
47
using namespace llvm ;
47
48
using namespace llvm ::PatternMatch;
49
+ using namespace llvm ::SCEVPatternMatch;
48
50
49
51
#define DEBUG_TYPE " loop-peel"
50
52
@@ -351,8 +353,8 @@ bool llvm::canPeelLastIteration(const Loop &L, ScalarEvolution &SE) {
351
353
m_BasicBlock (Succ1), m_BasicBlock (Succ2))) &&
352
354
((Pred == CmpInst::ICMP_EQ && Succ2 == L.getHeader ()) ||
353
355
(Pred == CmpInst::ICMP_NE && Succ1 == L.getHeader ())) &&
354
- isa<SCEVAddRecExpr> (SE.getSCEV (Inc)) &&
355
- cast<SCEVAddRecExpr>(SE. getSCEV (Inc))-> getStepRecurrence (SE)-> isOne ( );
356
+ match (SE.getSCEV (Inc),
357
+ m_scev_AffineAddRec ( m_SCEV (), m_scev_One (), m_SpecificLoop (&L)) );
356
358
}
357
359
358
360
// / Returns true if the last iteration can be peeled off and the condition (Pred
You can’t perform that action at this time.
0 commit comments