1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00

Sink this use_empty() check into isUsedOutsideOfDefiningBlock.

llvm-svn: 101902
This commit is contained in:
Dan Gohman 2010-04-20 14:50:13 +00:00
parent c276def9e9
commit 0c1f92afe1

View File

@ -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);