summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/AggressiveInstCombine/TruncInstCombine.cpp
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2018-03-02 23:22:49 +0000
committerVedant Kumar <vsk@apple.com>2018-03-02 23:22:49 +0000
commit7fc591f8bbc78b6983b3162f3a4a8a34a98c5497 (patch)
tree41b884a9875a1a36ddfb248a126b207873d9e667 /llvm/lib/Transforms/AggressiveInstCombine/TruncInstCombine.cpp
parentbeb6025361f439b71038e2f44a8ddcea6bbe7a57 (diff)
downloadbcm5719-llvm-7fc591f8bbc78b6983b3162f3a4a8a34a98c5497.tar.gz
bcm5719-llvm-7fc591f8bbc78b6983b3162f3a4a8a34a98c5497.zip
[AggressiveInstCombine] Use use_empty() instead of !getNumUses(), NFC
use_empty() runs in O(1), whereas getNumUses() runs in O(# uses). llvm-svn: 326635
Diffstat (limited to 'llvm/lib/Transforms/AggressiveInstCombine/TruncInstCombine.cpp')
-rw-r--r--llvm/lib/Transforms/AggressiveInstCombine/TruncInstCombine.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/AggressiveInstCombine/TruncInstCombine.cpp b/llvm/lib/Transforms/AggressiveInstCombine/TruncInstCombine.cpp
index d62b6434f00..c72df2d70a4 100644
--- a/llvm/lib/Transforms/AggressiveInstCombine/TruncInstCombine.cpp
+++ b/llvm/lib/Transforms/AggressiveInstCombine/TruncInstCombine.cpp
@@ -380,7 +380,7 @@ void TruncInstCombine::ReduceExpressionDag(Type *SclTy) {
// 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();
}
}
OpenPOWER on IntegriCloud