[PATCH] D94996: [GVN] do not repeat PRE on failure to split critical edge

Nick Desaulniers via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 19 12:50:27 PST 2021


nickdesaulniers created this revision.
nickdesaulniers added reviewers: void, jyknight, efriedma.
Herald added subscribers: pengfei, hiraditya.
nickdesaulniers requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Fixes an infinite loop encountered in GVN.

GVN will delay PRE if it encounters critical edges, and attempt to split
them later via calls to SplitCriticalEdge(), then restarting.

The caller of GVN::splitCriticalEdges() assumed a return value of true
meant that critical edges were split, that the IR had changed, and that
PRE should be re-attempted, upon which we loop infinitely.

This was exposed after D88438 <https://reviews.llvm.org/D88438>, by compiling the Linux kernel for s390,
but the test case is reproducible on x86.

Fixes: https://github.com/ClangBuiltLinux/linux/issues/1261


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D94996

Files:
  llvm/lib/Transforms/Scalar/GVN.cpp
  llvm/test/Transforms/GVN/critical-edge-split-failure.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D94996.317663.patch
Type: text/x-patch
Size: 4687 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210119/cd740d09/attachment.bin>


More information about the llvm-commits mailing list