[PATCH] D37569: Rework loop predication pass
Max Kazantsev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 11 05:21:48 PDT 2017
mkazantsev added inline comments.
================
Comment at: lib/Transforms/Scalar/LoopPredication.cpp:306
+ };
+ assert(CanExpand(Start) && "Must be able to expand Start!");
+ if (!CanExpand(LatchCheck.Limit) || !CanExpand(RangeCheck->Limit))
----------------
Why do we need to expand `Start`? It comes from above the loop, we should be able to reuse it.
================
Comment at: lib/Transforms/Scalar/LoopPredication.cpp:415
+
+ if (!Result->IV->isAffine()) {
+ DEBUG(dbgs() << "The induction variable is not affine!\n");
----------------
Doesn't check on `isOne()` automatically check affinity?
================
Comment at: lib/Transforms/Scalar/LoopPredication.cpp:422
+ if (!Step->isOne()) {
+ DEBUG(dbgs() << "Unsupported loop stride(" << Step << ")!\n");
+ return None;
----------------
Should be `*Step`.
Repository:
rL LLVM
https://reviews.llvm.org/D37569
More information about the llvm-commits
mailing list