[PATCH] D99853: [InstSimplify] Teach isUndefValue to understand const vector with both undef & poison

Juneyoung Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 7 22:39:40 PDT 2021


aqjune added a comment.

In D99853#2667983 <https://reviews.llvm.org/D99853#2667983>, @nikic wrote:

> This problem isn't really limited to this one function in InstSimplify. Might it make sense to adjust UndefValue to actually represent such constants? We'd have to add a bitmask to it that indicates which values are poison.

Hi,
There is ConstantStruct as well, so to make support that case UndefValue needs to store individual elements, I guess.

What do you think about updating `m_Undef` pattern matcher to recognize constants like `<undef, poison>` & replacing `isa<UndefValue>(V)` with `match(V, m_Undef())`? 
The benefit is that we don't need to add to UndefValue the data structures ConstantAggregate is having.

p.s:  BTW, `ConstantStruct::get` and `ConstantArray::getImpl` are not returning `poison` even if all elements are poison. I'll make a commit that applies the change that was made to `ConstantVector::getImpl` in the past.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D99853



More information about the llvm-commits mailing list