From 05dee7f1ac515f9689e0443ae05dba121b108823 Mon Sep 17 00:00:00 2001 From: Rong Xu Date: Tue, 24 Nov 2015 23:57:51 +0000 Subject: [PATCH] Revert r254021 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254042 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../PGOProfile/Inputs/branch1.proftext | 6 -- .../PGOProfile/Inputs/branch2.proftext | 6 -- .../PGOProfile/Inputs/criticaledge.proftext | 17 ---- .../PGOProfile/Inputs/landingpad.proftext | 14 --- .../PGOProfile/Inputs/loop1.proftext | 6 -- .../PGOProfile/Inputs/loop2.proftext | 6 -- .../PGOProfile/Inputs/loop3.proftext | 8 -- .../PGOProfile/Inputs/single_bb.proftext | 5 - .../PGOProfile/Inputs/switch.proftext | 8 -- test/Transforms/PGOProfile/branch1_use.ll | 21 ----- test/Transforms/PGOProfile/branch2_use.ll | 25 ----- .../PGOProfile/checksum_mismatch.ll | 18 ---- test/Transforms/PGOProfile/landingpad_use.ll | 94 ------------------- test/Transforms/PGOProfile/loop1_gen.ll | 29 ------ test/Transforms/PGOProfile/loop1_use.ll | 29 ------ test/Transforms/PGOProfile/loop2_gen.ll | 26 ----- test/Transforms/PGOProfile/loop2_use.ll | 26 ----- test/Transforms/PGOProfile/single_bb_gen.ll | 11 --- 18 files changed, 355 deletions(-) delete mode 100644 test/Transforms/PGOProfile/Inputs/branch1.proftext delete mode 100644 test/Transforms/PGOProfile/Inputs/branch2.proftext delete mode 100644 test/Transforms/PGOProfile/Inputs/criticaledge.proftext delete mode 100644 test/Transforms/PGOProfile/Inputs/landingpad.proftext delete mode 100644 test/Transforms/PGOProfile/Inputs/loop1.proftext delete mode 100644 test/Transforms/PGOProfile/Inputs/loop2.proftext delete mode 100644 test/Transforms/PGOProfile/Inputs/loop3.proftext delete mode 100644 test/Transforms/PGOProfile/Inputs/single_bb.proftext delete mode 100644 test/Transforms/PGOProfile/Inputs/switch.proftext delete mode 100644 test/Transforms/PGOProfile/branch1_use.ll delete mode 100644 test/Transforms/PGOProfile/branch2_use.ll delete mode 100644 test/Transforms/PGOProfile/checksum_mismatch.ll delete mode 100644 test/Transforms/PGOProfile/landingpad_use.ll delete mode 100644 test/Transforms/PGOProfile/loop1_gen.ll delete mode 100644 test/Transforms/PGOProfile/loop1_use.ll delete mode 100644 test/Transforms/PGOProfile/loop2_gen.ll delete mode 100644 test/Transforms/PGOProfile/loop2_use.ll delete mode 100644 test/Transforms/PGOProfile/single_bb_gen.ll diff --git a/test/Transforms/PGOProfile/Inputs/branch1.proftext b/test/Transforms/PGOProfile/Inputs/branch1.proftext deleted file mode 100644 index 3fa0a9bc11f..00000000000 --- a/test/Transforms/PGOProfile/Inputs/branch1.proftext +++ /dev/null @@ -1,6 +0,0 @@ -_Z9test_br_1i -23925403969 -2 -3 -2 - diff --git a/test/Transforms/PGOProfile/Inputs/branch2.proftext b/test/Transforms/PGOProfile/Inputs/branch2.proftext deleted file mode 100644 index 034bca05bb2..00000000000 --- a/test/Transforms/PGOProfile/Inputs/branch2.proftext +++ /dev/null @@ -1,6 +0,0 @@ -_Z9test_br_2i -29368252703 -2 -1 -1 - diff --git a/test/Transforms/PGOProfile/Inputs/criticaledge.proftext b/test/Transforms/PGOProfile/Inputs/criticaledge.proftext deleted file mode 100644 index 0414011cf53..00000000000 --- a/test/Transforms/PGOProfile/Inputs/criticaledge.proftext +++ /dev/null @@ -1,17 +0,0 @@ -_Z17test_criticalEdgeii -82348442248 -8 -2 -1 -2 -2 -0 -1 -2 -1 - -:_ZL3bari -12884901887 -1 -7 - diff --git a/test/Transforms/PGOProfile/Inputs/landingpad.proftext b/test/Transforms/PGOProfile/Inputs/landingpad.proftext deleted file mode 100644 index 3d932ac6c1c..00000000000 --- a/test/Transforms/PGOProfile/Inputs/landingpad.proftext +++ /dev/null @@ -1,14 +0,0 @@ -_Z3fooi -57451243578 -4 -3 -1 -2 -0 - -_Z3bari -23319865734 -2 -1 -2 - diff --git a/test/Transforms/PGOProfile/Inputs/loop1.proftext b/test/Transforms/PGOProfile/Inputs/loop1.proftext deleted file mode 100644 index a3f7dab9fbc..00000000000 --- a/test/Transforms/PGOProfile/Inputs/loop1.proftext +++ /dev/null @@ -1,6 +0,0 @@ -_Z15test_simple_fori -32052181608 -2 -96 -4 - diff --git a/test/Transforms/PGOProfile/Inputs/loop2.proftext b/test/Transforms/PGOProfile/Inputs/loop2.proftext deleted file mode 100644 index c075a5b3f56..00000000000 --- a/test/Transforms/PGOProfile/Inputs/loop2.proftext +++ /dev/null @@ -1,6 +0,0 @@ -_Z13test_do_whilei -29706172832 -2 -96 -4 - diff --git a/test/Transforms/PGOProfile/Inputs/loop3.proftext b/test/Transforms/PGOProfile/Inputs/loop3.proftext deleted file mode 100644 index ff19b010931..00000000000 --- a/test/Transforms/PGOProfile/Inputs/loop3.proftext +++ /dev/null @@ -1,8 +0,0 @@ -_Z15test_nested_foriii -75296580464 -4 -186 -33 -10 -6 - diff --git a/test/Transforms/PGOProfile/Inputs/single_bb.proftext b/test/Transforms/PGOProfile/Inputs/single_bb.proftext deleted file mode 100644 index bd14d2c151b..00000000000 --- a/test/Transforms/PGOProfile/Inputs/single_bb.proftext +++ /dev/null @@ -1,5 +0,0 @@ -_Z9single_bbv -12884999999 -1 -1 - diff --git a/test/Transforms/PGOProfile/Inputs/switch.proftext b/test/Transforms/PGOProfile/Inputs/switch.proftext deleted file mode 100644 index 11407f3e11f..00000000000 --- a/test/Transforms/PGOProfile/Inputs/switch.proftext +++ /dev/null @@ -1,8 +0,0 @@ -_Z13test_switch_1i -46628225222 -4 -0 -0 -0 -3 - diff --git a/test/Transforms/PGOProfile/branch1_use.ll b/test/Transforms/PGOProfile/branch1_use.ll deleted file mode 100644 index 44999a7b57b..00000000000 --- a/test/Transforms/PGOProfile/branch1_use.ll +++ /dev/null @@ -1,21 +0,0 @@ -; RUN: llvm-profdata merge %S/Inputs/branch1.proftext -o %T/branch1.profdata -; RUN: opt < %s -pgo-instr-use -pgo-profile-file=%T/branch1.profdata -S | FileCheck %s -target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" - -define i32 @_Z9test_br_1i(i32 %i) { -entry: - %cmp = icmp sgt i32 %i, 0 - br i1 %cmp, label %if.then, label %if.end -; CHECK: !prof !0 - -if.then: - %add = add nsw i32 %i, 2 - br label %if.end - -if.end: - %retv = phi i32 [ %add, %if.then ], [ %i, %entry ] - ret i32 %retv -} - -; CHECK: !0 = !{!"branch_weights", i32 2, i32 1} diff --git a/test/Transforms/PGOProfile/branch2_use.ll b/test/Transforms/PGOProfile/branch2_use.ll deleted file mode 100644 index f9f4dcf29b8..00000000000 --- a/test/Transforms/PGOProfile/branch2_use.ll +++ /dev/null @@ -1,25 +0,0 @@ -; RUN: llvm-profdata merge %S/Inputs/branch2.proftext -o %T/branch2.profdata -; RUN: opt < %s -pgo-instr-use -pgo-profile-file=%T/branch2.profdata -S | FileCheck %s -target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" - -define i32 @_Z9test_br_2i(i32 %i) { -entry: - %cmp = icmp sgt i32 %i, 0 - br i1 %cmp, label %if.then, label %if.else -; CHECK: !prof !0 - -if.then: - %add = add nsw i32 %i, 2 - br label %if.end - -if.else: - %sub = sub nsw i32 %i, 2 - br label %if.end - -if.end: - %retv = phi i32 [ %add, %if.then ], [ %sub, %if.else ] - ret i32 %retv -} - -; CHECK: !0 = !{!"branch_weights", i32 1, i32 1} diff --git a/test/Transforms/PGOProfile/checksum_mismatch.ll b/test/Transforms/PGOProfile/checksum_mismatch.ll deleted file mode 100644 index 3330dae61c0..00000000000 --- a/test/Transforms/PGOProfile/checksum_mismatch.ll +++ /dev/null @@ -1,18 +0,0 @@ -; RUN: llvm-profdata merge %S/Inputs/single_bb.proftext -o %T/single_bb.profdata -; RUN: opt < %s -pgo-instr-use -pgo-profile-file=%T/single_bb.profdata -S 2>&1 | FileCheck %s - -; CHECK: Function control flow change detected (hash mismatch) _Z9single_bbv -; CHECK: No profile data available for function _ZL8uncalledii - -target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" - -define i32 @_Z9single_bbv() { -entry: - ret i32 0 -} - -define i32 @_ZL8uncalledii(i32 %i, i32 %j) { - %mul = mul nsw i32 %i, %j - ret i32 %mul -} diff --git a/test/Transforms/PGOProfile/landingpad_use.ll b/test/Transforms/PGOProfile/landingpad_use.ll deleted file mode 100644 index db76739a975..00000000000 --- a/test/Transforms/PGOProfile/landingpad_use.ll +++ /dev/null @@ -1,94 +0,0 @@ -; RUN: llvm-profdata merge %S/Inputs/landingpad.proftext -o %T/landingpad.profdata -; RUN: opt < %s -pgo-instr-use -pgo-profile-file=%T/landingpad.profdata -S | FileCheck %s -target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" - -@val = global i32 0, align 4 -@_ZTIi = external constant i8* - -define i32 @_Z3bari(i32 %i) { -entry: - %rem = srem i32 %i, 3 - %tobool = icmp ne i32 %rem, 0 - br i1 %tobool, label %if.then, label %if.end -; CHECK: !prof !0 - -if.then: - %exception = call i8* @__cxa_allocate_exception(i64 4) - %tmp = bitcast i8* %exception to i32* - store i32 %i, i32* %tmp, align 16 - call void @__cxa_throw(i8* %exception, i8* bitcast (i8** @_ZTIi to i8*), i8* null) - unreachable - -if.end: - ret i32 0 -} - -declare i8* @__cxa_allocate_exception(i64) - -declare void @__cxa_throw(i8*, i8*, i8*) - -define i32 @_Z3fooi(i32 %i) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { -entry: - %rem = srem i32 %i, 2 - %tobool = icmp ne i32 %rem, 0 - br i1 %tobool, label %if.then, label %if.end -; CHECK: !prof !1 - -if.then: - %mul = mul nsw i32 %i, 7 - %call = invoke i32 @_Z3bari(i32 %mul) - to label %invoke.cont unwind label %lpad - -invoke.cont: - br label %if.end - -lpad: - %tmp = landingpad { i8*, i32 } - catch i8* bitcast (i8** @_ZTIi to i8*) - %tmp1 = extractvalue { i8*, i32 } %tmp, 0 - %tmp2 = extractvalue { i8*, i32 } %tmp, 1 - br label %catch.dispatch - -catch.dispatch: - %tmp3 = call i32 @llvm.eh.typeid.for(i8* bitcast (i8** @_ZTIi to i8*)) - %matches = icmp eq i32 %tmp2, %tmp3 - br i1 %matches, label %catch, label %eh.resume -; CHECK: !prof !2 - -catch: - %tmp4 = call i8* @__cxa_begin_catch(i8* %tmp1) - %tmp5 = bitcast i8* %tmp4 to i32* - %tmp6 = load i32, i32* %tmp5, align 4 - %tmp7 = load i32, i32* @val, align 4 - %sub = sub nsw i32 %tmp7, %tmp6 - store i32 %sub, i32* @val, align 4 - call void @__cxa_end_catch() - br label %try.cont - -try.cont: - ret i32 -1 - -if.end: - %tmp8 = load i32, i32* @val, align 4 - %add = add nsw i32 %tmp8, %i - store i32 %add, i32* @val, align 4 - br label %try.cont - -eh.resume: - %lpad.val = insertvalue { i8*, i32 } undef, i8* %tmp1, 0 - %lpad.val3 = insertvalue { i8*, i32 } %lpad.val, i32 %tmp2, 1 - resume { i8*, i32 } %lpad.val3 -} - -declare i32 @__gxx_personality_v0(...) - -declare i32 @llvm.eh.typeid.for(i8*) - -declare i8* @__cxa_begin_catch(i8*) - -declare void @__cxa_end_catch() - -; CHECK: !0 = !{!"branch_weights", i32 2, i32 1} -; CHECK: !1 = !{!"branch_weights", i32 3, i32 2} -; CHECK: !2 = !{!"branch_weights", i32 2, i32 0} diff --git a/test/Transforms/PGOProfile/loop1_gen.ll b/test/Transforms/PGOProfile/loop1_gen.ll deleted file mode 100644 index c0b20a40f67..00000000000 --- a/test/Transforms/PGOProfile/loop1_gen.ll +++ /dev/null @@ -1,29 +0,0 @@ -; RUN: opt < %s -pgo-instr-gen -S | FileCheck %s -target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" - -; CHECK: @__llvm_profile_name__Z15test_simple_fori = private constant [20 x i8] c"_Z15test_simple_fori" - -define i32 @_Z15test_simple_fori(i32 %n) { -entry: - br label %for.cond - -for.cond: - %i = phi i32 [ 0, %entry ], [ %inc1, %for.inc ] - %sum = phi i32 [ 1, %entry ], [ %inc, %for.inc ] - %cmp = icmp slt i32 %i, %n - br i1 %cmp, label %for.body, label %for.end - -for.body: - %inc = add nsw i32 %sum, 1 - br label %for.inc - -for.inc: -; CHECK: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @__llvm_profile_name__Z15test_simple_fori, i32 0, i32 0), i64 32052181608, i32 2, i32 0) - %inc1 = add nsw i32 %i, 1 - br label %for.cond - -for.end: -; CHECK: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @__llvm_profile_name__Z15test_simple_fori, i32 0, i32 0), i64 32052181608, i32 2, i32 1) - ret i32 %sum -} diff --git a/test/Transforms/PGOProfile/loop1_use.ll b/test/Transforms/PGOProfile/loop1_use.ll deleted file mode 100644 index f4eb1f35bfc..00000000000 --- a/test/Transforms/PGOProfile/loop1_use.ll +++ /dev/null @@ -1,29 +0,0 @@ -; RUN: llvm-profdata merge %S/Inputs/loop1.proftext -o %T/loop1.profdata -; RUN: opt < %s -pgo-instr-use -pgo-profile-file=%T/loop1.profdata -S | FileCheck %s -target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" - -define i32 @_Z15test_simple_fori(i32 %n) { -entry: - br label %for.cond - -for.cond: - %i = phi i32 [ 0, %entry ], [ %inc1, %for.inc ] - %sum = phi i32 [ 1, %entry ], [ %inc, %for.inc ] - %cmp = icmp slt i32 %i, %n - br i1 %cmp, label %for.body, label %for.end -; CHECK: !prof !0 - -for.body: - %inc = add nsw i32 %sum, 1 - br label %for.inc - -for.inc: - %inc1 = add nsw i32 %i, 1 - br label %for.cond - -for.end: - ret i32 %sum -} - -; CHECK: !0 = !{!"branch_weights", i32 96, i32 4} diff --git a/test/Transforms/PGOProfile/loop2_gen.ll b/test/Transforms/PGOProfile/loop2_gen.ll deleted file mode 100644 index b540cac2fad..00000000000 --- a/test/Transforms/PGOProfile/loop2_gen.ll +++ /dev/null @@ -1,26 +0,0 @@ -; RUN: opt < %s -pgo-instr-gen -S | FileCheck %s -target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" - -; CHECK: @__llvm_profile_name__Z13test_do_whilei = private constant [18 x i8] c"_Z13test_do_whilei" - -define i32 @_Z13test_do_whilei(i32 %n) { -entry: - br label %do.body - -do.body: - %i.0 = phi i32 [ 0, %entry ], [ %inc1, %do.cond ] - %sum = phi i32 [ 1, %entry ], [ %inc, %do.cond ] -; CHECK: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__llvm_profile_name__Z13test_do_whilei, i32 0, i32 0), i64 29706172832, i32 2, i32 0) - %inc = add nsw i32 %sum, 1 - br label %do.cond - -do.cond: - %inc1 = add nsw i32 %i.0, 1 - %cmp = icmp slt i32 %i.0, %n - br i1 %cmp, label %do.body, label %do.end - -do.end: -; CHECK: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__llvm_profile_name__Z13test_do_whilei, i32 0, i32 0), i64 29706172832, i32 2, i32 1) - ret i32 %inc -} diff --git a/test/Transforms/PGOProfile/loop2_use.ll b/test/Transforms/PGOProfile/loop2_use.ll deleted file mode 100644 index 12666f424a5..00000000000 --- a/test/Transforms/PGOProfile/loop2_use.ll +++ /dev/null @@ -1,26 +0,0 @@ -; RUN: llvm-profdata merge %S/Inputs/loop2.proftext -o %T/loop2.profdata -; RUN: opt < %s -pgo-instr-use -pgo-profile-file=%T/loop2.profdata -S | FileCheck %s -target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" - -define i32 @_Z13test_do_whilei(i32 %n) { -entry: - br label %do.body - -do.body: - %i.0 = phi i32 [ 0, %entry ], [ %inc1, %do.cond ] - %sum = phi i32 [ 1, %entry ], [ %inc, %do.cond ] - %inc = add nsw i32 %sum, 1 - br label %do.cond - -do.cond: - %inc1 = add nsw i32 %i.0, 1 - %cmp = icmp slt i32 %i.0, %n - br i1 %cmp, label %do.body, label %do.end -; CHECK: !prof !0 - -do.end: - ret i32 %inc -} - -; CHECK: !0 = !{!"branch_weights", i32 92, i32 4} diff --git a/test/Transforms/PGOProfile/single_bb_gen.ll b/test/Transforms/PGOProfile/single_bb_gen.ll deleted file mode 100644 index 26eeb9dbdfc..00000000000 --- a/test/Transforms/PGOProfile/single_bb_gen.ll +++ /dev/null @@ -1,11 +0,0 @@ -; RUN: opt < %s -pgo-instr-gen -S | FileCheck %s -target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" - -; CHECK: @__llvm_profile_name__Z9single_bbv = private constant [13 x i8] c"_Z9single_bbv" - -define i32 @_Z9single_bbv() { -entry: -; CHECK: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__llvm_profile_name__Z9single_bbv, i32 0, i32 0), i64 12884901887, i32 1, i32 0) - ret i32 0 -} -- 2.34.1