Skip to content

Commit d3c0ed3

Browse files
authored
[NFCI][metadata][LibCallsShrinkWrap] Use create{Unlikely,Likely}BranchWeights (#89465)
It does not look like 2000 is needed here in particular. Follow up to #89464
1 parent 983bf65 commit d3c0ed3

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

llvm/lib/Transforms/Utils/LibCallsShrinkWrap.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ Value *LibCallsShrinkWrap::generateCondForPow(CallInst *CI,
467467
void LibCallsShrinkWrap::shrinkWrapCI(CallInst *CI, Value *Cond) {
468468
assert(Cond != nullptr && "ShrinkWrapCI is not expecting an empty call inst");
469469
MDNode *BranchWeights =
470-
MDBuilder(CI->getContext()).createBranchWeights(1, 2000);
470+
MDBuilder(CI->getContext()).createUnlikelyBranchWeights();
471471

472472
Instruction *NewInst =
473473
SplitBlockAndInsertIfThen(Cond, CI, false, BranchWeights, &DTU);

llvm/test/Transforms/Util/libcalls-shrinkwrap-double.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,4 +448,4 @@ define void @test_pow_strictfp(i32 %int_val, double %exp) strictfp {
448448

449449
declare double @pow(double, double)
450450

451-
; CHECK: ![[BRANCH_WEIGHT]] = !{!"branch_weights", i32 1, i32 2000}
451+
; CHECK: ![[BRANCH_WEIGHT]] = !{!"branch_weights", i32 1, i32 1048575}

llvm/test/Transforms/Util/libcalls-shrinkwrap-float.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,4 +350,4 @@ declare float @log2f(float)
350350
declare float @logbf(float)
351351
declare float @log1pf(float)
352352

353-
; CHECK: ![[BRANCH_WEIGHT]] = !{!"branch_weights", i32 1, i32 2000}
353+
; CHECK: ![[BRANCH_WEIGHT]] = !{!"branch_weights", i32 1, i32 1048575}

llvm/test/Transforms/Util/libcalls-shrinkwrap-long-double.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,4 +351,4 @@ declare x86_fp80 @log2l(x86_fp80)
351351
declare x86_fp80 @logbl(x86_fp80)
352352
declare x86_fp80 @log1pl(x86_fp80)
353353

354-
; CHECK: ![[BRANCH_WEIGHT]] = !{!"branch_weights", i32 1, i32 2000}
354+
; CHECK: ![[BRANCH_WEIGHT]] = !{!"branch_weights", i32 1, i32 1048575}

0 commit comments

Comments
 (0)