mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-11 11:34:02 +00:00
More 80 violations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101330 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
44398693e7
commit
adf979900c
@ -407,7 +407,9 @@ SDValue ExpandUnalignedStore(StoreSDNode *ST, SelectionDAG &DAG,
|
||||
// to the final destination using (unaligned) integer loads and stores.
|
||||
EVT StoredVT = ST->getMemoryVT();
|
||||
EVT RegVT =
|
||||
TLI.getRegisterType(*DAG.getContext(), EVT::getIntegerVT(*DAG.getContext(), StoredVT.getSizeInBits()));
|
||||
TLI.getRegisterType(*DAG.getContext(),
|
||||
EVT::getIntegerVT(*DAG.getContext(),
|
||||
StoredVT.getSizeInBits()));
|
||||
unsigned StoredBytes = StoredVT.getSizeInBits() / 8;
|
||||
unsigned RegBytes = RegVT.getSizeInBits() / 8;
|
||||
unsigned NumRegs = (StoredBytes + RegBytes - 1) / RegBytes;
|
||||
@ -443,7 +445,8 @@ SDValue ExpandUnalignedStore(StoreSDNode *ST, SelectionDAG &DAG,
|
||||
// The last store may be partial. Do a truncating store. On big-endian
|
||||
// machines this requires an extending load from the stack slot to ensure
|
||||
// that the bits are in the right place.
|
||||
EVT MemVT = EVT::getIntegerVT(*DAG.getContext(), 8 * (StoredBytes - Offset));
|
||||
EVT MemVT = EVT::getIntegerVT(*DAG.getContext(),
|
||||
8 * (StoredBytes - Offset));
|
||||
|
||||
// Load from the stack slot.
|
||||
SDValue Load = DAG.getExtLoad(ISD::EXTLOAD, dl, RegVT, Store, StackPtr,
|
||||
@ -546,7 +549,8 @@ SDValue ExpandUnalignedLoad(LoadSDNode *LD, SelectionDAG &DAG,
|
||||
}
|
||||
|
||||
// The last copy may be partial. Do an extending load.
|
||||
EVT MemVT = EVT::getIntegerVT(*DAG.getContext(), 8 * (LoadedBytes - Offset));
|
||||
EVT MemVT = EVT::getIntegerVT(*DAG.getContext(),
|
||||
8 * (LoadedBytes - Offset));
|
||||
SDValue Load = DAG.getExtLoad(ISD::EXTLOAD, dl, RegVT, Chain, Ptr,
|
||||
LD->getSrcValue(), SVOffset + Offset,
|
||||
MemVT, LD->isVolatile(),
|
||||
@ -1392,7 +1396,8 @@ SDValue SelectionDAGLegalize::LegalizeOp(SDValue Op) {
|
||||
// Promote to a byte-sized store with upper bits zero if not
|
||||
// storing an integral number of bytes. For example, promote
|
||||
// TRUNCSTORE:i1 X -> TRUNCSTORE:i8 (and X, 1)
|
||||
EVT NVT = EVT::getIntegerVT(*DAG.getContext(), StVT.getStoreSizeInBits());
|
||||
EVT NVT = EVT::getIntegerVT(*DAG.getContext(),
|
||||
StVT.getStoreSizeInBits());
|
||||
Tmp3 = DAG.getZeroExtendInReg(Tmp3, dl, StVT);
|
||||
Result = DAG.getTruncStore(Tmp1, dl, Tmp3, Tmp2, ST->getSrcValue(),
|
||||
SVOffset, NVT, isVolatile, isNonTemporal,
|
||||
@ -1736,8 +1741,8 @@ SDValue SelectionDAGLegalize::EmitStackConvert(SDValue SrcOp,
|
||||
unsigned SrcSize = SrcOp.getValueType().getSizeInBits();
|
||||
unsigned SlotSize = SlotVT.getSizeInBits();
|
||||
unsigned DestSize = DestVT.getSizeInBits();
|
||||
unsigned DestAlign =
|
||||
TLI.getTargetData()->getPrefTypeAlignment(DestVT.getTypeForEVT(*DAG.getContext()));
|
||||
const Type *DestType = DestVT.getTypeForEVT(*DAG.getContext());
|
||||
unsigned DestAlign = TLI.getTargetData()->getPrefTypeAlignment(DestType);
|
||||
|
||||
// Emit a store to the stack slot. Use a truncstore if the input value is
|
||||
// later than DestVT.
|
||||
@ -2429,7 +2434,7 @@ void SelectionDAGLegalize::ExpandNode(SDNode *Node,
|
||||
// Increment the pointer, VAList, to the next vaarg
|
||||
Tmp3 = DAG.getNode(ISD::ADD, dl, TLI.getPointerTy(), VAList,
|
||||
DAG.getConstant(TLI.getTargetData()->
|
||||
getTypeAllocSize(VT.getTypeForEVT(*DAG.getContext())),
|
||||
getTypeAllocSize(VT.getTypeForEVT(*DAG.getContext())),
|
||||
TLI.getPointerTy()));
|
||||
// Store the incremented VAList to the legalized pointer
|
||||
Tmp3 = DAG.getStore(VAList.getValue(1), dl, Tmp3, Tmp2, V, 0,
|
||||
|
@ -109,14 +109,16 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_BIT_CONVERT(SDNode *N) {
|
||||
SDValue DAGTypeLegalizer::SoftenFloatRes_BUILD_PAIR(SDNode *N) {
|
||||
// Convert the inputs to integers, and build a new pair out of them.
|
||||
return DAG.getNode(ISD::BUILD_PAIR, N->getDebugLoc(),
|
||||
TLI.getTypeToTransformTo(*DAG.getContext(), N->getValueType(0)),
|
||||
TLI.getTypeToTransformTo(*DAG.getContext(),
|
||||
N->getValueType(0)),
|
||||
BitConvertToInteger(N->getOperand(0)),
|
||||
BitConvertToInteger(N->getOperand(1)));
|
||||
}
|
||||
|
||||
SDValue DAGTypeLegalizer::SoftenFloatRes_ConstantFP(ConstantFPSDNode *N) {
|
||||
return DAG.getConstant(N->getValueAPF().bitcastToAPInt(),
|
||||
TLI.getTypeToTransformTo(*DAG.getContext(), N->getValueType(0)));
|
||||
TLI.getTypeToTransformTo(*DAG.getContext(),
|
||||
N->getValueType(0)));
|
||||
}
|
||||
|
||||
SDValue DAGTypeLegalizer::SoftenFloatRes_EXTRACT_VECTOR_ELT(SDNode *N) {
|
||||
@ -338,7 +340,8 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_FP_EXTEND(SDNode *N) {
|
||||
SDValue DAGTypeLegalizer::SoftenFloatRes_FP16_TO_FP32(SDNode *N) {
|
||||
EVT NVT = TLI.getTypeToTransformTo(*DAG.getContext(), N->getValueType(0));
|
||||
SDValue Op = N->getOperand(0);
|
||||
return MakeLibCall(RTLIB::FPEXT_F16_F32, NVT, &Op, 1, false, N->getDebugLoc());
|
||||
return MakeLibCall(RTLIB::FPEXT_F16_F32, NVT, &Op, 1, false,
|
||||
N->getDebugLoc());
|
||||
}
|
||||
|
||||
SDValue DAGTypeLegalizer::SoftenFloatRes_FP_ROUND(SDNode *N) {
|
||||
@ -489,7 +492,8 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_SELECT_CC(SDNode *N) {
|
||||
}
|
||||
|
||||
SDValue DAGTypeLegalizer::SoftenFloatRes_UNDEF(SDNode *N) {
|
||||
return DAG.getUNDEF(TLI.getTypeToTransformTo(*DAG.getContext(), N->getValueType(0)));
|
||||
return DAG.getUNDEF(TLI.getTypeToTransformTo(*DAG.getContext(),
|
||||
N->getValueType(0)));
|
||||
}
|
||||
|
||||
SDValue DAGTypeLegalizer::SoftenFloatRes_VAARG(SDNode *N) {
|
||||
@ -531,7 +535,8 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_XINT_TO_FP(SDNode *N) {
|
||||
// Sign/zero extend the argument if the libcall takes a larger type.
|
||||
SDValue Op = DAG.getNode(Signed ? ISD::SIGN_EXTEND : ISD::ZERO_EXTEND, dl,
|
||||
NVT, N->getOperand(0));
|
||||
return MakeLibCall(LC, TLI.getTypeToTransformTo(*DAG.getContext(), RVT), &Op, 1, false, dl);
|
||||
return MakeLibCall(LC, TLI.getTypeToTransformTo(*DAG.getContext(), RVT),
|
||||
&Op, 1, false, dl);
|
||||
}
|
||||
|
||||
|
||||
@ -1403,7 +1408,8 @@ SDValue DAGTypeLegalizer::ExpandFloatOp_STORE(SDNode *N, unsigned OpNo) {
|
||||
SDValue Chain = ST->getChain();
|
||||
SDValue Ptr = ST->getBasePtr();
|
||||
|
||||
EVT NVT = TLI.getTypeToTransformTo(*DAG.getContext(), ST->getValue().getValueType());
|
||||
EVT NVT = TLI.getTypeToTransformTo(*DAG.getContext(),
|
||||
ST->getValue().getValueType());
|
||||
assert(NVT.isByteSized() && "Expanded type not byte sized!");
|
||||
assert(ST->getMemoryVT().bitsLE(NVT) && "Float type not round?");
|
||||
|
||||
|
@ -204,7 +204,8 @@ SDValue DAGTypeLegalizer::PromoteIntRes_BIT_CONVERT(SDNode *N) {
|
||||
std::swap(Lo, Hi);
|
||||
|
||||
InOp = DAG.getNode(ISD::ANY_EXTEND, dl,
|
||||
EVT::getIntegerVT(*DAG.getContext(), NOutVT.getSizeInBits()),
|
||||
EVT::getIntegerVT(*DAG.getContext(),
|
||||
NOutVT.getSizeInBits()),
|
||||
JoinIntegers(Lo, Hi));
|
||||
return DAG.getNode(ISD::BIT_CONVERT, dl, NOutVT, InOp);
|
||||
}
|
||||
@ -1968,7 +1969,8 @@ void DAGTypeLegalizer::ExpandIntRes_ZERO_EXTEND(SDNode *N,
|
||||
SplitInteger(Res, Lo, Hi);
|
||||
unsigned ExcessBits =
|
||||
Op.getValueType().getSizeInBits() - NVT.getSizeInBits();
|
||||
Hi = DAG.getZeroExtendInReg(Hi, dl, EVT::getIntegerVT(*DAG.getContext(), ExcessBits));
|
||||
Hi = DAG.getZeroExtendInReg(Hi, dl,
|
||||
EVT::getIntegerVT(*DAG.getContext(), ExcessBits));
|
||||
}
|
||||
}
|
||||
|
||||
@ -2269,7 +2271,8 @@ SDValue DAGTypeLegalizer::ExpandIntOp_STORE(StoreSDNode *N, unsigned OpNo) {
|
||||
unsigned EBytes = ExtVT.getStoreSize();
|
||||
unsigned IncrementSize = NVT.getSizeInBits()/8;
|
||||
unsigned ExcessBits = (EBytes - IncrementSize)*8;
|
||||
EVT HiVT = EVT::getIntegerVT(*DAG.getContext(), ExtVT.getSizeInBits() - ExcessBits);
|
||||
EVT HiVT = EVT::getIntegerVT(*DAG.getContext(),
|
||||
ExtVT.getSizeInBits() - ExcessBits);
|
||||
|
||||
if (ExcessBits < NVT.getSizeInBits()) {
|
||||
// Transfer high bits from the top of Lo to the bottom of Hi.
|
||||
|
@ -173,8 +173,9 @@ void DAGTypeLegalizer::ExpandRes_EXTRACT_VECTOR_ELT(SDNode *N, SDValue &Lo,
|
||||
EVT NewVT = TLI.getTypeToTransformTo(*DAG.getContext(), OldVT);
|
||||
|
||||
SDValue NewVec = DAG.getNode(ISD::BIT_CONVERT, dl,
|
||||
EVT::getVectorVT(*DAG.getContext(), NewVT, 2*OldElts),
|
||||
OldVec);
|
||||
EVT::getVectorVT(*DAG.getContext(),
|
||||
NewVT, 2*OldElts),
|
||||
OldVec);
|
||||
|
||||
// Extract the elements at 2 * Idx and 2 * Idx + 1 from the new vector.
|
||||
SDValue Idx = N->getOperand(1);
|
||||
@ -268,7 +269,9 @@ SDValue DAGTypeLegalizer::ExpandOp_BIT_CONVERT(SDNode *N) {
|
||||
// is no point, and it might create expansion loops). For example, on
|
||||
// x86 this turns v1i64 = BIT_CONVERT i64 into v1i64 = BIT_CONVERT v2i32.
|
||||
EVT OVT = N->getOperand(0).getValueType();
|
||||
EVT NVT = EVT::getVectorVT(*DAG.getContext(), TLI.getTypeToTransformTo(*DAG.getContext(), OVT), 2);
|
||||
EVT NVT = EVT::getVectorVT(*DAG.getContext(),
|
||||
TLI.getTypeToTransformTo(*DAG.getContext(), OVT),
|
||||
2);
|
||||
|
||||
if (isTypeLegal(NVT)) {
|
||||
SDValue Parts[2];
|
||||
@ -312,8 +315,9 @@ SDValue DAGTypeLegalizer::ExpandOp_BUILD_VECTOR(SDNode *N) {
|
||||
}
|
||||
|
||||
SDValue NewVec = DAG.getNode(ISD::BUILD_VECTOR, dl,
|
||||
EVT::getVectorVT(*DAG.getContext(), NewVT, NewElts.size()),
|
||||
&NewElts[0], NewElts.size());
|
||||
EVT::getVectorVT(*DAG.getContext(),
|
||||
NewVT, NewElts.size()),
|
||||
&NewElts[0], NewElts.size());
|
||||
|
||||
// Convert the new vector to the old vector type.
|
||||
return DAG.getNode(ISD::BIT_CONVERT, dl, VecVT, NewVec);
|
||||
@ -380,7 +384,8 @@ SDValue DAGTypeLegalizer::ExpandOp_NormalStore(SDNode *N, unsigned OpNo) {
|
||||
DebugLoc dl = N->getDebugLoc();
|
||||
|
||||
StoreSDNode *St = cast<StoreSDNode>(N);
|
||||
EVT NVT = TLI.getTypeToTransformTo(*DAG.getContext(), St->getValue().getValueType());
|
||||
EVT NVT = TLI.getTypeToTransformTo(*DAG.getContext(),
|
||||
St->getValue().getValueType());
|
||||
SDValue Chain = St->getChain();
|
||||
SDValue Ptr = St->getBasePtr();
|
||||
int SVOffset = St->getSrcValueOffset();
|
||||
|
@ -705,8 +705,9 @@ void DAGTypeLegalizer::SplitVecRes_INSERT_VECTOR_ELT(SDNode *N, SDValue &Lo,
|
||||
// Store the new element. This may be larger than the vector element type,
|
||||
// so use a truncating store.
|
||||
SDValue EltPtr = GetVectorElementPointer(StackPtr, EltVT, Idx);
|
||||
const Type *VecType = VecVT.getTypeForEVT(*DAG.getContext());
|
||||
unsigned Alignment =
|
||||
TLI.getTargetData()->getPrefTypeAlignment(VecVT.getTypeForEVT(*DAG.getContext()));
|
||||
TLI.getTargetData()->getPrefTypeAlignment(VecType);
|
||||
Store = DAG.getTruncStore(Store, dl, Elt, EltPtr, NULL, 0, EltVT,
|
||||
false, false, 0);
|
||||
|
||||
@ -1419,7 +1420,8 @@ SDValue DAGTypeLegalizer::WidenVecRes_Shift(SDNode *N) {
|
||||
ShOp = GetWidenedVector(ShOp);
|
||||
ShVT = ShOp.getValueType();
|
||||
}
|
||||
EVT ShWidenVT = EVT::getVectorVT(*DAG.getContext(), ShVT.getVectorElementType(),
|
||||
EVT ShWidenVT = EVT::getVectorVT(*DAG.getContext(),
|
||||
ShVT.getVectorElementType(),
|
||||
WidenVT.getVectorNumElements());
|
||||
if (ShVT != ShWidenVT)
|
||||
ShOp = ModifyToType(ShOp, ShWidenVT);
|
||||
@ -1493,7 +1495,8 @@ SDValue DAGTypeLegalizer::WidenVecRes_BIT_CONVERT(SDNode *N) {
|
||||
unsigned NewNumElts = WidenSize / InSize;
|
||||
if (InVT.isVector()) {
|
||||
EVT InEltVT = InVT.getVectorElementType();
|
||||
NewInVT= EVT::getVectorVT(*DAG.getContext(), InEltVT, WidenSize / InEltVT.getSizeInBits());
|
||||
NewInVT= EVT::getVectorVT(*DAG.getContext(), InEltVT,
|
||||
WidenSize / InEltVT.getSizeInBits());
|
||||
} else {
|
||||
NewInVT = EVT::getVectorVT(*DAG.getContext(), InVT, NewNumElts);
|
||||
}
|
||||
@ -1617,7 +1620,8 @@ SDValue DAGTypeLegalizer::WidenVecRes_CONVERT_RNDSAT(SDNode *N) {
|
||||
SDValue RndOp = N->getOperand(3);
|
||||
SDValue SatOp = N->getOperand(4);
|
||||
|
||||
EVT WidenVT = TLI.getTypeToTransformTo(*DAG.getContext(), N->getValueType(0));
|
||||
EVT WidenVT = TLI.getTypeToTransformTo(*DAG.getContext(),
|
||||
N->getValueType(0));
|
||||
unsigned WidenNumElts = WidenVT.getVectorNumElements();
|
||||
|
||||
EVT InVT = InOp.getValueType();
|
||||
@ -1791,7 +1795,8 @@ SDValue DAGTypeLegalizer::WidenVecRes_SELECT(SDNode *N) {
|
||||
EVT CondVT = Cond1.getValueType();
|
||||
if (CondVT.isVector()) {
|
||||
EVT CondEltVT = CondVT.getVectorElementType();
|
||||
EVT CondWidenVT = EVT::getVectorVT(*DAG.getContext(), CondEltVT, WidenNumElts);
|
||||
EVT CondWidenVT = EVT::getVectorVT(*DAG.getContext(),
|
||||
CondEltVT, WidenNumElts);
|
||||
if (getTypeAction(CondVT) == WidenVector)
|
||||
Cond1 = GetWidenedVector(Cond1);
|
||||
|
||||
@ -1859,7 +1864,8 @@ SDValue DAGTypeLegalizer::WidenVecRes_VSETCC(SDNode *N) {
|
||||
SDValue InOp1 = N->getOperand(0);
|
||||
EVT InVT = InOp1.getValueType();
|
||||
assert(InVT.isVector() && "can not widen non vector type");
|
||||
EVT WidenInVT = EVT::getVectorVT(*DAG.getContext(), InVT.getVectorElementType(), WidenNumElts);
|
||||
EVT WidenInVT = EVT::getVectorVT(*DAG.getContext(),
|
||||
InVT.getVectorElementType(), WidenNumElts);
|
||||
InOp1 = GetWidenedVector(InOp1);
|
||||
SDValue InOp2 = GetWidenedVector(N->getOperand(1));
|
||||
|
||||
@ -2124,7 +2130,7 @@ SDValue DAGTypeLegalizer::GenWidenVectorLoads(SmallVector<SDValue, 16>& LdChain,
|
||||
// The routines chops the vector into the largest vector loads with the same
|
||||
// element type or scalar loads and then recombines it to the widen vector
|
||||
// type.
|
||||
EVT WidenVT = TLI.getTypeToTransformTo(*DAG.getContext(), LD->getValueType(0));
|
||||
EVT WidenVT = TLI.getTypeToTransformTo(*DAG.getContext(),LD->getValueType(0));
|
||||
unsigned WidenWidth = WidenVT.getSizeInBits();
|
||||
EVT LdVT = LD->getMemoryVT();
|
||||
DebugLoc dl = LD->getDebugLoc();
|
||||
|
Loading…
x
Reference in New Issue
Block a user