]> granicus.if.org Git - llvm/commitdiff
[Target] Use hasOneUse() instead of getNumUses().
authorDavide Italiano <davide@freebsd.org>
Tue, 18 Apr 2017 00:29:54 +0000 (00:29 +0000)
committerDavide Italiano <davide@freebsd.org>
Tue, 18 Apr 2017 00:29:54 +0000 (00:29 +0000)
The latter does a liner scan over a linked list, therefore is
much more expensive.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300518 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/AArch64/AArch64ISelLowering.cpp

index 38f85bfcc9f695dd71e9f816ba7560e9034fc83d..1918d0b728cc89355bbfc85136cc11fa7d5c18a6 100644 (file)
@@ -7126,7 +7126,7 @@ bool AArch64TargetLowering::isProfitableToHoist(Instruction *I) const {
   if (I->getOpcode() != Instruction::FMul)
     return true;
 
-  if (I->getNumUses() != 1)
+  if (!I->hasOneUse())
     return true;
 
   Instruction *User = I->user_back();