[PATCH] D98144: [CodeGenPrepare] Fix isIVIncrement (PR49466)

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 8 20:17:04 PST 2021


mkazantsev accepted this revision.
mkazantsev added a comment.
This revision is now accepted and ready to land.

Thanks for catching this. Indeed, this fact was checked before my patch and was lost during the refactoring. LGTM with nits.



================
Comment at: llvm/lib/CodeGen/CodeGenPrepare.cpp:1350
     const Loop *L = LI->getLoopFor(BO->getParent());
+    assert(L && "L should not be null after isIVIncrement()\n");
     // IV increment may have other users than the IV. We do not want to make
----------------
nit: \n not needed.


================
Comment at: llvm/test/CodeGen/X86/pr49466.ll:1
+; REQUIRES: asserts
+; RUN: opt < %s -O2 -codegenprepare
----------------
If the test is expected to pass, it doesn't really need `REQUIRES: asserts`


================
Comment at: llvm/test/CodeGen/X86/pr49466.ll:2
+; REQUIRES: asserts
+; RUN: opt < %s -O2 -codegenprepare
+
----------------
`| Filecheck %s` + `; CHECK-LABEL: @m(` if all you want to check is a no-crash.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98144



More information about the llvm-commits mailing list