forked from OSchip/llvm-project
Revert EVT->MVT changes, r169836-169851, due to buildbot failures.
llvm-svn: 169854
This commit is contained in:
parent
7ec41c7827
commit
e98b7a0389
|
@ -136,7 +136,7 @@ public:
|
|||
return ValueMap.count(V);
|
||||
}
|
||||
|
||||
unsigned CreateReg(MVT VT);
|
||||
unsigned CreateReg(EVT VT);
|
||||
|
||||
unsigned CreateRegs(Type *Ty);
|
||||
|
||||
|
|
|
@ -130,11 +130,6 @@ public:
|
|||
///
|
||||
inline EVT getValueType() const;
|
||||
|
||||
/// Return the simple ValueType of the referenced return value.
|
||||
MVT getSimpleValueType() const {
|
||||
return getValueType().getSimpleVT();
|
||||
}
|
||||
|
||||
/// getValueSizeInBits - Returns the size of the value in bits.
|
||||
///
|
||||
unsigned getValueSizeInBits() const {
|
||||
|
@ -600,12 +595,6 @@ public:
|
|||
return ValueList[ResNo];
|
||||
}
|
||||
|
||||
/// Return the type of a specified result as a simple type.
|
||||
///
|
||||
MVT getSimpleValueType(unsigned ResNo) const {
|
||||
return getValueType(ResNo).getSimpleVT();
|
||||
}
|
||||
|
||||
/// getValueSizeInBits - Returns MVT::getSizeInBits(getValueType(ResNo)).
|
||||
///
|
||||
unsigned getValueSizeInBits(unsigned ResNo) const {
|
||||
|
|
|
@ -389,27 +389,6 @@ namespace llvm {
|
|||
return getStoreSize() * 8;
|
||||
}
|
||||
|
||||
/// Return true if this has more bits than VT.
|
||||
bool bitsGT(MVT VT) const {
|
||||
return getSizeInBits() > VT.getSizeInBits();
|
||||
}
|
||||
|
||||
/// Return true if this has no less bits than VT.
|
||||
bool bitsGE(MVT VT) const {
|
||||
return getSizeInBits() >= VT.getSizeInBits();
|
||||
}
|
||||
|
||||
/// Return true if this has less bits than VT.
|
||||
bool bitsLT(MVT VT) const {
|
||||
return getSizeInBits() < VT.getSizeInBits();
|
||||
}
|
||||
|
||||
/// Return true if this has no more bits than VT.
|
||||
bool bitsLE(MVT VT) const {
|
||||
return getSizeInBits() <= VT.getSizeInBits();
|
||||
}
|
||||
|
||||
|
||||
static MVT getFloatingPointVT(unsigned BitWidth) {
|
||||
switch (BitWidth) {
|
||||
default:
|
||||
|
|
|
@ -232,8 +232,9 @@ public:
|
|||
|
||||
/// getRegClassFor - Return the register class that should be used for the
|
||||
/// specified value type.
|
||||
virtual const TargetRegisterClass *getRegClassFor(MVT VT) const {
|
||||
const TargetRegisterClass *RC = RegClassForVT[VT.SimpleTy];
|
||||
virtual const TargetRegisterClass *getRegClassFor(EVT VT) const {
|
||||
assert(VT.isSimple() && "getRegClassFor called on illegal type!");
|
||||
const TargetRegisterClass *RC = RegClassForVT[VT.getSimpleVT().SimpleTy];
|
||||
assert(RC && "This value type is not natively supported!");
|
||||
return RC;
|
||||
}
|
||||
|
@ -243,15 +244,17 @@ public:
|
|||
/// legal super-reg register class for the register class of the value type.
|
||||
/// For example, on i386 the rep register class for i8, i16, and i32 are GR32;
|
||||
/// while the rep register class is GR64 on x86_64.
|
||||
virtual const TargetRegisterClass *getRepRegClassFor(MVT VT) const {
|
||||
const TargetRegisterClass *RC = RepRegClassForVT[VT.SimpleTy];
|
||||
virtual const TargetRegisterClass *getRepRegClassFor(EVT VT) const {
|
||||
assert(VT.isSimple() && "getRepRegClassFor called on illegal type!");
|
||||
const TargetRegisterClass *RC = RepRegClassForVT[VT.getSimpleVT().SimpleTy];
|
||||
return RC;
|
||||
}
|
||||
|
||||
/// getRepRegClassCostFor - Return the cost of the 'representative' register
|
||||
/// class for the specified value type.
|
||||
virtual uint8_t getRepRegClassCostFor(MVT VT) const {
|
||||
return RepRegClassCostForVT[VT.SimpleTy];
|
||||
virtual uint8_t getRepRegClassCostFor(EVT VT) const {
|
||||
assert(VT.isSimple() && "getRepRegClassCostFor called on illegal type!");
|
||||
return RepRegClassCostForVT[VT.getSimpleVT().SimpleTy];
|
||||
}
|
||||
|
||||
/// isTypeLegal - Return true if the target has native support for the
|
||||
|
@ -277,8 +280,8 @@ public:
|
|||
return (LegalizeTypeAction)ValueTypeActions[VT.SimpleTy];
|
||||
}
|
||||
|
||||
void setTypeAction(MVT VT, LegalizeTypeAction Action) {
|
||||
unsigned I = VT.SimpleTy;
|
||||
void setTypeAction(EVT VT, LegalizeTypeAction Action) {
|
||||
unsigned I = VT.getSimpleVT().SimpleTy;
|
||||
ValueTypeActions[I] = Action;
|
||||
}
|
||||
};
|
||||
|
@ -339,7 +342,7 @@ public:
|
|||
unsigned getVectorTypeBreakdown(LLVMContext &Context, EVT VT,
|
||||
EVT &IntermediateVT,
|
||||
unsigned &NumIntermediates,
|
||||
MVT &RegisterVT) const;
|
||||
EVT &RegisterVT) const;
|
||||
|
||||
/// getTgtMemIntrinsic: Given an intrinsic, checks if on the target the
|
||||
/// intrinsic will need to map to a MemIntrinsicNode (touches memory). If
|
||||
|
@ -441,35 +444,36 @@ public:
|
|||
/// either it is legal, needs to be promoted to a larger size, needs to be
|
||||
/// expanded to some other code sequence, or the target has a custom expander
|
||||
/// for it.
|
||||
LegalizeAction getLoadExtAction(unsigned ExtType, MVT VT) const {
|
||||
assert(ExtType < ISD::LAST_LOADEXT_TYPE && VT < MVT::LAST_VALUETYPE &&
|
||||
LegalizeAction getLoadExtAction(unsigned ExtType, EVT VT) const {
|
||||
assert(ExtType < ISD::LAST_LOADEXT_TYPE &&
|
||||
VT.getSimpleVT() < MVT::LAST_VALUETYPE &&
|
||||
"Table isn't big enough!");
|
||||
return (LegalizeAction)LoadExtActions[VT.SimpleTy][ExtType];
|
||||
return (LegalizeAction)LoadExtActions[VT.getSimpleVT().SimpleTy][ExtType];
|
||||
}
|
||||
|
||||
/// isLoadExtLegal - Return true if the specified load with extension is legal
|
||||
/// on this target.
|
||||
bool isLoadExtLegal(unsigned ExtType, EVT VT) const {
|
||||
return VT.isSimple() &&
|
||||
getLoadExtAction(ExtType, VT.getSimpleVT()) == Legal;
|
||||
return VT.isSimple() && getLoadExtAction(ExtType, VT) == Legal;
|
||||
}
|
||||
|
||||
/// getTruncStoreAction - Return how this store with truncation should be
|
||||
/// treated: either it is legal, needs to be promoted to a larger size, needs
|
||||
/// to be expanded to some other code sequence, or the target has a custom
|
||||
/// expander for it.
|
||||
LegalizeAction getTruncStoreAction(MVT ValVT, MVT MemVT) const {
|
||||
assert(ValVT < MVT::LAST_VALUETYPE && MemVT < MVT::LAST_VALUETYPE &&
|
||||
LegalizeAction getTruncStoreAction(EVT ValVT, EVT MemVT) const {
|
||||
assert(ValVT.getSimpleVT() < MVT::LAST_VALUETYPE &&
|
||||
MemVT.getSimpleVT() < MVT::LAST_VALUETYPE &&
|
||||
"Table isn't big enough!");
|
||||
return (LegalizeAction)TruncStoreActions[ValVT.SimpleTy]
|
||||
[MemVT.SimpleTy];
|
||||
return (LegalizeAction)TruncStoreActions[ValVT.getSimpleVT().SimpleTy]
|
||||
[MemVT.getSimpleVT().SimpleTy];
|
||||
}
|
||||
|
||||
/// isTruncStoreLegal - Return true if the specified store with truncation is
|
||||
/// legal on this target.
|
||||
bool isTruncStoreLegal(EVT ValVT, EVT MemVT) const {
|
||||
return isTypeLegal(ValVT) && MemVT.isSimple() &&
|
||||
getTruncStoreAction(ValVT.getSimpleVT(), MemVT.getSimpleVT()) == Legal;
|
||||
getTruncStoreAction(ValVT, MemVT) == Legal;
|
||||
}
|
||||
|
||||
/// getIndexedLoadAction - Return how the indexed load should be treated:
|
||||
|
@ -477,10 +481,11 @@ public:
|
|||
/// expanded to some other code sequence, or the target has a custom expander
|
||||
/// for it.
|
||||
LegalizeAction
|
||||
getIndexedLoadAction(unsigned IdxMode, MVT VT) const {
|
||||
assert(IdxMode < ISD::LAST_INDEXED_MODE && VT < MVT::LAST_VALUETYPE &&
|
||||
getIndexedLoadAction(unsigned IdxMode, EVT VT) const {
|
||||
assert(IdxMode < ISD::LAST_INDEXED_MODE &&
|
||||
VT.getSimpleVT() < MVT::LAST_VALUETYPE &&
|
||||
"Table isn't big enough!");
|
||||
unsigned Ty = (unsigned)VT.SimpleTy;
|
||||
unsigned Ty = (unsigned)VT.getSimpleVT().SimpleTy;
|
||||
return (LegalizeAction)((IndexedModeActions[Ty][IdxMode] & 0xf0) >> 4);
|
||||
}
|
||||
|
||||
|
@ -488,8 +493,8 @@ public:
|
|||
/// on this target.
|
||||
bool isIndexedLoadLegal(unsigned IdxMode, EVT VT) const {
|
||||
return VT.isSimple() &&
|
||||
(getIndexedLoadAction(IdxMode, VT.getSimpleVT()) == Legal ||
|
||||
getIndexedLoadAction(IdxMode, VT.getSimpleVT()) == Custom);
|
||||
(getIndexedLoadAction(IdxMode, VT) == Legal ||
|
||||
getIndexedLoadAction(IdxMode, VT) == Custom);
|
||||
}
|
||||
|
||||
/// getIndexedStoreAction - Return how the indexed store should be treated:
|
||||
|
@ -497,10 +502,11 @@ public:
|
|||
/// expanded to some other code sequence, or the target has a custom expander
|
||||
/// for it.
|
||||
LegalizeAction
|
||||
getIndexedStoreAction(unsigned IdxMode, MVT VT) const {
|
||||
assert(IdxMode < ISD::LAST_INDEXED_MODE && VT < MVT::LAST_VALUETYPE &&
|
||||
getIndexedStoreAction(unsigned IdxMode, EVT VT) const {
|
||||
assert(IdxMode < ISD::LAST_INDEXED_MODE &&
|
||||
VT.getSimpleVT() < MVT::LAST_VALUETYPE &&
|
||||
"Table isn't big enough!");
|
||||
unsigned Ty = (unsigned)VT.SimpleTy;
|
||||
unsigned Ty = (unsigned)VT.getSimpleVT().SimpleTy;
|
||||
return (LegalizeAction)(IndexedModeActions[Ty][IdxMode] & 0x0f);
|
||||
}
|
||||
|
||||
|
@ -508,54 +514,54 @@ public:
|
|||
/// on this target.
|
||||
bool isIndexedStoreLegal(unsigned IdxMode, EVT VT) const {
|
||||
return VT.isSimple() &&
|
||||
(getIndexedStoreAction(IdxMode, VT.getSimpleVT()) == Legal ||
|
||||
getIndexedStoreAction(IdxMode, VT.getSimpleVT()) == Custom);
|
||||
(getIndexedStoreAction(IdxMode, VT) == Legal ||
|
||||
getIndexedStoreAction(IdxMode, VT) == Custom);
|
||||
}
|
||||
|
||||
/// getCondCodeAction - Return how the condition code should be treated:
|
||||
/// either it is legal, needs to be expanded to some other code sequence,
|
||||
/// or the target has a custom expander for it.
|
||||
LegalizeAction
|
||||
getCondCodeAction(ISD::CondCode CC, MVT VT) const {
|
||||
getCondCodeAction(ISD::CondCode CC, EVT VT) const {
|
||||
assert((unsigned)CC < array_lengthof(CondCodeActions) &&
|
||||
(unsigned)VT.SimpleTy < sizeof(CondCodeActions[0])*4 &&
|
||||
(unsigned)VT.getSimpleVT().SimpleTy < sizeof(CondCodeActions[0])*4 &&
|
||||
"Table isn't big enough!");
|
||||
/// The lower 5 bits of the SimpleTy index into Nth 2bit set from the 64bit
|
||||
/// value and the upper 27 bits index into the second dimension of the
|
||||
/// array to select what 64bit value to use.
|
||||
LegalizeAction Action = (LegalizeAction)
|
||||
((CondCodeActions[CC][VT.SimpleTy >> 5] >> (2*(VT.SimpleTy & 0x1F))) & 3);
|
||||
((CondCodeActions[CC][VT.getSimpleVT().SimpleTy >> 5]
|
||||
>> (2*(VT.getSimpleVT().SimpleTy & 0x1F))) & 3);
|
||||
assert(Action != Promote && "Can't promote condition code!");
|
||||
return Action;
|
||||
}
|
||||
|
||||
/// isCondCodeLegal - Return true if the specified condition code is legal
|
||||
/// on this target.
|
||||
bool isCondCodeLegal(ISD::CondCode CC, MVT VT) const {
|
||||
return
|
||||
getCondCodeAction(CC, VT) == Legal ||
|
||||
getCondCodeAction(CC, VT) == Custom;
|
||||
bool isCondCodeLegal(ISD::CondCode CC, EVT VT) const {
|
||||
return getCondCodeAction(CC, VT) == Legal ||
|
||||
getCondCodeAction(CC, VT) == Custom;
|
||||
}
|
||||
|
||||
|
||||
/// getTypeToPromoteTo - If the action for this operation is to promote, this
|
||||
/// method returns the ValueType to promote to.
|
||||
MVT getTypeToPromoteTo(unsigned Op, MVT VT) const {
|
||||
EVT getTypeToPromoteTo(unsigned Op, EVT VT) const {
|
||||
assert(getOperationAction(Op, VT) == Promote &&
|
||||
"This operation isn't promoted!");
|
||||
|
||||
// See if this has an explicit type specified.
|
||||
std::map<std::pair<unsigned, MVT::SimpleValueType>,
|
||||
MVT::SimpleValueType>::const_iterator PTTI =
|
||||
PromoteToType.find(std::make_pair(Op, VT.SimpleTy));
|
||||
PromoteToType.find(std::make_pair(Op, VT.getSimpleVT().SimpleTy));
|
||||
if (PTTI != PromoteToType.end()) return PTTI->second;
|
||||
|
||||
assert((VT.isInteger() || VT.isFloatingPoint()) &&
|
||||
"Cannot autopromote this type, add it with AddPromotedToType.");
|
||||
|
||||
MVT NVT = VT;
|
||||
EVT NVT = VT;
|
||||
do {
|
||||
NVT = (MVT::SimpleValueType)(NVT.SimpleTy+1);
|
||||
NVT = (MVT::SimpleValueType)(NVT.getSimpleVT().SimpleTy+1);
|
||||
assert(NVT.isInteger() == VT.isInteger() && NVT != MVT::isVoid &&
|
||||
"Didn't find type to promote to!");
|
||||
} while (!isTypeLegal(NVT) ||
|
||||
|
@ -582,11 +588,7 @@ public:
|
|||
}
|
||||
return EVT::getEVT(Ty, AllowUnknown);
|
||||
}
|
||||
|
||||
/// Return the MVT corresponding to this LLVM type. See getValueType.
|
||||
MVT getSimpleValueType(Type *Ty, bool AllowUnknown = false) const {
|
||||
return getValueType(Ty, AllowUnknown).getSimpleVT();
|
||||
}
|
||||
|
||||
|
||||
/// getByValTypeAlignment - Return the desired alignment for ByVal aggregate
|
||||
/// function arguments in the caller parameter area. This is the actual
|
||||
|
@ -595,22 +597,21 @@ public:
|
|||
|
||||
/// getRegisterType - Return the type of registers that this ValueType will
|
||||
/// eventually require.
|
||||
MVT getRegisterType(MVT VT) const {
|
||||
EVT getRegisterType(MVT VT) const {
|
||||
assert((unsigned)VT.SimpleTy < array_lengthof(RegisterTypeForVT));
|
||||
return RegisterTypeForVT[VT.SimpleTy];
|
||||
}
|
||||
|
||||
/// getRegisterType - Return the type of registers that this ValueType will
|
||||
/// eventually require.
|
||||
MVT getRegisterType(LLVMContext &Context, EVT VT) const {
|
||||
EVT getRegisterType(LLVMContext &Context, EVT VT) const {
|
||||
if (VT.isSimple()) {
|
||||
assert((unsigned)VT.getSimpleVT().SimpleTy <
|
||||
array_lengthof(RegisterTypeForVT));
|
||||
return RegisterTypeForVT[VT.getSimpleVT().SimpleTy];
|
||||
}
|
||||
if (VT.isVector()) {
|
||||
EVT VT1;
|
||||
MVT RegisterVT;
|
||||
EVT VT1, RegisterVT;
|
||||
unsigned NumIntermediates;
|
||||
(void)getVectorTypeBreakdown(Context, VT, VT1,
|
||||
NumIntermediates, RegisterVT);
|
||||
|
@ -635,8 +636,7 @@ public:
|
|||
return NumRegistersForVT[VT.getSimpleVT().SimpleTy];
|
||||
}
|
||||
if (VT.isVector()) {
|
||||
EVT VT1;
|
||||
MVT VT2;
|
||||
EVT VT1, VT2;
|
||||
unsigned NumIntermediates;
|
||||
return getVectorTypeBreakdown(Context, VT, VT1, NumIntermediates, VT2);
|
||||
}
|
||||
|
@ -1128,16 +1128,16 @@ protected:
|
|||
/// addRegisterClass - Add the specified register class as an available
|
||||
/// regclass for the specified value type. This indicates the selector can
|
||||
/// handle values of that class natively.
|
||||
void addRegisterClass(MVT VT, const TargetRegisterClass *RC) {
|
||||
assert((unsigned)VT.SimpleTy < array_lengthof(RegClassForVT));
|
||||
void addRegisterClass(EVT VT, const TargetRegisterClass *RC) {
|
||||
assert((unsigned)VT.getSimpleVT().SimpleTy < array_lengthof(RegClassForVT));
|
||||
AvailableRegClasses.push_back(std::make_pair(VT, RC));
|
||||
RegClassForVT[VT.SimpleTy] = RC;
|
||||
RegClassForVT[VT.getSimpleVT().SimpleTy] = RC;
|
||||
}
|
||||
|
||||
/// findRepresentativeClass - Return the largest legal super-reg register class
|
||||
/// of the register class for the specified type and its associated "cost".
|
||||
virtual std::pair<const TargetRegisterClass*, uint8_t>
|
||||
findRepresentativeClass(MVT VT) const;
|
||||
findRepresentativeClass(EVT VT) const;
|
||||
|
||||
/// computeRegisterProperties - Once all of the register classes are added,
|
||||
/// this allows us to compute derived properties we expose.
|
||||
|
@ -1446,9 +1446,9 @@ public:
|
|||
/// but this is not true all the time, e.g. i1 on x86-64. It is also not
|
||||
/// necessary for non-C calling conventions. The frontend should handle this
|
||||
/// and include all of the necessary information.
|
||||
virtual MVT getTypeForExtArgOrReturn(LLVMContext &Context, MVT VT,
|
||||
virtual EVT getTypeForExtArgOrReturn(LLVMContext &Context, EVT VT,
|
||||
ISD::NodeType /*ExtendKind*/) const {
|
||||
MVT MinVT = getRegisterType(Context, MVT::i32);
|
||||
EVT MinVT = getRegisterType(Context, MVT::i32);
|
||||
return VT.bitsLT(MinVT) ? MinVT : VT;
|
||||
}
|
||||
|
||||
|
@ -1933,7 +1933,7 @@ private:
|
|||
/// each ValueType the target supports natively.
|
||||
const TargetRegisterClass *RegClassForVT[MVT::LAST_VALUETYPE];
|
||||
unsigned char NumRegistersForVT[MVT::LAST_VALUETYPE];
|
||||
MVT RegisterTypeForVT[MVT::LAST_VALUETYPE];
|
||||
EVT RegisterTypeForVT[MVT::LAST_VALUETYPE];
|
||||
|
||||
/// RepRegClassForVT - This indicates the "representative" register class to
|
||||
/// use for each ValueType the target supports natively. This information is
|
||||
|
@ -1953,7 +1953,7 @@ private:
|
|||
/// contains one step of the expand (e.g. i64 -> i32), even if there are
|
||||
/// multiple steps required (e.g. i64 -> i16). For types natively supported
|
||||
/// by the system, this holds the same type (e.g. i32 -> i32).
|
||||
MVT TransformToType[MVT::LAST_VALUETYPE];
|
||||
EVT TransformToType[MVT::LAST_VALUETYPE];
|
||||
|
||||
/// OpActions - For each operation and each value type, keep a LegalizeAction
|
||||
/// that indicates how instruction selection should deal with the operation.
|
||||
|
@ -1994,19 +1994,19 @@ public:
|
|||
getTypeConversion(LLVMContext &Context, EVT VT) const {
|
||||
// If this is a simple type, use the ComputeRegisterProp mechanism.
|
||||
if (VT.isSimple()) {
|
||||
MVT SVT = VT.getSimpleVT();
|
||||
assert((unsigned)SVT.SimpleTy < array_lengthof(TransformToType));
|
||||
MVT NVT = TransformToType[SVT.SimpleTy];
|
||||
LegalizeTypeAction LA = ValueTypeActions.getTypeAction(SVT);
|
||||
assert((unsigned)VT.getSimpleVT().SimpleTy <
|
||||
array_lengthof(TransformToType));
|
||||
EVT NVT = TransformToType[VT.getSimpleVT().SimpleTy];
|
||||
LegalizeTypeAction LA = ValueTypeActions.getTypeAction(VT.getSimpleVT());
|
||||
|
||||
assert(
|
||||
(LA == TypeLegal ||
|
||||
ValueTypeActions.getTypeAction(NVT) != TypePromoteInteger)
|
||||
(!(NVT.isSimple() && LA != TypeLegal) ||
|
||||
ValueTypeActions.getTypeAction(NVT.getSimpleVT()) != TypePromoteInteger)
|
||||
&& "Promote may not follow Expand or Promote");
|
||||
|
||||
if (LA == TypeSplitVector)
|
||||
NVT = MVT::getVectorVT(SVT.getVectorElementType(),
|
||||
SVT.getVectorNumElements() / 2);
|
||||
NVT = EVT::getVectorVT(Context, VT.getVectorElementType(),
|
||||
VT.getVectorNumElements() / 2);
|
||||
return LegalizeKind(LA, NVT);
|
||||
}
|
||||
|
||||
|
@ -2110,7 +2110,7 @@ public:
|
|||
}
|
||||
|
||||
private:
|
||||
std::vector<std::pair<MVT, const TargetRegisterClass*> > AvailableRegClasses;
|
||||
std::vector<std::pair<EVT, const TargetRegisterClass*> > AvailableRegClasses;
|
||||
|
||||
/// TargetDAGCombineArray - Targets can specify ISD nodes that they would
|
||||
/// like PerformDAGCombine callbacks for by calling setTargetDAGCombine(),
|
||||
|
|
|
@ -780,7 +780,7 @@ MachineLICM::getRegisterClassIDAndCost(const MachineInstr *MI,
|
|||
unsigned Reg, unsigned OpIdx,
|
||||
unsigned &RCId, unsigned &RCCost) const {
|
||||
const TargetRegisterClass *RC = MRI->getRegClass(Reg);
|
||||
MVT VT = *RC->vt_begin();
|
||||
EVT VT = *RC->vt_begin();
|
||||
if (VT == MVT::Untyped) {
|
||||
RCId = RC->getID();
|
||||
RCCost = 1;
|
||||
|
|
|
@ -2632,8 +2632,7 @@ SDValue DAGCombiner::visitAND(SDNode *N) {
|
|||
bool isInteger = LL.getValueType().isInteger();
|
||||
ISD::CondCode Result = ISD::getSetCCAndOperation(Op0, Op1, isInteger);
|
||||
if (Result != ISD::SETCC_INVALID &&
|
||||
(!LegalOperations ||
|
||||
TLI.isCondCodeLegal(Result, LL.getSimpleValueType())))
|
||||
(!LegalOperations || TLI.isCondCodeLegal(Result, LL.getValueType())))
|
||||
return DAG.getSetCC(N->getDebugLoc(), N0.getValueType(),
|
||||
LL, LR, Result);
|
||||
}
|
||||
|
@ -3141,8 +3140,7 @@ SDValue DAGCombiner::visitOR(SDNode *N) {
|
|||
bool isInteger = LL.getValueType().isInteger();
|
||||
ISD::CondCode Result = ISD::getSetCCOrOperation(Op0, Op1, isInteger);
|
||||
if (Result != ISD::SETCC_INVALID &&
|
||||
(!LegalOperations ||
|
||||
TLI.isCondCodeLegal(Result, LL.getSimpleValueType())))
|
||||
(!LegalOperations || TLI.isCondCodeLegal(Result, LL.getValueType())))
|
||||
return DAG.getSetCC(N->getDebugLoc(), N0.getValueType(),
|
||||
LL, LR, Result);
|
||||
}
|
||||
|
@ -3405,8 +3403,7 @@ SDValue DAGCombiner::visitXOR(SDNode *N) {
|
|||
ISD::CondCode NotCC = ISD::getSetCCInverse(cast<CondCodeSDNode>(CC)->get(),
|
||||
isInt);
|
||||
|
||||
if (!LegalOperations ||
|
||||
TLI.isCondCodeLegal(NotCC, LHS.getSimpleValueType())) {
|
||||
if (!LegalOperations || TLI.isCondCodeLegal(NotCC, LHS.getValueType())) {
|
||||
switch (N0.getOpcode()) {
|
||||
default:
|
||||
llvm_unreachable("Unhandled SetCC Equivalent!");
|
||||
|
|
|
@ -737,10 +737,11 @@ bool FastISel::SelectBitCast(const User *I) {
|
|||
}
|
||||
|
||||
// Bitcasts of other values become reg-reg copies or BITCAST operators.
|
||||
MVT SrcVT = TLI.getSimpleValueType(I->getOperand(0)->getType());
|
||||
MVT DstVT = TLI.getSimpleValueType(I->getType());
|
||||
EVT SrcVT = TLI.getValueType(I->getOperand(0)->getType());
|
||||
EVT DstVT = TLI.getValueType(I->getType());
|
||||
|
||||
if (SrcVT == MVT::Other || DstVT == MVT::Other ||
|
||||
if (SrcVT == MVT::Other || !SrcVT.isSimple() ||
|
||||
DstVT == MVT::Other || !DstVT.isSimple() ||
|
||||
!TLI.isTypeLegal(SrcVT) || !TLI.isTypeLegal(DstVT))
|
||||
// Unhandled type. Halt "fast" selection and bail.
|
||||
return false;
|
||||
|
@ -754,7 +755,7 @@ bool FastISel::SelectBitCast(const User *I) {
|
|||
|
||||
// First, try to perform the bitcast by inserting a reg-reg copy.
|
||||
unsigned ResultReg = 0;
|
||||
if (SrcVT == DstVT) {
|
||||
if (SrcVT.getSimpleVT() == DstVT.getSimpleVT()) {
|
||||
const TargetRegisterClass* SrcClass = TLI.getRegClassFor(SrcVT);
|
||||
const TargetRegisterClass* DstClass = TLI.getRegClassFor(DstVT);
|
||||
// Don't attempt a cross-class copy. It will likely fail.
|
||||
|
@ -767,7 +768,7 @@ bool FastISel::SelectBitCast(const User *I) {
|
|||
|
||||
// If the reg-reg copy failed, select a BITCAST opcode.
|
||||
if (!ResultReg)
|
||||
ResultReg = FastEmit_r(SrcVT, DstVT,
|
||||
ResultReg = FastEmit_r(SrcVT.getSimpleVT(), DstVT.getSimpleVT(),
|
||||
ISD::BITCAST, Op0, Op0IsKill);
|
||||
|
||||
if (!ResultReg)
|
||||
|
|
|
@ -208,7 +208,7 @@ void FunctionLoweringInfo::clear() {
|
|||
}
|
||||
|
||||
/// CreateReg - Allocate a single virtual register for the given type.
|
||||
unsigned FunctionLoweringInfo::CreateReg(MVT VT) {
|
||||
unsigned FunctionLoweringInfo::CreateReg(EVT VT) {
|
||||
return RegInfo->createVirtualRegister(TLI.getRegClassFor(VT));
|
||||
}
|
||||
|
||||
|
@ -226,7 +226,7 @@ unsigned FunctionLoweringInfo::CreateRegs(Type *Ty) {
|
|||
unsigned FirstReg = 0;
|
||||
for (unsigned Value = 0, e = ValueVTs.size(); Value != e; ++Value) {
|
||||
EVT ValueVT = ValueVTs[Value];
|
||||
MVT RegisterVT = TLI.getRegisterType(Ty->getContext(), ValueVT);
|
||||
EVT RegisterVT = TLI.getRegisterType(Ty->getContext(), ValueVT);
|
||||
|
||||
unsigned NumRegs = TLI.getNumRegisters(Ty->getContext(), ValueVT);
|
||||
for (unsigned i = 0; i != NumRegs; ++i) {
|
||||
|
|
|
@ -99,7 +99,7 @@ EmitCopyFromReg(SDNode *Node, unsigned ResNo, bool IsClone, bool IsCloned,
|
|||
// the CopyToReg'd destination register instead of creating a new vreg.
|
||||
bool MatchReg = true;
|
||||
const TargetRegisterClass *UseRC = NULL;
|
||||
MVT VT = Node->getSimpleValueType(ResNo);
|
||||
EVT VT = Node->getValueType(ResNo);
|
||||
|
||||
// Stick to the preferred register classes for legal types.
|
||||
if (TLI->isTypeLegal(VT))
|
||||
|
@ -272,8 +272,7 @@ unsigned InstrEmitter::getVR(SDValue Op,
|
|||
// IMPLICIT_DEF can produce any type of result so its MCInstrDesc
|
||||
// does not include operand register class info.
|
||||
if (!VReg) {
|
||||
const TargetRegisterClass *RC =
|
||||
TLI->getRegClassFor(Op.getSimpleValueType());
|
||||
const TargetRegisterClass *RC = TLI->getRegClassFor(Op.getValueType());
|
||||
VReg = MRI->createVirtualRegister(RC);
|
||||
}
|
||||
BuildMI(*MBB, InsertPos, Op.getDebugLoc(),
|
||||
|
@ -427,7 +426,7 @@ void InstrEmitter::AddOperand(MachineInstr *MI, SDValue Op,
|
|||
}
|
||||
|
||||
unsigned InstrEmitter::ConstrainForSubReg(unsigned VReg, unsigned SubIdx,
|
||||
MVT VT, DebugLoc DL) {
|
||||
EVT VT, DebugLoc DL) {
|
||||
const TargetRegisterClass *VRC = MRI->getRegClass(VReg);
|
||||
const TargetRegisterClass *RC = TRI->getSubClassWithSubReg(VRC, SubIdx);
|
||||
|
||||
|
@ -478,8 +477,7 @@ void InstrEmitter::EmitSubregNode(SDNode *Node,
|
|||
// constraints on the %dst register, COPY can target all legal register
|
||||
// classes.
|
||||
unsigned SubIdx = cast<ConstantSDNode>(Node->getOperand(1))->getZExtValue();
|
||||
const TargetRegisterClass *TRC =
|
||||
TLI->getRegClassFor(Node->getSimpleValueType(0));
|
||||
const TargetRegisterClass *TRC = TLI->getRegClassFor(Node->getValueType(0));
|
||||
|
||||
unsigned VReg = getVR(Node->getOperand(0), VRBaseMap);
|
||||
MachineInstr *DefMI = MRI->getVRegDef(VReg);
|
||||
|
@ -502,7 +500,7 @@ void InstrEmitter::EmitSubregNode(SDNode *Node,
|
|||
// constrain its register class or issue a COPY to a compatible register
|
||||
// class.
|
||||
VReg = ConstrainForSubReg(VReg, SubIdx,
|
||||
Node->getOperand(0).getSimpleValueType(),
|
||||
Node->getOperand(0).getValueType(),
|
||||
Node->getDebugLoc());
|
||||
|
||||
// Create the destreg if it is missing.
|
||||
|
@ -534,7 +532,7 @@ void InstrEmitter::EmitSubregNode(SDNode *Node,
|
|||
//
|
||||
// There is no constraint on the %src register class.
|
||||
//
|
||||
const TargetRegisterClass *SRC = TLI->getRegClassFor(Node->getSimpleValueType(0));
|
||||
const TargetRegisterClass *SRC = TLI->getRegClassFor(Node->getValueType(0));
|
||||
SRC = TRI->getSubClassWithSubReg(SRC, SubIdx);
|
||||
assert(SRC && "No register class supports VT and SubIdx for INSERT_SUBREG");
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ class InstrEmitter {
|
|||
/// supports SubIdx sub-registers. Emit a copy if that isn't possible.
|
||||
/// Return the virtual register to use.
|
||||
unsigned ConstrainForSubReg(unsigned VReg, unsigned SubIdx,
|
||||
MVT VT, DebugLoc DL);
|
||||
EVT VT, DebugLoc DL);
|
||||
|
||||
/// EmitSubregNode - Generate machine code for subreg nodes.
|
||||
///
|
||||
|
|
|
@ -321,7 +321,7 @@ static void ExpandUnalignedStore(StoreSDNode *ST, SelectionDAG &DAG,
|
|||
// Do a (aligned) store to a stack slot, then copy from the stack slot
|
||||
// to the final destination using (unaligned) integer loads and stores.
|
||||
EVT StoredVT = ST->getMemoryVT();
|
||||
MVT RegVT =
|
||||
EVT RegVT =
|
||||
TLI.getRegisterType(*DAG.getContext(),
|
||||
EVT::getIntegerVT(*DAG.getContext(),
|
||||
StoredVT.getSizeInBits()));
|
||||
|
@ -447,7 +447,7 @@ ExpandUnalignedLoad(LoadSDNode *LD, SelectionDAG &DAG,
|
|||
|
||||
// Copy the value to a (aligned) stack slot using (unaligned) integer
|
||||
// loads and stores, then do a (aligned) load from the stack slot.
|
||||
MVT RegVT = TLI.getRegisterType(*DAG.getContext(), intVT);
|
||||
EVT RegVT = TLI.getRegisterType(*DAG.getContext(), intVT);
|
||||
unsigned LoadedBytes = LoadedVT.getSizeInBits() / 8;
|
||||
unsigned RegBytes = RegVT.getSizeInBits() / 8;
|
||||
unsigned NumRegs = (LoadedBytes + RegBytes - 1) / RegBytes;
|
||||
|
@ -710,7 +710,7 @@ void SelectionDAGLegalize::LegalizeStoreOps(SDNode *Node) {
|
|||
|
||||
{
|
||||
SDValue Value = ST->getValue();
|
||||
MVT VT = Value.getSimpleValueType();
|
||||
EVT VT = Value.getValueType();
|
||||
switch (TLI.getOperationAction(ISD::STORE, VT)) {
|
||||
default: llvm_unreachable("This action is not supported yet!");
|
||||
case TargetLowering::Legal:
|
||||
|
@ -818,8 +818,7 @@ void SelectionDAGLegalize::LegalizeStoreOps(SDNode *Node) {
|
|||
SDValue Result = DAG.getNode(ISD::TokenFactor, dl, MVT::Other, Lo, Hi);
|
||||
ReplaceNode(SDValue(Node, 0), Result);
|
||||
} else {
|
||||
switch (TLI.getTruncStoreAction(ST->getValue().getSimpleValueType(),
|
||||
StVT.getSimpleVT())) {
|
||||
switch (TLI.getTruncStoreAction(ST->getValue().getValueType(), StVT)) {
|
||||
default: llvm_unreachable("This action is not supported yet!");
|
||||
case TargetLowering::Legal:
|
||||
// If this is an unaligned store and the target doesn't support it,
|
||||
|
@ -864,7 +863,7 @@ void SelectionDAGLegalize::LegalizeLoadOps(SDNode *Node) {
|
|||
|
||||
ISD::LoadExtType ExtType = LD->getExtensionType();
|
||||
if (ExtType == ISD::NON_EXTLOAD) {
|
||||
MVT VT = Node->getSimpleValueType(0);
|
||||
EVT VT = Node->getValueType(0);
|
||||
SDValue RVal = SDValue(Node, 0);
|
||||
SDValue RChain = SDValue(Node, 1);
|
||||
|
||||
|
@ -891,7 +890,7 @@ void SelectionDAGLegalize::LegalizeLoadOps(SDNode *Node) {
|
|||
break;
|
||||
}
|
||||
case TargetLowering::Promote: {
|
||||
MVT NVT = TLI.getTypeToPromoteTo(Node->getOpcode(), VT);
|
||||
EVT NVT = TLI.getTypeToPromoteTo(Node->getOpcode(), VT);
|
||||
assert(NVT.getSizeInBits() == VT.getSizeInBits() &&
|
||||
"Can only promote loads to same size type");
|
||||
|
||||
|
@ -1038,7 +1037,7 @@ void SelectionDAGLegalize::LegalizeLoadOps(SDNode *Node) {
|
|||
Chain = Ch;
|
||||
} else {
|
||||
bool isCustom = false;
|
||||
switch (TLI.getLoadExtAction(ExtType, SrcVT.getSimpleVT())) {
|
||||
switch (TLI.getLoadExtAction(ExtType, SrcVT)) {
|
||||
default: llvm_unreachable("This action is not supported yet!");
|
||||
case TargetLowering::Custom:
|
||||
isCustom = true;
|
||||
|
@ -1185,7 +1184,7 @@ void SelectionDAGLegalize::LegalizeOp(SDNode *Node) {
|
|||
unsigned CCOperand = Node->getOpcode() == ISD::SELECT_CC ? 4 :
|
||||
Node->getOpcode() == ISD::SETCC ? 2 : 1;
|
||||
unsigned CompareOperand = Node->getOpcode() == ISD::BR_CC ? 2 : 0;
|
||||
MVT OpVT = Node->getOperand(CompareOperand).getSimpleValueType();
|
||||
EVT OpVT = Node->getOperand(CompareOperand).getValueType();
|
||||
ISD::CondCode CCCode =
|
||||
cast<CondCodeSDNode>(Node->getOperand(CCOperand))->get();
|
||||
Action = TLI.getCondCodeAction(CCCode, OpVT);
|
||||
|
@ -1592,7 +1591,7 @@ void SelectionDAGLegalize::LegalizeSetCCCondCode(EVT VT,
|
|||
SDValue &LHS, SDValue &RHS,
|
||||
SDValue &CC,
|
||||
DebugLoc dl) {
|
||||
MVT OpVT = LHS.getSimpleValueType();
|
||||
EVT OpVT = LHS.getValueType();
|
||||
ISD::CondCode CCCode = cast<CondCodeSDNode>(CC)->get();
|
||||
switch (TLI.getCondCodeAction(CCCode, OpVT)) {
|
||||
default: llvm_unreachable("Unknown condition code action!");
|
||||
|
@ -3576,13 +3575,13 @@ void SelectionDAGLegalize::ExpandNode(SDNode *Node) {
|
|||
|
||||
void SelectionDAGLegalize::PromoteNode(SDNode *Node) {
|
||||
SmallVector<SDValue, 8> Results;
|
||||
MVT OVT = Node->getSimpleValueType(0);
|
||||
EVT OVT = Node->getValueType(0);
|
||||
if (Node->getOpcode() == ISD::UINT_TO_FP ||
|
||||
Node->getOpcode() == ISD::SINT_TO_FP ||
|
||||
Node->getOpcode() == ISD::SETCC) {
|
||||
OVT = Node->getOperand(0).getSimpleValueType();
|
||||
OVT = Node->getOperand(0).getValueType();
|
||||
}
|
||||
MVT NVT = TLI.getTypeToPromoteTo(Node->getOpcode(), OVT);
|
||||
EVT NVT = TLI.getTypeToPromoteTo(Node->getOpcode(), OVT);
|
||||
DebugLoc dl = Node->getDebugLoc();
|
||||
SDValue Tmp1, Tmp2, Tmp3;
|
||||
switch (Node->getOpcode()) {
|
||||
|
|
|
@ -703,7 +703,7 @@ SDValue DAGTypeLegalizer::PromoteIntRes_VAARG(SDNode *N) {
|
|||
EVT VT = N->getValueType(0);
|
||||
DebugLoc dl = N->getDebugLoc();
|
||||
|
||||
MVT RegVT = TLI.getRegisterType(*DAG.getContext(), VT);
|
||||
EVT RegVT = TLI.getRegisterType(*DAG.getContext(), VT);
|
||||
unsigned NumRegs = TLI.getNumRegisters(*DAG.getContext(), VT);
|
||||
// The argument is passed as NumRegs registers of type RegVT.
|
||||
|
||||
|
|
|
@ -142,9 +142,9 @@ SDValue VectorLegalizer::LegalizeOp(SDValue Op) {
|
|||
} else if (Op.getOpcode() == ISD::STORE) {
|
||||
StoreSDNode *ST = cast<StoreSDNode>(Op.getNode());
|
||||
EVT StVT = ST->getMemoryVT();
|
||||
MVT ValVT = ST->getValue().getSimpleValueType();
|
||||
EVT ValVT = ST->getValue().getValueType();
|
||||
if (StVT.isVector() && ST->isTruncatingStore())
|
||||
switch (TLI.getTruncStoreAction(ValVT, StVT.getSimpleVT())) {
|
||||
switch (TLI.getTruncStoreAction(ValVT, StVT)) {
|
||||
default: llvm_unreachable("This action is not supported yet!");
|
||||
case TargetLowering::Legal:
|
||||
return TranslateLegalizeResults(Op, Result);
|
||||
|
@ -293,10 +293,10 @@ SDValue VectorLegalizer::PromoteVectorOp(SDValue Op) {
|
|||
// Vector "promotion" is basically just bitcasting and doing the operation
|
||||
// in a different type. For example, x86 promotes ISD::AND on v2i32 to
|
||||
// v1i64.
|
||||
MVT VT = Op.getSimpleValueType();
|
||||
EVT VT = Op.getValueType();
|
||||
assert(Op.getNode()->getNumValues() == 1 &&
|
||||
"Can't promote a vector with multiple results!");
|
||||
MVT NVT = TLI.getTypeToPromoteTo(Op.getOpcode(), VT);
|
||||
EVT NVT = TLI.getTypeToPromoteTo(Op.getOpcode(), VT);
|
||||
DebugLoc dl = Op.getDebugLoc();
|
||||
SmallVector<SDValue, 4> Operands(Op.getNumOperands());
|
||||
|
||||
|
|
|
@ -94,9 +94,9 @@ ResourcePriorityQueue::numberRCValPredInSU(SUnit *SU, unsigned RCId) {
|
|||
continue;
|
||||
|
||||
for (unsigned i = 0, e = ScegN->getNumValues(); i != e; ++i) {
|
||||
MVT VT = ScegN->getSimpleValueType(i);
|
||||
EVT VT = ScegN->getValueType(i);
|
||||
if (TLI->isTypeLegal(VT)
|
||||
&& (TLI->getRegClassFor(VT)->getID() == RCId)) {
|
||||
&& (TLI->getRegClassFor(VT)->getID() == RCId)) {
|
||||
NumberDeps++;
|
||||
break;
|
||||
}
|
||||
|
@ -132,9 +132,9 @@ unsigned ResourcePriorityQueue::numberRCValSuccInSU(SUnit *SU,
|
|||
|
||||
for (unsigned i = 0, e = ScegN->getNumOperands(); i != e; ++i) {
|
||||
const SDValue &Op = ScegN->getOperand(i);
|
||||
MVT VT = Op.getNode()->getSimpleValueType(Op.getResNo());
|
||||
EVT VT = Op.getNode()->getValueType(Op.getResNo());
|
||||
if (TLI->isTypeLegal(VT)
|
||||
&& (TLI->getRegClassFor(VT)->getID() == RCId)) {
|
||||
&& (TLI->getRegClassFor(VT)->getID() == RCId)) {
|
||||
NumberDeps++;
|
||||
break;
|
||||
}
|
||||
|
@ -332,7 +332,7 @@ signed ResourcePriorityQueue::rawRegPressureDelta(SUnit *SU, unsigned RCId) {
|
|||
|
||||
// Gen estimate.
|
||||
for (unsigned i = 0, e = SU->getNode()->getNumValues(); i != e; ++i) {
|
||||
MVT VT = SU->getNode()->getSimpleValueType(i);
|
||||
EVT VT = SU->getNode()->getValueType(i);
|
||||
if (TLI->isTypeLegal(VT)
|
||||
&& TLI->getRegClassFor(VT)
|
||||
&& TLI->getRegClassFor(VT)->getID() == RCId)
|
||||
|
@ -341,7 +341,7 @@ signed ResourcePriorityQueue::rawRegPressureDelta(SUnit *SU, unsigned RCId) {
|
|||
// Kill estimate.
|
||||
for (unsigned i = 0, e = SU->getNode()->getNumOperands(); i != e; ++i) {
|
||||
const SDValue &Op = SU->getNode()->getOperand(i);
|
||||
MVT VT = Op.getNode()->getSimpleValueType(Op.getResNo());
|
||||
EVT VT = Op.getNode()->getValueType(Op.getResNo());
|
||||
if (isa<ConstantSDNode>(Op.getNode()))
|
||||
continue;
|
||||
|
||||
|
@ -485,7 +485,7 @@ void ResourcePriorityQueue::scheduledNode(SUnit *SU) {
|
|||
if (ScegN->isMachineOpcode()) {
|
||||
// Estimate generated regs.
|
||||
for (unsigned i = 0, e = ScegN->getNumValues(); i != e; ++i) {
|
||||
MVT VT = ScegN->getSimpleValueType(i);
|
||||
EVT VT = ScegN->getValueType(i);
|
||||
|
||||
if (TLI->isTypeLegal(VT)) {
|
||||
const TargetRegisterClass *RC = TLI->getRegClassFor(VT);
|
||||
|
@ -496,7 +496,7 @@ void ResourcePriorityQueue::scheduledNode(SUnit *SU) {
|
|||
// Estimate killed regs.
|
||||
for (unsigned i = 0, e = ScegN->getNumOperands(); i != e; ++i) {
|
||||
const SDValue &Op = ScegN->getOperand(i);
|
||||
MVT VT = Op.getNode()->getSimpleValueType(Op.getResNo());
|
||||
EVT VT = Op.getNode()->getValueType(Op.getResNo());
|
||||
|
||||
if (TLI->isTypeLegal(VT)) {
|
||||
const TargetRegisterClass *RC = TLI->getRegClassFor(VT);
|
||||
|
|
|
@ -268,7 +268,7 @@ static void GetCostForDef(const ScheduleDAGSDNodes::RegDefIter &RegDefPos,
|
|||
const TargetRegisterInfo *TRI,
|
||||
unsigned &RegClass, unsigned &Cost,
|
||||
const MachineFunction &MF) {
|
||||
MVT VT = RegDefPos.GetValue();
|
||||
EVT VT = RegDefPos.GetValue();
|
||||
|
||||
// Special handling for untyped values. These values can only come from
|
||||
// the expansion of custom DAG-to-DAG patterns.
|
||||
|
@ -1939,7 +1939,7 @@ bool RegReductionPQBase::MayReduceRegPressure(SUnit *SU) const {
|
|||
|
||||
unsigned NumDefs = TII->get(N->getMachineOpcode()).getNumDefs();
|
||||
for (unsigned i = 0; i != NumDefs; ++i) {
|
||||
MVT VT = N->getSimpleValueType(i);
|
||||
EVT VT = N->getValueType(i);
|
||||
if (!N->hasAnyUseOfValue(i))
|
||||
continue;
|
||||
unsigned RCId = TLI->getRepRegClassFor(VT)->getID();
|
||||
|
@ -1973,7 +1973,7 @@ int RegReductionPQBase::RegPressureDiff(SUnit *SU, unsigned &LiveUses) const {
|
|||
}
|
||||
for (ScheduleDAGSDNodes::RegDefIter RegDefPos(PredSU, scheduleDAG);
|
||||
RegDefPos.IsValid(); RegDefPos.Advance()) {
|
||||
MVT VT = RegDefPos.GetValue();
|
||||
EVT VT = RegDefPos.GetValue();
|
||||
unsigned RCId = TLI->getRepRegClassFor(VT)->getID();
|
||||
if (RegPressure[RCId] >= RegLimit[RCId])
|
||||
++PDiff;
|
||||
|
@ -1986,7 +1986,7 @@ int RegReductionPQBase::RegPressureDiff(SUnit *SU, unsigned &LiveUses) const {
|
|||
|
||||
unsigned NumDefs = TII->get(N->getMachineOpcode()).getNumDefs();
|
||||
for (unsigned i = 0; i != NumDefs; ++i) {
|
||||
MVT VT = N->getSimpleValueType(i);
|
||||
EVT VT = N->getValueType(i);
|
||||
if (!N->hasAnyUseOfValue(i))
|
||||
continue;
|
||||
unsigned RCId = TLI->getRepRegClassFor(VT)->getID();
|
||||
|
@ -2097,7 +2097,7 @@ void RegReductionPQBase::unscheduledNode(SUnit *SU) {
|
|||
const SDNode *PN = PredSU->getNode();
|
||||
if (!PN->isMachineOpcode()) {
|
||||
if (PN->getOpcode() == ISD::CopyFromReg) {
|
||||
MVT VT = PN->getSimpleValueType(0);
|
||||
EVT VT = PN->getValueType(0);
|
||||
unsigned RCId = TLI->getRepRegClassFor(VT)->getID();
|
||||
RegPressure[RCId] += TLI->getRepRegClassCostFor(VT);
|
||||
}
|
||||
|
@ -2109,14 +2109,14 @@ void RegReductionPQBase::unscheduledNode(SUnit *SU) {
|
|||
if (POpc == TargetOpcode::EXTRACT_SUBREG ||
|
||||
POpc == TargetOpcode::INSERT_SUBREG ||
|
||||
POpc == TargetOpcode::SUBREG_TO_REG) {
|
||||
MVT VT = PN->getSimpleValueType(0);
|
||||
EVT VT = PN->getValueType(0);
|
||||
unsigned RCId = TLI->getRepRegClassFor(VT)->getID();
|
||||
RegPressure[RCId] += TLI->getRepRegClassCostFor(VT);
|
||||
continue;
|
||||
}
|
||||
unsigned NumDefs = TII->get(PN->getMachineOpcode()).getNumDefs();
|
||||
for (unsigned i = 0; i != NumDefs; ++i) {
|
||||
MVT VT = PN->getSimpleValueType(i);
|
||||
EVT VT = PN->getValueType(i);
|
||||
if (!PN->hasAnyUseOfValue(i))
|
||||
continue;
|
||||
unsigned RCId = TLI->getRepRegClassFor(VT)->getID();
|
||||
|
@ -2133,7 +2133,7 @@ void RegReductionPQBase::unscheduledNode(SUnit *SU) {
|
|||
if (SU->NumSuccs && N->isMachineOpcode()) {
|
||||
unsigned NumDefs = TII->get(N->getMachineOpcode()).getNumDefs();
|
||||
for (unsigned i = NumDefs, e = N->getNumValues(); i != e; ++i) {
|
||||
MVT VT = N->getSimpleValueType(i);
|
||||
EVT VT = N->getValueType(i);
|
||||
if (VT == MVT::Glue || VT == MVT::Other)
|
||||
continue;
|
||||
if (!N->hasAnyUseOfValue(i))
|
||||
|
|
|
@ -562,7 +562,7 @@ void ScheduleDAGSDNodes::RegDefIter::Advance() {
|
|||
for (;DefIdx < NodeNumDefs; ++DefIdx) {
|
||||
if (!Node->hasAnyUseOfValue(DefIdx))
|
||||
continue;
|
||||
ValueType = Node->getSimpleValueType(DefIdx);
|
||||
ValueType = Node->getValueType(DefIdx);
|
||||
++DefIdx;
|
||||
return; // Found a normal regdef.
|
||||
}
|
||||
|
|
|
@ -135,13 +135,13 @@ namespace llvm {
|
|||
const SDNode *Node;
|
||||
unsigned DefIdx;
|
||||
unsigned NodeNumDefs;
|
||||
MVT ValueType;
|
||||
EVT ValueType;
|
||||
public:
|
||||
RegDefIter(const SUnit *SU, const ScheduleDAGSDNodes *SD);
|
||||
|
||||
bool IsValid() const { return Node != NULL; }
|
||||
|
||||
MVT GetValue() const {
|
||||
EVT GetValue() const {
|
||||
assert(IsValid() && "bad iterator");
|
||||
return ValueType;
|
||||
}
|
||||
|
|
|
@ -227,17 +227,15 @@ static SDValue getCopyFromPartsVector(SelectionDAG &DAG, DebugLoc DL,
|
|||
|
||||
// Handle a multi-element vector.
|
||||
if (NumParts > 1) {
|
||||
EVT IntermediateVT;
|
||||
MVT RegisterVT;
|
||||
EVT IntermediateVT, RegisterVT;
|
||||
unsigned NumIntermediates;
|
||||
unsigned NumRegs =
|
||||
TLI.getVectorTypeBreakdown(*DAG.getContext(), ValueVT, IntermediateVT,
|
||||
NumIntermediates, RegisterVT);
|
||||
assert(NumRegs == NumParts && "Part count doesn't match vector breakdown!");
|
||||
NumParts = NumRegs; // Silence a compiler warning.
|
||||
assert(RegisterVT == PartVT.getSimpleVT() &&
|
||||
"Part type doesn't match vector breakdown!");
|
||||
assert(RegisterVT == Parts[0].getSimpleValueType() &&
|
||||
assert(RegisterVT == PartVT && "Part type doesn't match vector breakdown!");
|
||||
assert(RegisterVT == Parts[0].getValueType() &&
|
||||
"Part type doesn't match part!");
|
||||
|
||||
// Assemble the parts into intermediate operands.
|
||||
|
@ -526,8 +524,7 @@ static void getCopyToPartsVector(SelectionDAG &DAG, DebugLoc DL,
|
|||
}
|
||||
|
||||
// Handle a multi-element vector.
|
||||
EVT IntermediateVT;
|
||||
MVT RegisterVT;
|
||||
EVT IntermediateVT, RegisterVT;
|
||||
unsigned NumIntermediates;
|
||||
unsigned NumRegs = TLI.getVectorTypeBreakdown(*DAG.getContext(), ValueVT,
|
||||
IntermediateVT,
|
||||
|
@ -536,8 +533,7 @@ static void getCopyToPartsVector(SelectionDAG &DAG, DebugLoc DL,
|
|||
|
||||
assert(NumRegs == NumParts && "Part count doesn't match vector breakdown!");
|
||||
NumParts = NumRegs; // Silence a compiler warning.
|
||||
assert(RegisterVT == PartVT.getSimpleVT() &&
|
||||
"Part type doesn't match vector breakdown!");
|
||||
assert(RegisterVT == PartVT && "Part type doesn't match vector breakdown!");
|
||||
|
||||
// Split the vector into intermediate operands.
|
||||
SmallVector<SDValue, 8> Ops(NumIntermediates);
|
||||
|
@ -593,7 +589,7 @@ namespace {
|
|||
/// getRegisterType member function, however when with physical registers
|
||||
/// it is necessary to have a separate record of the types.
|
||||
///
|
||||
SmallVector<MVT, 4> RegVTs;
|
||||
SmallVector<EVT, 4> RegVTs;
|
||||
|
||||
/// Regs - This list holds the registers assigned to the values.
|
||||
/// Each legal or promoted value requires one register, and each
|
||||
|
@ -604,7 +600,7 @@ namespace {
|
|||
RegsForValue() {}
|
||||
|
||||
RegsForValue(const SmallVector<unsigned, 4> ®s,
|
||||
MVT regvt, EVT valuevt)
|
||||
EVT regvt, EVT valuevt)
|
||||
: ValueVTs(1, valuevt), RegVTs(1, regvt), Regs(regs) {}
|
||||
|
||||
RegsForValue(LLVMContext &Context, const TargetLowering &tli,
|
||||
|
@ -614,7 +610,7 @@ namespace {
|
|||
for (unsigned Value = 0, e = ValueVTs.size(); Value != e; ++Value) {
|
||||
EVT ValueVT = ValueVTs[Value];
|
||||
unsigned NumRegs = tli.getNumRegisters(Context, ValueVT);
|
||||
MVT RegisterVT = tli.getRegisterType(Context, ValueVT);
|
||||
EVT RegisterVT = tli.getRegisterType(Context, ValueVT);
|
||||
for (unsigned i = 0; i != NumRegs; ++i)
|
||||
Regs.push_back(Reg + i);
|
||||
RegVTs.push_back(RegisterVT);
|
||||
|
@ -625,7 +621,7 @@ namespace {
|
|||
/// areValueTypesLegal - Return true if types of all the values are legal.
|
||||
bool areValueTypesLegal(const TargetLowering &TLI) {
|
||||
for (unsigned Value = 0, e = ValueVTs.size(); Value != e; ++Value) {
|
||||
MVT RegisterVT = RegVTs[Value];
|
||||
EVT RegisterVT = RegVTs[Value];
|
||||
if (!TLI.isTypeLegal(RegisterVT))
|
||||
return false;
|
||||
}
|
||||
|
@ -687,7 +683,7 @@ SDValue RegsForValue::getCopyFromRegs(SelectionDAG &DAG,
|
|||
// Copy the legal parts from the registers.
|
||||
EVT ValueVT = ValueVTs[Value];
|
||||
unsigned NumRegs = TLI.getNumRegisters(*DAG.getContext(), ValueVT);
|
||||
MVT RegisterVT = RegVTs[Value];
|
||||
EVT RegisterVT = RegVTs[Value];
|
||||
|
||||
Parts.resize(NumRegs);
|
||||
for (unsigned i = 0; i != NumRegs; ++i) {
|
||||
|
@ -772,7 +768,7 @@ void RegsForValue::getCopyToRegs(SDValue Val, SelectionDAG &DAG, DebugLoc dl,
|
|||
for (unsigned Value = 0, Part = 0, e = ValueVTs.size(); Value != e; ++Value) {
|
||||
EVT ValueVT = ValueVTs[Value];
|
||||
unsigned NumParts = TLI.getNumRegisters(*DAG.getContext(), ValueVT);
|
||||
MVT RegisterVT = RegVTs[Value];
|
||||
EVT RegisterVT = RegVTs[Value];
|
||||
ISD::NodeType ExtendKind =
|
||||
TLI.isZExtFree(Val, RegisterVT)? ISD::ZERO_EXTEND: ISD::ANY_EXTEND;
|
||||
|
||||
|
@ -840,7 +836,7 @@ void RegsForValue::AddInlineAsmOperands(unsigned Code, bool HasMatching,
|
|||
|
||||
for (unsigned Value = 0, Reg = 0, e = ValueVTs.size(); Value != e; ++Value) {
|
||||
unsigned NumRegs = TLI.getNumRegisters(*DAG.getContext(), ValueVTs[Value]);
|
||||
MVT RegisterVT = RegVTs[Value];
|
||||
EVT RegisterVT = RegVTs[Value];
|
||||
for (unsigned i = 0; i != NumRegs; ++i) {
|
||||
assert(Reg < Regs.size() && "Mismatch in # registers expected");
|
||||
Ops.push_back(DAG.getRegister(Regs[Reg++], RegisterVT));
|
||||
|
@ -1239,11 +1235,10 @@ void SelectionDAGBuilder::visitRet(const ReturnInst &I) {
|
|||
ExtendKind = ISD::ZERO_EXTEND;
|
||||
|
||||
if (ExtendKind != ISD::ANY_EXTEND && VT.isInteger())
|
||||
VT = TLI.getTypeForExtArgOrReturn(*DAG.getContext(),
|
||||
VT.getSimpleVT(), ExtendKind);
|
||||
VT = TLI.getTypeForExtArgOrReturn(*DAG.getContext(), VT, ExtendKind);
|
||||
|
||||
unsigned NumParts = TLI.getNumRegisters(*DAG.getContext(), VT);
|
||||
MVT PartVT = TLI.getRegisterType(*DAG.getContext(), VT);
|
||||
EVT PartVT = TLI.getRegisterType(*DAG.getContext(), VT);
|
||||
SmallVector<SDValue, 4> Parts(NumParts);
|
||||
getCopyToParts(DAG, getCurDebugLoc(),
|
||||
SDValue(RetOp.getNode(), RetOp.getResNo() + j),
|
||||
|
@ -1737,7 +1732,7 @@ void SelectionDAGBuilder::visitBitTestHeader(BitTestBlock &B,
|
|||
MachineBasicBlock *SwitchBB) {
|
||||
// Subtract the minimum value
|
||||
SDValue SwitchOp = getValue(B.SValue);
|
||||
MVT VT = SwitchOp.getSimpleValueType();
|
||||
EVT VT = SwitchOp.getValueType();
|
||||
SDValue Sub = DAG.getNode(ISD::SUB, getCurDebugLoc(), VT, SwitchOp,
|
||||
DAG.getConstant(B.First, VT));
|
||||
|
||||
|
@ -1800,7 +1795,7 @@ void SelectionDAGBuilder::visitBitTestCase(BitTestBlock &BB,
|
|||
unsigned Reg,
|
||||
BitTestCase &B,
|
||||
MachineBasicBlock *SwitchBB) {
|
||||
MVT VT = BB.RegVT;
|
||||
EVT VT = BB.RegVT;
|
||||
SDValue ShiftOp = DAG.getCopyFromReg(getControlRoot(), getCurDebugLoc(),
|
||||
Reg, VT);
|
||||
SDValue Cmp;
|
||||
|
@ -5749,7 +5744,7 @@ static void GetRegistersForValue(SelectionDAG &DAG,
|
|||
// Try to convert to the first EVT that the reg class contains. If the
|
||||
// types are identical size, use a bitcast to convert (e.g. two differing
|
||||
// vector types).
|
||||
MVT RegVT = *PhysReg.second->vt_begin();
|
||||
EVT RegVT = *PhysReg.second->vt_begin();
|
||||
if (RegVT.getSizeInBits() == OpInfo.ConstraintVT.getSizeInBits()) {
|
||||
OpInfo.CallOperand = DAG.getNode(ISD::BITCAST, DL,
|
||||
RegVT, OpInfo.CallOperand);
|
||||
|
@ -5759,7 +5754,8 @@ static void GetRegistersForValue(SelectionDAG &DAG,
|
|||
// bitcast to the corresponding integer type. This turns an f64 value
|
||||
// into i64, which can be passed with two i32 values on a 32-bit
|
||||
// machine.
|
||||
RegVT = MVT::getIntegerVT(OpInfo.ConstraintVT.getSizeInBits());
|
||||
RegVT = EVT::getIntegerVT(Context,
|
||||
OpInfo.ConstraintVT.getSizeInBits());
|
||||
OpInfo.CallOperand = DAG.getNode(ISD::BITCAST, DL,
|
||||
RegVT, OpInfo.CallOperand);
|
||||
OpInfo.ConstraintVT = RegVT;
|
||||
|
@ -5769,7 +5765,7 @@ static void GetRegistersForValue(SelectionDAG &DAG,
|
|||
NumRegs = TLI.getNumRegisters(Context, OpInfo.ConstraintVT);
|
||||
}
|
||||
|
||||
MVT RegVT;
|
||||
EVT RegVT;
|
||||
EVT ValueVT = OpInfo.ConstraintVT;
|
||||
|
||||
// If this is a constraint for a specific physical register, like {r17},
|
||||
|
@ -6149,7 +6145,7 @@ void SelectionDAGBuilder::visitInlineAsm(ImmutableCallSite CS) {
|
|||
|
||||
RegsForValue MatchedRegs;
|
||||
MatchedRegs.ValueVTs.push_back(InOperandVal.getValueType());
|
||||
MVT RegVT = AsmNodeOperands[CurOp+1].getSimpleValueType();
|
||||
EVT RegVT = AsmNodeOperands[CurOp+1].getValueType();
|
||||
MatchedRegs.RegVTs.push_back(RegVT);
|
||||
MachineRegisterInfo &RegInfo = DAG.getMachineFunction().getRegInfo();
|
||||
for (unsigned i = 0, e = InlineAsm::getNumOperandRegisters(OpFlag);
|
||||
|
@ -6416,7 +6412,7 @@ TargetLowering::LowerCallTo(TargetLowering::CallLoweringInfo &CLI) const {
|
|||
Flags.setNest();
|
||||
Flags.setOrigAlign(OriginalAlignment);
|
||||
|
||||
MVT PartVT = getRegisterType(CLI.RetTy->getContext(), VT);
|
||||
EVT PartVT = getRegisterType(CLI.RetTy->getContext(), VT);
|
||||
unsigned NumParts = getNumRegisters(CLI.RetTy->getContext(), VT);
|
||||
SmallVector<SDValue, 4> Parts(NumParts);
|
||||
ISD::NodeType ExtendKind = ISD::ANY_EXTEND;
|
||||
|
@ -6451,11 +6447,11 @@ TargetLowering::LowerCallTo(TargetLowering::CallLoweringInfo &CLI) const {
|
|||
ComputeValueVTs(*this, CLI.RetTy, RetTys);
|
||||
for (unsigned I = 0, E = RetTys.size(); I != E; ++I) {
|
||||
EVT VT = RetTys[I];
|
||||
MVT RegisterVT = getRegisterType(CLI.RetTy->getContext(), VT);
|
||||
EVT RegisterVT = getRegisterType(CLI.RetTy->getContext(), VT);
|
||||
unsigned NumRegs = getNumRegisters(CLI.RetTy->getContext(), VT);
|
||||
for (unsigned i = 0; i != NumRegs; ++i) {
|
||||
ISD::InputArg MyFlags;
|
||||
MyFlags.VT = RegisterVT;
|
||||
MyFlags.VT = RegisterVT.getSimpleVT();
|
||||
MyFlags.Used = CLI.IsReturnValueUsed;
|
||||
if (CLI.RetSExt)
|
||||
MyFlags.Flags.setSExt();
|
||||
|
@ -6505,7 +6501,7 @@ TargetLowering::LowerCallTo(TargetLowering::CallLoweringInfo &CLI) const {
|
|||
unsigned CurReg = 0;
|
||||
for (unsigned I = 0, E = RetTys.size(); I != E; ++I) {
|
||||
EVT VT = RetTys[I];
|
||||
MVT RegisterVT = getRegisterType(CLI.RetTy->getContext(), VT);
|
||||
EVT RegisterVT = getRegisterType(CLI.RetTy->getContext(), VT);
|
||||
unsigned NumRegs = getNumRegisters(CLI.RetTy->getContext(), VT);
|
||||
|
||||
ReturnValues.push_back(getCopyFromParts(CLI.DAG, CLI.DL, &InVals[CurReg],
|
||||
|
@ -6595,7 +6591,7 @@ void SelectionDAGISel::LowerArguments(const BasicBlock *LLVMBB) {
|
|||
// or one register.
|
||||
ISD::ArgFlagsTy Flags;
|
||||
Flags.setSRet();
|
||||
MVT RegisterVT = TLI.getRegisterType(*DAG.getContext(), ValueVTs[0]);
|
||||
EVT RegisterVT = TLI.getRegisterType(*DAG.getContext(), ValueVTs[0]);
|
||||
ISD::InputArg RetArg(Flags, RegisterVT, true, 0, 0);
|
||||
Ins.push_back(RetArg);
|
||||
}
|
||||
|
@ -6641,7 +6637,7 @@ void SelectionDAGISel::LowerArguments(const BasicBlock *LLVMBB) {
|
|||
Flags.setNest();
|
||||
Flags.setOrigAlign(OriginalAlignment);
|
||||
|
||||
MVT RegisterVT = TLI.getRegisterType(*CurDAG->getContext(), VT);
|
||||
EVT RegisterVT = TLI.getRegisterType(*CurDAG->getContext(), VT);
|
||||
unsigned NumRegs = TLI.getNumRegisters(*CurDAG->getContext(), VT);
|
||||
for (unsigned i = 0; i != NumRegs; ++i) {
|
||||
ISD::InputArg MyFlags(Flags, RegisterVT, isArgValueUsed,
|
||||
|
@ -6687,8 +6683,8 @@ void SelectionDAGISel::LowerArguments(const BasicBlock *LLVMBB) {
|
|||
// from the sret argument into it.
|
||||
SmallVector<EVT, 1> ValueVTs;
|
||||
ComputeValueVTs(TLI, PointerType::getUnqual(F.getReturnType()), ValueVTs);
|
||||
MVT VT = ValueVTs[0].getSimpleVT();
|
||||
MVT RegVT = TLI.getRegisterType(*CurDAG->getContext(), VT);
|
||||
EVT VT = ValueVTs[0];
|
||||
EVT RegVT = TLI.getRegisterType(*CurDAG->getContext(), VT);
|
||||
ISD::NodeType AssertOp = ISD::DELETED_NODE;
|
||||
SDValue ArgValue = getCopyFromParts(DAG, dl, &InVals[0], 1,
|
||||
RegVT, VT, NULL, AssertOp);
|
||||
|
@ -6720,7 +6716,7 @@ void SelectionDAGISel::LowerArguments(const BasicBlock *LLVMBB) {
|
|||
|
||||
for (unsigned Val = 0; Val != NumValues; ++Val) {
|
||||
EVT VT = ValueVTs[Val];
|
||||
MVT PartVT = TLI.getRegisterType(*CurDAG->getContext(), VT);
|
||||
EVT PartVT = TLI.getRegisterType(*CurDAG->getContext(), VT);
|
||||
unsigned NumParts = TLI.getNumRegisters(*CurDAG->getContext(), VT);
|
||||
|
||||
if (!I->use_empty()) {
|
||||
|
|
|
@ -262,7 +262,7 @@ private:
|
|||
|
||||
struct BitTestBlock {
|
||||
BitTestBlock(APInt F, APInt R, const Value* SV,
|
||||
unsigned Rg, MVT RgVT, bool E,
|
||||
unsigned Rg, EVT RgVT, bool E,
|
||||
MachineBasicBlock* P, MachineBasicBlock* D,
|
||||
const BitTestInfo& C):
|
||||
First(F), Range(R), SValue(SV), Reg(Rg), RegVT(RgVT), Emitted(E),
|
||||
|
@ -271,7 +271,7 @@ private:
|
|||
APInt Range;
|
||||
const Value *SValue;
|
||||
unsigned Reg;
|
||||
MVT RegVT;
|
||||
EVT RegVT;
|
||||
bool Emitted;
|
||||
MachineBasicBlock *Parent;
|
||||
MachineBasicBlock *Default;
|
||||
|
|
|
@ -653,7 +653,7 @@ bool TargetLowering::canOpTrap(unsigned Op, EVT VT) const {
|
|||
|
||||
static unsigned getVectorTypeBreakdownMVT(MVT VT, MVT &IntermediateVT,
|
||||
unsigned &NumIntermediates,
|
||||
MVT &RegisterVT,
|
||||
EVT &RegisterVT,
|
||||
TargetLowering *TLI) {
|
||||
// Figure out the right, legal destination reg to copy into.
|
||||
unsigned NumElts = VT.getVectorNumElements();
|
||||
|
@ -688,7 +688,7 @@ static unsigned getVectorTypeBreakdownMVT(MVT VT, MVT &IntermediateVT,
|
|||
if (!isPowerOf2_32(NewVTSize))
|
||||
NewVTSize = NextPowerOf2(NewVTSize);
|
||||
|
||||
MVT DestVT = TLI->getRegisterType(NewVT);
|
||||
EVT DestVT = TLI->getRegisterType(NewVT);
|
||||
RegisterVT = DestVT;
|
||||
if (EVT(DestVT).bitsLT(NewVT)) // Value is expanded, e.g. i64 -> i16.
|
||||
return NumVectorRegs*(NewVTSize/DestVT.getSizeInBits());
|
||||
|
@ -712,9 +712,9 @@ bool TargetLowering::isLegalRC(const TargetRegisterClass *RC) const {
|
|||
/// findRepresentativeClass - Return the largest legal super-reg register class
|
||||
/// of the register class for the specified type and its associated "cost".
|
||||
std::pair<const TargetRegisterClass*, uint8_t>
|
||||
TargetLowering::findRepresentativeClass(MVT VT) const {
|
||||
TargetLowering::findRepresentativeClass(EVT VT) const {
|
||||
const TargetRegisterInfo *TRI = getTargetMachine().getRegisterInfo();
|
||||
const TargetRegisterClass *RC = RegClassForVT[VT.SimpleTy];
|
||||
const TargetRegisterClass *RC = RegClassForVT[VT.getSimpleVT().SimpleTy];
|
||||
if (!RC)
|
||||
return std::make_pair(RC, 0);
|
||||
|
||||
|
@ -772,7 +772,7 @@ void TargetLowering::computeRegisterProperties() {
|
|||
unsigned LegalIntReg = LargestIntReg;
|
||||
for (unsigned IntReg = LargestIntReg - 1;
|
||||
IntReg >= (unsigned)MVT::i1; --IntReg) {
|
||||
MVT IVT = (MVT::SimpleValueType)IntReg;
|
||||
EVT IVT = (MVT::SimpleValueType)IntReg;
|
||||
if (isTypeLegal(IVT)) {
|
||||
LegalIntReg = IntReg;
|
||||
} else {
|
||||
|
@ -823,14 +823,14 @@ void TargetLowering::computeRegisterProperties() {
|
|||
|
||||
// Determine if there is a legal wider type. If so, we should promote to
|
||||
// that wider vector type.
|
||||
MVT EltVT = VT.getVectorElementType();
|
||||
EVT EltVT = VT.getVectorElementType();
|
||||
unsigned NElts = VT.getVectorNumElements();
|
||||
if (NElts != 1 && !shouldSplitVectorElementType(EltVT)) {
|
||||
bool IsLegalWiderType = false;
|
||||
// First try to promote the elements of integer vectors. If no legal
|
||||
// promotion was found, fallback to the widen-vector method.
|
||||
for (unsigned nVT = i+1; nVT <= MVT::LAST_VECTOR_VALUETYPE; ++nVT) {
|
||||
MVT SVT = (MVT::SimpleValueType)nVT;
|
||||
EVT SVT = (MVT::SimpleValueType)nVT;
|
||||
// Promote vectors of integers to vectors with the same number
|
||||
// of elements, with a wider element type.
|
||||
if (SVT.getVectorElementType().getSizeInBits() > EltVT.getSizeInBits()
|
||||
|
@ -849,7 +849,7 @@ void TargetLowering::computeRegisterProperties() {
|
|||
|
||||
// Try to widen the vector.
|
||||
for (unsigned nVT = i+1; nVT <= MVT::LAST_VECTOR_VALUETYPE; ++nVT) {
|
||||
MVT SVT = (MVT::SimpleValueType)nVT;
|
||||
EVT SVT = (MVT::SimpleValueType)nVT;
|
||||
if (SVT.getVectorElementType() == EltVT &&
|
||||
SVT.getVectorNumElements() > NElts &&
|
||||
isTypeLegal(SVT)) {
|
||||
|
@ -865,14 +865,14 @@ void TargetLowering::computeRegisterProperties() {
|
|||
}
|
||||
|
||||
MVT IntermediateVT;
|
||||
MVT RegisterVT;
|
||||
EVT RegisterVT;
|
||||
unsigned NumIntermediates;
|
||||
NumRegistersForVT[i] =
|
||||
getVectorTypeBreakdownMVT(VT, IntermediateVT, NumIntermediates,
|
||||
RegisterVT, this);
|
||||
RegisterTypeForVT[i] = RegisterVT;
|
||||
|
||||
MVT NVT = VT.getPow2VectorType();
|
||||
EVT NVT = VT.getPow2VectorType();
|
||||
if (NVT == VT) {
|
||||
// Type is already a power of 2. The default action is to split.
|
||||
TransformToType[i] = MVT::Other;
|
||||
|
@ -924,7 +924,7 @@ MVT::SimpleValueType TargetLowering::getCmpLibcallReturnType() const {
|
|||
unsigned TargetLowering::getVectorTypeBreakdown(LLVMContext &Context, EVT VT,
|
||||
EVT &IntermediateVT,
|
||||
unsigned &NumIntermediates,
|
||||
MVT &RegisterVT) const {
|
||||
EVT &RegisterVT) const {
|
||||
unsigned NumElts = VT.getVectorNumElements();
|
||||
|
||||
// If there is a wider vector type with the same element type as this one,
|
||||
|
@ -934,10 +934,9 @@ unsigned TargetLowering::getVectorTypeBreakdown(LLVMContext &Context, EVT VT,
|
|||
// <4 x i1> -> <4 x i32>.
|
||||
LegalizeTypeAction TA = getTypeAction(Context, VT);
|
||||
if (NumElts != 1 && (TA == TypeWidenVector || TA == TypePromoteInteger)) {
|
||||
EVT RegisterEVT = getTypeToTransformTo(Context, VT);
|
||||
if (isTypeLegal(RegisterEVT)) {
|
||||
IntermediateVT = RegisterEVT;
|
||||
RegisterVT = RegisterEVT.getSimpleVT();
|
||||
RegisterVT = getTypeToTransformTo(Context, VT);
|
||||
if (isTypeLegal(RegisterVT)) {
|
||||
IntermediateVT = RegisterVT;
|
||||
NumIntermediates = 1;
|
||||
return 1;
|
||||
}
|
||||
|
@ -970,7 +969,7 @@ unsigned TargetLowering::getVectorTypeBreakdown(LLVMContext &Context, EVT VT,
|
|||
NewVT = EltTy;
|
||||
IntermediateVT = NewVT;
|
||||
|
||||
MVT DestVT = getRegisterType(Context, NewVT);
|
||||
EVT DestVT = getRegisterType(Context, NewVT);
|
||||
RegisterVT = DestVT;
|
||||
unsigned NewVTSize = NewVT.getSizeInBits();
|
||||
|
||||
|
@ -978,7 +977,7 @@ unsigned TargetLowering::getVectorTypeBreakdown(LLVMContext &Context, EVT VT,
|
|||
if (!isPowerOf2_32(NewVTSize))
|
||||
NewVTSize = NextPowerOf2(NewVTSize);
|
||||
|
||||
if (EVT(DestVT).bitsLT(NewVT)) // Value is expanded, e.g. i64 -> i16.
|
||||
if (DestVT.bitsLT(NewVT)) // Value is expanded, e.g. i64 -> i16.
|
||||
return NumVectorRegs*(NewVTSize/DestVT.getSizeInBits());
|
||||
|
||||
// Otherwise, promotion or legal types use the same number of registers as
|
||||
|
@ -1012,13 +1011,13 @@ void llvm::GetReturnInfo(Type* ReturnType, Attributes attr,
|
|||
// conventions. The frontend should mark functions whose return values
|
||||
// require promoting with signext or zeroext attributes.
|
||||
if (ExtendKind != ISD::ANY_EXTEND && VT.isInteger()) {
|
||||
MVT MinVT = TLI.getRegisterType(ReturnType->getContext(), MVT::i32);
|
||||
EVT MinVT = TLI.getRegisterType(ReturnType->getContext(), MVT::i32);
|
||||
if (VT.bitsLT(MinVT))
|
||||
VT = MinVT;
|
||||
}
|
||||
|
||||
unsigned NumParts = TLI.getNumRegisters(ReturnType->getContext(), VT);
|
||||
MVT PartVT = TLI.getRegisterType(ReturnType->getContext(), VT);
|
||||
EVT PartVT = TLI.getRegisterType(ReturnType->getContext(), VT);
|
||||
|
||||
// 'inreg' on function refers to return value
|
||||
ISD::ArgFlagsTy Flags = ISD::ArgFlagsTy();
|
||||
|
@ -2108,7 +2107,7 @@ TargetLowering::SimplifySetCC(EVT VT, SDValue N0, SDValue N1,
|
|||
case ISD::SETUGE:
|
||||
case ISD::SETULT:
|
||||
case ISD::SETULE: {
|
||||
MVT newVT = N0.getOperand(0).getSimpleValueType();
|
||||
EVT newVT = N0.getOperand(0).getValueType();
|
||||
if (DCI.isBeforeLegalizeOps() ||
|
||||
(isOperationLegal(ISD::SETCC, newVT) &&
|
||||
getCondCodeAction(Cond, newVT)==Legal))
|
||||
|
@ -2406,36 +2405,36 @@ TargetLowering::SimplifySetCC(EVT VT, SDValue N0, SDValue N1,
|
|||
|
||||
// If the condition is not legal, see if we can find an equivalent one
|
||||
// which is legal.
|
||||
if (!isCondCodeLegal(Cond, N0.getSimpleValueType())) {
|
||||
if (!isCondCodeLegal(Cond, N0.getValueType())) {
|
||||
// If the comparison was an awkward floating-point == or != and one of
|
||||
// the comparison operands is infinity or negative infinity, convert the
|
||||
// condition to a less-awkward <= or >=.
|
||||
if (CFP->getValueAPF().isInfinity()) {
|
||||
if (CFP->getValueAPF().isNegative()) {
|
||||
if (Cond == ISD::SETOEQ &&
|
||||
isCondCodeLegal(ISD::SETOLE, N0.getSimpleValueType()))
|
||||
isCondCodeLegal(ISD::SETOLE, N0.getValueType()))
|
||||
return DAG.getSetCC(dl, VT, N0, N1, ISD::SETOLE);
|
||||
if (Cond == ISD::SETUEQ &&
|
||||
isCondCodeLegal(ISD::SETOLE, N0.getSimpleValueType()))
|
||||
isCondCodeLegal(ISD::SETOLE, N0.getValueType()))
|
||||
return DAG.getSetCC(dl, VT, N0, N1, ISD::SETULE);
|
||||
if (Cond == ISD::SETUNE &&
|
||||
isCondCodeLegal(ISD::SETUGT, N0.getSimpleValueType()))
|
||||
isCondCodeLegal(ISD::SETUGT, N0.getValueType()))
|
||||
return DAG.getSetCC(dl, VT, N0, N1, ISD::SETUGT);
|
||||
if (Cond == ISD::SETONE &&
|
||||
isCondCodeLegal(ISD::SETUGT, N0.getSimpleValueType()))
|
||||
isCondCodeLegal(ISD::SETUGT, N0.getValueType()))
|
||||
return DAG.getSetCC(dl, VT, N0, N1, ISD::SETOGT);
|
||||
} else {
|
||||
if (Cond == ISD::SETOEQ &&
|
||||
isCondCodeLegal(ISD::SETOGE, N0.getSimpleValueType()))
|
||||
isCondCodeLegal(ISD::SETOGE, N0.getValueType()))
|
||||
return DAG.getSetCC(dl, VT, N0, N1, ISD::SETOGE);
|
||||
if (Cond == ISD::SETUEQ &&
|
||||
isCondCodeLegal(ISD::SETOGE, N0.getSimpleValueType()))
|
||||
isCondCodeLegal(ISD::SETOGE, N0.getValueType()))
|
||||
return DAG.getSetCC(dl, VT, N0, N1, ISD::SETUGE);
|
||||
if (Cond == ISD::SETUNE &&
|
||||
isCondCodeLegal(ISD::SETULT, N0.getSimpleValueType()))
|
||||
isCondCodeLegal(ISD::SETULT, N0.getValueType()))
|
||||
return DAG.getSetCC(dl, VT, N0, N1, ISD::SETULT);
|
||||
if (Cond == ISD::SETONE &&
|
||||
isCondCodeLegal(ISD::SETULT, N0.getSimpleValueType()))
|
||||
isCondCodeLegal(ISD::SETULT, N0.getValueType()))
|
||||
return DAG.getSetCC(dl, VT, N0, N1, ISD::SETOLT);
|
||||
}
|
||||
}
|
||||
|
@ -2469,7 +2468,7 @@ TargetLowering::SimplifySetCC(EVT VT, SDValue N0, SDValue N1,
|
|||
// if it is not already.
|
||||
ISD::CondCode NewCond = UOF == 0 ? ISD::SETO : ISD::SETUO;
|
||||
if (NewCond != Cond && (DCI.isBeforeLegalizeOps() ||
|
||||
getCondCodeAction(NewCond, N0.getSimpleValueType()) == Legal))
|
||||
getCondCodeAction(NewCond, N0.getValueType()) == Legal))
|
||||
return DAG.getSetCC(dl, VT, N0, N1, NewCond);
|
||||
}
|
||||
|
||||
|
|
|
@ -178,24 +178,24 @@ class ARMFastISel : public FastISel {
|
|||
bool isLoadTypeLegal(Type *Ty, MVT &VT);
|
||||
bool ARMEmitCmp(const Value *Src1Value, const Value *Src2Value,
|
||||
bool isZExt);
|
||||
bool ARMEmitLoad(MVT VT, unsigned &ResultReg, Address &Addr,
|
||||
bool ARMEmitLoad(EVT VT, unsigned &ResultReg, Address &Addr,
|
||||
unsigned Alignment = 0, bool isZExt = true,
|
||||
bool allocReg = true);
|
||||
bool ARMEmitStore(MVT VT, unsigned SrcReg, Address &Addr,
|
||||
bool ARMEmitStore(EVT VT, unsigned SrcReg, Address &Addr,
|
||||
unsigned Alignment = 0);
|
||||
bool ARMComputeAddress(const Value *Obj, Address &Addr);
|
||||
void ARMSimplifyAddress(Address &Addr, EVT VT, bool useAM3);
|
||||
bool ARMIsMemCpySmall(uint64_t Len);
|
||||
bool ARMTryEmitSmallMemCpy(Address Dest, Address Src, uint64_t Len,
|
||||
unsigned Alignment);
|
||||
unsigned ARMEmitIntExt(MVT SrcVT, unsigned SrcReg, MVT DestVT, bool isZExt);
|
||||
unsigned ARMMaterializeFP(const ConstantFP *CFP, MVT VT);
|
||||
unsigned ARMMaterializeInt(const Constant *C, MVT VT);
|
||||
unsigned ARMMaterializeGV(const GlobalValue *GV, MVT VT);
|
||||
unsigned ARMMoveToFPReg(MVT VT, unsigned SrcReg);
|
||||
unsigned ARMMoveToIntReg(MVT VT, unsigned SrcReg);
|
||||
unsigned ARMEmitIntExt(EVT SrcVT, unsigned SrcReg, EVT DestVT, bool isZExt);
|
||||
unsigned ARMMaterializeFP(const ConstantFP *CFP, EVT VT);
|
||||
unsigned ARMMaterializeInt(const Constant *C, EVT VT);
|
||||
unsigned ARMMaterializeGV(const GlobalValue *GV, EVT VT);
|
||||
unsigned ARMMoveToFPReg(EVT VT, unsigned SrcReg);
|
||||
unsigned ARMMoveToIntReg(EVT VT, unsigned SrcReg);
|
||||
unsigned ARMSelectCallOp(bool UseReg);
|
||||
unsigned ARMLowerPICELF(const GlobalValue *GV, unsigned Align, MVT VT);
|
||||
unsigned ARMLowerPICELF(const GlobalValue *GV, unsigned Align, EVT VT);
|
||||
|
||||
// Call handling routines.
|
||||
private:
|
||||
|
@ -487,7 +487,7 @@ unsigned ARMFastISel::FastEmitInst_extractsubreg(MVT RetVT,
|
|||
|
||||
// TODO: Don't worry about 64-bit now, but when this is fixed remove the
|
||||
// checks from the various callers.
|
||||
unsigned ARMFastISel::ARMMoveToFPReg(MVT VT, unsigned SrcReg) {
|
||||
unsigned ARMFastISel::ARMMoveToFPReg(EVT VT, unsigned SrcReg) {
|
||||
if (VT == MVT::f64) return 0;
|
||||
|
||||
unsigned MoveReg = createResultReg(TLI.getRegClassFor(VT));
|
||||
|
@ -497,7 +497,7 @@ unsigned ARMFastISel::ARMMoveToFPReg(MVT VT, unsigned SrcReg) {
|
|||
return MoveReg;
|
||||
}
|
||||
|
||||
unsigned ARMFastISel::ARMMoveToIntReg(MVT VT, unsigned SrcReg) {
|
||||
unsigned ARMFastISel::ARMMoveToIntReg(EVT VT, unsigned SrcReg) {
|
||||
if (VT == MVT::i64) return 0;
|
||||
|
||||
unsigned MoveReg = createResultReg(TLI.getRegClassFor(VT));
|
||||
|
@ -510,7 +510,7 @@ unsigned ARMFastISel::ARMMoveToIntReg(MVT VT, unsigned SrcReg) {
|
|||
// For double width floating point we need to materialize two constants
|
||||
// (the high and the low) into integer registers then use a move to get
|
||||
// the combined constant into an FP reg.
|
||||
unsigned ARMFastISel::ARMMaterializeFP(const ConstantFP *CFP, MVT VT) {
|
||||
unsigned ARMFastISel::ARMMaterializeFP(const ConstantFP *CFP, EVT VT) {
|
||||
const APFloat Val = CFP->getValueAPF();
|
||||
bool is64bit = VT == MVT::f64;
|
||||
|
||||
|
@ -554,7 +554,7 @@ unsigned ARMFastISel::ARMMaterializeFP(const ConstantFP *CFP, MVT VT) {
|
|||
return DestReg;
|
||||
}
|
||||
|
||||
unsigned ARMFastISel::ARMMaterializeInt(const Constant *C, MVT VT) {
|
||||
unsigned ARMFastISel::ARMMaterializeInt(const Constant *C, EVT VT) {
|
||||
|
||||
if (VT != MVT::i32 && VT != MVT::i16 && VT != MVT::i8 && VT != MVT::i1)
|
||||
return false;
|
||||
|
@ -616,7 +616,7 @@ unsigned ARMFastISel::ARMMaterializeInt(const Constant *C, MVT VT) {
|
|||
return DestReg;
|
||||
}
|
||||
|
||||
unsigned ARMFastISel::ARMMaterializeGV(const GlobalValue *GV, MVT VT) {
|
||||
unsigned ARMFastISel::ARMMaterializeGV(const GlobalValue *GV, EVT VT) {
|
||||
// For now 32-bit only.
|
||||
if (VT != MVT::i32) return 0;
|
||||
|
||||
|
@ -719,7 +719,10 @@ unsigned ARMFastISel::ARMMaterializeGV(const GlobalValue *GV, MVT VT) {
|
|||
}
|
||||
|
||||
unsigned ARMFastISel::TargetMaterializeConstant(const Constant *C) {
|
||||
MVT VT = TLI.getSimpleValueType(C->getType(), true);
|
||||
EVT VT = TLI.getValueType(C->getType(), true);
|
||||
|
||||
// Only handle simple types.
|
||||
if (!VT.isSimple()) return 0;
|
||||
|
||||
if (const ConstantFP *CFP = dyn_cast<ConstantFP>(C))
|
||||
return ARMMaterializeFP(CFP, VT);
|
||||
|
@ -1000,13 +1003,14 @@ void ARMFastISel::AddLoadStoreOperands(EVT VT, Address &Addr,
|
|||
AddOptionalDefs(MIB);
|
||||
}
|
||||
|
||||
bool ARMFastISel::ARMEmitLoad(MVT VT, unsigned &ResultReg, Address &Addr,
|
||||
bool ARMFastISel::ARMEmitLoad(EVT VT, unsigned &ResultReg, Address &Addr,
|
||||
unsigned Alignment, bool isZExt, bool allocReg) {
|
||||
assert(VT.isSimple() && "Non-simple types are invalid here!");
|
||||
unsigned Opc;
|
||||
bool useAM3 = false;
|
||||
bool needVMOV = false;
|
||||
const TargetRegisterClass *RC;
|
||||
switch (VT.SimpleTy) {
|
||||
switch (VT.getSimpleVT().SimpleTy) {
|
||||
// This is mostly going to be Neon/vector support.
|
||||
default: return false;
|
||||
case MVT::i1:
|
||||
|
@ -1123,11 +1127,11 @@ bool ARMFastISel::SelectLoad(const Instruction *I) {
|
|||
return true;
|
||||
}
|
||||
|
||||
bool ARMFastISel::ARMEmitStore(MVT VT, unsigned SrcReg, Address &Addr,
|
||||
bool ARMFastISel::ARMEmitStore(EVT VT, unsigned SrcReg, Address &Addr,
|
||||
unsigned Alignment) {
|
||||
unsigned StrOpc;
|
||||
bool useAM3 = false;
|
||||
switch (VT.SimpleTy) {
|
||||
switch (VT.getSimpleVT().SimpleTy) {
|
||||
// This is mostly going to be Neon/vector support.
|
||||
default: return false;
|
||||
case MVT::i1: {
|
||||
|
@ -1401,7 +1405,8 @@ bool ARMFastISel::SelectIndirectBr(const Instruction *I) {
|
|||
bool ARMFastISel::ARMEmitCmp(const Value *Src1Value, const Value *Src2Value,
|
||||
bool isZExt) {
|
||||
Type *Ty = Src1Value->getType();
|
||||
MVT SrcVT = TLI.getSimpleValueType(Ty, true);
|
||||
EVT SrcVT = TLI.getValueType(Ty, true);
|
||||
if (!SrcVT.isSimple()) return false;
|
||||
|
||||
bool isFloat = (Ty->isFloatTy() || Ty->isDoubleTy());
|
||||
if (isFloat && !Subtarget->hasVFP2())
|
||||
|
@ -1438,7 +1443,7 @@ bool ARMFastISel::ARMEmitCmp(const Value *Src1Value, const Value *Src2Value,
|
|||
unsigned CmpOpc;
|
||||
bool isICmp = true;
|
||||
bool needsExt = false;
|
||||
switch (SrcVT.SimpleTy) {
|
||||
switch (SrcVT.getSimpleVT().SimpleTy) {
|
||||
default: return false;
|
||||
// TODO: Verify compares.
|
||||
case MVT::f32:
|
||||
|
@ -1590,7 +1595,7 @@ bool ARMFastISel::SelectIToFP(const Instruction *I, bool isSigned) {
|
|||
return false;
|
||||
|
||||
Value *Src = I->getOperand(0);
|
||||
MVT SrcVT = TLI.getSimpleValueType(Src->getType(), true);
|
||||
EVT SrcVT = TLI.getValueType(Src->getType(), true);
|
||||
if (SrcVT != MVT::i32 && SrcVT != MVT::i16 && SrcVT != MVT::i8)
|
||||
return false;
|
||||
|
||||
|
@ -1599,7 +1604,7 @@ bool ARMFastISel::SelectIToFP(const Instruction *I, bool isSigned) {
|
|||
|
||||
// Handle sign-extension.
|
||||
if (SrcVT == MVT::i16 || SrcVT == MVT::i8) {
|
||||
MVT DestVT = MVT::i32;
|
||||
EVT DestVT = MVT::i32;
|
||||
SrcReg = ARMEmitIntExt(SrcVT, SrcReg, DestVT,
|
||||
/*isZExt*/!isSigned);
|
||||
if (SrcReg == 0) return false;
|
||||
|
@ -1806,7 +1811,7 @@ bool ARMFastISel::SelectBinaryIntOp(const Instruction *I, unsigned ISDOpcode) {
|
|||
}
|
||||
|
||||
bool ARMFastISel::SelectBinaryFPOp(const Instruction *I, unsigned ISDOpcode) {
|
||||
MVT VT = TLI.getSimpleValueType(I->getType(), true);
|
||||
EVT VT = TLI.getValueType(I->getType(), true);
|
||||
|
||||
// We can get here in the case when we want to use NEON for our fp
|
||||
// operations, but can't figure out how to. Just use the vfp instructions
|
||||
|
@ -2050,7 +2055,7 @@ bool ARMFastISel::FinishCall(MVT RetVT, SmallVectorImpl<unsigned> &UsedRegs,
|
|||
if (RVLocs.size() == 2 && RetVT == MVT::f64) {
|
||||
// For this move we copy into two registers and then move into the
|
||||
// double fp reg we want.
|
||||
MVT DestVT = RVLocs[0].getValVT();
|
||||
EVT DestVT = RVLocs[0].getValVT();
|
||||
const TargetRegisterClass* DstRC = TLI.getRegClassFor(DestVT);
|
||||
unsigned ResultReg = createResultReg(DstRC);
|
||||
AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL,
|
||||
|
@ -2065,7 +2070,7 @@ bool ARMFastISel::FinishCall(MVT RetVT, SmallVectorImpl<unsigned> &UsedRegs,
|
|||
UpdateValueMap(I, ResultReg);
|
||||
} else {
|
||||
assert(RVLocs.size() == 1 &&"Can't handle non-double multi-reg retvals!");
|
||||
MVT CopyVT = RVLocs[0].getValVT();
|
||||
EVT CopyVT = RVLocs[0].getValVT();
|
||||
|
||||
// Special handling for extended integers.
|
||||
if (RetVT == MVT::i1 || RetVT == MVT::i8 || RetVT == MVT::i16)
|
||||
|
@ -2124,8 +2129,8 @@ bool ARMFastISel::SelectRet(const Instruction *I) {
|
|||
return false;
|
||||
|
||||
unsigned SrcReg = Reg + VA.getValNo();
|
||||
MVT RVVT = TLI.getSimpleValueType(RV->getType());
|
||||
MVT DestVT = VA.getValVT();
|
||||
EVT RVVT = TLI.getValueType(RV->getType());
|
||||
EVT DestVT = VA.getValVT();
|
||||
// Special handling for extended integers.
|
||||
if (RVVT != DestVT) {
|
||||
if (RVVT != MVT::i1 && RVVT != MVT::i8 && RVVT != MVT::i16)
|
||||
|
@ -2170,7 +2175,7 @@ unsigned ARMFastISel::ARMSelectCallOp(bool UseReg) {
|
|||
unsigned ARMFastISel::getLibcallReg(const Twine &Name) {
|
||||
GlobalValue *GV = new GlobalVariable(Type::getInt32Ty(*Context), false,
|
||||
GlobalValue::ExternalLinkage, 0, Name);
|
||||
return ARMMaterializeGV(GV, TLI.getSimpleValueType(GV->getType()));
|
||||
return ARMMaterializeGV(GV, TLI.getValueType(GV->getType()));
|
||||
}
|
||||
|
||||
// A quick function that will emit a call for a named libcall in F with the
|
||||
|
@ -2582,7 +2587,7 @@ bool ARMFastISel::SelectTrunc(const Instruction *I) {
|
|||
return true;
|
||||
}
|
||||
|
||||
unsigned ARMFastISel::ARMEmitIntExt(MVT SrcVT, unsigned SrcReg, MVT DestVT,
|
||||
unsigned ARMFastISel::ARMEmitIntExt(EVT SrcVT, unsigned SrcReg, EVT DestVT,
|
||||
bool isZExt) {
|
||||
if (DestVT != MVT::i32 && DestVT != MVT::i16 && DestVT != MVT::i8)
|
||||
return 0;
|
||||
|
@ -2590,7 +2595,8 @@ unsigned ARMFastISel::ARMEmitIntExt(MVT SrcVT, unsigned SrcReg, MVT DestVT,
|
|||
unsigned Opc;
|
||||
bool isBoolZext = false;
|
||||
const TargetRegisterClass *RC = TLI.getRegClassFor(MVT::i32);
|
||||
switch (SrcVT.SimpleTy) {
|
||||
if (!SrcVT.isSimple()) return 0;
|
||||
switch (SrcVT.getSimpleVT().SimpleTy) {
|
||||
default: return 0;
|
||||
case MVT::i16:
|
||||
if (!Subtarget->hasV6Ops()) return 0;
|
||||
|
@ -2637,9 +2643,9 @@ bool ARMFastISel::SelectIntExt(const Instruction *I) {
|
|||
Value *Src = I->getOperand(0);
|
||||
Type *SrcTy = Src->getType();
|
||||
|
||||
MVT SrcVT, DestVT;
|
||||
SrcVT = TLI.getSimpleValueType(SrcTy, true);
|
||||
DestVT = TLI.getSimpleValueType(DestTy, true);
|
||||
EVT SrcVT, DestVT;
|
||||
SrcVT = TLI.getValueType(SrcTy, true);
|
||||
DestVT = TLI.getValueType(DestTy, true);
|
||||
|
||||
bool isZExt = isa<ZExtInst>(I);
|
||||
unsigned SrcReg = getRegForValue(Src);
|
||||
|
@ -2824,7 +2830,7 @@ bool ARMFastISel::TryToFoldLoad(MachineInstr *MI, unsigned OpNo,
|
|||
}
|
||||
|
||||
unsigned ARMFastISel::ARMLowerPICELF(const GlobalValue *GV,
|
||||
unsigned Align, MVT VT) {
|
||||
unsigned Align, EVT VT) {
|
||||
bool UseGOTOFF = GV->hasLocalLinkage() || GV->hasHiddenVisibility();
|
||||
ARMConstantPoolConstant *CPV =
|
||||
ARMConstantPoolConstant::Create(GV, UseGOTOFF ? ARMCP::GOTOFF : ARMCP::GOT);
|
||||
|
|
|
@ -863,10 +863,10 @@ ARMTargetLowering::ARMTargetLowering(TargetMachine &TM)
|
|||
// due to the common occurrence of cross class copies and subregister insertions
|
||||
// and extractions.
|
||||
std::pair<const TargetRegisterClass*, uint8_t>
|
||||
ARMTargetLowering::findRepresentativeClass(MVT VT) const{
|
||||
ARMTargetLowering::findRepresentativeClass(EVT VT) const{
|
||||
const TargetRegisterClass *RRC = 0;
|
||||
uint8_t Cost = 1;
|
||||
switch (VT.SimpleTy) {
|
||||
switch (VT.getSimpleVT().SimpleTy) {
|
||||
default:
|
||||
return TargetLowering::findRepresentativeClass(VT);
|
||||
// Use DPR as representative register class for all floating point
|
||||
|
@ -1046,7 +1046,7 @@ EVT ARMTargetLowering::getSetCCResultType(EVT VT) const {
|
|||
|
||||
/// getRegClassFor - Return the register class that should be used for the
|
||||
/// specified value type.
|
||||
const TargetRegisterClass *ARMTargetLowering::getRegClassFor(MVT VT) const {
|
||||
const TargetRegisterClass *ARMTargetLowering::getRegClassFor(EVT VT) const {
|
||||
// Map v4i64 to QQ registers but do not make the type legal. Similarly map
|
||||
// v8i64 to QQQQ registers. v4i64 and v8i64 are only used for REG_SEQUENCE to
|
||||
// load / store 4 to 8 consecutive D registers.
|
||||
|
|
|
@ -366,7 +366,7 @@ namespace llvm {
|
|||
|
||||
/// getRegClassFor - Return the register class that should be used for the
|
||||
/// specified value type.
|
||||
virtual const TargetRegisterClass *getRegClassFor(MVT VT) const;
|
||||
virtual const TargetRegisterClass *getRegClassFor(EVT VT) const;
|
||||
|
||||
/// getMaximalGlobalOffset - Returns the maximal possible offset which can
|
||||
/// be used for loads / stores from the global.
|
||||
|
@ -394,7 +394,7 @@ namespace llvm {
|
|||
unsigned Intrinsic) const;
|
||||
protected:
|
||||
std::pair<const TargetRegisterClass*, uint8_t>
|
||||
findRepresentativeClass(MVT VT) const;
|
||||
findRepresentativeClass(EVT VT) const;
|
||||
|
||||
private:
|
||||
/// Subtarget - Keep a pointer to the ARMSubtarget around so that we can
|
||||
|
|
|
@ -2155,7 +2155,7 @@ SDValue MipsTargetLowering::LowerRETURNADDR(SDValue Op,
|
|||
|
||||
MachineFunction &MF = DAG.getMachineFunction();
|
||||
MachineFrameInfo *MFI = MF.getFrameInfo();
|
||||
MVT VT = Op.getSimpleValueType();
|
||||
EVT VT = Op.getValueType();
|
||||
unsigned RA = IsN64 ? Mips::RA_64 : Mips::RA;
|
||||
MFI->setReturnAddressIsTaken(true);
|
||||
|
||||
|
@ -3655,7 +3655,7 @@ copyByValRegs(SDValue Chain, DebugLoc DL, std::vector<SDValue> &OutChains,
|
|||
return;
|
||||
|
||||
// Copy arg registers.
|
||||
MVT RegTy = MVT::getIntegerVT(CC.regSize() * 8);
|
||||
EVT RegTy = MVT::getIntegerVT(CC.regSize() * 8);
|
||||
const TargetRegisterClass *RC = getRegClassFor(RegTy);
|
||||
|
||||
for (unsigned I = 0; I < ByVal.NumRegs; ++I) {
|
||||
|
@ -3777,7 +3777,7 @@ MipsTargetLowering::writeVarArgRegs(std::vector<SDValue> &OutChains,
|
|||
const CCState &CCInfo = CC.getCCInfo();
|
||||
unsigned Idx = CCInfo.getFirstUnallocated(ArgRegs, NumRegs);
|
||||
unsigned RegSize = CC.regSize();
|
||||
MVT RegTy = MVT::getIntegerVT(RegSize * 8);
|
||||
EVT RegTy = MVT::getIntegerVT(RegSize * 8);
|
||||
const TargetRegisterClass *RC = getRegClassFor(RegTy);
|
||||
MachineFunction &MF = DAG.getMachineFunction();
|
||||
MachineFrameInfo *MFI = MF.getFrameInfo();
|
||||
|
|
|
@ -1909,11 +1909,11 @@ bool X86FastISel::DoSelectCall(const Instruction *I, const char *MemIntName) {
|
|||
ComputeValueVTs(TLI, I->getType(), RetTys);
|
||||
for (unsigned i = 0, e = RetTys.size(); i != e; ++i) {
|
||||
EVT VT = RetTys[i];
|
||||
MVT RegisterVT = TLI.getRegisterType(I->getParent()->getContext(), VT);
|
||||
EVT RegisterVT = TLI.getRegisterType(I->getParent()->getContext(), VT);
|
||||
unsigned NumRegs = TLI.getNumRegisters(I->getParent()->getContext(), VT);
|
||||
for (unsigned j = 0; j != NumRegs; ++j) {
|
||||
ISD::InputArg MyFlags;
|
||||
MyFlags.VT = RegisterVT;
|
||||
MyFlags.VT = RegisterVT.getSimpleVT();
|
||||
MyFlags.Used = !CS.getInstruction()->use_empty();
|
||||
if (CS.paramHasAttr(0, Attributes::SExt))
|
||||
MyFlags.Flags.setSExt();
|
||||
|
|
|
@ -1472,10 +1472,10 @@ getPICJumpTableRelocBaseExpr(const MachineFunction *MF, unsigned JTI,
|
|||
|
||||
// FIXME: Why this routine is here? Move to RegInfo!
|
||||
std::pair<const TargetRegisterClass*, uint8_t>
|
||||
X86TargetLowering::findRepresentativeClass(MVT VT) const{
|
||||
X86TargetLowering::findRepresentativeClass(EVT VT) const{
|
||||
const TargetRegisterClass *RRC = 0;
|
||||
uint8_t Cost = 1;
|
||||
switch (VT.SimpleTy) {
|
||||
switch (VT.getSimpleVT().SimpleTy) {
|
||||
default:
|
||||
return TargetLowering::findRepresentativeClass(VT);
|
||||
case MVT::i8: case MVT::i16: case MVT::i32: case MVT::i64:
|
||||
|
@ -1689,8 +1689,8 @@ bool X86TargetLowering::isUsedByReturnOnly(SDNode *N, SDValue &Chain) const {
|
|||
return true;
|
||||
}
|
||||
|
||||
MVT
|
||||
X86TargetLowering::getTypeForExtArgOrReturn(LLVMContext &Context, MVT VT,
|
||||
EVT
|
||||
X86TargetLowering::getTypeForExtArgOrReturn(LLVMContext &Context, EVT VT,
|
||||
ISD::NodeType ExtendKind) const {
|
||||
MVT ReturnMVT;
|
||||
// TODO: Is this also valid on 32-bit?
|
||||
|
@ -1699,7 +1699,7 @@ X86TargetLowering::getTypeForExtArgOrReturn(LLVMContext &Context, MVT VT,
|
|||
else
|
||||
ReturnMVT = MVT::i32;
|
||||
|
||||
MVT MinVT = getRegisterType(Context, ReturnMVT);
|
||||
EVT MinVT = getRegisterType(Context, ReturnMVT);
|
||||
return VT.bitsLT(MinVT) ? MinVT : VT;
|
||||
}
|
||||
|
||||
|
|
|
@ -708,7 +708,7 @@ namespace llvm {
|
|||
|
||||
protected:
|
||||
std::pair<const TargetRegisterClass*, uint8_t>
|
||||
findRepresentativeClass(MVT VT) const;
|
||||
findRepresentativeClass(EVT VT) const;
|
||||
|
||||
private:
|
||||
/// Subtarget - Keep a pointer to the X86Subtarget around so that we can
|
||||
|
@ -859,8 +859,8 @@ namespace llvm {
|
|||
|
||||
virtual bool mayBeEmittedAsTailCall(CallInst *CI) const;
|
||||
|
||||
virtual MVT
|
||||
getTypeForExtArgOrReturn(LLVMContext &Context, MVT VT,
|
||||
virtual EVT
|
||||
getTypeForExtArgOrReturn(LLVMContext &Context, EVT VT,
|
||||
ISD::NodeType ExtendKind) const;
|
||||
|
||||
virtual bool
|
||||
|
|
|
@ -1093,7 +1093,7 @@ bool CodeGenPrepare::MoveExtToFormExtLoad(Instruction *I) {
|
|||
assert(isa<SExtInst>(I) && "Unexpected ext type!");
|
||||
LType = ISD::SEXTLOAD;
|
||||
}
|
||||
if (TLI && !TLI->isLoadExtLegal(LType, TLI->getSimpleValueType(LI->getType())))
|
||||
if (TLI && !TLI->isLoadExtLegal(LType, TLI->getValueType(LI->getType())))
|
||||
return false;
|
||||
|
||||
// Move the extend into the same block as the load, so that SelectionDAG
|
||||
|
|
Loading…
Reference in New Issue