[PATCH] D117907: [NewGVN] do phi(undef, x) -> x only if x is not poison

Nuno Lopes via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 21 09:36:23 PST 2022


nlopes created this revision.
nlopes added reviewers: asbirlea, fhahn.
Herald added subscribers: bollu, hiraditya.
nlopes requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

phi([undef, A], [x, B]) -> x is only correct x is guaranteed to be a non-poison value. Otherwise we would be changing an undef to poison in the branch A.

This patch fixes this bug in NewGVN.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D117907

Files:
  llvm/lib/Transforms/Scalar/NewGVN.cpp
  llvm/test/Transforms/NewGVN/completeness.ll
  llvm/test/Transforms/NewGVN/phi-edge-handling.ll
  llvm/test/Transforms/NewGVN/pr31682.ll
  llvm/test/Transforms/NewGVN/pr32403.ll
  llvm/test/Transforms/NewGVN/pr32838.ll
  llvm/test/Transforms/NewGVN/pr34135.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D117907.402022.patch
Type: text/x-patch
Size: 9278 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220121/70f9ba86/attachment.bin>


More information about the llvm-commits mailing list