diff options
author | Chris Lattner <sabre@nondot.org> | 2003-10-15 16:48:29 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-10-15 16:48:29 +0000 |
commit | fd05924946ebfcfb3409b21996cfd0836e4ddb31 (patch) | |
tree | 72c12deace7b040069b69109a7405311e0002581 /lib/Target | |
parent | 33922eb64811ac758b5ebd2bc79150298f57ba7b (diff) | |
download | llvm-fd05924946ebfcfb3409b21996cfd0836e4ddb31.tar.gz llvm-fd05924946ebfcfb3409b21996cfd0836e4ddb31.tar.bz2 llvm-fd05924946ebfcfb3409b21996cfd0836e4ddb31.tar.xz |
Decrease usage of use_size()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9135 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r-- | lib/Target/CBackend/CBackend.cpp | 2 | ||||
-rw-r--r-- | lib/Target/CBackend/Writer.cpp | 2 | ||||
-rw-r--r-- | lib/Target/SparcV9/InstrSelection/InstrForest.cpp | 2 | ||||
-rw-r--r-- | lib/Target/X86/InstSelectSimple.cpp | 2 | ||||
-rw-r--r-- | lib/Target/X86/X86ISelSimple.cpp | 2 |
5 files changed, 5 insertions, 5 deletions
diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp index a3607be8a0..af33e4b85f 100644 --- a/lib/Target/CBackend/CBackend.cpp +++ b/lib/Target/CBackend/CBackend.cpp @@ -88,7 +88,7 @@ namespace { static bool isInlinableInst(const Instruction &I) { // Must be an expression, must be used exactly once. If it is dead, we // emit it inline where it would go. - if (I.getType() == Type::VoidTy || I.use_size() != 1 || + if (I.getType() == Type::VoidTy || !I.hasOneUse() || isa<TerminatorInst>(I) || isa<CallInst>(I) || isa<PHINode>(I) || isa<LoadInst>(I) || isa<VarArgInst>(I)) // Don't inline a load across a store or other bad things! diff --git a/lib/Target/CBackend/Writer.cpp b/lib/Target/CBackend/Writer.cpp index a3607be8a0..af33e4b85f 100644 --- a/lib/Target/CBackend/Writer.cpp +++ b/lib/Target/CBackend/Writer.cpp @@ -88,7 +88,7 @@ namespace { static bool isInlinableInst(const Instruction &I) { // Must be an expression, must be used exactly once. If it is dead, we // emit it inline where it would go. - if (I.getType() == Type::VoidTy || I.use_size() != 1 || + if (I.getType() == Type::VoidTy || !I.hasOneUse() || isa<TerminatorInst>(I) || isa<CallInst>(I) || isa<PHINode>(I) || isa<LoadInst>(I) || isa<VarArgInst>(I)) // Don't inline a load across a store or other bad things! diff --git a/lib/Target/SparcV9/InstrSelection/InstrForest.cpp b/lib/Target/SparcV9/InstrSelection/InstrForest.cpp index f4736b59ea..496e279ef9 100644 --- a/lib/Target/SparcV9/InstrSelection/InstrForest.cpp +++ b/lib/Target/SparcV9/InstrSelection/InstrForest.cpp @@ -297,7 +297,7 @@ InstrForest::buildTreeForInstruction(Instruction *instr) // is used directly, i.e., made a child of the instruction node. // InstrTreeNode* opTreeNode; - if (isa<Instruction>(operand) && operand->use_size() == 1 && + if (isa<Instruction>(operand) && operand->hasOneUse() && cast<Instruction>(operand)->getParent() == instr->getParent() && instr->getOpcode() != Instruction::PHINode && instr->getOpcode() != Instruction::Call) diff --git a/lib/Target/X86/InstSelectSimple.cpp b/lib/Target/X86/InstSelectSimple.cpp index 9e4e499de9..a6dc7c9fb4 100644 --- a/lib/Target/X86/InstSelectSimple.cpp +++ b/lib/Target/X86/InstSelectSimple.cpp @@ -554,7 +554,7 @@ void ISel::SelectPHINodes() { // static SetCondInst *canFoldSetCCIntoBranch(Value *V) { if (SetCondInst *SCI = dyn_cast<SetCondInst>(V)) - if (SCI->use_size() == 1 && isa<BranchInst>(SCI->use_back()) && + if (SCI->hasOneUse() && isa<BranchInst>(SCI->use_back()) && SCI->getParent() == cast<BranchInst>(SCI->use_back())->getParent()) { const Type *Ty = SCI->getOperand(0)->getType(); if (Ty != Type::LongTy && Ty != Type::ULongTy) diff --git a/lib/Target/X86/X86ISelSimple.cpp b/lib/Target/X86/X86ISelSimple.cpp index 9e4e499de9..a6dc7c9fb4 100644 --- a/lib/Target/X86/X86ISelSimple.cpp +++ b/lib/Target/X86/X86ISelSimple.cpp @@ -554,7 +554,7 @@ void ISel::SelectPHINodes() { // static SetCondInst *canFoldSetCCIntoBranch(Value *V) { if (SetCondInst *SCI = dyn_cast<SetCondInst>(V)) - if (SCI->use_size() == 1 && isa<BranchInst>(SCI->use_back()) && + if (SCI->hasOneUse() && isa<BranchInst>(SCI->use_back()) && SCI->getParent() == cast<BranchInst>(SCI->use_back())->getParent()) { const Type *Ty = SCI->getOperand(0)->getType(); if (Ty != Type::LongTy && Ty != Type::ULongTy) |