Change TargetLowering::getLoadExtAction to take an MVT, instead of EVT.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169840 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Patrik Hagglund
2012-12-11 09:39:09 +00:00
parent 968947766b
commit ffa03b7981
3 changed files with 7 additions and 7 deletions

View File

@@ -442,17 +442,17 @@ public:
/// either it is legal, needs to be promoted to a larger size, needs to be /// 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 /// expanded to some other code sequence, or the target has a custom expander
/// for it. /// for it.
LegalizeAction getLoadExtAction(unsigned ExtType, EVT VT) const { LegalizeAction getLoadExtAction(unsigned ExtType, MVT VT) const {
assert(ExtType < ISD::LAST_LOADEXT_TYPE && assert(ExtType < ISD::LAST_LOADEXT_TYPE && VT < MVT::LAST_VALUETYPE &&
VT.getSimpleVT() < MVT::LAST_VALUETYPE &&
"Table isn't big enough!"); "Table isn't big enough!");
return (LegalizeAction)LoadExtActions[VT.getSimpleVT().SimpleTy][ExtType]; return (LegalizeAction)LoadExtActions[VT.SimpleTy][ExtType];
} }
/// isLoadExtLegal - Return true if the specified load with extension is legal /// isLoadExtLegal - Return true if the specified load with extension is legal
/// on this target. /// on this target.
bool isLoadExtLegal(unsigned ExtType, EVT VT) const { bool isLoadExtLegal(unsigned ExtType, EVT VT) const {
return VT.isSimple() && getLoadExtAction(ExtType, VT) == Legal; return VT.isSimple() &&
getLoadExtAction(ExtType, VT.getSimpleVT()) == Legal;
} }
/// getTruncStoreAction - Return how this store with truncation should be /// getTruncStoreAction - Return how this store with truncation should be

View File

@@ -1037,7 +1037,7 @@ void SelectionDAGLegalize::LegalizeLoadOps(SDNode *Node) {
Chain = Ch; Chain = Ch;
} else { } else {
bool isCustom = false; bool isCustom = false;
switch (TLI.getLoadExtAction(ExtType, SrcVT)) { switch (TLI.getLoadExtAction(ExtType, SrcVT.getSimpleVT())) {
default: llvm_unreachable("This action is not supported yet!"); default: llvm_unreachable("This action is not supported yet!");
case TargetLowering::Custom: case TargetLowering::Custom:
isCustom = true; isCustom = true;

View File

@@ -1093,7 +1093,7 @@ bool CodeGenPrepare::MoveExtToFormExtLoad(Instruction *I) {
assert(isa<SExtInst>(I) && "Unexpected ext type!"); assert(isa<SExtInst>(I) && "Unexpected ext type!");
LType = ISD::SEXTLOAD; LType = ISD::SEXTLOAD;
} }
if (TLI && !TLI->isLoadExtLegal(LType, TLI->getValueType(LI->getType()))) if (TLI && !TLI->isLoadExtLegal(LType, TLI->getSimpleValueType(LI->getType())))
return false; return false;
// Move the extend into the same block as the load, so that SelectionDAG // Move the extend into the same block as the load, so that SelectionDAG