File tree Expand file tree Collapse file tree 1 file changed +10
-15
lines changed
llvm/lib/Transforms/Vectorize Expand file tree Collapse file tree 1 file changed +10
-15
lines changed Original file line number Diff line number Diff line change @@ -32,22 +32,17 @@ bool vputils::onlyScalarValuesUsed(const VPValue *Def) {
3232}
3333
3434VPValue *vputils::getOrCreateVPValueForSCEVExpr (VPlan &Plan, const SCEV *Expr) {
35- VPValue *Expanded = nullptr ;
3635 if (auto *E = dyn_cast<SCEVConstant>(Expr))
37- Expanded = Plan.getOrAddLiveIn (E->getValue ());
38- else {
39- auto *U = dyn_cast<SCEVUnknown>(Expr);
40- // Skip SCEV expansion if Expr is a SCEVUnknown wrapping a non-instruction
41- // value. Otherwise the value may be defined in a loop and using it directly
42- // will break LCSSA form. The SCEV expansion takes care of preserving LCSSA
43- // form.
44- if (U && !isa<Instruction>(U->getValue ())) {
45- Expanded = Plan.getOrAddLiveIn (U->getValue ());
46- } else {
47- Expanded = new VPExpandSCEVRecipe (Expr);
48- Plan.getEntry ()->appendRecipe (Expanded->getDefiningRecipe ());
49- }
50- }
36+ return Plan.getOrAddLiveIn (E->getValue ());
37+ // Skip SCEV expansion if Expr is a SCEVUnknown wrapping a non-instruction
38+ // value. Otherwise the value may be defined in a loop and using it directly
39+ // will break LCSSA form. The SCEV expansion takes care of preserving LCSSA
40+ // form.
41+ auto *U = dyn_cast<SCEVUnknown>(Expr);
42+ if (U && !isa<Instruction>(U->getValue ()))
43+ return Plan.getOrAddLiveIn (U->getValue ());
44+ auto *Expanded = new VPExpandSCEVRecipe (Expr);
45+ Plan.getEntry ()->appendRecipe (Expanded);
5146 return Expanded;
5247}
5348
You can’t perform that action at this time.
0 commit comments