[PATCH] D102234: [SimpleLoopBoundSplit] Split Bound of Loop which has conditional branch with IV

JinGu Kang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 2 08:14:04 PDT 2021


jaykang10 added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/LoopBoundSplit.cpp:131
+  // Allowed constant step.
+  if (!isa<SCEVConstant>(StepRecSCEV))
+    return false;
----------------
jaykang10 wrote:
> mkazantsev wrote:
> > ```
> > ConstantInt *StepCI = dyn_cast<SCEVConstant>(StepRecSCEV)->getValue();
> > if (!StepCI || !StepCI->isPositive())
> >   return false;
> > ...
> > ```
> > 
> It looked there is no `isPositive` in ConstantInt. I will update it with isNegative() and isZero(),
Sorry, I have found a test which has StepRecSCEV is not SCEVConstant. In this case, the nullptr->getValue() causes segment fault. I will re-update it.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102234/new/

https://reviews.llvm.org/D102234



More information about the llvm-commits mailing list