mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-17 21:29:20 +00:00
Cleanup up LegalizeTypes handling of loads and
stores. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52620 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
04eeefb32a
commit
ab09b7e8f3
@ -415,8 +415,8 @@ void DAGTypeLegalizer::ExpandFloatResult(SDNode *N, unsigned ResNo) {
|
|||||||
|
|
||||||
void DAGTypeLegalizer::ExpandFloatRes_LOAD(SDNode *N, SDOperand &Lo,
|
void DAGTypeLegalizer::ExpandFloatRes_LOAD(SDNode *N, SDOperand &Lo,
|
||||||
SDOperand &Hi) {
|
SDOperand &Hi) {
|
||||||
if (ISD::isNON_EXTLoad(N)) {
|
if (ISD::isNormalLoad(N)) {
|
||||||
ExpandRes_NON_EXTLOAD(N, Lo, Hi);
|
ExpandRes_NormalLoad(N, Lo, Hi);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -502,8 +502,8 @@ bool DAGTypeLegalizer::ExpandFloatOperand(SDNode *N, unsigned OpNo) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
SDOperand DAGTypeLegalizer::ExpandFloatOp_STORE(SDNode *N, unsigned OpNo) {
|
SDOperand DAGTypeLegalizer::ExpandFloatOp_STORE(SDNode *N, unsigned OpNo) {
|
||||||
if (ISD::isNON_TRUNCStore(N))
|
if (ISD::isNormalStore(N))
|
||||||
return ExpandOp_NON_TRUNCStore(N, OpNo);
|
return ExpandOp_NormalStore(N, OpNo);
|
||||||
|
|
||||||
assert(ISD::isUNINDEXEDStore(N) && "Indexed store during type legalization!");
|
assert(ISD::isUNINDEXEDStore(N) && "Indexed store during type legalization!");
|
||||||
assert(OpNo == 1 && "Can only expand the stored value so far");
|
assert(OpNo == 1 && "Can only expand the stored value so far");
|
||||||
|
@ -192,7 +192,7 @@ SDOperand DAGTypeLegalizer::PromoteIntRes_SETCC(SDNode *N) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
SDOperand DAGTypeLegalizer::PromoteIntRes_LOAD(LoadSDNode *N) {
|
SDOperand DAGTypeLegalizer::PromoteIntRes_LOAD(LoadSDNode *N) {
|
||||||
// FIXME: Add support for indexed loads.
|
assert(ISD::isUNINDEXEDLoad(N) && "Indexed load during type legalization!");
|
||||||
MVT NVT = TLI.getTypeToTransformTo(N->getValueType(0));
|
MVT NVT = TLI.getTypeToTransformTo(N->getValueType(0));
|
||||||
ISD::LoadExtType ExtType =
|
ISD::LoadExtType ExtType =
|
||||||
ISD::isNON_EXTLoad(N) ? ISD::EXTLOAD : N->getExtensionType();
|
ISD::isNON_EXTLoad(N) ? ISD::EXTLOAD : N->getExtensionType();
|
||||||
@ -636,7 +636,7 @@ void DAGTypeLegalizer::PromoteSetCCOperands(SDOperand &NewLHS,SDOperand &NewRHS,
|
|||||||
}
|
}
|
||||||
|
|
||||||
SDOperand DAGTypeLegalizer::PromoteIntOp_STORE(StoreSDNode *N, unsigned OpNo){
|
SDOperand DAGTypeLegalizer::PromoteIntOp_STORE(StoreSDNode *N, unsigned OpNo){
|
||||||
// FIXME: Add support for indexed stores.
|
assert(ISD::isUNINDEXEDStore(N) && "Indexed store during type legalization!");
|
||||||
SDOperand Ch = N->getChain(), Ptr = N->getBasePtr();
|
SDOperand Ch = N->getChain(), Ptr = N->getBasePtr();
|
||||||
int SVOffset = N->getSrcValueOffset();
|
int SVOffset = N->getSrcValueOffset();
|
||||||
unsigned Alignment = N->getAlignment();
|
unsigned Alignment = N->getAlignment();
|
||||||
@ -1000,8 +1000,8 @@ void DAGTypeLegalizer::ExpandIntRes_FP_TO_UINT(SDNode *N, SDOperand &Lo,
|
|||||||
|
|
||||||
void DAGTypeLegalizer::ExpandIntRes_LOAD(LoadSDNode *N,
|
void DAGTypeLegalizer::ExpandIntRes_LOAD(LoadSDNode *N,
|
||||||
SDOperand &Lo, SDOperand &Hi) {
|
SDOperand &Lo, SDOperand &Hi) {
|
||||||
if (ISD::isNON_EXTLoad(N)) {
|
if (ISD::isNormalLoad(N)) {
|
||||||
ExpandRes_NON_EXTLOAD(N, Lo, Hi);
|
ExpandRes_NormalLoad(N, Lo, Hi);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1860,8 +1860,8 @@ void DAGTypeLegalizer::ExpandSetCCOperands(SDOperand &NewLHS, SDOperand &NewRHS,
|
|||||||
}
|
}
|
||||||
|
|
||||||
SDOperand DAGTypeLegalizer::ExpandIntOp_STORE(StoreSDNode *N, unsigned OpNo) {
|
SDOperand DAGTypeLegalizer::ExpandIntOp_STORE(StoreSDNode *N, unsigned OpNo) {
|
||||||
if (ISD::isNON_TRUNCStore(N))
|
if (ISD::isNormalStore(N))
|
||||||
return ExpandOp_NON_TRUNCStore(N, OpNo);
|
return ExpandOp_NormalStore(N, OpNo);
|
||||||
|
|
||||||
assert(ISD::isUNINDEXEDStore(N) && "Indexed store during type legalization!");
|
assert(ISD::isUNINDEXEDStore(N) && "Indexed store during type legalization!");
|
||||||
assert(OpNo == 1 && "Can only expand the stored value so far");
|
assert(OpNo == 1 && "Can only expand the stored value so far");
|
||||||
|
@ -465,13 +465,13 @@ private:
|
|||||||
void ExpandRes_BIT_CONVERT (SDNode *N, SDOperand &Lo, SDOperand &Hi);
|
void ExpandRes_BIT_CONVERT (SDNode *N, SDOperand &Lo, SDOperand &Hi);
|
||||||
void ExpandRes_BUILD_PAIR (SDNode *N, SDOperand &Lo, SDOperand &Hi);
|
void ExpandRes_BUILD_PAIR (SDNode *N, SDOperand &Lo, SDOperand &Hi);
|
||||||
void ExpandRes_EXTRACT_VECTOR_ELT(SDNode *N, SDOperand &Lo, SDOperand &Hi);
|
void ExpandRes_EXTRACT_VECTOR_ELT(SDNode *N, SDOperand &Lo, SDOperand &Hi);
|
||||||
void ExpandRes_NON_EXTLOAD (SDNode *N, SDOperand &Lo, SDOperand &Hi);
|
void ExpandRes_NormalLoad (SDNode *N, SDOperand &Lo, SDOperand &Hi);
|
||||||
|
|
||||||
// Generic Operand Expansion.
|
// Generic Operand Expansion.
|
||||||
SDOperand ExpandOp_BIT_CONVERT (SDNode *N);
|
SDOperand ExpandOp_BIT_CONVERT (SDNode *N);
|
||||||
SDOperand ExpandOp_BUILD_VECTOR (SDNode *N);
|
SDOperand ExpandOp_BUILD_VECTOR (SDNode *N);
|
||||||
SDOperand ExpandOp_EXTRACT_ELEMENT(SDNode *N);
|
SDOperand ExpandOp_EXTRACT_ELEMENT(SDNode *N);
|
||||||
SDOperand ExpandOp_NON_TRUNCStore (SDNode *N, unsigned OpNo);
|
SDOperand ExpandOp_NormalStore (SDNode *N, unsigned OpNo);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -75,7 +75,7 @@ void DAGTypeLegalizer::ExpandRes_BIT_CONVERT(SDNode *N,
|
|||||||
|
|
||||||
// Lower the bit-convert to a store/load from the stack, then expand the load.
|
// Lower the bit-convert to a store/load from the stack, then expand the load.
|
||||||
SDOperand Op = CreateStackStoreLoad(InOp, N->getValueType(0));
|
SDOperand Op = CreateStackStoreLoad(InOp, N->getValueType(0));
|
||||||
ExpandRes_NON_EXTLOAD(Op.Val, Lo, Hi);
|
ExpandRes_NormalLoad(Op.Val, Lo, Hi);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DAGTypeLegalizer::ExpandRes_BUILD_PAIR(SDNode *N,
|
void DAGTypeLegalizer::ExpandRes_BUILD_PAIR(SDNode *N,
|
||||||
@ -118,10 +118,9 @@ void DAGTypeLegalizer::ExpandRes_EXTRACT_VECTOR_ELT(SDNode *N,
|
|||||||
std::swap(Lo, Hi);
|
std::swap(Lo, Hi);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DAGTypeLegalizer::ExpandRes_NON_EXTLOAD(SDNode *N, SDOperand &Lo,
|
void DAGTypeLegalizer::ExpandRes_NormalLoad(SDNode *N, SDOperand &Lo,
|
||||||
SDOperand &Hi) {
|
SDOperand &Hi) {
|
||||||
assert(ISD::isNON_EXTLoad(N) && "This routine is not for extending loads!");
|
assert(ISD::isNormalLoad(N) && "This routine only for normal loads!");
|
||||||
assert(ISD::isUNINDEXEDLoad(N) && "Indexed load during type legalization!");
|
|
||||||
|
|
||||||
LoadSDNode *LD = cast<LoadSDNode>(N);
|
LoadSDNode *LD = cast<LoadSDNode>(N);
|
||||||
MVT NVT = TLI.getTypeToTransformTo(LD->getValueType(0));
|
MVT NVT = TLI.getTypeToTransformTo(LD->getValueType(0));
|
||||||
@ -222,9 +221,8 @@ SDOperand DAGTypeLegalizer::ExpandOp_EXTRACT_ELEMENT(SDNode *N) {
|
|||||||
return cast<ConstantSDNode>(N->getOperand(1))->getValue() ? Hi : Lo;
|
return cast<ConstantSDNode>(N->getOperand(1))->getValue() ? Hi : Lo;
|
||||||
}
|
}
|
||||||
|
|
||||||
SDOperand DAGTypeLegalizer::ExpandOp_NON_TRUNCStore(SDNode *N, unsigned OpNo) {
|
SDOperand DAGTypeLegalizer::ExpandOp_NormalStore(SDNode *N, unsigned OpNo) {
|
||||||
assert(ISD::isNON_TRUNCStore(N) && "This routine not for truncating stores!");
|
assert(ISD::isNormalStore(N) && "This routine only for normal stores!");
|
||||||
assert(ISD::isUNINDEXEDStore(N) && "Indexed store during type legalization!");
|
|
||||||
assert(OpNo == 1 && "Can only expand the stored value so far");
|
assert(OpNo == 1 && "Can only expand the stored value so far");
|
||||||
|
|
||||||
StoreSDNode *St = cast<StoreSDNode>(N);
|
StoreSDNode *St = cast<StoreSDNode>(N);
|
||||||
|
@ -100,7 +100,7 @@ SDOperand DAGTypeLegalizer::ScalarizeVecRes_UNDEF(SDNode *N) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
SDOperand DAGTypeLegalizer::ScalarizeVecRes_LOAD(LoadSDNode *N) {
|
SDOperand DAGTypeLegalizer::ScalarizeVecRes_LOAD(LoadSDNode *N) {
|
||||||
// FIXME: Add support for indexed loads.
|
assert(ISD::isUNINDEXEDLoad(N) && "Indexed load during type legalization!");
|
||||||
SDOperand Result = DAG.getLoad(N->getValueType(0).getVectorElementType(),
|
SDOperand Result = DAG.getLoad(N->getValueType(0).getVectorElementType(),
|
||||||
N->getChain(), N->getBasePtr(),
|
N->getChain(), N->getBasePtr(),
|
||||||
N->getSrcValue(), N->getSrcValueOffset(),
|
N->getSrcValue(), N->getSrcValueOffset(),
|
||||||
@ -232,7 +232,7 @@ SDOperand DAGTypeLegalizer::ScalarizeVecOp_EXTRACT_VECTOR_ELT(SDNode *N) {
|
|||||||
/// ScalarizeVecOp_STORE - If the value to store is a vector that needs to be
|
/// ScalarizeVecOp_STORE - If the value to store is a vector that needs to be
|
||||||
/// scalarized, it must be <1 x ty>. Just store the element.
|
/// scalarized, it must be <1 x ty>. Just store the element.
|
||||||
SDOperand DAGTypeLegalizer::ScalarizeVecOp_STORE(StoreSDNode *N, unsigned OpNo){
|
SDOperand DAGTypeLegalizer::ScalarizeVecOp_STORE(StoreSDNode *N, unsigned OpNo){
|
||||||
// FIXME: Add support for indexed stores.
|
assert(ISD::isUNINDEXEDStore(N) && "Indexed store during type legalization!");
|
||||||
assert(OpNo == 1 && "Do not know how to scalarize this operand!");
|
assert(OpNo == 1 && "Do not know how to scalarize this operand!");
|
||||||
return DAG.getStore(N->getChain(), GetScalarizedVector(N->getOperand(1)),
|
return DAG.getStore(N->getChain(), GetScalarizedVector(N->getOperand(1)),
|
||||||
N->getBasePtr(), N->getSrcValue(), N->getSrcValueOffset(),
|
N->getBasePtr(), N->getSrcValue(), N->getSrcValueOffset(),
|
||||||
@ -328,7 +328,7 @@ void DAGTypeLegalizer::SplitResult(SDNode *N, unsigned ResNo) {
|
|||||||
|
|
||||||
void DAGTypeLegalizer::SplitVecRes_LOAD(LoadSDNode *LD, SDOperand &Lo,
|
void DAGTypeLegalizer::SplitVecRes_LOAD(LoadSDNode *LD, SDOperand &Lo,
|
||||||
SDOperand &Hi) {
|
SDOperand &Hi) {
|
||||||
// FIXME: Add support for indexed loads.
|
assert(ISD::isUNINDEXEDLoad(LD) && "Indexed load during type legalization!");
|
||||||
MVT LoVT, HiVT;
|
MVT LoVT, HiVT;
|
||||||
GetSplitDestVTs(LD->getValueType(0), LoVT, HiVT);
|
GetSplitDestVTs(LD->getValueType(0), LoVT, HiVT);
|
||||||
|
|
||||||
@ -622,7 +622,7 @@ bool DAGTypeLegalizer::SplitOperand(SDNode *N, unsigned OpNo) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
SDOperand DAGTypeLegalizer::SplitVecOp_STORE(StoreSDNode *N, unsigned OpNo) {
|
SDOperand DAGTypeLegalizer::SplitVecOp_STORE(StoreSDNode *N, unsigned OpNo) {
|
||||||
// FIXME: Add support for indexed stores.
|
assert(ISD::isUNINDEXEDStore(N) && "Indexed store during type legalization!");
|
||||||
assert(OpNo == 1 && "Can only split the stored value");
|
assert(OpNo == 1 && "Can only split the stored value");
|
||||||
|
|
||||||
SDOperand Ch = N->getChain();
|
SDOperand Ch = N->getChain();
|
||||||
|
Loading…
Reference in New Issue
Block a user