projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[NFC] [SLSR] clean up some tests
[oota-llvm.git]
/
test
/
Transforms
/
StraightLineStrengthReduce
/
slsr-mul.ll
diff --git
a/test/Transforms/StraightLineStrengthReduce/slsr-mul.ll
b/test/Transforms/StraightLineStrengthReduce/slsr-mul.ll
index 471a3685e51f41fd8216e769404b81e38343050d..1c7333dab9feee7b9c713ec212e9878729a30475 100644
(file)
--- a/
test/Transforms/StraightLineStrengthReduce/slsr-mul.ll
+++ b/
test/Transforms/StraightLineStrengthReduce/slsr-mul.ll
@@
-2,37
+2,32
@@
target datalayout = "e-i64:64-v16:16-v32:32-n16:32:64"
target datalayout = "e-i64:64-v16:16-v32:32-n16:32:64"
-declare i32 @foo(i32 %a)
-
-define i32 @slsr1(i32 %b, i32 %s) {
+define void @slsr1(i32 %b, i32 %s) {
; CHECK-LABEL: @slsr1(
; CHECK-LABEL: @slsr1(
- ;
v0 =
foo(b * s);
+ ; foo(b * s);
%mul0 = mul i32 %b, %s
; CHECK: mul i32
; CHECK-NOT: mul i32
%mul0 = mul i32 %b, %s
; CHECK: mul i32
; CHECK-NOT: mul i32
-
%v0 = call i32
@foo(i32 %mul0)
+
call void
@foo(i32 %mul0)
- ;
v1 =
foo((b + 1) * s);
+ ; foo((b + 1) * s);
%b1 = add i32 %b, 1
%mul1 = mul i32 %b1, %s
%b1 = add i32 %b, 1
%mul1 = mul i32 %b1, %s
-
%v1 = call i32
@foo(i32 %mul1)
+
call void
@foo(i32 %mul1)
- ;
v2 =
foo((b + 2) * s);
+ ; foo((b + 2) * s);
%b2 = add i32 %b, 2
%mul2 = mul i32 %b2, %s
%b2 = add i32 %b, 2
%mul2 = mul i32 %b2, %s
-
%v2 = call i32
@foo(i32 %mul2)
+
call void
@foo(i32 %mul2)
- ; return v0 + v1 + v2;
- %1 = add i32 %v0, %v1
- %2 = add i32 %1, %v2
- ret i32 %2
+ ret void
}
}
-;
v0 =
foo(a * b)
-;
v1 =
foo((a + 1) * b)
-;
v2 =
foo(a * (b + 1))
-;
v3 =
foo((a + 1) * (b + 1))
-define
i32
@slsr2(i32 %a, i32 %b) {
+; foo(a * b)
+; foo((a + 1) * b)
+; foo(a * (b + 1))
+; foo((a + 1) * (b + 1))
+define
void
@slsr2(i32 %a, i32 %b) {
; CHECK-LABEL: @slsr2(
%a1 = add i32 %a, 1
%b1 = add i32 %b, 1
; CHECK-LABEL: @slsr2(
%a1 = add i32 %a, 1
%b1 = add i32 %b, 1
@@
-43,63
+38,50
@@
define i32 @slsr2(i32 %a, i32 %b) {
%mul2 = mul i32 %a, %b1
%mul3 = mul i32 %a1, %b1
%mul2 = mul i32 %a, %b1
%mul3 = mul i32 %a1, %b1
-
%v0 = call i32
@foo(i32 %mul0)
-
%v1 = call i32
@foo(i32 %mul1)
-
%v2 = call i32
@foo(i32 %mul2)
-
%v3 = call i32
@foo(i32 %mul3)
+
call void
@foo(i32 %mul0)
+
call void
@foo(i32 %mul1)
+
call void
@foo(i32 %mul2)
+
call void
@foo(i32 %mul3)
- %1 = add i32 %v0, %v1
- %2 = add i32 %1, %v2
- %3 = add i32 %2, %v3
- ret i32 %3
+ ret void
}
; The bump is a multiple of the stride.
;
}
; The bump is a multiple of the stride.
;
-; v0 = foo(b * s);
-; v1 = foo((b + 2) * s);
-; v2 = foo((b + 4) * s);
-; return v0 + v1 + v2;
-;
-; ==>
-;
+; foo(b * s);
+; foo((b + 2) * s);
+; foo((b + 4) * s);
+; =>
; mul0 = b * s;
; mul0 = b * s;
-; v0 = foo(mul0);
; bump = s * 2;
; mul1 = mul0 + bump; // GVN ensures mul1 and mul2 use the same bump.
; bump = s * 2;
; mul1 = mul0 + bump; // GVN ensures mul1 and mul2 use the same bump.
-; v1 = foo(mul1);
; mul2 = mul1 + bump;
; mul2 = mul1 + bump;
-; v2 = foo(mul2);
-; return v0 + v1 + v2;
-define i32 @slsr3(i32 %b, i32 %s) {
+define void @slsr3(i32 %b, i32 %s) {
; CHECK-LABEL: @slsr3(
%mul0 = mul i32 %b, %s
; CHECK: mul i32
; CHECK-LABEL: @slsr3(
%mul0 = mul i32 %b, %s
; CHECK: mul i32
-
%v0 = call i32
@foo(i32 %mul0)
+
call void
@foo(i32 %mul0)
%b1 = add i32 %b, 2
%mul1 = mul i32 %b1, %s
; CHECK: [[BUMP:%[a-zA-Z0-9]+]] = shl i32 %s, 1
; CHECK: %mul1 = add i32 %mul0, [[BUMP]]
%b1 = add i32 %b, 2
%mul1 = mul i32 %b1, %s
; CHECK: [[BUMP:%[a-zA-Z0-9]+]] = shl i32 %s, 1
; CHECK: %mul1 = add i32 %mul0, [[BUMP]]
-
%v1 = call i32
@foo(i32 %mul1)
+
call void
@foo(i32 %mul1)
%b2 = add i32 %b, 4
%mul2 = mul i32 %b2, %s
; CHECK: %mul2 = add i32 %mul1, [[BUMP]]
%b2 = add i32 %b, 4
%mul2 = mul i32 %b2, %s
; CHECK: %mul2 = add i32 %mul1, [[BUMP]]
-
%v2 = call i32
@foo(i32 %mul2)
+
call void
@foo(i32 %mul2)
- %1 = add i32 %v0, %v1
- %2 = add i32 %1, %v2
- ret i32 %2
+ ret void
}
; Do not rewrite a candidate if its potential basis does not dominate it.
}
; Do not rewrite a candidate if its potential basis does not dominate it.
-;
v0 = 0;
+;
; if (cond)
; if (cond)
-; v0 = foo(a * b);
-; v1 = foo((a + 1) * b);
-; return v0 + v1;
-define i32 @not_dominate(i1 %cond, i32 %a, i32 %b) {
+; foo(a * b);
+; foo((a + 1) * b);
+define void @not_dominate(i1 %cond, i32 %a, i32 %b) {
; CHECK-LABEL: @not_dominate(
entry:
%a1 = add i32 %a, 1
; CHECK-LABEL: @not_dominate(
entry:
%a1 = add i32 %a, 1
@@
-108,14
+90,14
@@
entry:
then:
%mul0 = mul i32 %a, %b
; CHECK: %mul0 = mul i32 %a, %b
then:
%mul0 = mul i32 %a, %b
; CHECK: %mul0 = mul i32 %a, %b
-
%v0 = call i32
@foo(i32 %mul0)
+
call void
@foo(i32 %mul0)
br label %merge
merge:
br label %merge
merge:
- %v0.phi = phi i32 [ 0, %entry ], [ %mul0, %then ]
%mul1 = mul i32 %a1, %b
; CHECK: %mul1 = mul i32 %a1, %b
%mul1 = mul i32 %a1, %b
; CHECK: %mul1 = mul i32 %a1, %b
- %v1 = call i32 @foo(i32 %mul1)
- %sum = add i32 %v0.phi, %v1
- ret i32 %sum
+ call void @foo(i32 %mul1)
+ ret void
}
}
+
+declare void @foo(i32)