Skip to content

Commit 3ad353c

Browse files
authored
OMPIRBuilder: Avoid getNumUses (#136350)
1 parent 9c3ffa7 commit 3ad353c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -798,7 +798,7 @@ void OpenMPIRBuilder::finalize(Function *Fn) {
798798
ArtificialEntry.eraseFromParent();
799799
}
800800
assert(&OutlinedFn->getEntryBlock() == OI.EntryBB);
801-
assert(OutlinedFn && OutlinedFn->getNumUses() == 1);
801+
assert(OutlinedFn && OutlinedFn->hasNUses(1));
802802

803803
// Run a user callback, e.g. to add attributes.
804804
if (OI.PostOutlineCB)
@@ -1926,7 +1926,7 @@ OpenMPIRBuilder::InsertPointOrErrorTy OpenMPIRBuilder::createTask(
19261926
Mergeable, Priority, EventHandle, TaskAllocaBB,
19271927
ToBeDeleted](Function &OutlinedFn) mutable {
19281928
// Replace the Stale CI by appropriate RTL function call.
1929-
assert(OutlinedFn.getNumUses() == 1 &&
1929+
assert(OutlinedFn.hasOneUse() &&
19301930
"there must be a single user for the outlined function");
19311931
CallInst *StaleCI = cast<CallInst>(OutlinedFn.user_back());
19321932

@@ -7365,7 +7365,7 @@ OpenMPIRBuilder::InsertPointOrErrorTy OpenMPIRBuilder::emitTargetTask(
73657365

73667366
OI.PostOutlineCB = [this, ToBeDeleted, Dependencies, HasNoWait,
73677367
DeviceID](Function &OutlinedFn) mutable {
7368-
assert(OutlinedFn.getNumUses() == 1 &&
7368+
assert(OutlinedFn.hasOneUse() &&
73697369
"there must be a single user for the outlined function");
73707370

73717371
CallInst *StaleCI = cast<CallInst>(OutlinedFn.user_back());
@@ -9269,7 +9269,7 @@ OpenMPIRBuilder::createTeams(const LocationDescription &Loc,
92699269
// The stale call instruction will be replaced with a new call instruction
92709270
// for runtime call with the outlined function.
92719271

9272-
assert(OutlinedFn.getNumUses() == 1 &&
9272+
assert(OutlinedFn.hasOneUse() &&
92739273
"there must be a single user for the outlined function");
92749274
CallInst *StaleCI = cast<CallInst>(OutlinedFn.user_back());
92759275
ToBeDeleted.push_back(StaleCI);

0 commit comments

Comments
 (0)