@@ -798,7 +798,7 @@ void OpenMPIRBuilder::finalize(Function *Fn) {
798
798
ArtificialEntry.eraseFromParent ();
799
799
}
800
800
assert (&OutlinedFn->getEntryBlock () == OI.EntryBB );
801
- assert (OutlinedFn && OutlinedFn->getNumUses () == 1 );
801
+ assert (OutlinedFn && OutlinedFn->hasNUses ( 1 ) );
802
802
803
803
// Run a user callback, e.g. to add attributes.
804
804
if (OI.PostOutlineCB )
@@ -1926,7 +1926,7 @@ OpenMPIRBuilder::InsertPointOrErrorTy OpenMPIRBuilder::createTask(
1926
1926
Mergeable, Priority, EventHandle, TaskAllocaBB,
1927
1927
ToBeDeleted](Function &OutlinedFn) mutable {
1928
1928
// Replace the Stale CI by appropriate RTL function call.
1929
- assert (OutlinedFn.getNumUses () == 1 &&
1929
+ assert (OutlinedFn.hasOneUse () &&
1930
1930
" there must be a single user for the outlined function" );
1931
1931
CallInst *StaleCI = cast<CallInst>(OutlinedFn.user_back ());
1932
1932
@@ -7365,7 +7365,7 @@ OpenMPIRBuilder::InsertPointOrErrorTy OpenMPIRBuilder::emitTargetTask(
7365
7365
7366
7366
OI.PostOutlineCB = [this , ToBeDeleted, Dependencies, HasNoWait,
7367
7367
DeviceID](Function &OutlinedFn) mutable {
7368
- assert (OutlinedFn.getNumUses () == 1 &&
7368
+ assert (OutlinedFn.hasOneUse () &&
7369
7369
" there must be a single user for the outlined function" );
7370
7370
7371
7371
CallInst *StaleCI = cast<CallInst>(OutlinedFn.user_back ());
@@ -9269,7 +9269,7 @@ OpenMPIRBuilder::createTeams(const LocationDescription &Loc,
9269
9269
// The stale call instruction will be replaced with a new call instruction
9270
9270
// for runtime call with the outlined function.
9271
9271
9272
- assert (OutlinedFn.getNumUses () == 1 &&
9272
+ assert (OutlinedFn.hasOneUse () &&
9273
9273
" there must be a single user for the outlined function" );
9274
9274
CallInst *StaleCI = cast<CallInst>(OutlinedFn.user_back ());
9275
9275
ToBeDeleted.push_back (StaleCI);
0 commit comments