mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-13 14:46:53 +00:00
AMDGPU: Don't emit build_pair during udivrem legalization
Technically you aren't supposed to emit these after type legalization for some reason, and we use vector extracts of bitcasted integers as the canonical way to do this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262298 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c8a36aecdf
commit
7ff5c71a61
@ -1431,10 +1431,13 @@ void AMDGPUTargetLowering::LowerUDIVREM64(SDValue Op,
|
||||
SDValue Res = DAG.getNode(ISD::UDIVREM, DL, DAG.getVTList(HalfVT, HalfVT),
|
||||
LHS_Lo, RHS_Lo);
|
||||
|
||||
SDValue DIV = DAG.getNode(ISD::BUILD_PAIR, DL, VT, Res.getValue(0), zero);
|
||||
SDValue REM = DAG.getNode(ISD::BUILD_PAIR, DL, VT, Res.getValue(1), zero);
|
||||
Results.push_back(DIV);
|
||||
Results.push_back(REM);
|
||||
SDValue DIV = DAG.getNode(ISD::BUILD_VECTOR, DL, MVT::v2i32,
|
||||
Res.getValue(0), zero);
|
||||
SDValue REM = DAG.getNode(ISD::BUILD_VECTOR, DL, MVT::v2i32,
|
||||
Res.getValue(1), zero);
|
||||
|
||||
Results.push_back(DAG.getNode(ISD::BITCAST, DL, MVT::i64, DIV));
|
||||
Results.push_back(DAG.getNode(ISD::BITCAST, DL, MVT::i64, REM));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1443,7 +1446,8 @@ void AMDGPUTargetLowering::LowerUDIVREM64(SDValue Op,
|
||||
SDValue REM_Part = DAG.getNode(ISD::UREM, DL, HalfVT, LHS_Hi, RHS_Lo);
|
||||
|
||||
SDValue REM_Lo = DAG.getSelectCC(DL, RHS_Hi, zero, REM_Part, LHS_Hi, ISD::SETEQ);
|
||||
SDValue REM = DAG.getNode(ISD::BUILD_PAIR, DL, VT, REM_Lo, zero);
|
||||
SDValue REM = DAG.getNode(ISD::BUILD_VECTOR, DL, MVT::v2i32, REM_Lo, zero);
|
||||
REM = DAG.getNode(ISD::BITCAST, DL, MVT::i64, REM);
|
||||
|
||||
SDValue DIV_Hi = DAG.getSelectCC(DL, RHS_Hi, zero, DIV_Part, zero, ISD::SETEQ);
|
||||
SDValue DIV_Lo = zero;
|
||||
@ -1473,7 +1477,8 @@ void AMDGPUTargetLowering::LowerUDIVREM64(SDValue Op,
|
||||
REM = DAG.getSelectCC(DL, REM, RHS, REM_sub, REM, ISD::SETUGE);
|
||||
}
|
||||
|
||||
SDValue DIV = DAG.getNode(ISD::BUILD_PAIR, DL, VT, DIV_Lo, DIV_Hi);
|
||||
SDValue DIV = DAG.getNode(ISD::BUILD_VECTOR, DL, MVT::v2i32, DIV_Lo, DIV_Hi);
|
||||
DIV = DAG.getNode(ISD::BITCAST, DL, MVT::i64, DIV);
|
||||
Results.push_back(DIV);
|
||||
Results.push_back(REM);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user