diff options
author | Eric Christopher <echristo@gmail.com> | 2019-04-17 02:12:23 +0000 |
---|---|---|
committer | Eric Christopher <echristo@gmail.com> | 2019-04-17 02:12:23 +0000 |
commit | a86343512845c9c1fdbac865fea88aa5fce7142a (patch) | |
tree | 666fc6353de19ad8b00e56b67edd33f24104e4a7 /llvm/test/Transforms/ConstantHoisting/X86 | |
parent | 7f8ca6e3679b3af951cb7a4b1377edfaa3244b93 (diff) | |
download | bcm5719-llvm-a86343512845c9c1fdbac865fea88aa5fce7142a.tar.gz bcm5719-llvm-a86343512845c9c1fdbac865fea88aa5fce7142a.zip |
Temporarily Revert "Add basic loop fusion pass."
As it's causing some bot failures (and per request from kbarton).
This reverts commit r358543/ab70da07286e618016e78247e4a24fcb84077fda.
llvm-svn: 358546
Diffstat (limited to 'llvm/test/Transforms/ConstantHoisting/X86')
11 files changed, 0 insertions, 542 deletions
diff --git a/llvm/test/Transforms/ConstantHoisting/X86/bad-cases.ll b/llvm/test/Transforms/ConstantHoisting/X86/bad-cases.ll deleted file mode 100644 index 8d0e9e00156..00000000000 --- a/llvm/test/Transforms/ConstantHoisting/X86/bad-cases.ll +++ /dev/null @@ -1,127 +0,0 @@ -; NOTE: Assertions have been autogenerated by utils/update_test_checks.py -; RUN: opt -consthoist -S < %s | FileCheck %s -target triple = "x86_64--" - -; We don't want to convert constant divides because the benefit from converting -; them to a mul in the backend is larget than constant materialization savings. -define void @signed_const_division(i64 %in1, i64 %in2, i64* %addr) { -; CHECK-LABEL: @signed_const_division( -; CHECK-NEXT: entry: -; CHECK-NEXT: br label [[LOOP:%.*]] -; CHECK: loop: -; CHECK-NEXT: [[L1:%.*]] = phi i64 [ [[RES1:%.*]], [[LOOP]] ], [ [[IN1:%.*]], [[ENTRY:%.*]] ] -; CHECK-NEXT: [[L2:%.*]] = phi i64 [ [[RES2:%.*]], [[LOOP]] ], [ [[IN2:%.*]], [[ENTRY]] ] -; CHECK-NEXT: [[RES1]] = sdiv i64 [[L1]], 4294967296 -; CHECK-NEXT: store volatile i64 [[RES1]], i64* [[ADDR:%.*]] -; CHECK-NEXT: [[RES2]] = srem i64 [[L2]], 4294967296 -; CHECK-NEXT: store volatile i64 [[RES2]], i64* [[ADDR]] -; CHECK-NEXT: [[AGAIN:%.*]] = icmp eq i64 [[RES1]], [[RES2]] -; CHECK-NEXT: br i1 [[AGAIN]], label [[LOOP]], label [[END:%.*]] -; CHECK: end: -; CHECK-NEXT: ret void -; -entry: - br label %loop - -loop: - %l1 = phi i64 [%res1, %loop], [%in1, %entry] - %l2 = phi i64 [%res2, %loop], [%in2, %entry] - %res1 = sdiv i64 %l1, 4294967296 - store volatile i64 %res1, i64* %addr - %res2 = srem i64 %l2, 4294967296 - store volatile i64 %res2, i64* %addr - %again = icmp eq i64 %res1, %res2 - br i1 %again, label %loop, label %end - -end: - ret void -} - -define void @unsigned_const_division(i64 %in1, i64 %in2, i64* %addr) { -; CHECK-LABEL: @unsigned_const_division( -; CHECK-NEXT: entry: -; CHECK-NEXT: br label [[LOOP:%.*]] -; CHECK: loop: -; CHECK-NEXT: [[L1:%.*]] = phi i64 [ [[RES1:%.*]], [[LOOP]] ], [ [[IN1:%.*]], [[ENTRY:%.*]] ] -; CHECK-NEXT: [[L2:%.*]] = phi i64 [ [[RES2:%.*]], [[LOOP]] ], [ [[IN2:%.*]], [[ENTRY]] ] -; CHECK-NEXT: [[RES1]] = udiv i64 [[L1]], 4294967296 -; CHECK-NEXT: store volatile i64 [[RES1]], i64* [[ADDR:%.*]] -; CHECK-NEXT: [[RES2]] = urem i64 [[L2]], 4294967296 -; CHECK-NEXT: store volatile i64 [[RES2]], i64* [[ADDR]] -; CHECK-NEXT: [[AGAIN:%.*]] = icmp eq i64 [[RES1]], [[RES2]] -; CHECK-NEXT: br i1 [[AGAIN]], label [[LOOP]], label [[END:%.*]] -; CHECK: end: -; CHECK-NEXT: ret void -; - -entry: - br label %loop - -loop: - %l1 = phi i64 [%res1, %loop], [%in1, %entry] - %l2 = phi i64 [%res2, %loop], [%in2, %entry] - %res1 = udiv i64 %l1, 4294967296 - store volatile i64 %res1, i64* %addr - %res2 = urem i64 %l2, 4294967296 - store volatile i64 %res2, i64* %addr - %again = icmp eq i64 %res1, %res2 - br i1 %again, label %loop, label %end - -end: - ret void -} - -define i32 @PR40934() { -; CHECK-LABEL: @PR40934( -; CHECK-NEXT: ret i32 undef -; CHECK: bb: -; CHECK-NEXT: [[T2:%.*]] = call i32 (i64, ...) bitcast (i32 (...)* @d to i32 (i64, ...)*)(i64 7788015061) -; CHECK-NEXT: [[T3:%.*]] = and i64 [[T3]], 7788015061 -; CHECK-NEXT: br label [[BB:%.*]] -; - ret i32 undef - -bb: - %t2 = call i32 (i64, ...) bitcast (i32 (...)* @d to i32 (i64, ...)*)(i64 7788015061) - %t3 = and i64 %t3, 7788015061 - br label %bb -} - -declare i32 @d(...) - -define i32 @PR40930() { -; CHECK-LABEL: @PR40930( -; CHECK-NEXT: bb: -; CHECK-NEXT: [[TMP:%.*]] = alloca i32, align 4 -; CHECK-NEXT: br label [[BB1:%.*]] -; CHECK: bb1: -; CHECK-NEXT: br label [[BB2:%.*]] -; CHECK: bb2: -; CHECK-NEXT: br label [[BB2]] -; CHECK: bb3: -; CHECK-NEXT: [[TMP4:%.*]] = call i32 (i64, i64, ...) bitcast (i32 (...)* @c to i32 (i64, i64, ...)*)(i64 4208870971, i64 4208870971) -; CHECK-NEXT: br label [[BB1]] -; CHECK: bb5: -; CHECK-NEXT: [[TMP6:%.*]] = load i32, i32* [[TMP]], align 4 -; CHECK-NEXT: ret i32 [[TMP6]] -; -bb: - %tmp = alloca i32, align 4 - br label %bb1 - -bb1: ; preds = %bb3, %bb - br label %bb2 - -bb2: ; preds = %bb2, %bb1 - br label %bb2 - -bb3: ; No predecessors! - %tmp4 = call i32 (i64, i64, ...) bitcast (i32 (...)* @c to i32 (i64, i64, ...)*)(i64 4208870971, i64 4208870971) - br label %bb1 - -bb5: ; No predecessors! - %tmp6 = load i32, i32* %tmp, align 4 - ret i32 %tmp6 -} - -declare i32 @c(...) diff --git a/llvm/test/Transforms/ConstantHoisting/X86/cast-inst.ll b/llvm/test/Transforms/ConstantHoisting/X86/cast-inst.ll deleted file mode 100644 index 58d7650f91f..00000000000 --- a/llvm/test/Transforms/ConstantHoisting/X86/cast-inst.ll +++ /dev/null @@ -1,30 +0,0 @@ -; RUN: opt -S -consthoist < %s | FileCheck %s -; RUN: opt -S -passes='consthoist' < %s | FileCheck %s - -target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-apple-macosx10.9.0" - -; Check if the materialization of the constant and the cast instruction are -; inserted in the correct order. -define i32 @cast_inst_test() { -; CHECK-LABEL: @cast_inst_test -; CHECK: %const = bitcast i64 4646526064 to i64 -; CHECK: %1 = inttoptr i64 %const to i32* -; CHECK: %v0 = load i32, i32* %1, align 16 -; CHECK: %const_mat = add i64 %const, 16 -; CHECK-NEXT: %2 = inttoptr i64 %const_mat to i32* -; CHECK-NEXT: %v1 = load i32, i32* %2, align 16 -; CHECK: %const_mat1 = add i64 %const, 32 -; CHECK-NEXT: %3 = inttoptr i64 %const_mat1 to i32* -; CHECK-NEXT: %v2 = load i32, i32* %3, align 16 - %a0 = inttoptr i64 4646526064 to i32* - %v0 = load i32, i32* %a0, align 16 - %a1 = inttoptr i64 4646526080 to i32* - %v1 = load i32, i32* %a1, align 16 - %a2 = inttoptr i64 4646526096 to i32* - %v2 = load i32, i32* %a2, align 16 - %r0 = add i32 %v0, %v1 - %r1 = add i32 %r0, %v2 - ret i32 %r1 -} - diff --git a/llvm/test/Transforms/ConstantHoisting/X86/const-base-addr.ll b/llvm/test/Transforms/ConstantHoisting/X86/const-base-addr.ll deleted file mode 100644 index db5dfdd1538..00000000000 --- a/llvm/test/Transforms/ConstantHoisting/X86/const-base-addr.ll +++ /dev/null @@ -1,24 +0,0 @@ -; RUN: opt -S -consthoist < %s | FileCheck %s - -target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-apple-macosx10.9.0" - -%T = type { i32, i32, i32, i32 } - -; Test if even cheap base addresses are hoisted. -define i32 @test1() nounwind { -; CHECK-LABEL: @test1 -; CHECK: %const = bitcast i32 12345678 to i32 -; CHECK: %1 = inttoptr i32 %const to %T* -; CHECK: %addr1 = getelementptr %T, %T* %1, i32 0, i32 1 - %addr1 = getelementptr %T, %T* inttoptr (i32 12345678 to %T*), i32 0, i32 1 - %tmp1 = load i32, i32* %addr1 - %addr2 = getelementptr %T, %T* inttoptr (i32 12345678 to %T*), i32 0, i32 2 - %tmp2 = load i32, i32* %addr2 - %addr3 = getelementptr %T, %T* inttoptr (i32 12345678 to %T*), i32 0, i32 3 - %tmp3 = load i32, i32* %addr3 - %tmp4 = add i32 %tmp1, %tmp2 - %tmp5 = add i32 %tmp3, %tmp4 - ret i32 %tmp5 -} - diff --git a/llvm/test/Transforms/ConstantHoisting/X86/dbg-dominatingblock.ll b/llvm/test/Transforms/ConstantHoisting/X86/dbg-dominatingblock.ll deleted file mode 100644 index 0f7c5766654..00000000000 --- a/llvm/test/Transforms/ConstantHoisting/X86/dbg-dominatingblock.ll +++ /dev/null @@ -1,55 +0,0 @@ -; RUN: opt -S -consthoist < %s | FileCheck %s -; ModuleID = 'test-hoist-debug.cpp' -source_filename = "test-hoist-debug.cpp" -target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" - -; Function Attrs: noinline nounwind optnone uwtable -define i32 @_Z3foov() !dbg !7 { -; CHECK: bitcast -; CHECK-NOT: !dbg !11 -; CHECK: inttoptr -entry: - %a0 = inttoptr i64 4646526064 to i32* - %v0 = load i32, i32* %a0, align 16, !dbg !11 - %c = alloca i32, align 4 - store i32 1, i32* %c, align 4 - %0 = load i32, i32* %c, align 4 - %cmp = icmp eq i32 %0, 0 - br i1 %cmp, label %if.then, label %if.else - -if.then: ; preds = %entry - %a1 = inttoptr i64 4646526080 to i32* - %v1 = load i32, i32* %a1, align 16, !dbg !11 - br label %return - -if.else: ; preds = %entry - %a2 = inttoptr i64 4646526096 to i32* - %v2 = load i32, i32* %a2, align 16, !dbg !11 - br label %return - -return: ; preds = %if.else, %if.then - %vx = phi i32 [%v1, %if.then], [%v2, %if.else] - %r0 = add i32 %vx, %v0 - - ret i32 %r0 -} - -!llvm.dbg.cu = !{!0} -!llvm.module.flags = !{!3, !4, !5} -!llvm.ident = !{!6} - -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 6.0.0 (trunk 313291)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2) -!1 = !DIFile(filename: "test-hoist-debug.cpp", directory: "/tmp") -!2 = !{} -!3 = !{i32 2, !"Dwarf Version", i32 4} -!4 = !{i32 2, !"Debug Info Version", i32 3} -!5 = !{i32 1, !"wchar_size", i32 4} -!6 = !{!"clang version 6.0.0 (trunk 313291)"} -!7 = distinct !DISubprogram(name: "foo", linkageName: "_Z3foov", scope: !1, file: !1, line: 1, type: !8, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2) -!8 = !DISubroutineType(types: !9) -!9 = !{!10} -!10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -!11 = !DILocation(line: 2, column: 3, scope: !7) -!12 = !DILocation(line: 3, column: 3, scope: !7) -!13 = !DILocation(line: 4, column: 3, scope: !7) diff --git a/llvm/test/Transforms/ConstantHoisting/X86/dbg-samebasicblock.ll b/llvm/test/Transforms/ConstantHoisting/X86/dbg-samebasicblock.ll deleted file mode 100644 index 75445666e7e..00000000000 --- a/llvm/test/Transforms/ConstantHoisting/X86/dbg-samebasicblock.ll +++ /dev/null @@ -1,41 +0,0 @@ -; RUN: opt -S -consthoist < %s | FileCheck %s -; ModuleID = 'test-hoist-debug.cpp' -source_filename = "test-hoist-debug.cpp" -target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" - -; Function Attrs: noinline nounwind optnone uwtable -define i32 @_Z3foov() !dbg !7 { -; CHECK: bitcast -; CHECK: !dbg !11 -; CHECK: inttoptr - %a0 = inttoptr i64 4646526064 to i32*, !dbg !11 - %v0 = load i32, i32* %a0, align 16, !dbg !11 - - %a1 = inttoptr i64 4646526080 to i32* - %v1 = load i32, i32* %a1, align 16, !dbg !11 - - %a2 = inttoptr i64 4646526096 to i32* - %v2 = load i32, i32* %a2, align 16, !dbg !11 - - %r0 = add i32 %v0, %v1 - %r1 = add i32 %r0, %v2 - ret i32 %r1 -} - -!llvm.dbg.cu = !{!0} -!llvm.module.flags = !{!3, !4, !5} -!llvm.ident = !{!6} - -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 6.0.0 (trunk 313291)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2) -!1 = !DIFile(filename: "test-hoist-debug.cpp", directory: "/tmp") -!2 = !{} -!3 = !{i32 2, !"Dwarf Version", i32 4} -!4 = !{i32 2, !"Debug Info Version", i32 3} -!5 = !{i32 1, !"wchar_size", i32 4} -!6 = !{!"clang version 6.0.0 (trunk 313291)"} -!7 = distinct !DISubprogram(name: "foo", linkageName: "_Z3foov", scope: !1, file: !1, line: 1, type: !8, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2) -!8 = !DISubroutineType(types: !9) -!9 = !{!10} -!10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -!11 = !DILocation(line: 2, column: 3, scope: !7) diff --git a/llvm/test/Transforms/ConstantHoisting/X86/delete-dead-cast-inst.ll b/llvm/test/Transforms/ConstantHoisting/X86/delete-dead-cast-inst.ll deleted file mode 100644 index 5df4c1a376e..00000000000 --- a/llvm/test/Transforms/ConstantHoisting/X86/delete-dead-cast-inst.ll +++ /dev/null @@ -1,22 +0,0 @@ -; RUN: opt -S -consthoist < %s | FileCheck %s - -target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-apple-macosx10.9.0" - -%T = type { i32, i32, i32, i32 } - -define i32 @test1() nounwind { -; CHECK-LABEL: @test1 -; CHECK: %const = bitcast i32 12345678 to i32 -; CHECK-NOT: %base = inttoptr i32 12345678 to %T* -; CHECK-NEXT: %1 = inttoptr i32 %const to %T* -; CHECK-NEXT: %addr1 = getelementptr %T, %T* %1, i32 0, i32 1 -; CHECK-NEXT: %addr2 = getelementptr %T, %T* %1, i32 0, i32 2 -; CHECK-NEXT: %addr3 = getelementptr %T, %T* %1, i32 0, i32 3 - %base = inttoptr i32 12345678 to %T* - %addr1 = getelementptr %T, %T* %base, i32 0, i32 1 - %addr2 = getelementptr %T, %T* %base, i32 0, i32 2 - %addr3 = getelementptr %T, %T* %base, i32 0, i32 3 - ret i32 12345678 -} - diff --git a/llvm/test/Transforms/ConstantHoisting/X86/ehpad.ll b/llvm/test/Transforms/ConstantHoisting/X86/ehpad.ll deleted file mode 100644 index 5e345c4515d..00000000000 --- a/llvm/test/Transforms/ConstantHoisting/X86/ehpad.ll +++ /dev/null @@ -1,70 +0,0 @@ -; RUN: opt -S -consthoist -consthoist-with-block-frequency=false < %s | FileCheck %s -; RUN: opt -S -consthoist -consthoist-with-block-frequency=true < %s | FileCheck --check-prefix=BFIHOIST %s - -target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-pc-windows-msvc" - -; CHECK-LABEL: define i32 @main -; CHECK: %tobool = icmp eq i32 %argc, 0 -; CHECK-NEXT: bitcast i64 9209618997431186100 to i64 -; CHECK-NEXT: br i1 %tobool - -; BFIHOIST-LABEL: define i32 @main -; BFIHOIST: then: -; BFIHOIST: %[[CONST1:.*]] = bitcast i64 9209618997431186100 to i64 -; BFIHOIST: %add = add i64 %call4, %[[CONST1]] -; BFIHOIST: br label %endif -; BFIHOIST: else: -; BFIHOIST: %[[CONST2:.*]] = bitcast i64 9209618997431186100 to i64 -; BFIHOIST: %add6 = add i64 %call5, %[[CONST2]] -; BFIHOIST: br label %endif - -; Function Attrs: norecurse -define i32 @main(i32 %argc, i8** nocapture readnone %argv) local_unnamed_addr #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) { - %call = tail call i64 @fn(i64 0) - %call1 = tail call i64 @fn(i64 1) - %tobool = icmp eq i32 %argc, 0 - br i1 %tobool, label %2, label %1 - -; <label>:1: ; preds = %0 - %call2 = invoke i64 @fn(i64 %call) - to label %6 unwind label %catch.dispatch - -; <label>:2: ; preds = %0 - %call3 = invoke i64 @fn(i64 %call1) - to label %6 unwind label %catch.dispatch - -catch.dispatch: ; preds = %2, %1 - %z.0 = phi i64 [ %call, %1 ], [ %call1, %2 ] - %3 = catchswitch within none [label %4] unwind to caller - -; <label>:4: ; preds = %catch.dispatch - %5 = catchpad within %3 [i8* null, i32 64, i8* null] - br i1 %tobool, label %then, label %else - -then: - %call4 = tail call i64 @fn(i64 %z.0) [ "funclet"(token %5) ] - %add = add i64 %call4, 9209618997431186100 - br label %endif - -else: - %call5 = tail call i64 @fn(i64 0) [ "funclet"(token %5) ] - %add6 = add i64 %call5, 9209618997431186100 - br label %endif - -endif: - %v = phi i64 [ %add, %then ], [ %add6, %else ] - %call7 = tail call i64 @fn(i64 %v) [ "funclet"(token %5) ] - %call8 = tail call i64 @fn(i64 %call7) [ "funclet"(token %5) ] - catchret from %5 to label %6 - -; <label>:6: ; preds = %1, %2, %4 - ret i32 0 -} - -declare i64 @fn(i64) local_unnamed_addr #1 - -declare i32 @__CxxFrameHandler3(...) - -attributes #0 = { norecurse "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "stack-protector-buffer-size"="8" "target-features"="+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } -attributes #1 = { "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "stack-protector-buffer-size"="8" "target-features"="+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } diff --git a/llvm/test/Transforms/ConstantHoisting/X86/large-immediate.ll b/llvm/test/Transforms/ConstantHoisting/X86/large-immediate.ll deleted file mode 100644 index b8c04f38b12..00000000000 --- a/llvm/test/Transforms/ConstantHoisting/X86/large-immediate.ll +++ /dev/null @@ -1,36 +0,0 @@ -; RUN: opt -mtriple=x86_64-darwin-unknown -S -consthoist < %s | FileCheck %s - -define i128 @test1(i128 %a) nounwind { -; CHECK-LABEL: test1 -; CHECK: %const = bitcast i128 12297829382473034410122878 to i128 - %1 = add i128 %a, 12297829382473034410122878 - %2 = add i128 %1, 12297829382473034410122878 - ret i128 %2 -} - -; Check that we don't hoist the shift value of a shift instruction. -define i512 @test2(i512 %a) nounwind { -; CHECK-LABEL: test2 -; CHECK-NOT: %const = bitcast i512 504 to i512 - %1 = shl i512 %a, 504 - %2 = ashr i512 %1, 504 - ret i512 %2 -} - -; Check that we don't hoist constants with a type larger than i128. -define i196 @test3(i196 %a) nounwind { -; CHECK-LABEL: test3 -; CHECK-NOT: %const = bitcast i196 2 to i196 - %1 = mul i196 %a, 2 - %2 = mul i196 %1, 2 - ret i196 %2 -} - -; Check that we don't hoist immediates with small values. -define i96 @test4(i96 %a) nounwind { -; CHECK-LABEL: test4 -; CHECK-NOT: %const = bitcast i96 2 to i96 - %1 = mul i96 %a, 2 - %2 = add i96 %1, 2 - ret i96 %2 -} diff --git a/llvm/test/Transforms/ConstantHoisting/X86/lit.local.cfg b/llvm/test/Transforms/ConstantHoisting/X86/lit.local.cfg deleted file mode 100644 index e71f3cc4c41..00000000000 --- a/llvm/test/Transforms/ConstantHoisting/X86/lit.local.cfg +++ /dev/null @@ -1,3 +0,0 @@ -if not 'X86' in config.root.targets: - config.unsupported = True - diff --git a/llvm/test/Transforms/ConstantHoisting/X86/phi.ll b/llvm/test/Transforms/ConstantHoisting/X86/phi.ll deleted file mode 100644 index f9fba3ee26a..00000000000 --- a/llvm/test/Transforms/ConstantHoisting/X86/phi.ll +++ /dev/null @@ -1,117 +0,0 @@ -; RUN: opt -S -consthoist < %s | FileCheck %s -; RUN: opt -S -passes=consthoist < %s | FileCheck %s - -target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-apple-macosx10.9.0" - -; PR18626 -define i8* @test1(i1 %cmp, i64* %tmp) { -entry: - call void @foo(i8* inttoptr (i64 68719476735 to i8*)) - br i1 %cmp, label %if.end, label %return - -if.end: ; preds = %bb1 - call void @foo(i8* inttoptr (i64 68719476736 to i8*)) - br label %return - -return: - %retval.0 = phi i8* [ null, %entry ], [ inttoptr (i64 68719476736 to i8*), %if.end ] - store i64 1172321806, i64* %tmp - ret i8* %retval.0 - -; CHECK-LABEL: @test1 -; CHECK: if.end: -; CHECK: %2 = inttoptr i64 %const to i8* -; CHECK-NEXT: br -; CHECK: return: -; CHECK-NEXT: %retval.0 = phi i8* [ null, %entry ], [ %2, %if.end ] -} - -define void @test2(i1 %cmp, i64** %tmp) { -entry: - call void @foo(i8* inttoptr (i64 68719476736 to i8*)) - br i1 %cmp, label %if.end, label %return - -if.end: ; preds = %bb1 - call void @foo(i8* inttoptr (i64 68719476736 to i8*)) - br label %return - -return: - store i64* inttoptr (i64 68719476735 to i64*), i64** %tmp - ret void - -; CHECK-LABEL: @test2 -; CHECK: return: -; CHECK-NEXT: %const_mat = add i64 %const, -1 -; CHECK-NEXT: inttoptr i64 %const_mat to i64* -} - -declare void @foo(i8*) - -; PR18768 -define i32 @test3(i1 %c) { -entry: - br i1 %c, label %if.then, label %if.end3 - -if.then: ; preds = %entry - br label %if.end3 - -if.end3: ; preds = %if.then, %entry - %d.0 = phi i32* [ inttoptr (i64 985162435264511 to i32*), %entry ], [ null, %if.then ] - %cmp4 = icmp eq i32* %d.0, inttoptr (i64 985162435264511 to i32*) - %cmp6 = icmp eq i32* %d.0, inttoptr (i64 985162418487296 to i32*) - %or = or i1 %cmp4, %cmp6 - br i1 %or, label %if.then8, label %if.end9 - -if.then8: ; preds = %if.end3 - ret i32 1 - -if.end9: ; preds = %if.then8, %if.end3 - ret i32 undef -} - -; <rdar://problem/16394449> -define i64 @switch_test1(i64 %a) { -; CHECK-LABEL: @switch_test1 -; CHECK: %0 = phi i64 [ %const, %case2 ], [ %const_mat, %Entry ], [ %const_mat, %Entry ] -Entry: - %sel = add i64 %a, 4519019440 - switch i64 %sel, label %fail [ - i64 462, label %continuation - i64 449, label %case2 - i64 443, label %continuation - ] - -case2: - br label %continuation - -continuation: - %0 = phi i64 [ 4519019440, %case2 ], [ 4519019460, %Entry ], [ 4519019460, %Entry ] - ret i64 0; - -fail: - ret i64 -1; -} - -define i64 @switch_test2(i64 %a) { -; CHECK-LABEL: @switch_test2 -; CHECK: %2 = phi i64* [ %1, %case2 ], [ %0, %Entry ], [ %0, %Entry ] -Entry: - %sel = add i64 %a, 4519019440 - switch i64 %sel, label %fail [ - i64 462, label %continuation - i64 449, label %case2 - i64 443, label %continuation - ] - -case2: - br label %continuation - -continuation: - %0 = phi i64* [ inttoptr(i64 4519019440 to i64*), %case2 ], [ inttoptr(i64 4519019460 to i64*), %Entry ], [ inttoptr(i64 4519019460 to i64*), %Entry ] - ret i64 0; - -fail: - ret i64 -1; -} - diff --git a/llvm/test/Transforms/ConstantHoisting/X86/stackmap.ll b/llvm/test/Transforms/ConstantHoisting/X86/stackmap.ll deleted file mode 100644 index b9aee6b38fb..00000000000 --- a/llvm/test/Transforms/ConstantHoisting/X86/stackmap.ll +++ /dev/null @@ -1,17 +0,0 @@ -; RUN: opt -S -consthoist < %s | FileCheck %s - -target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-apple-macosx10.9.0" - -; Test if the 3rd argument of a stackmap is hoisted. -define i128 @test1(i128 %a) { -; CHECK-LABEL: @test1 -; CHECK: %const = bitcast i128 134646182756734033220 to i128 -; CHECK: tail call void (i64, i32, ...) @llvm.experimental.stackmap(i64 1, i32 24, i128 %const) -entry: - %0 = add i128 %a, 134646182756734033220 - tail call void (i64, i32, ...) @llvm.experimental.stackmap(i64 1, i32 24, i128 134646182756734033220) - ret i128 %0 -} - -declare void @llvm.experimental.stackmap(i64, i32, ...) |