[PATCH] D143593: [InstCombine] Don't fold freeze poison when it's used in shufflevector

Manuel Brito via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 17 11:41:12 PST 2023


ManuelJBrito added a comment.

In D143593#4130108 <https://reviews.llvm.org/D143593#4130108>, @spatel wrote:

> What if we squash any cast of freeze(poison) into the freeze itself as an addition to `getUndefReplacement()`:
> https://alive2.llvm.org/ce/z/o7J2JS
>
> That would give us a far-fetched improvement on something like this:
> https://alive2.llvm.org/ce/z/hC_Gws
> ...so that could be an independent patch before the shuffle hack.

I think this would work great! The main hurdle is that getUndefReplacement's users expect a Constant.
In particular Constant::replaceUndefsWith, so I would have to change the return type of getUndefReplacement to Value and also change Constant::replaceUndefsWith to a take a Value as a Replacement.
I'm not sure which option is more desirable, the current patch or your suggestion.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D143593



More information about the llvm-commits mailing list