[llvm] a1e8b75 - [FuncSpec] Fix test case: only run funcspec and not any other passes. NFC.
Sjoerd Meijer via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 8 04:41:17 PDT 2021
Author: Sjoerd Meijer
Date: 2021-09-08T12:40:58+01:00
New Revision: a1e8b754ebb082dfd493ad19b86fa53676938351
URL: https://github.com/llvm/llvm-project/commit/a1e8b754ebb082dfd493ad19b86fa53676938351
DIFF: https://github.com/llvm/llvm-project/commit/a1e8b754ebb082dfd493ad19b86fa53676938351.diff
LOG: [FuncSpec] Fix test case: only run funcspec and not any other passes. NFC.
Added:
Modified:
llvm/test/Transforms/FunctionSpecialization/function-specialization.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/FunctionSpecialization/function-specialization.ll b/llvm/test/Transforms/FunctionSpecialization/function-specialization.ll
index 0606d5d2a6332..7598222325678 100644
--- a/llvm/test/Transforms/FunctionSpecialization/function-specialization.ll
+++ b/llvm/test/Transforms/FunctionSpecialization/function-specialization.ll
@@ -1,20 +1,21 @@
-; RUN: opt -function-specialization -deadargelim -inline -S < %s | FileCheck %s
+; RUN: opt -function-specialization -func-specialization-size-threshold=3 -S < %s | FileCheck %s
+define i64 @main(i64 %x, i1 %flag) {
+;
; CHECK-LABEL: @main(i64 %x, i1 %flag) {
-; CHECK: entry:
-; CHECK-NEXT: br i1 %flag, label %plus, label %minus
-; CHECK: plus:
-; CHECK-NEXT: [[TMP0:%.+]] = add i64 %x, 1
-; CHECH-NEXT: br label %merge
-; CHECK: minus:
-; CHECK-NEXT: [[TMP1:%.+]] = sub i64 %x, 1
-; CHECK-NEXT: br label %merge
-; CHECK: merge:
-; CHECK-NEXT: [[TMP2:%.+]] = phi i64 [ [[TMP0]], %plus ], [ [[TMP1]], %minus ]
-; CHECK-NEXT: ret i64 [[TMP2]]
-; CHECK-NEXT: }
+; CHECK: entry:
+; CHECK-NEXT: br i1 %flag, label %plus, label %minus
+; CHECK: plus:
+; CHECK-NEXT: [[TMP0:%.+]] = call i64 @compute.1(i64 %x, i64 (i64)* @plus)
+; CHECK-NEXT: br label %merge
+; CHECK: minus:
+; CHECK-NEXT: [[TMP1:%.+]] = call i64 @compute.2(i64 %x, i64 (i64)* @minus)
+; CHECK-NEXT: br label %merge
+; CHECK: merge:
+; CHECK-NEXT: [[TMP2:%.+]] = phi i64 [ [[TMP0]], %plus ], [ [[TMP1]], %minus ]
+; CHECK-NEXT: ret i64 [[TMP2]]
+; CHECK-NEXT: }
;
-define i64 @main(i64 %x, i1 %flag) {
entry:
br i1 %flag, label %plus, label %minus
@@ -31,6 +32,18 @@ merge:
ret i64 %tmp2
}
+; CHECK-LABEL: define internal i64 @compute.1(i64 %x, i64 (i64)* %binop) {
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[TMP0:%.+]] = call i64 @plus(i64 %x)
+; CHECK-NEXT: ret i64 [[TMP0]]
+; CHECK-NEXT: }
+;
+; CHECK-LABEL: define internal i64 @compute.2(i64 %x, i64 (i64)* %binop) {
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[TMP0:%.+]] = call i64 @minus(i64 %x)
+; CHECK-NEXT: ret i64 [[TMP0]]
+; CHECK-NEXT: }
+;
define internal i64 @compute(i64 %x, i64 (i64)* %binop) {
entry:
%tmp0 = call i64 %binop(i64 %x)
More information about the llvm-commits
mailing list