mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-02 07:17:36 +00:00
Sink this use_empty() check into isUsedOutsideOfDefiningBlock.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101902 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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
|
/// 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.
|
/// switch or atomic instruction, which may expand to multiple basic blocks.
|
||||||
static bool isUsedOutsideOfDefiningBlock(const Instruction *I) {
|
static bool isUsedOutsideOfDefiningBlock(const Instruction *I) {
|
||||||
|
if (I->use_empty()) return false;
|
||||||
if (isa<PHINode>(I)) return true;
|
if (isa<PHINode>(I)) return true;
|
||||||
const BasicBlock *BB = I->getParent();
|
const BasicBlock *BB = I->getParent();
|
||||||
for (Value::const_use_iterator UI = I->use_begin(), E = I->use_end();
|
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 (; BB != EB; ++BB)
|
||||||
for (BasicBlock::const_iterator I = BB->begin(), E = BB->end(); I != E; ++I)
|
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) ||
|
if (!isa<AllocaInst>(I) ||
|
||||||
!StaticAllocaMap.count(cast<AllocaInst>(I)))
|
!StaticAllocaMap.count(cast<AllocaInst>(I)))
|
||||||
InitializeRegForValue(I);
|
InitializeRegForValue(I);
|
||||||
|
|||||||
Reference in New Issue
Block a user