[PATCH] Added TargetLowering::isVectorEltOrderLittleEndian(EVT)

Daniel Sanders daniel.sanders at imgtec.com
Fri Oct 18 02:44:24 PDT 2013


It returns the same value as isLittleEndian() for most targets. For MIPS,
it returns true for MSA vector types and isLittleEndian() for others.

This function will be used in a subsequent patch that prevents illegal types
being used in DAG's produced by SelectionDAG::getConstant() when given a legal
vector type with an illegal element type and the element type is normally
expanded.

There is no test in this patch. Tests will follow in the patch that changes
SelectionDAG::getConstant() to make use of this function.

http://llvm-reviews.chandlerc.com/D1971

Files:
  include/llvm/Target/TargetLowering.h
  lib/Target/Mips/MipsSEISelLowering.h

Index: include/llvm/Target/TargetLowering.h
===================================================================
--- include/llvm/Target/TargetLowering.h
+++ include/llvm/Target/TargetLowering.h
@@ -148,6 +148,7 @@
 
   bool isBigEndian() const { return !IsLittleEndian; }
   bool isLittleEndian() const { return IsLittleEndian; }
+  bool isVectorEltOrderLittleEndian(EVT Ty) const { return IsLittleEndian; }
   // Return the pointer type for the given address space, defaults to
   // the pointer type from the data layout.
   // FIXME: The default needs to be removed once all the code is updated.
Index: lib/Target/Mips/MipsSEISelLowering.h
===================================================================
--- lib/Target/Mips/MipsSEISelLowering.h
+++ lib/Target/Mips/MipsSEISelLowering.h
@@ -52,6 +52,11 @@
       return TargetLowering::getRepRegClassFor(VT);
     }
 
+    bool isVectorEltOrderLittleEndian(EVT Ty) const {
+      if (Ty.is128BitVector())
+        return true;
+      return isLittleEndian();
+    }
   private:
     virtual bool
     isEligibleForTailCallOptimization(const MipsCC &MipsCCInfo,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D1971.1.patch
Type: text/x-patch
Size: 1117 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131018/c688cef0/attachment.bin>


More information about the llvm-commits mailing list