mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-16 11:24:39 +00:00
Implement Duncan's suggestion to use the result of getSetCCResultType if it is legal
(this is always the case for scalars), otherwise use the promoted result type. Fix test/CodeGen/X86/vsplit-and.ll when promote-elements is enabled. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140464 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -503,8 +503,15 @@ SDValue DAGTypeLegalizer::PromoteIntRes_SELECT_CC(SDNode *N) {
|
|||||||
|
|
||||||
SDValue DAGTypeLegalizer::PromoteIntRes_SETCC(SDNode *N) {
|
SDValue DAGTypeLegalizer::PromoteIntRes_SETCC(SDNode *N) {
|
||||||
EVT SVT = TLI.getSetCCResultType(N->getOperand(0).getValueType());
|
EVT SVT = TLI.getSetCCResultType(N->getOperand(0).getValueType());
|
||||||
// Vector setcc result types need to be leglized.
|
|
||||||
SVT = TLI.getTypeToTransformTo(*DAG.getContext(), SVT);
|
// Convert to the expected type.
|
||||||
|
EVT NVT = TLI.getTypeToTransformTo(*DAG.getContext(), N->getValueType(0));
|
||||||
|
|
||||||
|
// Only use the result of getSetCCResultType if it is legal,
|
||||||
|
// otherwise just use the promoted result type (NVT).
|
||||||
|
if (getTypeAction(SVT) != TargetLowering::TypeLegal) {
|
||||||
|
SVT = NVT;
|
||||||
|
}
|
||||||
|
|
||||||
DebugLoc dl = N->getDebugLoc();
|
DebugLoc dl = N->getDebugLoc();
|
||||||
assert(SVT.isVector() == N->getOperand(0).getValueType().isVector() &&
|
assert(SVT.isVector() == N->getOperand(0).getValueType().isVector() &&
|
||||||
@@ -514,8 +521,6 @@ SDValue DAGTypeLegalizer::PromoteIntRes_SETCC(SDNode *N) {
|
|||||||
SDValue SetCC = DAG.getNode(N->getOpcode(), dl, SVT, N->getOperand(0),
|
SDValue SetCC = DAG.getNode(N->getOpcode(), dl, SVT, N->getOperand(0),
|
||||||
N->getOperand(1), N->getOperand(2));
|
N->getOperand(1), N->getOperand(2));
|
||||||
|
|
||||||
// Convert to the expected type.
|
|
||||||
EVT NVT = TLI.getTypeToTransformTo(*DAG.getContext(), N->getValueType(0));
|
|
||||||
assert(NVT.bitsLE(SVT) && "Integer type overpromoted?");
|
assert(NVT.bitsLE(SVT) && "Integer type overpromoted?");
|
||||||
return DAG.getNode(ISD::TRUNCATE, dl, NVT, SetCC);
|
return DAG.getNode(ISD::TRUNCATE, dl, NVT, SetCC);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user