[llvm] [RISCV][GlobalISel] Vector Extension vadd Legalizer (PR #71400)

Jiahan Xie via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 7 06:18:16 PST 2023


================
@@ -0,0 +1,14 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc -mtriple=riscv32 -mattr=+v -stop-after=irtranslator | FileCheck %s --check-prefixes=CHECK,RV32
+; RUN: llc -mtriple=riscv64 -mattr=+v --stop-after=irtranslator | FileCheck %s --check-prefixes=CHECK,RV64
+
+define <vscale x 1 x i8> @vadd_vv_mask_nxv1i8(<vscale x 1 x i8> %va, <vscale x 1 x i8> %vb, <vscale x 1 x i1> %mask) {
----------------
jiahanxie353 wrote:

Thanks for explaining!

Just wanted to clarify:
> if you run that test case with -global-isel, you will see that it currently fails in IRTranslator to convert the LLVM add to G_ADD. Once you implement that functionality, you might see it fail in the legalizer

So it currently fails at [here](https://github.com/llvm/llvm-project/blob/9b2439167d9f794e317fecbdbb0a6e96f9ea4b56/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp#L3151) because #70133 patch made it fall back to SelectionDAG. I tried to comment it out and keep it running, it fails at [translate return with vector types](https://github.com/llvm/llvm-project/blob/9b2439167d9f794e317fecbdbb0a6e96f9ea4b56/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp#L359).
I was wondering, @michaelmaitland , should I be working on lowering return or you will do it and I'll just focus on legalizing for now?

https://github.com/llvm/llvm-project/pull/71400


More information about the llvm-commits mailing list