Avoid creating virtual registers for unused values.
llvm-svn: 101480
This commit is contained in:
parent
5664b9f1a9
commit
3a7ee8eead
|
@ -918,9 +918,9 @@ void SelectionDAGBuilder::visitRet(const ReturnInst &I) {
|
|||
/// created for it, emit nodes to copy the value into the virtual
|
||||
/// registers.
|
||||
void SelectionDAGBuilder::CopyToExportRegsIfNeeded(const Value *V) {
|
||||
if (!V->use_empty()) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -834,7 +834,7 @@ void SelectionDAGISel::SelectAllBasicBlocks(const Function &Fn) {
|
|||
BI->dump();
|
||||
}
|
||||
|
||||
if (!BI->getType()->isVoidTy()) {
|
||||
if (!BI->getType()->isVoidTy() && !BI->use_empty()) {
|
||||
unsigned &R = FuncInfo->ValueMap[BI];
|
||||
if (!R)
|
||||
R = FuncInfo->CreateRegForValue(BI);
|
||||
|
|
Loading…
Reference in New Issue