forked from OSchip/llvm-project
NaryReassociate: Convert tests to opaque pointers
NVPTX/nary-gep.ll had one test that checked for a deleted bitcast which needed to be updated manually.
This commit is contained in:
parent
bcabf0a51f
commit
06612123dc
|
@ -4,7 +4,7 @@
|
||||||
target datalayout = "e-i64:64-v16:16-v32:32-n16:32:64"
|
target datalayout = "e-i64:64-v16:16-v32:32-n16:32:64"
|
||||||
target triple = "nvptx64-unknown-unknown"
|
target triple = "nvptx64-unknown-unknown"
|
||||||
|
|
||||||
declare void @foo(float*)
|
declare void @foo(ptr)
|
||||||
|
|
||||||
; foo(&a[i]);
|
; foo(&a[i]);
|
||||||
; foo(&a[i + j]);
|
; foo(&a[i + j]);
|
||||||
|
@ -12,17 +12,17 @@ declare void @foo(float*)
|
||||||
; t = &a[i];
|
; t = &a[i];
|
||||||
; foo(t);
|
; foo(t);
|
||||||
; foo(t + j);
|
; foo(t + j);
|
||||||
define void @reassociate_gep(float* %a, i64 %i, i64 %j) {
|
define void @reassociate_gep(ptr %a, i64 %i, i64 %j) {
|
||||||
; CHECK-LABEL: @reassociate_gep(
|
; CHECK-LABEL: @reassociate_gep(
|
||||||
%1 = add i64 %i, %j
|
%1 = add i64 %i, %j
|
||||||
%2 = getelementptr float, float* %a, i64 %i
|
%2 = getelementptr float, ptr %a, i64 %i
|
||||||
; CHECK: [[t1:[^ ]+]] = getelementptr float, float* %a, i64 %i
|
; CHECK: [[t1:[^ ]+]] = getelementptr float, ptr %a, i64 %i
|
||||||
call void @foo(float* %2)
|
call void @foo(ptr %2)
|
||||||
; CHECK: call void @foo(float* [[t1]])
|
; CHECK: call void @foo(ptr [[t1]])
|
||||||
%3 = getelementptr float, float* %a, i64 %1
|
%3 = getelementptr float, ptr %a, i64 %1
|
||||||
; CHECK: [[t2:[^ ]+]] = getelementptr float, float* [[t1]], i64 %j
|
; CHECK: [[t2:[^ ]+]] = getelementptr float, ptr [[t1]], i64 %j
|
||||||
call void @foo(float* %3)
|
call void @foo(ptr %3)
|
||||||
; CHECK: call void @foo(float* [[t2]])
|
; CHECK: call void @foo(ptr [[t2]])
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,28 +36,28 @@ define void @reassociate_gep(float* %a, i64 %i, i64 %j) {
|
||||||
; foo(t2);
|
; foo(t2);
|
||||||
; t3 = t2 + sext(i); // sext(i) should be GVN'ed.
|
; t3 = t2 + sext(i); // sext(i) should be GVN'ed.
|
||||||
; foo(t3);
|
; foo(t3);
|
||||||
define void @reassociate_gep_nsw(float* %a, i32 %i, i32 %j) {
|
define void @reassociate_gep_nsw(ptr %a, i32 %i, i32 %j) {
|
||||||
; CHECK-LABEL: @reassociate_gep_nsw(
|
; CHECK-LABEL: @reassociate_gep_nsw(
|
||||||
%idxprom.j = sext i32 %j to i64
|
%idxprom.j = sext i32 %j to i64
|
||||||
%1 = getelementptr float, float* %a, i64 %idxprom.j
|
%1 = getelementptr float, ptr %a, i64 %idxprom.j
|
||||||
; CHECK: [[t1:[^ ]+]] = getelementptr float, float* %a, i64 %idxprom.j
|
; CHECK: [[t1:[^ ]+]] = getelementptr float, ptr %a, i64 %idxprom.j
|
||||||
call void @foo(float* %1)
|
call void @foo(ptr %1)
|
||||||
; CHECK: call void @foo(float* [[t1]])
|
; CHECK: call void @foo(ptr [[t1]])
|
||||||
|
|
||||||
%2 = add nsw i32 %i, %j
|
%2 = add nsw i32 %i, %j
|
||||||
%idxprom.2 = sext i32 %2 to i64
|
%idxprom.2 = sext i32 %2 to i64
|
||||||
%3 = getelementptr float, float* %a, i64 %idxprom.2
|
%3 = getelementptr float, ptr %a, i64 %idxprom.2
|
||||||
; CHECK: [[sexti:[^ ]+]] = sext i32 %i to i64
|
; CHECK: [[sexti:[^ ]+]] = sext i32 %i to i64
|
||||||
; CHECK: [[t2:[^ ]+]] = getelementptr float, float* [[t1]], i64 [[sexti]]
|
; CHECK: [[t2:[^ ]+]] = getelementptr float, ptr [[t1]], i64 [[sexti]]
|
||||||
call void @foo(float* %3)
|
call void @foo(ptr %3)
|
||||||
; CHECK: call void @foo(float* [[t2]])
|
; CHECK: call void @foo(ptr [[t2]])
|
||||||
|
|
||||||
%4 = add nsw i32 %2, %i
|
%4 = add nsw i32 %2, %i
|
||||||
%idxprom.4 = sext i32 %4 to i64
|
%idxprom.4 = sext i32 %4 to i64
|
||||||
%5 = getelementptr float, float* %a, i64 %idxprom.4
|
%5 = getelementptr float, ptr %a, i64 %idxprom.4
|
||||||
; CHECK: [[t3:[^ ]+]] = getelementptr float, float* [[t2]], i64 [[sexti]]
|
; CHECK: [[t3:[^ ]+]] = getelementptr float, ptr [[t2]], i64 [[sexti]]
|
||||||
call void @foo(float* %5)
|
call void @foo(ptr %5)
|
||||||
; CHECK: call void @foo(float* [[t3]])
|
; CHECK: call void @foo(ptr [[t3]])
|
||||||
|
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
@ -71,7 +71,7 @@ define void @reassociate_gep_nsw(float* %a, i32 %i, i32 %j) {
|
||||||
; foo(t1);
|
; foo(t1);
|
||||||
; t2 = t1 + sext(i);
|
; t2 = t1 + sext(i);
|
||||||
; foo(t2);
|
; foo(t2);
|
||||||
define void @reassociate_gep_assume(float* %a, i32 %i, i32 %j) {
|
define void @reassociate_gep_assume(ptr %a, i32 %i, i32 %j) {
|
||||||
; CHECK-LABEL: @reassociate_gep_assume(
|
; CHECK-LABEL: @reassociate_gep_assume(
|
||||||
; assume(j >= 0)
|
; assume(j >= 0)
|
||||||
%cmp = icmp sgt i32 %j, -1
|
%cmp = icmp sgt i32 %j, -1
|
||||||
|
@ -81,63 +81,64 @@ define void @reassociate_gep_assume(float* %a, i32 %i, i32 %j) {
|
||||||
call void @llvm.assume(i1 %cmp2)
|
call void @llvm.assume(i1 %cmp2)
|
||||||
|
|
||||||
%idxprom.j = zext i32 %j to i64
|
%idxprom.j = zext i32 %j to i64
|
||||||
%2 = getelementptr float, float* %a, i64 %idxprom.j
|
%2 = getelementptr float, ptr %a, i64 %idxprom.j
|
||||||
; CHECK: [[t1:[^ ]+]] = getelementptr float, float* %a, i64 %idxprom.j
|
; CHECK: [[t1:[^ ]+]] = getelementptr float, ptr %a, i64 %idxprom.j
|
||||||
call void @foo(float* %2)
|
call void @foo(ptr %2)
|
||||||
; CHECK: call void @foo(float* [[t1]])
|
; CHECK: call void @foo(ptr [[t1]])
|
||||||
|
|
||||||
%idxprom.1 = zext i32 %1 to i64
|
%idxprom.1 = zext i32 %1 to i64
|
||||||
%3 = getelementptr float, float* %a, i64 %idxprom.1
|
%3 = getelementptr float, ptr %a, i64 %idxprom.1
|
||||||
; CHECK: [[sexti:[^ ]+]] = sext i32 %i to i64
|
; CHECK: [[sexti:[^ ]+]] = sext i32 %i to i64
|
||||||
; CHECK: [[t2:[^ ]+]] = getelementptr float, float* [[t1]], i64 [[sexti]]
|
; CHECK: [[t2:[^ ]+]] = getelementptr float, ptr [[t1]], i64 [[sexti]]
|
||||||
call void @foo(float* %3)
|
call void @foo(ptr %3)
|
||||||
; CHECK: call void @foo(float* [[t2]])
|
; CHECK: call void @foo(ptr [[t2]])
|
||||||
|
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
; Do not split the second GEP because sext(i + j) != sext(i) + sext(j).
|
; Do not split the second GEP because sext(i + j) != sext(i) + sext(j).
|
||||||
define void @reassociate_gep_no_nsw(float* %a, i32 %i, i32 %j) {
|
define void @reassociate_gep_no_nsw(ptr %a, i32 %i, i32 %j) {
|
||||||
; CHECK-LABEL: @reassociate_gep_no_nsw(
|
; CHECK-LABEL: @reassociate_gep_no_nsw(
|
||||||
%1 = add i32 %i, %j
|
%1 = add i32 %i, %j
|
||||||
%2 = getelementptr float, float* %a, i32 %j
|
%2 = getelementptr float, ptr %a, i32 %j
|
||||||
; CHECK: getelementptr float, float* %a, i32 %j
|
; CHECK: getelementptr float, ptr %a, i32 %j
|
||||||
call void @foo(float* %2)
|
call void @foo(ptr %2)
|
||||||
%3 = getelementptr float, float* %a, i32 %1
|
%3 = getelementptr float, ptr %a, i32 %1
|
||||||
; CHECK: getelementptr float, float* %a, i32 %1
|
; CHECK: getelementptr float, ptr %a, i32 %1
|
||||||
call void @foo(float* %3)
|
call void @foo(ptr %3)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
define void @reassociate_gep_128(float* %a, i128 %i, i128 %j) {
|
define void @reassociate_gep_128(ptr %a, i128 %i, i128 %j) {
|
||||||
; CHECK-LABEL: @reassociate_gep_128(
|
; CHECK-LABEL: @reassociate_gep_128(
|
||||||
%1 = add i128 %i, %j
|
%1 = add i128 %i, %j
|
||||||
%2 = getelementptr float, float* %a, i128 %i
|
%2 = getelementptr float, ptr %a, i128 %i
|
||||||
; CHECK: [[t1:[^ ]+]] = getelementptr float, float* %a, i128 %i
|
; CHECK: [[t1:[^ ]+]] = getelementptr float, ptr %a, i128 %i
|
||||||
call void @foo(float* %2)
|
call void @foo(ptr %2)
|
||||||
; CHECK: call void @foo(float* [[t1]])
|
; CHECK: call void @foo(ptr [[t1]])
|
||||||
%3 = getelementptr float, float* %a, i128 %1
|
%3 = getelementptr float, ptr %a, i128 %1
|
||||||
; CHECK: [[truncj:[^ ]+]] = trunc i128 %j to i64
|
; CHECK: [[truncj:[^ ]+]] = trunc i128 %j to i64
|
||||||
; CHECK: [[t2:[^ ]+]] = getelementptr float, float* [[t1]], i64 [[truncj]]
|
; CHECK: [[t2:[^ ]+]] = getelementptr float, ptr [[t1]], i64 [[truncj]]
|
||||||
call void @foo(float* %3)
|
call void @foo(ptr %3)
|
||||||
; CHECK: call void @foo(float* [[t2]])
|
; CHECK: call void @foo(ptr [[t2]])
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
%struct.complex = type { float, float }
|
%struct.complex = type { float, float }
|
||||||
|
|
||||||
declare void @bar(%struct.complex*)
|
declare void @bar(ptr)
|
||||||
|
|
||||||
define void @different_types(%struct.complex* %input, i64 %i) {
|
define void @different_types(ptr %input, i64 %i) {
|
||||||
; CHECK-LABEL: @different_types(
|
; CHECK-LABEL: @different_types(
|
||||||
%t1 = getelementptr %struct.complex, %struct.complex* %input, i64 %i
|
; CHECK-NEXT: %t1 = getelementptr %struct.complex, ptr %input, i64 %i
|
||||||
call void @bar(%struct.complex* %t1)
|
; CHECK-NEXT: call void @bar(ptr %t1)
|
||||||
|
; CHECK-NEXT: %t2 = getelementptr float, ptr %t1, i64 10
|
||||||
|
; CHECK-NEXT: call void @foo(ptr %t2)
|
||||||
|
%t1 = getelementptr %struct.complex, ptr %input, i64 %i
|
||||||
|
call void @bar(ptr %t1)
|
||||||
%j = add i64 %i, 5
|
%j = add i64 %i, 5
|
||||||
%t2 = getelementptr %struct.complex, %struct.complex* %input, i64 %j, i32 0
|
%t2 = getelementptr %struct.complex, ptr %input, i64 %j, i32 0
|
||||||
; CHECK: [[cast:[^ ]+]] = bitcast %struct.complex* %t1 to float*
|
call void @foo(ptr %t2)
|
||||||
; CHECK-NEXT: %t2 = getelementptr float, float* [[cast]], i64 10
|
|
||||||
; CHECK-NEXT: call void @foo(float* %t2)
|
|
||||||
call void @foo(float* %t2)
|
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -146,26 +146,26 @@ define i32 @smax_test7(i32 %a, i32 %b, i32 %c) {
|
||||||
}
|
}
|
||||||
|
|
||||||
; Pointer types are not supported yet
|
; Pointer types are not supported yet
|
||||||
define i32* @smax_test8(i32* %a, i32* %b, i32* %c) {
|
define ptr @smax_test8(ptr %a, ptr %b, ptr %c) {
|
||||||
; CHECK-LABEL: @smax_test8(
|
; CHECK-LABEL: @smax_test8(
|
||||||
; CHECK-NEXT: [[C1:%.*]] = icmp sgt i32* [[A:%.*]], [[B:%.*]]
|
; CHECK-NEXT: [[C1:%.*]] = icmp sgt ptr [[A:%.*]], [[B:%.*]]
|
||||||
; CHECK-NEXT: [[SMAX1:%.*]] = select i1 [[C1]], i32* [[A]], i32* [[B]]
|
; CHECK-NEXT: [[SMAX1:%.*]] = select i1 [[C1]], ptr [[A]], ptr [[B]]
|
||||||
; CHECK-NEXT: [[C2:%.*]] = icmp sgt i32* [[B]], [[C:%.*]]
|
; CHECK-NEXT: [[C2:%.*]] = icmp sgt ptr [[B]], [[C:%.*]]
|
||||||
; CHECK-NEXT: [[SMAX2:%.*]] = select i1 [[C2]], i32* [[B]], i32* [[C]]
|
; CHECK-NEXT: [[SMAX2:%.*]] = select i1 [[C2]], ptr [[B]], ptr [[C]]
|
||||||
; CHECK-NEXT: [[C3:%.*]] = icmp sgt i32* [[SMAX2]], [[A]]
|
; CHECK-NEXT: [[C3:%.*]] = icmp sgt ptr [[SMAX2]], [[A]]
|
||||||
; CHECK-NEXT: [[SMAX3:%.*]] = select i1 [[C3]], i32* [[SMAX2]], i32* [[A]]
|
; CHECK-NEXT: [[SMAX3:%.*]] = select i1 [[C3]], ptr [[SMAX2]], ptr [[A]]
|
||||||
; CHECK-NEXT: [[C4:%.*]] = icmp sgt i32* [[SMAX1]], [[SMAX3]]
|
; CHECK-NEXT: [[C4:%.*]] = icmp sgt ptr [[SMAX1]], [[SMAX3]]
|
||||||
; CHECK-NEXT: [[RES:%.*]] = select i1 [[C4]], i32* [[SMAX1]], i32* [[SMAX3]]
|
; CHECK-NEXT: [[RES:%.*]] = select i1 [[C4]], ptr [[SMAX1]], ptr [[SMAX3]]
|
||||||
; CHECK-NEXT: ret i32* [[RES]]
|
; CHECK-NEXT: ret ptr [[RES]]
|
||||||
;
|
;
|
||||||
%c1 = icmp sgt i32* %a, %b
|
%c1 = icmp sgt ptr %a, %b
|
||||||
%smax1 = select i1 %c1, i32* %a, i32* %b
|
%smax1 = select i1 %c1, ptr %a, ptr %b
|
||||||
%c2 = icmp sgt i32* %b, %c
|
%c2 = icmp sgt ptr %b, %c
|
||||||
%smax2 = select i1 %c2, i32* %b, i32* %c
|
%smax2 = select i1 %c2, ptr %b, ptr %c
|
||||||
%c3 = icmp sgt i32* %smax2, %a
|
%c3 = icmp sgt ptr %smax2, %a
|
||||||
%smax3 = select i1 %c3, i32* %smax2, i32* %a
|
%smax3 = select i1 %c3, ptr %smax2, ptr %a
|
||||||
%c4 = icmp sgt i32* %smax1, %smax3
|
%c4 = icmp sgt ptr %smax1, %smax3
|
||||||
%res = select i1 %c4, i32* %smax1, i32* %smax3
|
%res = select i1 %c4, ptr %smax1, ptr %smax3
|
||||||
ret i32* %res
|
ret ptr %res
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -146,25 +146,25 @@ define i32 @smin_test7(i32 %a, i32 %b, i32 %c) {
|
||||||
}
|
}
|
||||||
|
|
||||||
; Pointer types are not supported yet
|
; Pointer types are not supported yet
|
||||||
define i32* @smin_test8(i32* %a, i32* %b, i32* %c) {
|
define ptr @smin_test8(ptr %a, ptr %b, ptr %c) {
|
||||||
; CHECK-LABEL: @smin_test8(
|
; CHECK-LABEL: @smin_test8(
|
||||||
; CHECK-NEXT: [[C1:%.*]] = icmp slt i32* [[A:%.*]], [[B:%.*]]
|
; CHECK-NEXT: [[C1:%.*]] = icmp slt ptr [[A:%.*]], [[B:%.*]]
|
||||||
; CHECK-NEXT: [[UMIN1:%.*]] = select i1 [[C1]], i32* [[A]], i32* [[B]]
|
; CHECK-NEXT: [[UMIN1:%.*]] = select i1 [[C1]], ptr [[A]], ptr [[B]]
|
||||||
; CHECK-NEXT: [[C2:%.*]] = icmp slt i32* [[B]], [[C:%.*]]
|
; CHECK-NEXT: [[C2:%.*]] = icmp slt ptr [[B]], [[C:%.*]]
|
||||||
; CHECK-NEXT: [[UMIN2:%.*]] = select i1 [[C2]], i32* [[B]], i32* [[C]]
|
; CHECK-NEXT: [[UMIN2:%.*]] = select i1 [[C2]], ptr [[B]], ptr [[C]]
|
||||||
; CHECK-NEXT: [[C3:%.*]] = icmp slt i32* [[UMIN2]], [[A]]
|
; CHECK-NEXT: [[C3:%.*]] = icmp slt ptr [[UMIN2]], [[A]]
|
||||||
; CHECK-NEXT: [[UMIN3:%.*]] = select i1 [[C3]], i32* [[UMIN2]], i32* [[A]]
|
; CHECK-NEXT: [[UMIN3:%.*]] = select i1 [[C3]], ptr [[UMIN2]], ptr [[A]]
|
||||||
; CHECK-NEXT: [[C4:%.*]] = icmp slt i32* [[UMIN1]], [[UMIN3]]
|
; CHECK-NEXT: [[C4:%.*]] = icmp slt ptr [[UMIN1]], [[UMIN3]]
|
||||||
; CHECK-NEXT: [[RES:%.*]] = select i1 [[C4]], i32* [[UMIN1]], i32* [[UMIN3]]
|
; CHECK-NEXT: [[RES:%.*]] = select i1 [[C4]], ptr [[UMIN1]], ptr [[UMIN3]]
|
||||||
; CHECK-NEXT: ret i32* [[RES]]
|
; CHECK-NEXT: ret ptr [[RES]]
|
||||||
;
|
;
|
||||||
%c1 = icmp slt i32* %a, %b
|
%c1 = icmp slt ptr %a, %b
|
||||||
%umin1 = select i1 %c1, i32* %a, i32* %b
|
%umin1 = select i1 %c1, ptr %a, ptr %b
|
||||||
%c2 = icmp slt i32* %b, %c
|
%c2 = icmp slt ptr %b, %c
|
||||||
%umin2 = select i1 %c2, i32* %b, i32* %c
|
%umin2 = select i1 %c2, ptr %b, ptr %c
|
||||||
%c3 = icmp slt i32* %umin2, %a
|
%c3 = icmp slt ptr %umin2, %a
|
||||||
%umin3 = select i1 %c3, i32* %umin2, i32* %a
|
%umin3 = select i1 %c3, ptr %umin2, ptr %a
|
||||||
%c4 = icmp slt i32* %umin1, %umin3
|
%c4 = icmp slt ptr %umin1, %umin3
|
||||||
%res = select i1 %c4, i32* %umin1, i32* %umin3
|
%res = select i1 %c4, ptr %umin1, ptr %umin3
|
||||||
ret i32* %res
|
ret ptr %res
|
||||||
}
|
}
|
||||||
|
|
|
@ -146,25 +146,25 @@ define i32 @umax_test7(i32 %a, i32 %b, i32 %c) {
|
||||||
}
|
}
|
||||||
|
|
||||||
; Pointer types are not supported yet
|
; Pointer types are not supported yet
|
||||||
define i32* @umax_test8(i32* %a, i32* %b, i32* %c) {
|
define ptr @umax_test8(ptr %a, ptr %b, ptr %c) {
|
||||||
; CHECK-LABEL: @umax_test8(
|
; CHECK-LABEL: @umax_test8(
|
||||||
; CHECK-NEXT: [[C1:%.*]] = icmp ugt i32* [[A:%.*]], [[B:%.*]]
|
; CHECK-NEXT: [[C1:%.*]] = icmp ugt ptr [[A:%.*]], [[B:%.*]]
|
||||||
; CHECK-NEXT: [[SMAX1:%.*]] = select i1 [[C1]], i32* [[A]], i32* [[B]]
|
; CHECK-NEXT: [[SMAX1:%.*]] = select i1 [[C1]], ptr [[A]], ptr [[B]]
|
||||||
; CHECK-NEXT: [[C2:%.*]] = icmp ugt i32* [[B]], [[C:%.*]]
|
; CHECK-NEXT: [[C2:%.*]] = icmp ugt ptr [[B]], [[C:%.*]]
|
||||||
; CHECK-NEXT: [[SMAX2:%.*]] = select i1 [[C2]], i32* [[B]], i32* [[C]]
|
; CHECK-NEXT: [[SMAX2:%.*]] = select i1 [[C2]], ptr [[B]], ptr [[C]]
|
||||||
; CHECK-NEXT: [[C3:%.*]] = icmp ugt i32* [[SMAX2]], [[A]]
|
; CHECK-NEXT: [[C3:%.*]] = icmp ugt ptr [[SMAX2]], [[A]]
|
||||||
; CHECK-NEXT: [[SMAX3:%.*]] = select i1 [[C3]], i32* [[SMAX2]], i32* [[A]]
|
; CHECK-NEXT: [[SMAX3:%.*]] = select i1 [[C3]], ptr [[SMAX2]], ptr [[A]]
|
||||||
; CHECK-NEXT: [[C4:%.*]] = icmp ugt i32* [[SMAX1]], [[SMAX3]]
|
; CHECK-NEXT: [[C4:%.*]] = icmp ugt ptr [[SMAX1]], [[SMAX3]]
|
||||||
; CHECK-NEXT: [[RES:%.*]] = select i1 [[C4]], i32* [[SMAX1]], i32* [[SMAX3]]
|
; CHECK-NEXT: [[RES:%.*]] = select i1 [[C4]], ptr [[SMAX1]], ptr [[SMAX3]]
|
||||||
; CHECK-NEXT: ret i32* [[RES]]
|
; CHECK-NEXT: ret ptr [[RES]]
|
||||||
;
|
;
|
||||||
%c1 = icmp ugt i32* %a, %b
|
%c1 = icmp ugt ptr %a, %b
|
||||||
%smax1 = select i1 %c1, i32* %a, i32* %b
|
%smax1 = select i1 %c1, ptr %a, ptr %b
|
||||||
%c2 = icmp ugt i32* %b, %c
|
%c2 = icmp ugt ptr %b, %c
|
||||||
%smax2 = select i1 %c2, i32* %b, i32* %c
|
%smax2 = select i1 %c2, ptr %b, ptr %c
|
||||||
%c3 = icmp ugt i32* %smax2, %a
|
%c3 = icmp ugt ptr %smax2, %a
|
||||||
%smax3 = select i1 %c3, i32* %smax2, i32* %a
|
%smax3 = select i1 %c3, ptr %smax2, ptr %a
|
||||||
%c4 = icmp ugt i32* %smax1, %smax3
|
%c4 = icmp ugt ptr %smax1, %smax3
|
||||||
%res = select i1 %c4, i32* %smax1, i32* %smax3
|
%res = select i1 %c4, ptr %smax1, ptr %smax3
|
||||||
ret i32* %res
|
ret ptr %res
|
||||||
}
|
}
|
||||||
|
|
|
@ -146,25 +146,25 @@ define i32 @umin_test7(i32 %a, i32 %b, i32 %c) {
|
||||||
}
|
}
|
||||||
|
|
||||||
; Pointer types are not supported yet
|
; Pointer types are not supported yet
|
||||||
define i32* @umin_test8(i32* %a, i32* %b, i32* %c) {
|
define ptr @umin_test8(ptr %a, ptr %b, ptr %c) {
|
||||||
; CHECK-LABEL: @umin_test8(
|
; CHECK-LABEL: @umin_test8(
|
||||||
; CHECK-NEXT: [[C1:%.*]] = icmp ult i32* [[A:%.*]], [[B:%.*]]
|
; CHECK-NEXT: [[C1:%.*]] = icmp ult ptr [[A:%.*]], [[B:%.*]]
|
||||||
; CHECK-NEXT: [[UMIN1:%.*]] = select i1 [[C1]], i32* [[A]], i32* [[B]]
|
; CHECK-NEXT: [[UMIN1:%.*]] = select i1 [[C1]], ptr [[A]], ptr [[B]]
|
||||||
; CHECK-NEXT: [[C2:%.*]] = icmp ult i32* [[B]], [[C:%.*]]
|
; CHECK-NEXT: [[C2:%.*]] = icmp ult ptr [[B]], [[C:%.*]]
|
||||||
; CHECK-NEXT: [[UMIN2:%.*]] = select i1 [[C2]], i32* [[B]], i32* [[C]]
|
; CHECK-NEXT: [[UMIN2:%.*]] = select i1 [[C2]], ptr [[B]], ptr [[C]]
|
||||||
; CHECK-NEXT: [[C3:%.*]] = icmp ult i32* [[UMIN2]], [[A]]
|
; CHECK-NEXT: [[C3:%.*]] = icmp ult ptr [[UMIN2]], [[A]]
|
||||||
; CHECK-NEXT: [[UMIN3:%.*]] = select i1 [[C3]], i32* [[UMIN2]], i32* [[A]]
|
; CHECK-NEXT: [[UMIN3:%.*]] = select i1 [[C3]], ptr [[UMIN2]], ptr [[A]]
|
||||||
; CHECK-NEXT: [[C4:%.*]] = icmp ult i32* [[UMIN1]], [[UMIN3]]
|
; CHECK-NEXT: [[C4:%.*]] = icmp ult ptr [[UMIN1]], [[UMIN3]]
|
||||||
; CHECK-NEXT: [[RES:%.*]] = select i1 [[C4]], i32* [[UMIN1]], i32* [[UMIN3]]
|
; CHECK-NEXT: [[RES:%.*]] = select i1 [[C4]], ptr [[UMIN1]], ptr [[UMIN3]]
|
||||||
; CHECK-NEXT: ret i32* [[RES]]
|
; CHECK-NEXT: ret ptr [[RES]]
|
||||||
;
|
;
|
||||||
%c1 = icmp ult i32* %a, %b
|
%c1 = icmp ult ptr %a, %b
|
||||||
%umin1 = select i1 %c1, i32* %a, i32* %b
|
%umin1 = select i1 %c1, ptr %a, ptr %b
|
||||||
%c2 = icmp ult i32* %b, %c
|
%c2 = icmp ult ptr %b, %c
|
||||||
%umin2 = select i1 %c2, i32* %b, i32* %c
|
%umin2 = select i1 %c2, ptr %b, ptr %c
|
||||||
%c3 = icmp ult i32* %umin2, %a
|
%c3 = icmp ult ptr %umin2, %a
|
||||||
%umin3 = select i1 %c3, i32* %umin2, i32* %a
|
%umin3 = select i1 %c3, ptr %umin2, ptr %a
|
||||||
%c4 = icmp ult i32* %umin1, %umin3
|
%c4 = icmp ult ptr %umin1, %umin3
|
||||||
%res = select i1 %c4, i32* %umin1, i32* %umin3
|
%res = select i1 %c4, ptr %umin1, ptr %umin3
|
||||||
ret i32* %res
|
ret ptr %res
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue