Using poison constant as a don't-care value when emitting/optimizing vector operations

Hello all,

Currently, undef is used as a don’t-care value for vector operations, which causes hard problems.
For example, a shufflevector sometimes cannot be optimized away ( The reason is that undef is not undefined enough.

To avoid such problem, I’d like to suggest using poison constant for vector operations’ placeholder instead.
I made a patch that updates InstCombine’s SimplifyDemandedVectorElts here, with a detailed description:


Thank you for doing this, it seems the right thing to me.