[PATCH] D113897: [GVNSink] Make GVNSink resistant against self referencing instructions (PR36954)

Dawid Jurczak via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 15 07:15:40 PST 2021


yurai007 created this revision.
yurai007 added reviewers: jmolloy, jeroen.dobbelaere, jnspaulsson, nikic, lebedev.ri, xbolva00.
Herald added a subscriber: hiraditya.
yurai007 requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Before this change GVNSink pass suffers from stack overflow while processing self referenced instruction in unreachable BB.
According [1] and [2] it's reasonable to make pass resistant against self referencing instructions.
To fix issue we skip sinking analysis for block in which such instruction is detected.

[1] https://groups.google.com/g/llvm-dev/c/843Tig9IzwA
[2] https://lists.llvm.org/pipermail/llvm-dev/2015-February/082629.html


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D113897

Files:
  llvm/lib/Transforms/Scalar/GVNSink.cpp
  llvm/test/Transforms/GVNSink/sink-common-code.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D113897.387250.patch
Type: text/x-patch
Size: 6018 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211115/d9cbb74e/attachment.bin>


More information about the llvm-commits mailing list