[all-commits] [llvm/llvm-project] d36812: [GVN] do not repeat PRE on failure to split critic...

Nick Desaulniers via All-commits all-commits at lists.llvm.org
Mon Jan 25 11:29:06 PST 2021


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: d36812892c16b551f058774babbc8727737f80cd
      https://github.com/llvm/llvm-project/commit/d36812892c16b551f058774babbc8727737f80cd
  Author: Nick Desaulniers <ndesaulniers at google.com>
  Date:   2021-01-25 (Mon, 25 Jan 2021)

  Changed paths:
    M llvm/lib/Transforms/Scalar/GVN.cpp
    A llvm/test/Transforms/GVN/critical-edge-split-failure.ll

  Log Message:
  -----------
  [GVN] do not repeat PRE on failure to split critical edge

Fixes an infinite loop encountered in GVN.

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

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, by compiling the Linux kernel for s390,
but the test case is reproducible on x86.

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

Reviewed By: void

Differential Revision: https://reviews.llvm.org/D94996




More information about the All-commits mailing list