[PATCH] D86589: (Expensive) Check for Loop, SCC and Region pass return status

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 3 03:08:39 PDT 2020


fhahn added inline comments.


================
Comment at: llvm/lib/IR/StructuralHash.cpp:51
+
+      const Instruction *Term = BB->getTerminator();
+      for (unsigned i = 0, e = Term->getNumSuccessors(); i != e; ++i) {
----------------
uabelho wrote:
> Hi!
> What if the BB doesn't have a terminator at all? Then Term will be nullptr which I don't think is good..
> 
> (This happens for us in the unit test PassManager.CallGraphUpdater0 with expensive checks when we run in our downstream clone)
I'd assume this should only be called for valid IR, which means there must be terminator? 

Unrelated, but could this just be something like `for (auto &Succ : successors(BB)) {`?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86589



More information about the llvm-commits mailing list