[llvm] 2d0d423 - [InstCombine] Add test for -expensive-combines option; NFC
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 17 08:56:36 PST 2020
Author: Nikita Popov
Date: 2020-01-17T17:56:20+01:00
New Revision: 2d0d4235a282e0f900d31ac1054aafc0c526245c
URL: https://github.com/llvm/llvm-project/commit/2d0d4235a282e0f900d31ac1054aafc0c526245c
DIFF: https://github.com/llvm/llvm-project/commit/2d0d4235a282e0f900d31ac1054aafc0c526245c.diff
LOG: [InstCombine] Add test for -expensive-combines option; NFC
This shows that -expensive-combines=0 is ignored.
Added:
llvm/test/Transforms/InstCombine/expensive-combines.ll
Modified:
Removed:
################################################################################
diff --git a/llvm/test/Transforms/InstCombine/expensive-combines.ll b/llvm/test/Transforms/InstCombine/expensive-combines.ll
new file mode 100644
index 000000000000..96a45b05cfb5
--- /dev/null
+++ b/llvm/test/Transforms/InstCombine/expensive-combines.ll
@@ -0,0 +1,28 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; RUN: opt -S -instcombine < %s | FileCheck %s --check-prefix=DEFAULT
+; RUN: opt -S -instcombine -expensive-combines=1 < %s | FileCheck %s --check-prefix=EXPENSIVE-ON
+; RUN: opt -S -instcombine -expensive-combines=0 < %s | FileCheck %s --check-prefix=EXPENSIVE-OFF
+
+define void @test() {
+; DEFAULT-LABEL: @test(
+; DEFAULT-NEXT: [[CALL:%.*]] = call i32 @passthru(i32 0)
+; DEFAULT-NEXT: call void @sink(i32 0)
+; DEFAULT-NEXT: ret void
+;
+; EXPENSIVE-ON-LABEL: @test(
+; EXPENSIVE-ON-NEXT: [[CALL:%.*]] = call i32 @passthru(i32 0)
+; EXPENSIVE-ON-NEXT: call void @sink(i32 0)
+; EXPENSIVE-ON-NEXT: ret void
+;
+; EXPENSIVE-OFF-LABEL: @test(
+; EXPENSIVE-OFF-NEXT: [[CALL:%.*]] = call i32 @passthru(i32 0)
+; EXPENSIVE-OFF-NEXT: call void @sink(i32 0)
+; EXPENSIVE-OFF-NEXT: ret void
+;
+ %call = call i32 @passthru(i32 0)
+ call void @sink(i32 %call)
+ ret void
+}
+
+declare i32 @passthru(i32 returned)
+declare void @sink(i32)
More information about the llvm-commits
mailing list