From d84e806dd4b03fa711ae2665ac1acef646f16c5c Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Tue, 20 Apr 2010 14:50:13 +0000 Subject: [PATCH] Sink this use_empty() check into isUsedOutsideOfDefiningBlock. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101902 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp b/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp index 8ca25bb995a..cc9a3d57225 100644 --- a/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp +++ b/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp @@ -124,6 +124,7 @@ void llvm::ComputeValueVTs(const TargetLowering &TLI, const Type *Ty, /// PHI nodes or outside of the basic block that defines it, or used by a /// switch or atomic instruction, which may expand to multiple basic blocks. static bool isUsedOutsideOfDefiningBlock(const Instruction *I) { + if (I->use_empty()) return false; if (isa(I)) return true; const BasicBlock *BB = I->getParent(); for (Value::const_use_iterator UI = I->use_begin(), E = I->use_end(); @@ -190,7 +191,7 @@ void FunctionLoweringInfo::set(const Function &fn, MachineFunction &mf, for (; BB != EB; ++BB) for (BasicBlock::const_iterator I = BB->begin(), E = BB->end(); I != E; ++I) - if (!I->use_empty() && isUsedOutsideOfDefiningBlock(I)) + if (isUsedOutsideOfDefiningBlock(I)) if (!isa(I) || !StaticAllocaMap.count(cast(I))) InitializeRegForValue(I);