summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-04-20 14:50:13 +0000
committerDan Gohman <gohman@apple.com>2010-04-20 14:50:13 +0000
commit7c845e4ea428d223a51c781890d51b6a2eeb2923 (patch)
tree934b03a2626383d6a6651c7d6fa84f926bdd8738 /llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
parent7b7f0883feebeddf961e0e38fd373923b0bad14a (diff)
downloadbcm5719-llvm-7c845e4ea428d223a51c781890d51b6a2eeb2923.tar.gz
bcm5719-llvm-7c845e4ea428d223a51c781890d51b6a2eeb2923.zip
Sink this use_empty() check into isUsedOutsideOfDefiningBlock.
llvm-svn: 101902
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp b/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
index 8ca25bb995a..cc9a3d57225 100644
--- a/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
+++ b/llvm/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<PHINode>(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<AllocaInst>(I) ||
!StaticAllocaMap.count(cast<AllocaInst>(I)))
InitializeRegForValue(I);
OpenPOWER on IntegriCloud