[PATCH] D45150: Less conservative LoopSafetyInfo for headers

Krzysztof Pszeniczny via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 5 10:00:32 PDT 2018


amharc added inline comments.


================
Comment at: llvm/include/llvm/Analysis/MustExecute.h:43
+  bool HeaderMayThrow = false;
+  const Instruction* FirstThrowingHeaderInstruction = nullptr;
+
----------------
This still tracks neither deletions nor RAUWs.


================
Comment at: llvm/include/llvm/Analysis/MustExecute.h:50
+
+  bool isHeaderInstructionGuaranteeToExecute(const Instruction* Instr,
+                                             const Loop *CurLoop) const;
----------------
nit: Guarantee -> Guaranteed


================
Comment at: llvm/lib/Analysis/MustExecute.cpp:283
+  for (const auto &HeaderInstr : *CurLoop->getHeader()) {
+    if (&HeaderInstr == FirstThrowingHeaderInstruction)
+      return false;
----------------
Wouldn't checking `isGuaranteedToTransferExecutionToSuccessor(&HeaderInstr)` be somewhat less error-prone wrt. deletions, RAUWs etc., especially since the header is already being scanned from the beginning?


Repository:
  rL LLVM

https://reviews.llvm.org/D45150





More information about the llvm-commits mailing list