[PATCH] D94494: canCreateUndefOrPoison: dyn_cast -> dyn_cast_or_null

Markus Lavin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 13 01:28:50 PST 2021


markus added a comment.

In D94494#2494746 <https://reviews.llvm.org/D94494#2494746>, @aqjune wrote:

> Thanks!
> Yes, a test should be added.
> I guess
>
>   ashr <4 x i16> %induction, select (i1 icmp sgt (i16 ptrtoint (i16* @c to i16), i16 1), <4 x i16> zeroinitializer, <4 x i16> <i16 ptrtoint (i16* @c to i16), i16 ptrtoint (i16* @c to i16), i16 ptrtoint (i16* @c to i16), i16 ptrtoint (i16* @c to i16)>)
>
> is the problematic part?
> If it is non-trivial to further reduce the input, you can also add this instruction to the list at ValueTrackingTest.cpp 's `TEST(ValueTracking, canCreatePoisonOrUndef)`.

Yes that is the problematic part. I think it makes most sense to add as a targeted unit-test for the specific function as below. Unfortunately the IR line is a bit messy but I was not able to simplify it any further. I guess it needs to be something that is considered a Constant but yet does not simplify to an "actual" Constant during import.


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

https://reviews.llvm.org/D94494



More information about the llvm-commits mailing list