Move branch folding test to a better location.
authorAndrew Kaylor <andrew.kaylor@intel.com>
Thu, 3 Dec 2015 19:41:25 +0000 (19:41 +0000)
committerAndrew Kaylor <andrew.kaylor@intel.com>
Thu, 3 Dec 2015 19:41:25 +0000 (19:41 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254640 91177308-0d34-0410-b5e6-96231b3b80d8

test/CodeGen/X86/branchfolding-catchpads.ll [new file with mode: 0644]
test/Transforms/BranchFolding/single-block-funclets.ll [deleted file]

diff --git a/test/CodeGen/X86/branchfolding-catchpads.ll b/test/CodeGen/X86/branchfolding-catchpads.ll
new file mode 100644 (file)
index 0000000..21c7818
--- /dev/null
@@ -0,0 +1,110 @@
+; RUN: llc -mtriple=x86_64-pc-windows-msvc < %s | FileCheck %s
+
+declare i32 @__CxxFrameHandler3(...)
+
+declare void @throw()
+declare i16 @f()
+
+define i16 @test1(i16 %a, i8* %b) personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
+entry:
+  %cmp = icmp eq i16 %a, 10
+  br i1 %cmp, label %if.then, label %if.else
+
+if.then:
+  %call1 = invoke i16 @f()
+          to label %cleanup unwind label %catch.dispatch
+
+if.else:
+  %call2 = invoke i16 @f()
+          to label %cleanup unwind label %catch.dispatch
+
+catch.dispatch:
+  catchpad [i8* null, i32 8, i8* null]
+          to label %catch unwind label %catch.dispatch.2
+
+catch:
+  invoke void @throw() noreturn
+          to label %unreachable unwind label %catchendblock
+
+catch.dispatch.2:
+  catchpad [i8* null, i32 64, i8* null]
+          to label %catch.2 unwind label %catchendblock
+
+catch.2:
+  store i8 1, i8* %b
+  invoke void @throw() noreturn
+          to label %unreachable unwind label %catchendblock
+
+catchendblock:
+  catchendpad unwind to caller
+
+cleanup:
+  %retval = phi i16 [ %call1, %if.then ], [ %call2, %if.else ]
+  ret i16 %retval
+
+unreachable:
+  unreachable
+}
+
+; This test verifies the case where two funclet blocks meet the old criteria
+; to be placed at the end.  The order of the blocks is not important for the
+; purposes of this test.  The failure mode is an infinite loop during
+; compilation.
+;
+; CHECK-LABEL: .def     test1;
+
+define i16 @test2(i16 %a, i8* %b) personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
+entry:
+  %cmp = icmp eq i16 %a, 10
+  br i1 %cmp, label %if.then, label %if.else
+
+if.then:
+  %call1 = invoke i16 @f()
+          to label %cleanup unwind label %catch.dispatch
+
+if.else:
+  %call2 = invoke i16 @f()
+          to label %cleanup unwind label %catch.dispatch
+
+catch.dispatch:
+  catchpad [i8* null, i32 8, i8* null]
+          to label %catch unwind label %catch.dispatch.2
+
+catch:
+  invoke void @throw() noreturn
+          to label %unreachable unwind label %catchendblock
+
+catch.dispatch.2:
+  %c2 = catchpad [i8* null, i32 32, i8* null]
+          to label %catch.2 unwind label %catch.dispatch.3
+
+catch.2:
+  store i8 1, i8* %b
+  catchret %c2 to label %cleanup
+
+catch.dispatch.3:
+  %c3 = catchpad [i8* null, i32 64, i8* null]
+          to label %catch.3 unwind label %catchendblock
+
+catch.3:
+  store i8 2, i8* %b
+  catchret %c3 to label %cleanup
+
+catchendblock:
+  catchendpad unwind to caller
+
+cleanup:
+  %retval = phi i16 [ %call1, %if.then ], [ %call2, %if.else ], [ -1, %catch.2 ], [ -1, %catch.3 ]
+  ret i16 %retval
+
+unreachable:
+  unreachable
+}
+
+; This test verifies the case where three funclet blocks all meet the old
+; criteria to be placed at the end.  The order of the blocks is not important
+; for the purposes of this test.  The failure mode is an infinite loop during
+; compilation.
+;
+; CHECK-LABEL: .def     test2;
+
diff --git a/test/Transforms/BranchFolding/single-block-funclets.ll b/test/Transforms/BranchFolding/single-block-funclets.ll
deleted file mode 100644 (file)
index b2286ac..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-; RUN: llc -mtriple=x86_64-pc-windows-msvc < %s | FileCheck %s
-; REQUIRES: X86\r
-
-declare i32 @__CxxFrameHandler3(...)
-
-declare void @throw()
-declare i16 @f()
-
-define i16 @test1(i16 %a, i8* %b) personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
-entry:
-  %cmp = icmp eq i16 %a, 10
-  br i1 %cmp, label %if.then, label %if.else
-
-if.then:
-  %call1 = invoke i16 @f()
-          to label %cleanup unwind label %catch.dispatch
-
-if.else:
-  %call2 = invoke i16 @f()
-          to label %cleanup unwind label %catch.dispatch
-
-catch.dispatch:
-  catchpad [i8* null, i32 8, i8* null]
-          to label %catch unwind label %catch.dispatch.2
-
-catch:
-  invoke void @throw() noreturn
-          to label %unreachable unwind label %catchendblock
-
-catch.dispatch.2:
-  catchpad [i8* null, i32 64, i8* null]
-          to label %catch.2 unwind label %catchendblock
-
-catch.2:
-  store i8 1, i8* %b
-  invoke void @throw() noreturn
-          to label %unreachable unwind label %catchendblock
-
-catchendblock:
-  catchendpad unwind to caller
-
-cleanup:
-  %retval = phi i16 [ %call1, %if.then ], [ %call2, %if.else ]
-  ret i16 %retval
-
-unreachable:
-  unreachable
-}
-
-; This test verifies the case where two funclet blocks meet the old criteria
-; to be placed at the end.  The order of the blocks is not important for the
-; purposes of this test.  The failure mode is an infinite loop during
-; compilation.
-;
-; CHECK-LABEL: .def     test1;
-
-define i16 @test2(i16 %a, i8* %b) personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
-entry:
-  %cmp = icmp eq i16 %a, 10
-  br i1 %cmp, label %if.then, label %if.else
-
-if.then:
-  %call1 = invoke i16 @f()
-          to label %cleanup unwind label %catch.dispatch
-
-if.else:
-  %call2 = invoke i16 @f()
-          to label %cleanup unwind label %catch.dispatch
-
-catch.dispatch:
-  catchpad [i8* null, i32 8, i8* null]
-          to label %catch unwind label %catch.dispatch.2
-
-catch:
-  invoke void @throw() noreturn
-          to label %unreachable unwind label %catchendblock
-
-catch.dispatch.2:
-  %c2 = catchpad [i8* null, i32 32, i8* null]
-          to label %catch.2 unwind label %catch.dispatch.3
-
-catch.2:
-  store i8 1, i8* %b
-  catchret %c2 to label %cleanup
-
-catch.dispatch.3:
-  %c3 = catchpad [i8* null, i32 64, i8* null]
-          to label %catch.3 unwind label %catchendblock
-
-catch.3:
-  store i8 2, i8* %b
-  catchret %c3 to label %cleanup
-
-catchendblock:
-  catchendpad unwind to caller
-
-cleanup:
-  %retval = phi i16 [ %call1, %if.then ], [ %call2, %if.else ], [ -1, %catch.2 ], [ -1, %catch.3 ]
-  ret i16 %retval
-
-unreachable:
-  unreachable
-}
-
-; This test verifies the case where three funclet blocks all meet the old
-; criteria to be placed at the end.  The order of the blocks is not important
-; for the purposes of this test.  The failure mode is an infinite loop during
-; compilation.
-;
-; CHECK-LABEL: .def     test2;
-