[llvm] [RISCV][GlobalISel] Legalize G_ADD, G_SUB, G_AND, G_OR, G_XOR on RISC-V Vector Extension (PR #71400)
Jiahan Xie via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 9 11:03:49 PST 2023
================
@@ -31,10 +31,16 @@ RISCVLegalizerInfo::RISCVLegalizerInfo(const RISCVSubtarget &ST) {
const LLT s32 = LLT::scalar(32);
const LLT s64 = LLT::scalar(64);
+ const LLT nxv1s8 = LLT::scalable_vector(1, s8);
+ const LLT nxv2s8 = LLT::scalable_vector(2, s8);
+ const LLT nxv4s8 = LLT::scalable_vector(4, s8);
+ const LLT nxv8s8 = LLT::scalable_vector(8, s8);
+
+
using namespace TargetOpcode;
getActionDefinitionsBuilder({G_ADD, G_SUB, G_AND, G_OR, G_XOR})
- .legalFor({s32, sXLen})
+ .legalFor({s32, sXLen, nxv1s8, nxv2s8, nxv4s8, nxv8s8})
----------------
jiahanxie353 wrote:
I see.
So I need to check `ST.hasVInstructions()` anyways?
https://github.com/llvm/llvm-project/pull/71400
More information about the llvm-commits
mailing list