[PATCH] D136095: [GVN] Patch for invalid GVN replacement

Alex Gatea via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 17 10:25:38 PDT 2022


alexgatea created this revision.
alexgatea added a project: LLVM.
Herald added a subscriber: hiraditya.
Herald added a project: All.
alexgatea requested review of this revision.
Herald added a subscriber: llvm-commits.

The way in which GVNPass is currently replacing uses of an instruction is incorrect because it's not considering the possibility that both the replacement and the use are in the same block with the replacement coming after the use. Prior to this patch, this results in an invalid dominator tree in the LIT test provided.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D136095

Files:
  llvm/lib/Transforms/Scalar/GVN.cpp
  llvm/test/Transforms/GVN/PRE/load-pre-identical-branches.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D136095.468249.patch
Type: text/x-patch
Size: 4315 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221017/52006a49/attachment.bin>


More information about the llvm-commits mailing list