Test: Transforms/InstSimplify/insertelement.ll Summary: We can't remove insertelement undef to a vector, since it may be replacing a poison value. define <4 x i32> @PR1286(<4 x i32> %A) { %B = insertelement <4 x i32> %A, i32 undef, i32 1 ret <4 x i32> %B } => define <4 x i32> @PR1286(<4 x i32> %A) { ret <4 x i32> %A } Transformation doesn't verify! ERROR: Target is more poisonous than source Example: <4 x i32> %A = < poison, poison, poison, poison > Source: <4 x i32> %B = < poison, undef, poison, poison > Target: Source value: < poison, undef, poison, poison > Target value: < poison, poison, poison, poison > Report: https://web.ist.utl.pt/nuno.lopes/alive2/index.php?hash=ed3ac07d4817b221&test=Transforms%2FInstSimplify%2Finsertelement.ll
Removed the unsafe fold: https://github.com/llvm/llvm-project/commit/5486e00dc3e3bb9969f1e8dbddfd18bb92c99e56 And added back a safe version: https://github.com/llvm/llvm-project/commit/57f0eed98d02cd684c358a45f68e716179f4bfa3
(In reply to Sanjay Patel from comment #1) > Removed the unsafe fold: > https://github.com/llvm/llvm-project/commit/ > 5486e00dc3e3bb9969f1e8dbddfd18bb92c99e56 > > And added back a safe version: > https://github.com/llvm/llvm-project/commit/ > 57f0eed98d02cd684c358a45f68e716179f4bfa3 I just wrote an issue about jump-threading not terminating after the above fixes: https://bugs.llvm.org/show_bug.cgi?id=48362