[llvm-branch-commits] [llvm] d65ef43 - [InstCombine] Add test for -expensive-combines option; NFC

Hans Wennborg via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Feb 10 02:32:41 PST 2020


Author: Nikita Popov
Date: 2020-02-10T11:28:17+01:00
New Revision: d65ef4321e6f244e68b191c84b8c76fb06662573

URL: https://github.com/llvm/llvm-project/commit/d65ef4321e6f244e68b191c84b8c76fb06662573
DIFF: https://github.com/llvm/llvm-project/commit/d65ef4321e6f244e68b191c84b8c76fb06662573.diff

LOG: [InstCombine] Add test for -expensive-combines option; NFC

This shows that -expensive-combines=0 is ignored.

(cherry picked from commit 2d0d4235a282e0f900d31ac1054aafc0c526245c)

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-branch-commits mailing list