[llvm] r326635 - [AggressiveInstCombine] Use use_empty() instead of !getNumUses(), NFC
Vedant Kumar via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 2 15:22:49 PST 2018
Author: vedantk
Date: Fri Mar 2 15:22:49 2018
New Revision: 326635
URL: http://llvm.org/viewvc/llvm-project?rev=326635&view=rev
Log:
[AggressiveInstCombine] Use use_empty() instead of !getNumUses(), NFC
use_empty() runs in O(1), whereas getNumUses() runs in O(# uses).
Modified:
llvm/trunk/lib/Transforms/AggressiveInstCombine/TruncInstCombine.cpp
Modified: llvm/trunk/lib/Transforms/AggressiveInstCombine/TruncInstCombine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/AggressiveInstCombine/TruncInstCombine.cpp?rev=326635&r1=326634&r2=326635&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/AggressiveInstCombine/TruncInstCombine.cpp (original)
+++ llvm/trunk/lib/Transforms/AggressiveInstCombine/TruncInstCombine.cpp Fri Mar 2 15:22:49 2018
@@ -380,7 +380,7 @@ void TruncInstCombine::ReduceExpressionD
// We still need to check that the instruction has no users before we erase
// it, because {SExt, ZExt}Inst Instruction might have other users that was
// not reduced, in such case, we need to keep that instruction.
- if (!I->first->getNumUses())
+ if (I->first->use_empty())
I->first->eraseFromParent();
}
}
More information about the llvm-commits
mailing list