forked from OSchip/llvm-project
[CVP] Fix tests for clamp patterns (NFC)
These tests didn't test the pattern they were supposed to, because %a instead of %add was used in the select, which turned this into a normal min/max). Noticed this when commenting out the clamp handling code did not result in any test failures...
This commit is contained in:
parent
99682bc039
commit
019ae8220f
|
@ -532,7 +532,7 @@ define i1 @clamp_low1(i32 %a) {
|
|||
; CHECK: a_guard:
|
||||
; CHECK-NEXT: [[SEL_CMP:%.*]] = icmp eq i32 [[A]], 5
|
||||
; CHECK-NEXT: [[ADD:%.*]] = add nsw i32 [[A]], -1
|
||||
; CHECK-NEXT: [[SEL:%.*]] = select i1 [[SEL_CMP]], i32 5, i32 [[A]]
|
||||
; CHECK-NEXT: [[SEL:%.*]] = select i1 [[SEL_CMP]], i32 5, i32 [[ADD]]
|
||||
; CHECK-NEXT: ret i1 false
|
||||
; CHECK: out:
|
||||
; CHECK-NEXT: ret i1 false
|
||||
|
@ -544,7 +544,7 @@ entry:
|
|||
a_guard:
|
||||
%sel_cmp = icmp eq i32 %a, 5
|
||||
%add = add i32 %a, -1
|
||||
%sel = select i1 %sel_cmp, i32 5, i32 %a
|
||||
%sel = select i1 %sel_cmp, i32 5, i32 %add
|
||||
%res = icmp eq i32 %sel, 4
|
||||
ret i1 %res
|
||||
out:
|
||||
|
@ -559,7 +559,7 @@ define i1 @clamp_low2(i32 %a) {
|
|||
; CHECK: a_guard:
|
||||
; CHECK-NEXT: [[SEL_CMP:%.*]] = icmp ne i32 [[A]], 5
|
||||
; CHECK-NEXT: [[ADD:%.*]] = add nsw i32 [[A]], -1
|
||||
; CHECK-NEXT: [[SEL:%.*]] = select i1 [[SEL_CMP]], i32 [[A]], i32 5
|
||||
; CHECK-NEXT: [[SEL:%.*]] = select i1 [[SEL_CMP]], i32 [[ADD]], i32 5
|
||||
; CHECK-NEXT: ret i1 false
|
||||
; CHECK: out:
|
||||
; CHECK-NEXT: ret i1 false
|
||||
|
@ -571,7 +571,7 @@ entry:
|
|||
a_guard:
|
||||
%sel_cmp = icmp ne i32 %a, 5
|
||||
%add = add i32 %a, -1
|
||||
%sel = select i1 %sel_cmp, i32 %a, i32 5
|
||||
%sel = select i1 %sel_cmp, i32 %add, i32 5
|
||||
%res = icmp eq i32 %sel, 4
|
||||
ret i1 %res
|
||||
out:
|
||||
|
@ -586,7 +586,7 @@ define i1 @clamp_high1(i32 %a) {
|
|||
; CHECK: a_guard:
|
||||
; CHECK-NEXT: [[SEL_CMP:%.*]] = icmp eq i32 [[A]], 5
|
||||
; CHECK-NEXT: [[ADD:%.*]] = add nsw i32 [[A]], 1
|
||||
; CHECK-NEXT: [[SEL:%.*]] = select i1 [[SEL_CMP]], i32 5, i32 [[A]]
|
||||
; CHECK-NEXT: [[SEL:%.*]] = select i1 [[SEL_CMP]], i32 5, i32 [[ADD]]
|
||||
; CHECK-NEXT: ret i1 false
|
||||
; CHECK: out:
|
||||
; CHECK-NEXT: ret i1 false
|
||||
|
@ -598,7 +598,7 @@ entry:
|
|||
a_guard:
|
||||
%sel_cmp = icmp eq i32 %a, 5
|
||||
%add = add i32 %a, 1
|
||||
%sel = select i1 %sel_cmp, i32 5, i32 %a
|
||||
%sel = select i1 %sel_cmp, i32 5, i32 %add
|
||||
%res = icmp eq i32 %sel, 6
|
||||
ret i1 %res
|
||||
out:
|
||||
|
@ -613,7 +613,7 @@ define i1 @clamp_high2(i32 %a) {
|
|||
; CHECK: a_guard:
|
||||
; CHECK-NEXT: [[SEL_CMP:%.*]] = icmp ne i32 [[A]], 5
|
||||
; CHECK-NEXT: [[ADD:%.*]] = add nsw i32 [[A]], 1
|
||||
; CHECK-NEXT: [[SEL:%.*]] = select i1 [[SEL_CMP]], i32 [[A]], i32 5
|
||||
; CHECK-NEXT: [[SEL:%.*]] = select i1 [[SEL_CMP]], i32 [[ADD]], i32 5
|
||||
; CHECK-NEXT: ret i1 false
|
||||
; CHECK: out:
|
||||
; CHECK-NEXT: ret i1 false
|
||||
|
@ -625,7 +625,7 @@ entry:
|
|||
a_guard:
|
||||
%sel_cmp = icmp ne i32 %a, 5
|
||||
%add = add i32 %a, 1
|
||||
%sel = select i1 %sel_cmp, i32 %a, i32 5
|
||||
%sel = select i1 %sel_cmp, i32 %add, i32 5
|
||||
%res = icmp eq i32 %sel, 6
|
||||
ret i1 %res
|
||||
out:
|
||||
|
@ -641,7 +641,7 @@ define i1 @clamp_high3(i32 %a) {
|
|||
; CHECK: a_guard:
|
||||
; CHECK-NEXT: [[SEL_CMP:%.*]] = icmp ne i32 [[A]], 5
|
||||
; CHECK-NEXT: [[ADD:%.*]] = add nsw i32 [[A]], 100
|
||||
; CHECK-NEXT: [[SEL:%.*]] = select i1 [[SEL_CMP]], i32 [[A]], i32 5
|
||||
; CHECK-NEXT: [[SEL:%.*]] = select i1 [[SEL_CMP]], i32 [[ADD]], i32 5
|
||||
; CHECK-NEXT: ret i1 false
|
||||
; CHECK: out:
|
||||
; CHECK-NEXT: ret i1 false
|
||||
|
@ -653,7 +653,7 @@ entry:
|
|||
a_guard:
|
||||
%sel_cmp = icmp ne i32 %a, 5
|
||||
%add = add i32 %a, 100
|
||||
%sel = select i1 %sel_cmp, i32 %a, i32 5
|
||||
%sel = select i1 %sel_cmp, i32 %add, i32 5
|
||||
%res = icmp eq i32 %sel, 105
|
||||
ret i1 %res
|
||||
out:
|
||||
|
|
Loading…
Reference in New Issue