diff options
author | Craig Topper <craig.topper@intel.com> | 2018-03-12 18:40:59 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@intel.com> | 2018-03-12 18:40:59 +0000 |
commit | 3b4ad9c12d2e0c4ac67b2f0661aa0072dd0b64cb (patch) | |
tree | d18666f87d85139926f3dc13d2603106f507cd12 /llvm/lib/Transforms/Scalar/CallSiteSplitting.cpp | |
parent | e2becaa92a4a2657a68bcca9d008b787dd28c045 (diff) | |
download | bcm5719-llvm-3b4ad9c12d2e0c4ac67b2f0661aa0072dd0b64cb.tar.gz bcm5719-llvm-3b4ad9c12d2e0c4ac67b2f0661aa0072dd0b64cb.zip |
[CallSiteSplitting] Use !Instruction::use_empty instead of checking for a non-zero return from getNumUses
getNumUses is a linear operation. It walks a linked list to get a count. So in this case its better to just ask if there are any users rather than how many.
llvm-svn: 327314
Diffstat (limited to 'llvm/lib/Transforms/Scalar/CallSiteSplitting.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/CallSiteSplitting.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/CallSiteSplitting.cpp b/llvm/lib/Transforms/Scalar/CallSiteSplitting.cpp index ddebaf67f66..341abde92b9 100644 --- a/llvm/lib/Transforms/Scalar/CallSiteSplitting.cpp +++ b/llvm/lib/Transforms/Scalar/CallSiteSplitting.cpp @@ -302,7 +302,7 @@ static void splitCallSite( // `musttail` calls must be followed by optional `bitcast`, and `ret`. The // split blocks will be terminated right after that so there're no users for // this phi in a `TailBB`. - if (!IsMustTailCall && Instr->getNumUses()) + if (!IsMustTailCall && !Instr->use_empty()) CallPN = PHINode::Create(Instr->getType(), Preds.size(), "phi.call"); DEBUG(dbgs() << "split call-site : " << *Instr << " into \n"); |