diff options
Diffstat (limited to 'llvm/lib/Target')
| -rw-r--r-- | llvm/lib/Target/AArch64/AArch64ISelLowering.cpp | 8 | ||||
| -rw-r--r-- | llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp | 2 | ||||
| -rw-r--r-- | llvm/lib/Target/ARM/ARMISelLowering.cpp | 8 | ||||
| -rw-r--r-- | llvm/lib/Target/Hexagon/HexagonISelLowering.cpp | 6 | ||||
| -rw-r--r-- | llvm/lib/Target/Hexagon/HexagonSubtarget.h | 2 | ||||
| -rw-r--r-- | llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.cpp | 2 | ||||
| -rw-r--r-- | llvm/lib/Target/Mips/MipsISelLowering.cpp | 2 | ||||
| -rw-r--r-- | llvm/lib/Target/Mips/MipsSEISelLowering.cpp | 4 | ||||
| -rw-r--r-- | llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp | 2 | ||||
| -rw-r--r-- | llvm/lib/Target/PowerPC/PPCISelLowering.cpp | 4 | ||||
| -rw-r--r-- | llvm/lib/Target/Sparc/SparcISelLowering.cpp | 2 | ||||
| -rw-r--r-- | llvm/lib/Target/SystemZ/SystemZISelLowering.cpp | 6 | ||||
| -rw-r--r-- | llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp | 4 | ||||
| -rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 8 | 
14 files changed, 31 insertions, 29 deletions
| diff --git a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp index 84b4e97420c..77311c5b918 100644 --- a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp +++ b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp @@ -307,7 +307,7 @@ AArch64TargetLowering::AArch64TargetLowering(const TargetMachine &TM,    // AArch64 lacks both left-rotate and popcount instructions.    setOperationAction(ISD::ROTL, MVT::i32, Expand);    setOperationAction(ISD::ROTL, MVT::i64, Expand); -  for (MVT VT : MVT::vector_valuetypes()) { +  for (MVT VT : MVT::fixedlen_vector_valuetypes()) {      setOperationAction(ISD::ROTL, VT, Expand);      setOperationAction(ISD::ROTR, VT, Expand);    } @@ -321,7 +321,7 @@ AArch64TargetLowering::AArch64TargetLowering(const TargetMachine &TM,    setOperationAction(ISD::SDIVREM, MVT::i32, Expand);    setOperationAction(ISD::SDIVREM, MVT::i64, Expand); -  for (MVT VT : MVT::vector_valuetypes()) { +  for (MVT VT : MVT::fixedlen_vector_valuetypes()) {      setOperationAction(ISD::SDIVREM, VT, Expand);      setOperationAction(ISD::UDIVREM, VT, Expand);    } @@ -754,7 +754,7 @@ AArch64TargetLowering::AArch64TargetLowering(const TargetMachine &TM,      setTruncStoreAction(MVT::v2i32, MVT::v2i16, Expand);      // Likewise, narrowing and extending vector loads/stores aren't handled      // directly. -    for (MVT VT : MVT::vector_valuetypes()) { +    for (MVT VT : MVT::fixedlen_vector_valuetypes()) {        setOperationAction(ISD::SIGN_EXTEND_INREG, VT, Expand);        if (VT == MVT::v16i8 || VT == MVT::v8i16 || VT == MVT::v4i32) { @@ -770,7 +770,7 @@ AArch64TargetLowering::AArch64TargetLowering(const TargetMachine &TM,        setOperationAction(ISD::BSWAP, VT, Expand);        setOperationAction(ISD::CTTZ, VT, Expand); -      for (MVT InnerVT : MVT::vector_valuetypes()) { +      for (MVT InnerVT : MVT::fixedlen_vector_valuetypes()) {          setTruncStoreAction(VT, InnerVT, Expand);          setLoadExtAction(ISD::SEXTLOAD, VT, InnerVT, Expand);          setLoadExtAction(ISD::ZEXTLOAD, VT, InnerVT, Expand); diff --git a/llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp b/llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp index 6b92ad0599a..c24ea043fc3 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp +++ b/llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp @@ -134,7 +134,7 @@ AMDGPUTargetLowering::AMDGPUTargetLowering(const TargetMachine &TM,      setLoadExtAction(ISD::EXTLOAD, VT, MVT::i32, Expand);    } -  for (MVT VT : MVT::integer_vector_valuetypes()) { +  for (MVT VT : MVT::integer_fixedlen_vector_valuetypes()) {      setLoadExtAction(ISD::EXTLOAD, VT, MVT::v2i8, Expand);      setLoadExtAction(ISD::SEXTLOAD, VT, MVT::v2i8, Expand);      setLoadExtAction(ISD::ZEXTLOAD, VT, MVT::v2i8, Expand); diff --git a/llvm/lib/Target/ARM/ARMISelLowering.cpp b/llvm/lib/Target/ARM/ARMISelLowering.cpp index 44c43edfcd0..9cf10981141 100644 --- a/llvm/lib/Target/ARM/ARMISelLowering.cpp +++ b/llvm/lib/Target/ARM/ARMISelLowering.cpp @@ -704,8 +704,8 @@ ARMTargetLowering::ARMTargetLowering(const TargetMachine &TM,      setOperationAction(ISD::FMAXNUM, MVT::f16, Legal);    } -  for (MVT VT : MVT::vector_valuetypes()) { -    for (MVT InnerVT : MVT::vector_valuetypes()) { +  for (MVT VT : MVT::fixedlen_vector_valuetypes()) { +    for (MVT InnerVT : MVT::fixedlen_vector_valuetypes()) {        setTruncStoreAction(VT, InnerVT, Expand);        addAllExtLoads(VT, InnerVT, Expand);      } @@ -910,7 +910,7 @@ ARMTargetLowering::ARMTargetLowering(const TargetMachine &TM,      // It is legal to extload from v4i8 to v4i16 or v4i32.      for (MVT Ty : {MVT::v8i8, MVT::v4i8, MVT::v2i8, MVT::v4i16, MVT::v2i16,                     MVT::v2i32}) { -      for (MVT VT : MVT::integer_vector_valuetypes()) { +      for (MVT VT : MVT::integer_fixedlen_vector_valuetypes()) {          setLoadExtAction(ISD::EXTLOAD, VT, Ty, Legal);          setLoadExtAction(ISD::ZEXTLOAD, VT, Ty, Legal);          setLoadExtAction(ISD::SEXTLOAD, VT, Ty, Legal); @@ -1054,7 +1054,7 @@ ARMTargetLowering::ARMTargetLowering(const TargetMachine &TM,    // ARM does not have ROTL.    setOperationAction(ISD::ROTL, MVT::i32, Expand); -  for (MVT VT : MVT::vector_valuetypes()) { +  for (MVT VT : MVT::fixedlen_vector_valuetypes()) {      setOperationAction(ISD::ROTL, VT, Expand);      setOperationAction(ISD::ROTR, VT, Expand);    } diff --git a/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp b/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp index 26a178c5378..ac70b4db86e 100644 --- a/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp +++ b/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp @@ -1439,12 +1439,12 @@ HexagonTargetLowering::HexagonTargetLowering(const TargetMachine &TM,      ISD::CONCAT_VECTORS,        ISD::VECTOR_SHUFFLE    }; -  for (MVT VT : MVT::vector_valuetypes()) { +  for (MVT VT : MVT::fixedlen_vector_valuetypes()) {      for (unsigned VectExpOp : VectExpOps)        setOperationAction(VectExpOp, VT, Expand);      // Expand all extending loads and truncating stores: -    for (MVT TargetVT : MVT::vector_valuetypes()) { +    for (MVT TargetVT : MVT::fixedlen_vector_valuetypes()) {        if (TargetVT == VT)          continue;        setLoadExtAction(ISD::EXTLOAD, TargetVT, VT, Expand); @@ -1864,7 +1864,7 @@ bool HexagonTargetLowering::isShuffleMaskLegal(ArrayRef<int> Mask,  TargetLoweringBase::LegalizeTypeAction  HexagonTargetLowering::getPreferredVectorAction(MVT VT) const { -  if (VT.getVectorNumElements() == 1) +  if (VT.getVectorNumElements() == 1 || VT.isScalableVector())      return TargetLoweringBase::TypeScalarizeVector;    // Always widen vectors of i1. diff --git a/llvm/lib/Target/Hexagon/HexagonSubtarget.h b/llvm/lib/Target/Hexagon/HexagonSubtarget.h index 007423ef190..31157a0065d 100644 --- a/llvm/lib/Target/Hexagon/HexagonSubtarget.h +++ b/llvm/lib/Target/Hexagon/HexagonSubtarget.h @@ -228,7 +228,7 @@ public:    }    bool isHVXVectorType(MVT VecTy, bool IncludeBool = false) const { -    if (!VecTy.isVector() || !useHVXOps()) +    if (!VecTy.isVector() || !useHVXOps() || VecTy.isScalableVector())        return false;      MVT ElemTy = VecTy.getVectorElementType();      if (!IncludeBool && ElemTy == MVT::i1) diff --git a/llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.cpp b/llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.cpp index 38062e8e922..ddbc5543348 100644 --- a/llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.cpp +++ b/llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.cpp @@ -45,6 +45,8 @@ bool HexagonTTIImpl::useHVX() const {  bool HexagonTTIImpl::isTypeForHVX(Type *VecTy) const {    assert(VecTy->isVectorTy()); +  if (cast<VectorType>(VecTy)->isScalable()) +    return false;    // Avoid types like <2 x i32*>.    if (!cast<VectorType>(VecTy)->getElementType()->isIntegerTy())      return false; diff --git a/llvm/lib/Target/Mips/MipsISelLowering.cpp b/llvm/lib/Target/Mips/MipsISelLowering.cpp index c352007415b..303791950c8 100644 --- a/llvm/lib/Target/Mips/MipsISelLowering.cpp +++ b/llvm/lib/Target/Mips/MipsISelLowering.cpp @@ -330,7 +330,7 @@ MipsTargetLowering::MipsTargetLowering(const MipsTargetMachine &TM,    }    // Set LoadExtAction for f16 vectors to Expand -  for (MVT VT : MVT::fp_vector_valuetypes()) { +  for (MVT VT : MVT::fp_fixedlen_vector_valuetypes()) {      MVT F16VT = MVT::getVectorVT(MVT::f16, VT.getVectorNumElements());      if (F16VT.isValid())        setLoadExtAction(ISD::EXTLOAD, VT, F16VT, Expand); diff --git a/llvm/lib/Target/Mips/MipsSEISelLowering.cpp b/llvm/lib/Target/Mips/MipsSEISelLowering.cpp index a79c3a089c4..ca4638561da 100644 --- a/llvm/lib/Target/Mips/MipsSEISelLowering.cpp +++ b/llvm/lib/Target/Mips/MipsSEISelLowering.cpp @@ -71,8 +71,8 @@ MipsSETargetLowering::MipsSETargetLowering(const MipsTargetMachine &TM,    if (Subtarget.hasDSP() || Subtarget.hasMSA()) {      // Expand all truncating stores and extending loads. -    for (MVT VT0 : MVT::vector_valuetypes()) { -      for (MVT VT1 : MVT::vector_valuetypes()) { +    for (MVT VT0 : MVT::fixedlen_vector_valuetypes()) { +      for (MVT VT1 : MVT::fixedlen_vector_valuetypes()) {          setTruncStoreAction(VT0, VT1, Expand);          setLoadExtAction(ISD::SEXTLOAD, VT0, VT1, Expand);          setLoadExtAction(ISD::ZEXTLOAD, VT0, VT1, Expand); diff --git a/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp b/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp index c76e06036b2..9b710f2b866 100644 --- a/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp +++ b/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp @@ -480,7 +480,7 @@ NVPTXTargetLowering::NVPTXTargetLowering(const NVPTXTargetMachine &TM,    setOperationAction(ISD::TRAP, MVT::Other, Legal);    // Register custom handling for vector loads/stores -  for (MVT VT : MVT::vector_valuetypes()) { +  for (MVT VT : MVT::fixedlen_vector_valuetypes()) {      if (IsPTXVectorType(VT)) {        setOperationAction(ISD::LOAD, VT, Custom);        setOperationAction(ISD::STORE, VT, Custom); diff --git a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp index 9655c212d4c..1ddc63d3200 100644 --- a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp +++ b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp @@ -551,7 +551,7 @@ PPCTargetLowering::PPCTargetLowering(const PPCTargetMachine &TM,    if (Subtarget.hasAltivec()) {      // First set operation action for all vector types to expand. Then we      // will selectively turn on ones that can be effectively codegen'd. -    for (MVT VT : MVT::vector_valuetypes()) { +    for (MVT VT : MVT::fixedlen_vector_valuetypes()) {        // add/sub are legal for all supported vector VT's.        setOperationAction(ISD::ADD, VT, Legal);        setOperationAction(ISD::SUB, VT, Legal); @@ -652,7 +652,7 @@ PPCTargetLowering::PPCTargetLowering(const PPCTargetMachine &TM,        setOperationAction(ISD::ROTL, VT, Expand);        setOperationAction(ISD::ROTR, VT, Expand); -      for (MVT InnerVT : MVT::vector_valuetypes()) { +      for (MVT InnerVT : MVT::fixedlen_vector_valuetypes()) {          setTruncStoreAction(VT, InnerVT, Expand);          setLoadExtAction(ISD::SEXTLOAD, VT, InnerVT, Expand);          setLoadExtAction(ISD::ZEXTLOAD, VT, InnerVT, Expand); diff --git a/llvm/lib/Target/Sparc/SparcISelLowering.cpp b/llvm/lib/Target/Sparc/SparcISelLowering.cpp index 660c5298d37..09dd8395f76 100644 --- a/llvm/lib/Target/Sparc/SparcISelLowering.cpp +++ b/llvm/lib/Target/Sparc/SparcISelLowering.cpp @@ -1438,7 +1438,7 @@ SparcTargetLowering::SparcTargetLowering(const TargetMachine &TM,        setOperationAction(Op, MVT::v2i32, Expand);      }      // Truncating/extending stores/loads are also not supported. -    for (MVT VT : MVT::integer_vector_valuetypes()) { +    for (MVT VT : MVT::integer_fixedlen_vector_valuetypes()) {        setLoadExtAction(ISD::SEXTLOAD, VT, MVT::v2i32, Expand);        setLoadExtAction(ISD::ZEXTLOAD, VT, MVT::v2i32, Expand);        setLoadExtAction(ISD::EXTLOAD, VT, MVT::v2i32, Expand); diff --git a/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp b/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp index f79f40cc6c3..febf75cb67b 100644 --- a/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp +++ b/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp @@ -300,14 +300,14 @@ SystemZTargetLowering::SystemZTargetLowering(const TargetMachine &TM,    // Handle prefetches with PFD or PFDRL.    setOperationAction(ISD::PREFETCH, MVT::Other, Custom); -  for (MVT VT : MVT::vector_valuetypes()) { +  for (MVT VT : MVT::fixedlen_vector_valuetypes()) {      // Assume by default that all vector operations need to be expanded.      for (unsigned Opcode = 0; Opcode < ISD::BUILTIN_OP_END; ++Opcode)        if (getOperationAction(Opcode, VT) == Legal)          setOperationAction(Opcode, VT, Expand);      // Likewise all truncating stores and extending loads. -    for (MVT InnerVT : MVT::vector_valuetypes()) { +    for (MVT InnerVT : MVT::fixedlen_vector_valuetypes()) {        setTruncStoreAction(VT, InnerVT, Expand);        setLoadExtAction(ISD::SEXTLOAD, VT, InnerVT, Expand);        setLoadExtAction(ISD::ZEXTLOAD, VT, InnerVT, Expand); @@ -333,7 +333,7 @@ SystemZTargetLowering::SystemZTargetLowering(const TargetMachine &TM,    }    // Handle integer vector types. -  for (MVT VT : MVT::integer_vector_valuetypes()) { +  for (MVT VT : MVT::integer_fixedlen_vector_valuetypes()) {      if (isTypeLegal(VT)) {        // These operations have direct equivalents.        setOperationAction(ISD::EXTRACT_VECTOR_ELT, VT, Legal); diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp index 4ac9995db01..78dfa88b510 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp +++ b/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp @@ -205,7 +205,7 @@ WebAssemblyTargetLowering::WebAssemblyTargetLowering(      for (auto T : {MVT::i8, MVT::i16, MVT::i32})        setOperationAction(ISD::SIGN_EXTEND_INREG, T, Action);    } -  for (auto T : MVT::integer_vector_valuetypes()) +  for (auto T : MVT::integer_fixedlen_vector_valuetypes())      setOperationAction(ISD::SIGN_EXTEND_INREG, T, Expand);    // Dynamic stack allocation: use the default expansion. @@ -237,7 +237,7 @@ WebAssemblyTargetLowering::WebAssemblyTargetLowering(    if (Subtarget->hasSIMD128()) {      for (auto T : {MVT::v16i8, MVT::v8i16, MVT::v4i32, MVT::v2i64, MVT::v4f32,                     MVT::v2f64}) { -      for (auto MemT : MVT::vector_valuetypes()) { +      for (auto MemT : MVT::fixedlen_vector_valuetypes()) {          if (MVT(T) != MemT) {            setTruncStoreAction(T, MemT, Expand);            for (auto Ext : {ISD::EXTLOAD, ISD::ZEXTLOAD, ISD::SEXTLOAD}) diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index 184645895dc..58b1d47aa2c 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -749,7 +749,7 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM,    // First set operation action for all vector types to either promote    // (for widening) or expand (for scalarization). Then we will selectively    // turn on ones that can be effectively codegen'd. -  for (MVT VT : MVT::vector_valuetypes()) { +  for (MVT VT : MVT::fixedlen_vector_valuetypes()) {      setOperationAction(ISD::SDIV, VT, Expand);      setOperationAction(ISD::UDIV, VT, Expand);      setOperationAction(ISD::SREM, VT, Expand); @@ -787,7 +787,7 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM,      setOperationAction(ISD::ZERO_EXTEND, VT, Expand);      setOperationAction(ISD::ANY_EXTEND, VT, Expand);      setOperationAction(ISD::SELECT_CC, VT, Expand); -    for (MVT InnerVT : MVT::vector_valuetypes()) { +    for (MVT InnerVT : MVT::fixedlen_vector_valuetypes()) {        setTruncStoreAction(InnerVT, VT, Expand);        setLoadExtAction(ISD::SEXTLOAD, InnerVT, VT, Expand); @@ -948,7 +948,7 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM,      // scalars) and extend in-register to a legal 128-bit vector type. For sext      // loads these must work with a single scalar load.      if (!ExperimentalVectorWideningLegalization) { -      for (MVT VT : MVT::integer_vector_valuetypes()) { +      for (MVT VT : MVT::integer_fixedlen_vector_valuetypes()) {          setLoadExtAction(ISD::EXTLOAD, VT, MVT::v2i8, Custom);          setLoadExtAction(ISD::EXTLOAD, VT, MVT::v2i16, Custom);          setLoadExtAction(ISD::EXTLOAD, VT, MVT::v2i32, Custom); @@ -1112,7 +1112,7 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM,      if (!ExperimentalVectorWideningLegalization) {        // Avoid narrow result types when widening. The legal types are listed        // in the next loop. -      for (MVT VT : MVT::integer_vector_valuetypes()) { +      for (MVT VT : MVT::integer_fixedlen_vector_valuetypes()) {          setLoadExtAction(ISD::SEXTLOAD, VT, MVT::v2i8, Custom);          setLoadExtAction(ISD::SEXTLOAD, VT, MVT::v2i16, Custom);          setLoadExtAction(ISD::SEXTLOAD, VT, MVT::v2i32, Custom); | 

