forked from OSchip/llvm-project
[SimplifyCFG] Regenerate test checks (NFC)
Regenerate the branch weight test using --check-globals.
This commit is contained in:
parent
44fd4575b3
commit
54db12ff5a
|
@ -1,15 +1,18 @@
|
|||
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
||||
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals
|
||||
; RUN: opt -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S -o - < %s | FileCheck %s
|
||||
|
||||
declare void @helper(i32)
|
||||
|
||||
;.
|
||||
; CHECK: @[[MAX_REGNO:[a-zA-Z0-9_$"\\.-]+]] = common global i32 0, align 4
|
||||
;.
|
||||
define void @test1(i1 %a, i1 %b) {
|
||||
; CHECK-LABEL: @test1(
|
||||
; CHECK-NEXT: entry:
|
||||
; CHECK-NEXT: [[A_NOT:%.*]] = xor i1 [[A:%.*]], true
|
||||
; CHECK-NEXT: [[C:%.*]] = or i1 [[B:%.*]], false
|
||||
; CHECK-NEXT: [[OR_COND:%.*]] = select i1 [[A_NOT]], i1 [[C]], i1 false
|
||||
; CHECK-NEXT: br i1 [[OR_COND]], label [[Z:%.*]], label [[Y:%.*]], !prof !0
|
||||
; CHECK-NEXT: br i1 [[OR_COND]], label [[Z:%.*]], label [[Y:%.*]], !prof [[PROF0:![0-9]+]]
|
||||
; CHECK: Y:
|
||||
; CHECK-NEXT: call void @helper(i32 0)
|
||||
; CHECK-NEXT: ret void
|
||||
|
@ -41,7 +44,7 @@ define void @fake_weights(i1 %a, i1 %b) {
|
|||
; CHECK-NEXT: [[A_NOT:%.*]] = xor i1 [[A:%.*]], true
|
||||
; CHECK-NEXT: [[C:%.*]] = or i1 [[B:%.*]], false
|
||||
; CHECK-NEXT: [[OR_COND:%.*]] = select i1 [[A_NOT]], i1 [[C]], i1 false
|
||||
; CHECK-NEXT: br i1 [[OR_COND]], label [[Z:%.*]], label [[Y:%.*]], !prof !1
|
||||
; CHECK-NEXT: br i1 [[OR_COND]], label [[Z:%.*]], label [[Y:%.*]], !prof [[PROF1:![0-9]+]]
|
||||
; CHECK: Y:
|
||||
; CHECK-NEXT: call void @helper(i32 0)
|
||||
; CHECK-NEXT: ret void
|
||||
|
@ -69,7 +72,7 @@ define void @test2(i1 %a, i1 %b) {
|
|||
; CHECK-NEXT: entry:
|
||||
; CHECK-NEXT: [[C:%.*]] = or i1 [[B:%.*]], false
|
||||
; CHECK-NEXT: [[OR_COND:%.*]] = select i1 [[A:%.*]], i1 [[C]], i1 false
|
||||
; CHECK-NEXT: br i1 [[OR_COND]], label [[Z:%.*]], label [[Y:%.*]], !prof !2
|
||||
; CHECK-NEXT: br i1 [[OR_COND]], label [[Z:%.*]], label [[Y:%.*]], !prof [[PROF2:![0-9]+]]
|
||||
; CHECK: Y:
|
||||
; CHECK-NEXT: call void @helper(i32 0)
|
||||
; CHECK-NEXT: ret void
|
||||
|
@ -98,7 +101,7 @@ define void @test3(i1 %a, i1 %b) {
|
|||
; CHECK-NEXT: entry:
|
||||
; CHECK-NEXT: [[C:%.*]] = or i1 [[B:%.*]], false
|
||||
; CHECK-NEXT: [[OR_COND:%.*]] = select i1 [[A:%.*]], i1 [[C]], i1 false
|
||||
; CHECK-NEXT: br i1 [[OR_COND]], label [[Z:%.*]], label [[Y:%.*]], !prof !1
|
||||
; CHECK-NEXT: br i1 [[OR_COND]], label [[Z:%.*]], label [[Y:%.*]], !prof [[PROF1]]
|
||||
; CHECK: Y:
|
||||
; CHECK-NEXT: call void @helper(i32 0)
|
||||
; CHECK-NEXT: ret void
|
||||
|
@ -127,7 +130,7 @@ define void @test4(i1 %a, i1 %b) {
|
|||
; CHECK-NEXT: entry:
|
||||
; CHECK-NEXT: [[C:%.*]] = or i1 [[B:%.*]], false
|
||||
; CHECK-NEXT: [[OR_COND:%.*]] = select i1 [[A:%.*]], i1 [[C]], i1 false
|
||||
; CHECK-NEXT: br i1 [[OR_COND]], label [[Z:%.*]], label [[Y:%.*]], !prof !1
|
||||
; CHECK-NEXT: br i1 [[OR_COND]], label [[Z:%.*]], label [[Y:%.*]], !prof [[PROF1]]
|
||||
; CHECK: Y:
|
||||
; CHECK-NEXT: call void @helper(i32 0)
|
||||
; CHECK-NEXT: ret void
|
||||
|
@ -158,7 +161,7 @@ define void @test5(i32 %M, i32 %N) nounwind uwtable {
|
|||
; CHECK-NEXT: switch i32 [[N:%.*]], label [[SW2:%.*]] [
|
||||
; CHECK-NEXT: i32 3, label [[SW_BB1:%.*]]
|
||||
; CHECK-NEXT: i32 2, label [[SW_BB:%.*]]
|
||||
; CHECK-NEXT: ], !prof !3
|
||||
; CHECK-NEXT: ], !prof [[PROF3:![0-9]+]]
|
||||
; CHECK: sw.bb:
|
||||
; CHECK-NEXT: call void @helper(i32 0)
|
||||
; CHECK-NEXT: br label [[SW_EPILOG:%.*]]
|
||||
|
@ -204,7 +207,7 @@ define void @test6(i32 %M, i32 %N) nounwind uwtable {
|
|||
; CHECK-NEXT: i32 3, label [[SW_BB1:%.*]]
|
||||
; CHECK-NEXT: i32 2, label [[SW_BB:%.*]]
|
||||
; CHECK-NEXT: i32 4, label [[SW_BB5:%.*]]
|
||||
; CHECK-NEXT: ], !prof !4
|
||||
; CHECK-NEXT: ], !prof [[PROF4:![0-9]+]]
|
||||
; CHECK: sw.bb:
|
||||
; CHECK-NEXT: call void @helper(i32 0)
|
||||
; CHECK-NEXT: br label [[SW_EPILOG]]
|
||||
|
@ -258,7 +261,7 @@ define void @test1_swap(i1 %a, i1 %b) {
|
|||
; CHECK-NEXT: entry:
|
||||
; CHECK-NEXT: [[C:%.*]] = or i1 [[B:%.*]], false
|
||||
; CHECK-NEXT: [[OR_COND:%.*]] = select i1 [[A:%.*]], i1 true, i1 [[C]]
|
||||
; CHECK-NEXT: br i1 [[OR_COND]], label [[Y:%.*]], label [[Z:%.*]], !prof !5
|
||||
; CHECK-NEXT: br i1 [[OR_COND]], label [[Y:%.*]], label [[Z:%.*]], !prof [[PROF5:![0-9]+]]
|
||||
; CHECK: Y:
|
||||
; CHECK-NEXT: call void @helper(i32 0)
|
||||
; CHECK-NEXT: ret void
|
||||
|
@ -287,7 +290,7 @@ define void @test7(i1 %a, i1 %b) {
|
|||
; CHECK-NEXT: entry:
|
||||
; CHECK-NEXT: [[C:%.*]] = or i1 [[B:%.*]], false
|
||||
; CHECK-NEXT: [[BRMERGE:%.*]] = or i1 [[A:%.*]], [[C]]
|
||||
; CHECK-NEXT: br i1 [[BRMERGE]], label [[Y:%.*]], label [[Z:%.*]], !prof !6
|
||||
; CHECK-NEXT: br i1 [[BRMERGE]], label [[Y:%.*]], label [[Z:%.*]], !prof [[PROF6:![0-9]+]]
|
||||
; CHECK: Y:
|
||||
; CHECK-NEXT: call void @helper(i32 0)
|
||||
; CHECK-NEXT: ret void
|
||||
|
@ -316,7 +319,7 @@ define void @test8(i64 %x, i64 %y) nounwind {
|
|||
; CHECK-LABEL: @test8(
|
||||
; CHECK-NEXT: entry:
|
||||
; CHECK-NEXT: [[LT:%.*]] = icmp slt i64 [[X:%.*]], [[Y:%.*]]
|
||||
; CHECK-NEXT: br i1 [[LT]], label [[A:%.*]], label [[B:%.*]], !prof !7
|
||||
; CHECK-NEXT: br i1 [[LT]], label [[A:%.*]], label [[B:%.*]], !prof [[PROF7:![0-9]+]]
|
||||
; CHECK: a:
|
||||
; CHECK-NEXT: call void @helper(i32 0) #[[ATTR1:[0-9]+]]
|
||||
; CHECK-NEXT: ret void
|
||||
|
@ -353,7 +356,7 @@ define i1 @test9(i32 %x, i32 %y) nounwind {
|
|||
; CHECK-NEXT: i32 1, label [[END:%.*]]
|
||||
; CHECK-NEXT: i32 2, label [[END]]
|
||||
; CHECK-NEXT: i32 92, label [[END]]
|
||||
; CHECK-NEXT: ], !prof !8
|
||||
; CHECK-NEXT: ], !prof [[PROF8:![0-9]+]]
|
||||
; CHECK: a:
|
||||
; CHECK-NEXT: call void @helper(i32 0) #[[ATTR1]]
|
||||
; CHECK-NEXT: [[RETA:%.*]] = icmp slt i32 [[X]], [[Y:%.*]]
|
||||
|
@ -392,7 +395,7 @@ define void @test10(i32 %x) nounwind readnone ssp noredzone {
|
|||
; CHECK-NEXT: entry:
|
||||
; CHECK-NEXT: [[X_OFF:%.*]] = add i32 [[X:%.*]], -1
|
||||
; CHECK-NEXT: [[SWITCH:%.*]] = icmp ult i32 [[X_OFF]], 3
|
||||
; CHECK-NEXT: br i1 [[SWITCH]], label [[LOR_END:%.*]], label [[LOR_RHS:%.*]], !prof !9
|
||||
; CHECK-NEXT: br i1 [[SWITCH]], label [[LOR_END:%.*]], label [[LOR_RHS:%.*]], !prof [[PROF9:![0-9]+]]
|
||||
; CHECK: lor.rhs:
|
||||
; CHECK-NEXT: call void @helper(i32 1) #[[ATTR1]]
|
||||
; CHECK-NEXT: ret void
|
||||
|
@ -422,7 +425,7 @@ define void @test11(i32 %x) nounwind {
|
|||
; CHECK-LABEL: @test11(
|
||||
; CHECK-NEXT: [[I:%.*]] = shl i32 [[X:%.*]], 1
|
||||
; CHECK-NEXT: [[COND:%.*]] = icmp eq i32 [[I]], 24
|
||||
; CHECK-NEXT: br i1 [[COND]], label [[C:%.*]], label [[A:%.*]], !prof !10
|
||||
; CHECK-NEXT: br i1 [[COND]], label [[C:%.*]], label [[A:%.*]], !prof [[PROF10:![0-9]+]]
|
||||
; CHECK: a:
|
||||
; CHECK-NEXT: call void @helper(i32 0) #[[ATTR1]]
|
||||
; CHECK-NEXT: ret void
|
||||
|
@ -508,7 +511,7 @@ define void @test14(i32* %old, i32 %final) {
|
|||
; CHECK-NEXT: [[V3:%.*]] = load i32, i32* @max_regno, align 4
|
||||
; CHECK-NEXT: [[CMP4:%.*]] = icmp eq i32 [[I_1]], [[V3]]
|
||||
; CHECK-NEXT: [[OR_COND:%.*]] = select i1 [[TOBOOL]], i1 true, i1 [[CMP4]]
|
||||
; CHECK-NEXT: br i1 [[OR_COND]], label [[FOR_EXIT:%.*]], label [[FOR_INC]], !prof !11
|
||||
; CHECK-NEXT: br i1 [[OR_COND]], label [[FOR_EXIT:%.*]], label [[FOR_INC]], !prof [[PROF11:![0-9]+]]
|
||||
; CHECK: for.inc:
|
||||
; CHECK-NEXT: [[SHL]] = shl i32 [[BIT_0]], 1
|
||||
; CHECK-NEXT: [[INC19]] = add nsw i32 [[I_1]], 1
|
||||
|
@ -541,7 +544,7 @@ define i32 @HoistThenElseCodeToIf(i32 %n) {
|
|||
; CHECK-LABEL: @HoistThenElseCodeToIf(
|
||||
; CHECK-NEXT: entry:
|
||||
; CHECK-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[N:%.*]], 0
|
||||
; CHECK-NEXT: [[DOT:%.*]] = select i1 [[TOBOOL]], i32 1, i32 234, !prof !12
|
||||
; CHECK-NEXT: [[DOT:%.*]] = select i1 [[TOBOOL]], i32 1, i32 234, !prof [[PROF12:![0-9]+]]
|
||||
; CHECK-NEXT: ret i32 [[DOT]]
|
||||
;
|
||||
entry:
|
||||
|
@ -565,8 +568,8 @@ define i32 @SimplifyCondBranchToCondBranch(i1 %cmpa, i1 %cmpb) {
|
|||
; CHECK-LABEL: @SimplifyCondBranchToCondBranch(
|
||||
; CHECK-NEXT: block1:
|
||||
; CHECK-NEXT: [[BRMERGE:%.*]] = or i1 [[CMPA:%.*]], [[CMPB:%.*]]
|
||||
; CHECK-NEXT: [[DOTMUX:%.*]] = select i1 [[CMPA]], i32 0, i32 2, !prof !13
|
||||
; CHECK-NEXT: [[OUTVAL:%.*]] = select i1 [[BRMERGE]], i32 [[DOTMUX]], i32 1, !prof !14
|
||||
; CHECK-NEXT: [[DOTMUX:%.*]] = select i1 [[CMPA]], i32 0, i32 2, !prof [[PROF13:![0-9]+]]
|
||||
; CHECK-NEXT: [[OUTVAL:%.*]] = select i1 [[BRMERGE]], i32 [[DOTMUX]], i32 1, !prof [[PROF14:![0-9]+]]
|
||||
; CHECK-NEXT: ret i32 [[OUTVAL]]
|
||||
;
|
||||
block1:
|
||||
|
@ -592,8 +595,8 @@ define i32 @SimplifyCondBranchToCondBranchSwap(i1 %cmpa, i1 %cmpb) {
|
|||
; CHECK-NEXT: [[CMPA_NOT:%.*]] = xor i1 [[CMPA:%.*]], true
|
||||
; CHECK-NEXT: [[CMPB_NOT:%.*]] = xor i1 [[CMPB:%.*]], true
|
||||
; CHECK-NEXT: [[BRMERGE:%.*]] = or i1 [[CMPA_NOT]], [[CMPB_NOT]]
|
||||
; CHECK-NEXT: [[DOTMUX:%.*]] = select i1 [[CMPA_NOT]], i32 0, i32 2, !prof !15
|
||||
; CHECK-NEXT: [[OUTVAL:%.*]] = select i1 [[BRMERGE]], i32 [[DOTMUX]], i32 1, !prof !16
|
||||
; CHECK-NEXT: [[DOTMUX:%.*]] = select i1 [[CMPA_NOT]], i32 0, i32 2, !prof [[PROF15:![0-9]+]]
|
||||
; CHECK-NEXT: [[OUTVAL:%.*]] = select i1 [[BRMERGE]], i32 [[DOTMUX]], i32 1, !prof [[PROF16:![0-9]+]]
|
||||
; CHECK-NEXT: ret i32 [[OUTVAL]]
|
||||
;
|
||||
block1:
|
||||
|
@ -617,8 +620,8 @@ define i32 @SimplifyCondBranchToCondBranchSwapMissingWeight(i1 %cmpa, i1 %cmpb)
|
|||
; CHECK-NEXT: [[CMPA_NOT:%.*]] = xor i1 [[CMPA:%.*]], true
|
||||
; CHECK-NEXT: [[CMPB_NOT:%.*]] = xor i1 [[CMPB:%.*]], true
|
||||
; CHECK-NEXT: [[BRMERGE:%.*]] = or i1 [[CMPA_NOT]], [[CMPB_NOT]]
|
||||
; CHECK-NEXT: [[DOTMUX:%.*]] = select i1 [[CMPA_NOT]], i32 0, i32 2, !prof !17
|
||||
; CHECK-NEXT: [[OUTVAL:%.*]] = select i1 [[BRMERGE]], i32 [[DOTMUX]], i32 1, !prof !18
|
||||
; CHECK-NEXT: [[DOTMUX:%.*]] = select i1 [[CMPA_NOT]], i32 0, i32 2, !prof [[PROF17:![0-9]+]]
|
||||
; CHECK-NEXT: [[OUTVAL:%.*]] = select i1 [[BRMERGE]], i32 [[DOTMUX]], i32 1, !prof [[PROF18:![0-9]+]]
|
||||
; CHECK-NEXT: ret i32 [[OUTVAL]]
|
||||
;
|
||||
block1:
|
||||
|
@ -643,7 +646,7 @@ define void @or_icmps_harmful(i32 %x, i32 %y, i8* %p) {
|
|||
; CHECK-LABEL: @or_icmps_harmful(
|
||||
; CHECK-NEXT: entry:
|
||||
; CHECK-NEXT: [[EXPECTED_TRUE:%.*]] = icmp sgt i32 [[X:%.*]], -1
|
||||
; CHECK-NEXT: br i1 [[EXPECTED_TRUE]], label [[EXIT:%.*]], label [[RARE:%.*]], !prof !19
|
||||
; CHECK-NEXT: br i1 [[EXPECTED_TRUE]], label [[EXIT:%.*]], label [[RARE:%.*]], !prof [[PROF19:![0-9]+]]
|
||||
; CHECK: rare:
|
||||
; CHECK-NEXT: [[EXPENSIVE:%.*]] = icmp eq i32 [[Y:%.*]], 0
|
||||
; CHECK-NEXT: br i1 [[EXPENSIVE]], label [[EXIT]], label [[FALSE:%.*]]
|
||||
|
@ -676,7 +679,7 @@ define void @or_icmps_harmful_inverted(i32 %x, i32 %y, i8* %p) {
|
|||
; CHECK-LABEL: @or_icmps_harmful_inverted(
|
||||
; CHECK-NEXT: entry:
|
||||
; CHECK-NEXT: [[EXPECTED_FALSE:%.*]] = icmp sgt i32 [[X:%.*]], -1
|
||||
; CHECK-NEXT: br i1 [[EXPECTED_FALSE]], label [[RARE:%.*]], label [[EXIT:%.*]], !prof !20
|
||||
; CHECK-NEXT: br i1 [[EXPECTED_FALSE]], label [[RARE:%.*]], label [[EXIT:%.*]], !prof [[PROF20:![0-9]+]]
|
||||
; CHECK: rare:
|
||||
; CHECK-NEXT: [[EXPENSIVE:%.*]] = icmp eq i32 [[Y:%.*]], 0
|
||||
; CHECK-NEXT: br i1 [[EXPENSIVE]], label [[EXIT]], label [[FALSE:%.*]]
|
||||
|
@ -711,7 +714,7 @@ define void @or_icmps_not_that_harmful(i32 %x, i32 %y, i8* %p) {
|
|||
; CHECK-NEXT: [[EXPECTED_TRUE:%.*]] = icmp sgt i32 [[X:%.*]], -1
|
||||
; CHECK-NEXT: [[EXPENSIVE:%.*]] = icmp eq i32 [[Y:%.*]], 0
|
||||
; CHECK-NEXT: [[OR_COND:%.*]] = select i1 [[EXPECTED_TRUE]], i1 true, i1 [[EXPENSIVE]]
|
||||
; CHECK-NEXT: br i1 [[OR_COND]], label [[EXIT:%.*]], label [[FALSE:%.*]], !prof !21
|
||||
; CHECK-NEXT: br i1 [[OR_COND]], label [[EXIT:%.*]], label [[FALSE:%.*]], !prof [[PROF21:![0-9]+]]
|
||||
; CHECK: false:
|
||||
; CHECK-NEXT: store i8 42, i8* [[P:%.*]], align 1
|
||||
; CHECK-NEXT: br label [[EXIT]]
|
||||
|
@ -743,7 +746,7 @@ define void @or_icmps_not_that_harmful_inverted(i32 %x, i32 %y, i8* %p) {
|
|||
; CHECK-NEXT: [[EXPECTED_TRUE:%.*]] = icmp sgt i32 [[X:%.*]], -1
|
||||
; CHECK-NEXT: [[EXPENSIVE:%.*]] = icmp eq i32 [[Y:%.*]], 0
|
||||
; CHECK-NEXT: [[OR_COND:%.*]] = select i1 [[EXPECTED_TRUE]], i1 true, i1 [[EXPENSIVE]]
|
||||
; CHECK-NEXT: br i1 [[OR_COND]], label [[EXIT:%.*]], label [[FALSE:%.*]], !prof !22
|
||||
; CHECK-NEXT: br i1 [[OR_COND]], label [[EXIT:%.*]], label [[FALSE:%.*]], !prof [[PROF22:![0-9]+]]
|
||||
; CHECK: false:
|
||||
; CHECK-NEXT: store i8 42, i8* [[P:%.*]], align 1
|
||||
; CHECK-NEXT: br label [[EXIT]]
|
||||
|
@ -774,7 +777,7 @@ define void @or_icmps_useful(i32 %x, i32 %y, i8* %p) {
|
|||
; CHECK-NEXT: [[EXPECTED_TRUE:%.*]] = icmp sle i32 [[X:%.*]], -1
|
||||
; CHECK-NEXT: [[EXPENSIVE:%.*]] = icmp eq i32 [[Y:%.*]], 0
|
||||
; CHECK-NEXT: [[OR_COND:%.*]] = select i1 [[EXPECTED_TRUE]], i1 true, i1 [[EXPENSIVE]]
|
||||
; CHECK-NEXT: br i1 [[OR_COND]], label [[EXIT:%.*]], label [[FALSE:%.*]], !prof !23
|
||||
; CHECK-NEXT: br i1 [[OR_COND]], label [[EXIT:%.*]], label [[FALSE:%.*]], !prof [[PROF23:![0-9]+]]
|
||||
; CHECK: false:
|
||||
; CHECK-NEXT: store i8 42, i8* [[P:%.*]], align 1
|
||||
; CHECK-NEXT: br label [[EXIT]]
|
||||
|
@ -805,7 +808,7 @@ define void @or_icmps_useful_inverted(i32 %x, i32 %y, i8* %p) {
|
|||
; CHECK-NEXT: [[EXPECTED_FALSE:%.*]] = icmp sgt i32 [[X:%.*]], -1
|
||||
; CHECK-NEXT: [[EXPENSIVE:%.*]] = icmp eq i32 [[Y:%.*]], 0
|
||||
; CHECK-NEXT: [[OR_COND:%.*]] = select i1 [[EXPECTED_FALSE]], i1 true, i1 [[EXPENSIVE]]
|
||||
; CHECK-NEXT: br i1 [[OR_COND]], label [[EXIT:%.*]], label [[FALSE:%.*]], !prof !23
|
||||
; CHECK-NEXT: br i1 [[OR_COND]], label [[EXIT:%.*]], label [[FALSE:%.*]], !prof [[PROF23]]
|
||||
; CHECK: false:
|
||||
; CHECK-NEXT: store i8 42, i8* [[P:%.*]], align 1
|
||||
; CHECK-NEXT: br label [[EXIT]]
|
||||
|
@ -866,7 +869,7 @@ define void @and_icmps_harmful(i32 %x, i32 %y, i8* %p) {
|
|||
; CHECK-LABEL: @and_icmps_harmful(
|
||||
; CHECK-NEXT: entry:
|
||||
; CHECK-NEXT: [[EXPECTED_FALSE:%.*]] = icmp sgt i32 [[X:%.*]], -1
|
||||
; CHECK-NEXT: br i1 [[EXPECTED_FALSE]], label [[RARE:%.*]], label [[EXIT:%.*]], !prof !20
|
||||
; CHECK-NEXT: br i1 [[EXPECTED_FALSE]], label [[RARE:%.*]], label [[EXIT:%.*]], !prof [[PROF20]]
|
||||
; CHECK: rare:
|
||||
; CHECK-NEXT: [[EXPENSIVE:%.*]] = icmp eq i32 [[Y:%.*]], 0
|
||||
; CHECK-NEXT: br i1 [[EXPENSIVE]], label [[FALSE:%.*]], label [[EXIT]]
|
||||
|
@ -899,7 +902,7 @@ define void @and_icmps_harmful_inverted(i32 %x, i32 %y, i8* %p) {
|
|||
; CHECK-LABEL: @and_icmps_harmful_inverted(
|
||||
; CHECK-NEXT: entry:
|
||||
; CHECK-NEXT: [[EXPECTED_TRUE:%.*]] = icmp sgt i32 [[X:%.*]], -1
|
||||
; CHECK-NEXT: br i1 [[EXPECTED_TRUE]], label [[EXIT:%.*]], label [[RARE:%.*]], !prof !19
|
||||
; CHECK-NEXT: br i1 [[EXPECTED_TRUE]], label [[EXIT:%.*]], label [[RARE:%.*]], !prof [[PROF19]]
|
||||
; CHECK: rare:
|
||||
; CHECK-NEXT: [[EXPENSIVE:%.*]] = icmp eq i32 [[Y:%.*]], 0
|
||||
; CHECK-NEXT: br i1 [[EXPENSIVE]], label [[FALSE:%.*]], label [[EXIT]]
|
||||
|
@ -934,7 +937,7 @@ define void @and_icmps_not_that_harmful(i32 %x, i32 %y, i8* %p) {
|
|||
; CHECK-NEXT: [[EXPECTED_FALSE:%.*]] = icmp sgt i32 [[X:%.*]], -1
|
||||
; CHECK-NEXT: [[EXPENSIVE:%.*]] = icmp eq i32 [[Y:%.*]], 0
|
||||
; CHECK-NEXT: [[OR_COND:%.*]] = select i1 [[EXPECTED_FALSE]], i1 [[EXPENSIVE]], i1 false
|
||||
; CHECK-NEXT: br i1 [[OR_COND]], label [[FALSE:%.*]], label [[EXIT:%.*]], !prof !24
|
||||
; CHECK-NEXT: br i1 [[OR_COND]], label [[FALSE:%.*]], label [[EXIT:%.*]], !prof [[PROF24:![0-9]+]]
|
||||
; CHECK: false:
|
||||
; CHECK-NEXT: store i8 42, i8* [[P:%.*]], align 1
|
||||
; CHECK-NEXT: br label [[EXIT]]
|
||||
|
@ -966,7 +969,7 @@ define void @and_icmps_not_that_harmful_inverted(i32 %x, i32 %y, i8* %p) {
|
|||
; CHECK-NEXT: [[EXPECTED_TRUE:%.*]] = icmp sle i32 [[X:%.*]], -1
|
||||
; CHECK-NEXT: [[EXPENSIVE:%.*]] = icmp eq i32 [[Y:%.*]], 0
|
||||
; CHECK-NEXT: [[OR_COND:%.*]] = select i1 [[EXPECTED_TRUE]], i1 [[EXPENSIVE]], i1 false
|
||||
; CHECK-NEXT: br i1 [[OR_COND]], label [[FALSE:%.*]], label [[EXIT:%.*]], !prof !24
|
||||
; CHECK-NEXT: br i1 [[OR_COND]], label [[FALSE:%.*]], label [[EXIT:%.*]], !prof [[PROF24]]
|
||||
; CHECK: false:
|
||||
; CHECK-NEXT: store i8 42, i8* [[P:%.*]], align 1
|
||||
; CHECK-NEXT: br label [[EXIT]]
|
||||
|
@ -997,7 +1000,7 @@ define void @and_icmps_useful(i32 %x, i32 %y, i8* %p) {
|
|||
; CHECK-NEXT: [[EXPECTED_TRUE:%.*]] = icmp sgt i32 [[X:%.*]], -1
|
||||
; CHECK-NEXT: [[EXPENSIVE:%.*]] = icmp eq i32 [[Y:%.*]], 0
|
||||
; CHECK-NEXT: [[OR_COND:%.*]] = select i1 [[EXPECTED_TRUE]], i1 [[EXPENSIVE]], i1 false
|
||||
; CHECK-NEXT: br i1 [[OR_COND]], label [[FALSE:%.*]], label [[EXIT:%.*]], !prof !25
|
||||
; CHECK-NEXT: br i1 [[OR_COND]], label [[FALSE:%.*]], label [[EXIT:%.*]], !prof [[PROF25:![0-9]+]]
|
||||
; CHECK: false:
|
||||
; CHECK-NEXT: store i8 42, i8* [[P:%.*]], align 1
|
||||
; CHECK-NEXT: br label [[EXIT]]
|
||||
|
@ -1028,7 +1031,7 @@ define void @and_icmps_useful_inverted(i32 %x, i32 %y, i8* %p) {
|
|||
; CHECK-NEXT: [[EXPECTED_FALSE:%.*]] = icmp sle i32 [[X:%.*]], -1
|
||||
; CHECK-NEXT: [[EXPENSIVE:%.*]] = icmp eq i32 [[Y:%.*]], 0
|
||||
; CHECK-NEXT: [[OR_COND:%.*]] = select i1 [[EXPECTED_FALSE]], i1 [[EXPENSIVE]], i1 false
|
||||
; CHECK-NEXT: br i1 [[OR_COND]], label [[FALSE:%.*]], label [[EXIT:%.*]], !prof !25
|
||||
; CHECK-NEXT: br i1 [[OR_COND]], label [[FALSE:%.*]], label [[EXIT:%.*]], !prof [[PROF25]]
|
||||
; CHECK: false:
|
||||
; CHECK-NEXT: store i8 42, i8* [[P:%.*]], align 1
|
||||
; CHECK-NEXT: br label [[EXIT]]
|
||||
|
@ -1073,24 +1076,35 @@ exit:
|
|||
!18 = !{!"branch_weights", i32 1, i32 98}
|
||||
!19 = !{!"branch_weights", i32 0, i32 0}
|
||||
|
||||
; CHECK: !0 = !{!"branch_weights", i32 5, i32 11}
|
||||
; CHECK: !1 = !{!"branch_weights", i32 1, i32 3}
|
||||
; CHECK: !2 = !{!"branch_weights", i32 1, i32 5}
|
||||
; CHECK: !3 = !{!"branch_weights", i32 7, i32 1, i32 2}
|
||||
; CHECK: !4 = !{!"branch_weights", i32 49, i32 12, i32 24, i32 35}
|
||||
; CHECK: !5 = !{!"branch_weights", i32 11, i32 5}
|
||||
; CHECK: !6 = !{!"branch_weights", i32 17, i32 15}
|
||||
; CHECK: !7 = !{!"branch_weights", i32 9, i32 7}
|
||||
; CHECK: !8 = !{!"branch_weights", i32 17, i32 9, i32 8, i32 7, i32 17}
|
||||
; CHECK: !9 = !{!"branch_weights", i32 24, i32 33}
|
||||
; CHECK: !10 = !{!"branch_weights", i32 8, i32 33}
|
||||
;; The false weight prints out as a negative integer here, but inside llvm, we
|
||||
;; treat the weight as an unsigned integer.
|
||||
; CHECK: !11 = !{!"branch_weights", i32 112017436, i32 -735157296}
|
||||
; CHECK: !12 = !{!"branch_weights", i32 3, i32 5}
|
||||
; CHECK: !13 = !{!"branch_weights", i32 22, i32 12}
|
||||
; CHECK: !14 = !{!"branch_weights", i32 34, i32 21}
|
||||
; CHECK: !15 = !{!"branch_weights", i32 33, i32 14}
|
||||
; CHECK: !16 = !{!"branch_weights", i32 47, i32 8}
|
||||
; CHECK: !17 = !{!"branch_weights", i32 6, i32 2}
|
||||
; CHECK: !18 = !{!"branch_weights", i32 8, i32 2}
|
||||
;.
|
||||
; CHECK: attributes #[[ATTR0:[0-9]+]] = { nounwind uwtable }
|
||||
; CHECK: attributes #[[ATTR1]] = { nounwind }
|
||||
; CHECK: attributes #[[ATTR2:[0-9]+]] = { noredzone nounwind readnone ssp }
|
||||
;.
|
||||
; CHECK: [[PROF0]] = !{!"branch_weights", i32 5, i32 11}
|
||||
; CHECK: [[PROF1]] = !{!"branch_weights", i32 1, i32 3}
|
||||
; CHECK: [[PROF2]] = !{!"branch_weights", i32 1, i32 5}
|
||||
; CHECK: [[PROF3]] = !{!"branch_weights", i32 7, i32 1, i32 2}
|
||||
; CHECK: [[PROF4]] = !{!"branch_weights", i32 49, i32 12, i32 24, i32 35}
|
||||
; CHECK: [[PROF5]] = !{!"branch_weights", i32 11, i32 5}
|
||||
; CHECK: [[PROF6]] = !{!"branch_weights", i32 17, i32 15}
|
||||
; CHECK: [[PROF7]] = !{!"branch_weights", i32 9, i32 7}
|
||||
; CHECK: [[PROF8]] = !{!"branch_weights", i32 17, i32 9, i32 8, i32 7, i32 17}
|
||||
; CHECK: [[PROF9]] = !{!"branch_weights", i32 24, i32 33}
|
||||
; CHECK: [[PROF10]] = !{!"branch_weights", i32 8, i32 33}
|
||||
; CHECK: [[PROF11]] = !{!"branch_weights", i32 112017436, i32 -735157296}
|
||||
; CHECK: [[PROF12]] = !{!"branch_weights", i32 3, i32 5}
|
||||
; CHECK: [[PROF13]] = !{!"branch_weights", i32 22, i32 12}
|
||||
; CHECK: [[PROF14]] = !{!"branch_weights", i32 34, i32 21}
|
||||
; CHECK: [[PROF15]] = !{!"branch_weights", i32 33, i32 14}
|
||||
; CHECK: [[PROF16]] = !{!"branch_weights", i32 47, i32 8}
|
||||
; CHECK: [[PROF17]] = !{!"branch_weights", i32 6, i32 2}
|
||||
; CHECK: [[PROF18]] = !{!"branch_weights", i32 8, i32 2}
|
||||
; CHECK: [[PROF19]] = !{!"branch_weights", i32 99, i32 1}
|
||||
; CHECK: [[PROF20]] = !{!"branch_weights", i32 1, i32 99}
|
||||
; CHECK: [[PROF21]] = !{!"branch_weights", i32 197, i32 1}
|
||||
; CHECK: [[PROF22]] = !{!"branch_weights", i32 100, i32 98}
|
||||
; CHECK: [[PROF23]] = !{!"branch_weights", i32 101, i32 99}
|
||||
; CHECK: [[PROF24]] = !{!"branch_weights", i32 1, i32 197}
|
||||
; CHECK: [[PROF25]] = !{!"branch_weights", i32 99, i32 101}
|
||||
;.
|
||||
|
|
Loading…
Reference in New Issue