Skip to content

Commit b8e3d80

Browse files
committed
[InstCombine] Add test for incorrect shuffle of unop transform (NFC)
1 parent 2f1e232 commit b8e3d80

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

llvm/test/Transforms/InstCombine/vec_shuffle.ll

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1280,6 +1280,18 @@ define <2 x float> @fneg(<2 x float> %x) {
12801280
ret <2 x float> %r
12811281
}
12821282

1283+
; FIXME: This is a miscompile.
1284+
define <2 x float> @fneg_not_single_source(<2 x float> %x) {
1285+
; CHECK-LABEL: @fneg_not_single_source(
1286+
; CHECK-NEXT: [[TMP1:%.*]] = shufflevector <2 x float> [[X:%.*]], <2 x float> poison, <2 x i32> <i32 0, i32 poison>
1287+
; CHECK-NEXT: [[SPLAT:%.*]] = fneg <2 x float> [[TMP1]]
1288+
; CHECK-NEXT: ret <2 x float> [[SPLAT]]
1289+
;
1290+
%neg = fneg <2 x float> %x
1291+
%splat = shufflevector <2 x float> %neg, <2 x float> undef, <2 x i32> <i32 0, i32 2>
1292+
ret <2 x float> %splat
1293+
}
1294+
12831295
define <2 x float> @fmul_splat_constant(<2 x float> %x) {
12841296
; CHECK-LABEL: @fmul_splat_constant(
12851297
; CHECK-NEXT: [[TMP1:%.*]] = fmul <2 x float> [[X:%.*]], <float 4.200000e+01, float poison>

0 commit comments

Comments
 (0)