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 1818#include " llvm/Analysis/LoopIterator.h"
1919#include " llvm/Analysis/ScalarEvolution.h"
2020#include " llvm/Analysis/ScalarEvolutionExpressions.h"
21+ #include " llvm/Analysis/ScalarEvolutionPatternMatch.h"
2122#include " llvm/Analysis/TargetTransformInfo.h"
2223#include " llvm/IR/BasicBlock.h"
2324#include " llvm/IR/Dominators.h"
4546
4647using namespace llvm ;
4748using namespace llvm ::PatternMatch;
49+ using namespace llvm ::SCEVPatternMatch;
4850
4951#define DEBUG_TYPE " loop-peel"
5052
@@ -351,8 +353,8 @@ bool llvm::canPeelLastIteration(const Loop &L, ScalarEvolution &SE) {
351353 m_BasicBlock (Succ1), m_BasicBlock (Succ2))) &&
352354 ((Pred == CmpInst::ICMP_EQ && Succ2 == L.getHeader ()) ||
353355 (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)) );
356358}
357359
358360// / 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