mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-02 07:32:52 +00:00
Avoid creating virtual registers for unused values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101480 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
ac7d05c4bf
commit
33b7a291aa
@ -918,10 +918,10 @@ void SelectionDAGBuilder::visitRet(const ReturnInst &I) {
|
|||||||
/// created for it, emit nodes to copy the value into the virtual
|
/// created for it, emit nodes to copy the value into the virtual
|
||||||
/// registers.
|
/// registers.
|
||||||
void SelectionDAGBuilder::CopyToExportRegsIfNeeded(const Value *V) {
|
void SelectionDAGBuilder::CopyToExportRegsIfNeeded(const Value *V) {
|
||||||
if (!V->use_empty()) {
|
DenseMap<const Value *, unsigned>::iterator VMI = FuncInfo.ValueMap.find(V);
|
||||||
DenseMap<const Value *, unsigned>::iterator VMI = FuncInfo.ValueMap.find(V);
|
if (VMI != FuncInfo.ValueMap.end()) {
|
||||||
if (VMI != FuncInfo.ValueMap.end())
|
assert(!V->use_empty() && "Unused value assigned virtual registers!");
|
||||||
CopyValueToVirtualRegister(V, VMI->second);
|
CopyValueToVirtualRegister(V, VMI->second);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -834,7 +834,7 @@ void SelectionDAGISel::SelectAllBasicBlocks(const Function &Fn) {
|
|||||||
BI->dump();
|
BI->dump();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!BI->getType()->isVoidTy()) {
|
if (!BI->getType()->isVoidTy() && !BI->use_empty()) {
|
||||||
unsigned &R = FuncInfo->ValueMap[BI];
|
unsigned &R = FuncInfo->ValueMap[BI];
|
||||||
if (!R)
|
if (!R)
|
||||||
R = FuncInfo->CreateRegForValue(BI);
|
R = FuncInfo->CreateRegForValue(BI);
|
||||||
|
Loading…
Reference in New Issue
Block a user