[PATCH] D93793: [IR] Let IRBuilder's CreateVectorSplat/CreateShuffleVector use poison as placeholder

Juneyoung Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 5 06:31:13 PST 2022


aqjune added a comment.

In D93793#3221414 <https://reviews.llvm.org/D93793#3221414>, @Allen wrote:

> I have a babyism question, why poison is preferred to the undef in the pattern ConstantVector::getSplat ?

Hi Allen,
It is because folding poison is easier than folding undef. :)
For example, according to the poison propagating rule, 'and i32 poison, 1' can be simplified into 'i32 poison'. However, 'and undef, 1' cannot be folded into 'undef' since the mask enforces all bits but LSB 0. 
This patch helps simplifications happen more easily.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D93793



More information about the llvm-commits mailing list