[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
Wed Jan 26 02:04:26 PST 2022


nlopes added a comment.

In D117907#3271648 <https://reviews.llvm.org/D117907#3271648>, @nikic wrote:

> It looks like the current behavior matches what GVN does: https://llvm.godbolt.org/z/eTYzMjKf7
>
> If an issue affects both GVN and NewGVN, please always fix it in GVN first. Otherwise the fix will remain untested, and this seems like a situation where it can cause a real regression in optimization quality (because we still treat uninit loads as undef, not poison).

The bug is not in GVN itself, it's in InstSimplify (which is called by GVNPass::processInstruction).
I do have a patch for InstSimplify as well, but given the potential to regress performance, I would rather delay that until after the LLVM 14 branch.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D117907/new/

https://reviews.llvm.org/D117907



More information about the llvm-commits mailing list