[PATCH] D123962: [InstCombine] fold freeze of partial undef/poison vector constants

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 18 15:18:57 PDT 2022


nikic added a comment.

For vector constants with some undef elements, wouldn't we be better off picking an existing (non-undef) vector element? That would be especially profitable if we can produce a splat vector constant.

In D123962#3457622 <https://reviews.llvm.org/D123962#3457622>, @lebedev.ri wrote:

> Given that we are replacing `freeze constant` with `constant`, and selecting the constant based on all the users,
> can we instead go over all the users, and perform replacement for each one separately, always picking the best choice?

Unless I'm misunderstanding what you're suggesting here, this is not legal: The value has to be chosen to be the same for all users.


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

https://reviews.llvm.org/D123962



More information about the llvm-commits mailing list