[llvm-commits] CVS: llvm/include/llvm/Target/TargetLowering.h

Evan Cheng evan.cheng at apple.com
Tue Oct 3 17:50:38 PDT 2006



Changes in directory llvm/include/llvm/Target:

TargetLowering.h updated: 1.78 -> 1.79
---
Log message:

Combine ISD::EXTLOAD, ISD::SEXTLOAD, ISD::ZEXTLOAD into ISD::LOADX. Add an
extra operand to LOADX to specify the exact value extension type.


---
Diffs of the changes:  (+32 -0)

 TargetLowering.h |   32 ++++++++++++++++++++++++++++++++
 1 files changed, 32 insertions(+)


Index: llvm/include/llvm/Target/TargetLowering.h
diff -u llvm/include/llvm/Target/TargetLowering.h:1.78 llvm/include/llvm/Target/TargetLowering.h:1.79
--- llvm/include/llvm/Target/TargetLowering.h:1.78	Mon Sep  4 01:21:35 2006
+++ llvm/include/llvm/Target/TargetLowering.h	Tue Oct  3 19:50:21 2006
@@ -215,16 +215,33 @@
   /// expanded to some other code sequence, or the target has a custom expander
   /// for it.
   LegalizeAction getOperationAction(unsigned Op, MVT::ValueType VT) const {
+    assert(Op != ISD::LOADX && "Should use getLoadXAction instead");
     return (LegalizeAction)((OpActions[Op] >> (2*VT)) & 3);
   }
   
   /// isOperationLegal - Return true if the specified operation is legal on this
   /// target.
   bool isOperationLegal(unsigned Op, MVT::ValueType VT) const {
+    assert(Op != ISD::LOADX && "Should use isLoadXLegal instead");
     return getOperationAction(Op, VT) == Legal ||
            getOperationAction(Op, VT) == Custom;
   }
   
+  /// getLoadXAction - Return how this load with extension 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 getLoadXAction(unsigned LType, MVT::ValueType VT) const {
+    return (LegalizeAction)((LoadXActions[LType] >> (2*VT)) & 3);
+  }
+  
+  /// isLoadXLegal - Return true if the specified load with extension is legal
+  /// is legal on this target.
+  bool isLoadXLegal(unsigned LType, MVT::ValueType VT) const {
+    return getLoadXAction(LType, VT) == Legal ||
+           getLoadXAction(LType, VT) == Custom;
+  }
+  
   /// getTypeToPromoteTo - If the action for this operation is to promote, this
   /// method returns the ValueType to promote to.
   MVT::ValueType getTypeToPromoteTo(unsigned Op, MVT::ValueType VT) const {
@@ -521,12 +538,22 @@
   /// with the specified type and indicate what to do about it.
   void setOperationAction(unsigned Op, MVT::ValueType VT,
                           LegalizeAction Action) {
+    assert(Op != ISD::LOADX && "Should use setLoadXAction instead");
     assert(VT < 32 && Op < sizeof(OpActions)/sizeof(OpActions[0]) &&
            "Table isn't big enough!");
     OpActions[Op] &= ~(uint64_t(3UL) << VT*2);
     OpActions[Op] |= (uint64_t)Action << VT*2;
   }
   
+  /// setLoadXAction - Indicate that the specified load with extension does not
+  /// work with the with specified type and indicate what to do about it.
+  void setLoadXAction(unsigned LType, MVT::ValueType VT, LegalizeAction Action){
+    assert(VT < 32 && LType < sizeof(LoadXActions)/sizeof(LoadXActions[0]) &&
+           "Table isn't big enough!");
+    LoadXActions[LType] &= ~(uint64_t(3UL) << VT*2);
+    LoadXActions[LType] |= (uint64_t)Action << VT*2;
+  }
+  
   /// AddPromotedToType - If Opc/OrigVT is specified as being promoted, the
   /// promotion code defaults to trying a larger integer/fp until it can find
   /// one that works.  If that default is insufficient, this method can be used
@@ -773,6 +800,11 @@
   /// non-legal value types are not described here.
   uint64_t OpActions[156];
   
+  /// LoadXActions - For each load of load extension type and each value type,
+  /// keep a LegalizeAction that indicates how instruction selection should deal
+  /// with the load.
+  uint64_t LoadXActions[ISD::LAST_LOADX_TYPE];
+  
   ValueTypeActionImpl ValueTypeActions;
 
   std::vector<double> LegalFPImmediates;






More information about the llvm-commits mailing list