[PATCH] D40808: [RISCV] Implement branch analysis

Alex Bradbury via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 13 09:36:38 PST 2017


asb added inline comments.


================
Comment at: lib/Target/RISCV/RISCVInstrInfo.cpp:190
+  // If there are three terminators, we don't know what sort of block this is.
+  if (SecondLastInst && I != MBB.begin() && isUnpredicatedTerminator(*--I))
+    return true;
----------------
glasnak wrote:
> isn't SecondLastInst always true?
I believe you're right - thanks. `I` is only decremented in cases where `I != MBB.begin()` so is always valid, so there's no reason SecondLastInst should ever be NULL. Other code in this function also freely assumes SecondLastInst is non-null.


https://reviews.llvm.org/D40808





More information about the llvm-commits mailing list