Skip to content

Commit b6e2cc3

Browse files
committed
Fix failures introduced in #166032
1 parent 4334b43 commit b6e2cc3

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

llvm/lib/CodeGen/AtomicExpandPass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1301,7 +1301,7 @@ Value *AtomicExpandImpl::insertRMWLLSCLoop(
13011301
// Atomic RMW expands to a Load-linked / Store-Conditional loop, because it is
13021302
// hard to predict precise branch weigths we mark the branch as "unknown"
13031303
// (50/50) to prevent misleading optimizations.
1304-
setExplicitlyUnknownBranchWeightsIfProfiled(*CondBr, *F, DEBUG_TYPE);
1304+
setExplicitlyUnknownBranchWeightsIfProfiled(*CondBr, DEBUG_TYPE);
13051305

13061306
Builder.SetInsertPoint(ExitBB, ExitBB->begin());
13071307
return Loaded;

llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -388,8 +388,7 @@ static void buildPartialInvariantUnswitchConditionalBranch(
388388
IRB.CreateCondBr(Cond, Direction ? &UnswitchedSucc : &NormalSucc,
389389
Direction ? &NormalSucc : &UnswitchedSucc, ProfData);
390390
if (!ProfData)
391-
setExplicitlyUnknownBranchWeightsIfProfiled(*BR, *BR->getFunction(),
392-
DEBUG_TYPE);
391+
setExplicitlyUnknownBranchWeightsIfProfiled(*BR, DEBUG_TYPE);
393392
}
394393

395394
/// Rewrite the PHI nodes in an unswitched loop exit basic block.
@@ -3203,8 +3202,7 @@ injectPendingInvariantConditions(NonTrivialUnswitchCandidate Candidate, Loop &L,
32033202
auto *InvariantBr =
32043203
Builder.CreateCondBr(InjectedCond, InLoopSucc, CheckBlock);
32053204
// We don't know anything about the relation between the limits.
3206-
setExplicitlyUnknownBranchWeightsIfProfiled(
3207-
*InvariantBr, *InvariantBr->getParent()->getParent(), DEBUG_TYPE);
3205+
setExplicitlyUnknownBranchWeightsIfProfiled(*InvariantBr, DEBUG_TYPE);
32083206

32093207
Builder.SetInsertPoint(CheckBlock);
32103208
Builder.CreateCondBr(

0 commit comments

Comments
 (0)