[llvm] d376b26 - [Hexagon] Make HexagonSubtarget::isHVXVectorType take EVT instead of MVT

Krzysztof Parzyszek via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 7 08:43:26 PDT 2022


Author: Krzysztof Parzyszek
Date: 2022-10-07T08:42:39-07:00
New Revision: d376b2667a559bf8af5dc43f1a118eb10538cea5

URL: https://github.com/llvm/llvm-project/commit/d376b2667a559bf8af5dc43f1a118eb10538cea5
DIFF: https://github.com/llvm/llvm-project/commit/d376b2667a559bf8af5dc43f1a118eb10538cea5.diff

LOG: [Hexagon] Make HexagonSubtarget::isHVXVectorType take EVT instead of MVT

EVT can be created for any Type, and so this function can now be used to
check if given Type, as-is, is an HVX type (as opposed to a type that may
be subject to legalization to an HVX type).

Added: 
    

Modified: 
    llvm/lib/Target/Hexagon/HexagonSubtarget.cpp
    llvm/lib/Target/Hexagon/HexagonSubtarget.h

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/Hexagon/HexagonSubtarget.cpp b/llvm/lib/Target/Hexagon/HexagonSubtarget.cpp
index 357354d177f2..78e85d7bc9cd 100644
--- a/llvm/lib/Target/Hexagon/HexagonSubtarget.cpp
+++ b/llvm/lib/Target/Hexagon/HexagonSubtarget.cpp
@@ -182,10 +182,12 @@ bool HexagonSubtarget::isHVXElementType(MVT Ty, bool IncludeBool) const {
   return llvm::is_contained(ElemTypes, Ty);
 }
 
-bool HexagonSubtarget::isHVXVectorType(MVT VecTy, bool IncludeBool) const {
+bool HexagonSubtarget::isHVXVectorType(EVT VecTy, bool IncludeBool) const {
+  if (!VecTy.isSimple())
+    return false;
   if (!VecTy.isVector() || !useHVXOps() || VecTy.isScalableVector())
     return false;
-  MVT ElemTy = VecTy.getVectorElementType();
+  MVT ElemTy = VecTy.getSimpleVT().getVectorElementType();
   if (!IncludeBool && ElemTy == MVT::i1)
     return false;
 

diff  --git a/llvm/lib/Target/Hexagon/HexagonSubtarget.h b/llvm/lib/Target/Hexagon/HexagonSubtarget.h
index f6c70928c2f6..9423553743c2 100644
--- a/llvm/lib/Target/Hexagon/HexagonSubtarget.h
+++ b/llvm/lib/Target/Hexagon/HexagonSubtarget.h
@@ -311,7 +311,7 @@ class HexagonSubtarget : public HexagonGenSubtargetInfo {
   }
 
   bool isHVXElementType(MVT Ty, bool IncludeBool = false) const;
-  bool isHVXVectorType(MVT VecTy, bool IncludeBool = false) const;
+  bool isHVXVectorType(EVT VecTy, bool IncludeBool = false) const;
   bool isTypeForHVX(Type *VecTy, bool IncludeBool = false) const;
 
   Align getTypeAlignment(MVT Ty) const {


        


More information about the llvm-commits mailing list