test/Transforms/InstSimplify/call.ll contains a few incorrect transformations when undef is involved. For example, when %v is zero, there's no overflow, so can't fold this to undef: define {i8, i1} @test_uadd3(i8 %v) { %0: %result = uadd_overflow i8 %v, undef ret {i8, i1} %result } => define {i8, i1} @test_uadd3(i8 %v) { %0: ret {i8, i1} undef } Transformation doesn't verify! ERROR: Value mismatch Example: i8 %v = #x00 (0) Source: {i8, i1} %result = { ?, #x0 } Target: Source value: { ?, #x0 } Target value: { #x00, #x1 }
https://reviews.llvm.org/D63065
(In reply to Nikita Popov from comment #1) > https://reviews.llvm.org/D63065 Yep, undef is uh, mindmelting. @Nuno - to summarize, and check myself - am i correct that we can fold the entire `{u,s}{add,sub}.with.overflow(%a, undef)` to `{undef, 0}`? To me, we can as per https://github.com/AliveToolkit/alive2/issues/71#issuecomment-502461113 But is that checking what i think it is checking? If not, alive is missing `insertvalue` i guess?
(In reply to Roman Lebedev from comment #2) > (In reply to Nikita Popov from comment #1) > > https://reviews.llvm.org/D63065 > > Yep, undef is uh, mindmelting. > > @Nuno - to summarize, and check myself - am i correct that we > can fold the entire `{u,s}{add,sub}.with.overflow(%a, undef)` to `{undef, > 0}`? > > To me, we can as per > https://github.com/AliveToolkit/alive2/issues/71#issuecomment-502461113 > But is that checking what i think it is checking? > If not, alive is missing `insertvalue` i guess? It is proving exactly what you want; the transformation you mention is correct per the `undef` semantics. You can fold to `{undef, 0}`.
I didn't check with alive-tv, so if this suddenly is still incorrect, do CC me in the new bug (: