[AMDGPU] Fix DAG types for V_MAD_I64_I32 and V_MAD_U64_U32. NFC. (#123629)

These instructions return a 64-bit result and a 1-bit carry, unlike
smul_lohi and umul_lohi which return a pair of 32-bit results.

This does not appear to make any difference in practice because the DAG
types are not used for anything before these nodes are converted to
MachineInstrs.
This commit is contained in:
Jay Foad 2025-01-20 16:29:23 +00:00 committed by GitHub
parent c8eb865747
commit f33e3d422d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1045,7 +1045,8 @@ void AMDGPUDAGToDAGISel::SelectMUL_LOHI(SDNode *N) {
SDValue Zero = CurDAG->getTargetConstant(0, SL, MVT::i64);
SDValue Clamp = CurDAG->getTargetConstant(0, SL, MVT::i1);
SDValue Ops[] = {N->getOperand(0), N->getOperand(1), Zero, Clamp};
SDNode *Mad = CurDAG->getMachineNode(Opc, SL, N->getVTList(), Ops);
SDNode *Mad = CurDAG->getMachineNode(
Opc, SL, CurDAG->getVTList(MVT::i64, MVT::i1), Ops);
if (!SDValue(N, 0).use_empty()) {
SDValue Sub0 = CurDAG->getTargetConstant(AMDGPU::sub0, SL, MVT::i32);
SDNode *Lo = CurDAG->getMachineNode(TargetOpcode::EXTRACT_SUBREG, SL,