mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 03:33:20 +01:00
Revert 99335. getTypeToExpandTo's iterative behavior is actually
needed here. llvm-svn: 99339
This commit is contained in:
parent
9a977ce8ce
commit
ce6d4394a8
@ -268,6 +268,27 @@ public:
|
||||
return MVT(MVT::Other); // Not reached
|
||||
}
|
||||
|
||||
/// getTypeToExpandTo - For types supported by the target, this is an
|
||||
/// identity function. For types that must be expanded (i.e. integer types
|
||||
/// that are larger than the largest integer register or illegal floating
|
||||
/// point types), this returns the largest legal type it will be expanded to.
|
||||
EVT getTypeToExpandTo(LLVMContext &Context, EVT VT) const {
|
||||
assert(!VT.isVector());
|
||||
while (true) {
|
||||
switch (getTypeAction(Context, VT)) {
|
||||
case Legal:
|
||||
return VT;
|
||||
case Expand:
|
||||
VT = getTypeToTransformTo(Context, VT);
|
||||
break;
|
||||
default:
|
||||
assert(false && "Type is not legal nor is it to be expanded!");
|
||||
return VT;
|
||||
}
|
||||
}
|
||||
return VT;
|
||||
}
|
||||
|
||||
/// getVectorTypeBreakdown - Vector types are broken down into some number of
|
||||
/// legal first class types. For example, EVT::v8f32 maps to 2 EVT::v4f32
|
||||
/// with Altivec or SSE1, or 8 promoted EVT::f64 values with the X86 FP stack.
|
||||
|
@ -1021,7 +1021,7 @@ void DAGTypeLegalizer::ExpandShiftByConstant(SDNode *N, unsigned Amt,
|
||||
Hi = InL;
|
||||
} else if (Amt == 1 &&
|
||||
TLI.isOperationLegalOrCustom(ISD::ADDC,
|
||||
TLI.getTypeToTransformTo(*DAG.getContext(), NVT))) {
|
||||
TLI.getTypeToExpandTo(*DAG.getContext(), NVT))) {
|
||||
// Emit this X << 1 as X+X.
|
||||
SDVTList VTList = DAG.getVTList(NVT, MVT::Flag);
|
||||
SDValue LoOps[2] = { InL, InL };
|
||||
@ -1263,8 +1263,7 @@ void DAGTypeLegalizer::ExpandIntRes_ADDSUB(SDNode *N,
|
||||
bool hasCarry =
|
||||
TLI.isOperationLegalOrCustom(N->getOpcode() == ISD::ADD ?
|
||||
ISD::ADDC : ISD::SUBC,
|
||||
TLI.getTypeToTransformTo(*DAG.getContext(),
|
||||
NVT));
|
||||
TLI.getTypeToExpandTo(*DAG.getContext(), NVT));
|
||||
|
||||
if (hasCarry) {
|
||||
SDVTList VTList = DAG.getVTList(NVT, MVT::Flag);
|
||||
|
Loading…
Reference in New Issue
Block a user