[PATCH] D95789: [SpeculateAroundPHIs] Avoid speculation on loop back edges

Bjorn Pettersson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 4 12:39:23 PST 2021


bjope added a comment.

In D95789#2575065 <https://reviews.llvm.org/D95789#2575065>, @Meinersbur wrote:

> Some passes passes might not handle critical edges, in addition to SpeculateAroundPHIs . Wouldn't it be simpler to fix `llvm::SplitCriticalEdge` to make it put the loop metadata to the correct branch?

That could perhaps be a long-term solution, although I'm not familiar with all uses of SplitCriticalEdge to know if it is feasible (I figure that sometimes the metadata should be updated as well, not only being moved).
Other passes, e.g. LoopRotate, is handling loop metadata "manually". But maybe there are other passes using SplitCriticalEdge that also suffer from not updating loop metadata.

In this patch I put  focused on getting rid of the "bug" (having loop metadata on the wrong branch should ideally be caught be the verifier but as I recall it isn't that easy to verify).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D95789



More information about the llvm-commits mailing list