When we do extractvalue (any_mul_with_overflow X, -1) --> (-X and icmp),
which left partly failed to match vector constant with poison element.
This patch try to fix it.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Transforms/InstCombine/InstructionCombining.cpp | ||
---|---|---|
3295 | It seems that the tests we fix in this patch can also test for this transform, and I add Alive2 conform in summary. |
LGTM - see inline for an extra test request.
llvm/lib/Transforms/InstCombine/InstructionCombining.cpp | ||
---|---|---|
3295 | Ah, sorry - I didn't notice that the test diffs showed the transform was partly enabled (because m_AllOnes accepts undef). It would still be good to have an explicit test for this path, so please add a test like this with "not-negative-one" constant: define <4 x i1> @smul_neg1_vec_poison(<4 x i8> %x) { %m = call { <4 x i8>, <4 x i1> } @llvm.smul.with.overflow.v4i8(<4 x i8> %x, <4 x i8> <i8 -3, i8 -3, i8 poison, i8 -3>) %ov = extractvalue { <4 x i8>, <4 x i1> } %m, 1 ret <4 x i1> %ov } |
Nit: that's a lot of capital letters. Just leave this named "C"?