[PATCH] D71383: [LoopGuard] Instructions in loop preheader and loop exit must be safe to execute speculatively.

Whitney Tsang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 12 07:17:52 PST 2019


Whitney added a comment.

> I think this restriction needs to be at least documented. But what's the reason for this restriction? Unless I am missing something, even if the instructions between the guard and the loop are not safe to speculate, the guard condition still applies to the loop, right?

Good point, it should be documented, changed the description in the .h file. Added a comment in the code to explain the reason. Right, the guard condition still applies to the loop, but let say in the preheader there exists an instruction which throw, then the loop is not executed even if it entered the guarded region. If I understand correctly, this is what people agreed upon in the loop group meeting.  In the loop group meeting, people also agreed to allow basic blocks without control flow and without unsafe instructions in between GuardBB and Preheader, and between ExitFromLatch  and GuardOtherSucc, which I will implement in the later PR.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71383





More information about the llvm-commits mailing list