From 540c0392b5a8a124eb0cbc017ca7cd532cc64bf0 Mon Sep 17 00:00:00 2001 From: Davide Italiano Date: Tue, 18 Apr 2017 00:29:54 +0000 Subject: [PATCH] [Target] Use hasOneUse() instead of getNumUses(). 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Target/AArch64/AArch64ISelLowering.cpp b/lib/Target/AArch64/AArch64ISelLowering.cpp index 38f85bfcc9f..1918d0b728c 100644 --- a/lib/Target/AArch64/AArch64ISelLowering.cpp +++ b/lib/Target/AArch64/AArch64ISelLowering.cpp @@ -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(); -- 2.50.1