[PATCH] D45617: [IRCE] Only check for NSW on equality predicates

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 4 00:42:44 PDT 2018


mkazantsev added inline comments.


================
Comment at: llvm/trunk/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp:928
+  const SCEV* StepRec = IndVarBase->getStepRecurrence(SE);
+  ConstantInt *StepCI = dyn_cast<SCEVConstant>(StepRec)->getValue();
+  if (!StepCI) {
----------------
Hi Sam, there is a bug here. dyn_cast may return nullptr and then we still access it, which is UB. I've fixed it in https://reviews.llvm.org/rL331508. Please review post-commit if you can.


Repository:
  rL LLVM

https://reviews.llvm.org/D45617





More information about the llvm-commits mailing list