diff options
author | zhongyunde <zhongyunde@huawei.com> | 2022-04-15 09:44:11 +0800 |
---|---|---|
committer | zhongyunde <zhongyunde@huawei.com> | 2022-04-15 19:11:40 +0800 |
commit | 49cb4fef02e635bf304906232214166c7531d753 (patch) | |
tree | 0087a69c46215bb9b37aca56c5c7fe505c1aec8e | |
parent | f097885b07435bb6cd64440ed23c60660024285e (diff) | |
download | llvm-49cb4fef02e635bf304906232214166c7531d753.zip llvm-49cb4fef02e635bf304906232214166c7531d753.tar.gz llvm-49cb4fef02e635bf304906232214166c7531d753.tar.bz2 |
[AArch64][SelectionDAG] Refactor to support more scalable vector extending stores
Similar to D122281, we should firstly exclude all scalable vector extending
stores and then selectively enable those which we directly support.
Also merge integer and float scalable vector into scalable_vector_valuetypes.
Reviewed By: paulwalker-arm
Differential Revision: https://reviews.llvm.org/D123449
-rw-r--r-- | llvm/lib/Target/AArch64/AArch64ISelLowering.cpp | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp index ba1a9ad..cde9433 100644 --- a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp +++ b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp @@ -1177,22 +1177,11 @@ AArch64TargetLowering::AArch64TargetLowering(const TargetMachine &TM, setOperationAction(ISD::MSCATTER, VT, Custom); } - for (MVT VT : MVT::fp_scalable_vector_valuetypes()) { - for (MVT InnerVT : MVT::fp_scalable_vector_valuetypes()) { - // Avoid marking truncating FP stores as legal to prevent the - // DAGCombiner from creating unsupported truncating stores. + // Firstly, exclude all scalable vector extending loads/truncating stores, + // include both integer and floating scalable vector. + for (MVT VT : MVT::scalable_vector_valuetypes()) { + for (MVT InnerVT : MVT::scalable_vector_valuetypes()) { setTruncStoreAction(VT, InnerVT, Expand); - // SVE does not have floating-point extending loads. - setLoadExtAction(ISD::SEXTLOAD, VT, InnerVT, Expand); - setLoadExtAction(ISD::ZEXTLOAD, VT, InnerVT, Expand); - setLoadExtAction(ISD::EXTLOAD, VT, InnerVT, Expand); - } - } - - // Firstly, exclude all scalable vector extending loads/truncating stores. - for (MVT VT : MVT::integer_scalable_vector_valuetypes()) { - for (MVT InnerVT : MVT::integer_scalable_vector_valuetypes()) { - // TODO: truncating stores should also be exclude setLoadExtAction(ISD::SEXTLOAD, VT, InnerVT, Expand); setLoadExtAction(ISD::ZEXTLOAD, VT, InnerVT, Expand); setLoadExtAction(ISD::EXTLOAD, VT, InnerVT, Expand); @@ -1200,6 +1189,12 @@ AArch64TargetLowering::AArch64TargetLowering(const TargetMachine &TM, } // Then, selectively enable those which we directly support. + setTruncStoreAction(MVT::nxv2i64, MVT::nxv2i8, Legal); + setTruncStoreAction(MVT::nxv2i64, MVT::nxv2i16, Legal); + setTruncStoreAction(MVT::nxv2i64, MVT::nxv2i32, Legal); + setTruncStoreAction(MVT::nxv4i32, MVT::nxv4i8, Legal); + setTruncStoreAction(MVT::nxv4i32, MVT::nxv4i16, Legal); + setTruncStoreAction(MVT::nxv8i16, MVT::nxv8i8, Legal); for (auto Op : {ISD::ZEXTLOAD, ISD::SEXTLOAD, ISD::EXTLOAD}) { setLoadExtAction(Op, MVT::nxv2i64, MVT::nxv2i8, Legal); setLoadExtAction(Op, MVT::nxv2i64, MVT::nxv2i16, Legal); |