Skip to content

Commit bf7c580

Browse files
elvinw-inteligcbot
authored andcommitted
Fix inefficient uses of getNumUses()
change some of the LLVM getNumUses() to better candidates.
1 parent f276326 commit bf7c580

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

IGC/Compiler/CISACodeGen/BlockMemOpAddrScalarizationPass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ bool BlockMemOpAddrScalarizationPass::canInstBeScalarized(Instruction *InstForCh
7171
return false;
7272

7373
// This check showes that InstForCheck is used only the address calculation chain.
74-
if (InstForCheck->getNumUses() == 1)
74+
if (InstForCheck->hasOneUse())
7575
return true;
7676

7777
SmallVector<std::tuple<Instruction*, Instruction*, bool>, 32> UseStack;
@@ -111,7 +111,7 @@ bool BlockMemOpAddrScalarizationPass::canInstBeScalarized(Instruction *InstForCh
111111
return false;
112112
}
113113

114-
if (CurrUse->getNumUses()) {
114+
if (!CurrUse->use_empty()) {
115115
Steps.push_back(CurrUse);
116116
for (auto U : CurrUse->users()) {
117117
if (Instruction *I = dyn_cast<Instruction>(U)) {

0 commit comments

Comments
 (0)