https://bugs.llvm.org/show_bug.cgi?id=45481

            Bug ID: 45481
           Summary: Can't remove insertelement undef
           Product: libraries
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Keywords: miscompilation
          Severity: normal
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedb...@nondot.org
          Reporter: nunoplo...@sapo.pt
                CC: lebedev...@gmail.com, llvm-bugs@lists.llvm.org,
                    reg...@cs.utah.edu, spatel+l...@rotateright.com

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

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to