|
1 | 1 | ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 6 |
2 | 2 | ; RUN: opt < %s -passes=instcombine -S | FileCheck %s |
3 | 3 |
|
4 | | -define void @test_undef(float %b, ptr %p) { |
5 | | -; CHECK-LABEL: define void @test_undef( |
6 | | -; CHECK-SAME: float [[B:%.*]], ptr [[P:%.*]]) { |
7 | | -; CHECK-NEXT: [[TMP1:%.*]] = load <8 x float>, ptr [[P]], align 32 |
8 | | -; CHECK-NEXT: [[TMP2:%.*]] = fptosi float [[B]] to i32 |
9 | | -; CHECK-NEXT: [[TMP3:%.*]] = add i32 [[TMP2]], -2 |
10 | | -; CHECK-NEXT: [[TMP4:%.*]] = extractelement <8 x float> [[TMP1]], i32 [[TMP3]] |
11 | | -; CHECK-NEXT: [[TMP5:%.*]] = fptosi float [[TMP4]] to i32 |
12 | | -; CHECK-NEXT: [[TMP6:%.*]] = insertelement <8 x i32> <i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 poison>, i32 [[TMP5]], i64 7 |
13 | | -; CHECK-NEXT: [[TMP7:%.*]] = sitofp <8 x i32> [[TMP6]] to <8 x float> |
14 | | -; CHECK-NEXT: store <8 x float> [[TMP7]], ptr [[P]], align 32 |
15 | | -; CHECK-NEXT: ret void |
16 | | -; |
17 | | - %1 = load <8 x float>, ptr %p |
18 | | - %2 = bitcast <8 x float> %1 to <8 x i32> |
19 | | - %3 = bitcast <8 x i32> %2 to <8 x float> |
20 | | - %a = fptosi <8 x float> %3 to <8 x i32> |
21 | | - %4 = fptosi float %b to i32 |
22 | | - %5 = add i32 %4, -2 |
23 | | - %6 = extractelement <8 x i32> %a, i32 %5 |
24 | | - %7 = insertelement <8 x i32> undef, i32 %6, i32 7 |
25 | | - %8 = sitofp <8 x i32> %7 to <8 x float> |
26 | | - store <8 x float> %8, ptr %p |
27 | | - ret void |
28 | | -} |
29 | | - |
30 | 4 | define void @test_poison(float %b, ptr %p) { |
31 | 5 | ; CHECK-LABEL: define void @test_poison( |
32 | 6 | ; CHECK-SAME: float [[B:%.*]], ptr [[P:%.*]]) { |
@@ -91,21 +65,17 @@ entry: |
91 | 65 | %r = call <4 x float> @llvm.x86.sse41.round.ps(<4 x float> %in, i32 9) |
92 | 66 | %vi = fptosi <4 x float> %r to <4 x i32> |
93 | 67 | br label %loop |
94 | | - |
95 | 68 | loop: |
96 | 69 | %i = phi i32 [ 0, %entry ], [ %next, %latch ] |
97 | 70 | %cond = icmp ult i32 %i, 4 |
98 | 71 | br i1 %cond, label %body, label %done |
99 | | - |
100 | 72 | body: |
101 | 73 | %elem = extractelement <4 x i32> %vi, i32 %i |
102 | 74 | call void @use(i32 %elem) |
103 | 75 | br label %latch |
104 | | - |
105 | 76 | latch: |
106 | 77 | %next = add i32 %i, 1 |
107 | 78 | br label %loop |
108 | | - |
109 | 79 | done: |
110 | 80 | ret void |
111 | 81 | } |
0 commit comments