Change TargetLowering::getLoadExtAction to take an MVT, instead of EVT.
authorPatrik Hagglund <patrik.h.hagglund@ericsson.com>
Tue, 11 Dec 2012 09:39:09 +0000 (09:39 +0000)
committerPatrik Hagglund <patrik.h.hagglund@ericsson.com>
Tue, 11 Dec 2012 09:39:09 +0000 (09:39 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169840 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Target/TargetLowering.h
lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
lib/Transforms/Scalar/CodeGenPrepare.cpp

index 736fca196bf4fc543f66305546e392520cd218b3..ef9296957a48d7d5e93e1409c48d9feede027ce6 100644 (file)
@@ -442,17 +442,17 @@ 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, EVT VT) const {
-    assert(ExtType < ISD::LAST_LOADEXT_TYPE &&
-           VT.getSimpleVT() < MVT::LAST_VALUETYPE &&
+  LegalizeAction getLoadExtAction(unsigned ExtType, MVT VT) const {
+    assert(ExtType < ISD::LAST_LOADEXT_TYPE && VT < MVT::LAST_VALUETYPE &&
            "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
   /// on this target.
   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
index 2c249fcaf961b5ce33ce63ada34856dff5c2a759..c7eef8cf9eeb3cafc39829477f232c1bcd1d7685 100644 (file)
@@ -1037,7 +1037,7 @@ void SelectionDAGLegalize::LegalizeLoadOps(SDNode *Node) {
     Chain = Ch;
   } else {
     bool isCustom = false;
-    switch (TLI.getLoadExtAction(ExtType, SrcVT)) {
+    switch (TLI.getLoadExtAction(ExtType, SrcVT.getSimpleVT())) {
     default: llvm_unreachable("This action is not supported yet!");
     case TargetLowering::Custom:
              isCustom = true;
index e6abfdf581f03bff2cd1012844f03c24de5bd865..f39a370e13caa44a21087384b4ee8f96d0b18b87 100644 (file)
@@ -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->getValueType(LI->getType())))
+  if (TLI && !TLI->isLoadExtLegal(LType, TLI->getSimpleValueType(LI->getType())))
     return false;
 
   // Move the extend into the same block as the load, so that SelectionDAG