[PATCH] D127146: [LoopFlatten] Check for null result after dyn_cast.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 6 13:48:24 PDT 2022


fhahn added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/LoopFlatten.cpp:414
   Increment =
       dyn_cast<BinaryOperator>(InductionPHI->getIncomingValueForBlock(Latch));
+  if (!Increment || Increment->hasNUsesOrMore(3)) {
----------------
I *think* this must by a binary op at the moment, is maybe it's possible to just use `cast`. If it triggers, we will at least have a test case :) 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D127146



More information about the llvm-commits mailing list