Skip to content

[NVPTX] don't erase CopyToRegs when folding movs into loads #149393

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5060,12 +5060,6 @@ combineUnpackingMovIntoLoad(SDNode *N, TargetLowering::DAGCombinerInfo &DCI) {
return !U.getUser()->use_empty();
}

// Handle CopyToReg nodes that will become dead after our replacement
if (U.getUser()->getOpcode() == ISD::CopyToReg) {
DeadCopyToRegs.push_back(U.getUser());
return true;
}

// Otherwise, this use prevents us from splitting a value.
return false;
}))
Expand Down Expand Up @@ -5132,10 +5126,6 @@ combineUnpackingMovIntoLoad(SDNode *N, TargetLowering::DAGCombinerInfo &DCI) {
for (unsigned I : seq(NewLoad->getNumValues() - NewNumOutputs))
Results.push_back(NewLoad.getValue(NewNumOutputs + I));

// Remove dead CopyToReg nodes by folding them into the chain they reference
for (SDNode *CTR : DeadCopyToRegs)
DCI.CombineTo(CTR, CTR->getOperand(0));

return DCI.DAG.getMergeValues(Results, DL);
}

Expand Down Expand Up @@ -6544,4 +6534,4 @@ void NVPTXTargetLowering::computeKnownBitsForTargetNode(
default:
break;
}
}
}
591 changes: 346 additions & 245 deletions llvm/test/CodeGen/NVPTX/f16x2-instructions.ll

Large diffs are not rendered by default.

643 changes: 397 additions & 246 deletions llvm/test/CodeGen/NVPTX/f32x2-instructions.ll

Large diffs are not rendered by default.

Loading