[llvm-bugs] [Bug 43958] New: shuffle undef mask on vectors with poison
via llvm-bugs
llvm-bugs at lists.llvm.org
Sun Nov 10 17:29:41 PST 2019
https://bugs.llvm.org/show_bug.cgi?id=43958
Bug ID: 43958
Summary: shuffle undef mask on vectors with poison
Product: libraries
Version: trunk
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P
Component: Scalar Optimizations
Assignee: unassignedbugs at nondot.org
Reporter: liuz at cs.utah.edu
CC: llvm-bugs at lists.llvm.org
A shuffle undef mask should select either of the elements. If one of them
happens to be poison, then the result can be poison. The langref [1] and a
transformation in instcombine seems forgot considering the poison case.
See below the transformation of insertelement to shufflevector. Assume the
function input %arg is poison, the target program shuffles the vector <poison,
undef, undef, undef> with mask <undef, 0, 0, 0>, the result should be <poison,
poison, poison, poison>, whereas the source program evaluates to <undef,
poison, poison, poison>. The target is more poisonous than the source.
llvm/test/Transforms/InstCombine/broadcast.ll
define <4 x float> @splat_undef1(float %arg) {
; CHECK-LABEL: @splat_undef1(
; CHECK-NEXT: [[TMP1:%.*]] = insertelement <4 x float> undef, float
[[ARG:%.*]], i32 0
; CHECK-NEXT: [[T6:%.*]] = shufflevector <4 x float> [[TMP1]], <4 x float>
undef, <4 x i32> <i32 undef, i32 0, i32 0, i32 0>
; CHECK-NEXT: ret <4 x float> [[T6]]
;
%t = insertelement <4 x float> undef, float %arg, i32 1
%t4 = insertelement <4 x float> %t, float %arg, i32 1
%t5 = insertelement <4 x float> %t4, float %arg, i32 2
%t6 = insertelement <4 x float> %t5, float %arg, i32 3
ret <4 x float> %t6
}
[1] https://llvm.org/docs/LangRef.html#id186
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20191111/bffd1b42/attachment-0001.html>
More information about the llvm-bugs
mailing list