[PATCH] D117947: [RISCV] Don't allow i64 vector div by constant to use mulh with Zve64x

Yueh-Ting Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 23 22:45:39 PST 2022


eopXD marked 2 inline comments as done.
eopXD added a comment.

Concluding the test case change:

- For eew < 64, check lines should be the same between all 4 lines of `RUN:`
- For eew = 64
  - Since this patch rules out `vmulh` from `Zve64*`, `ZVE64X` lines don't use them.
  - GPR length for rv32 and rv64 differ, so ways to load from function arguments differ between `RV32-V` and `RV64-V`



================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:919
 
-        setOperationAction(ISD::MULHS, VT, Custom);
-        setOperationAction(ISD::MULHU, VT, Custom);
+        // nxvXi64 MULHS/MULHU requires the V extension instead of Zve64*.
+        if (VT.getVectorElementType() != MVT::i64 ||
----------------
craig.topper wrote:
> This one should say vXi64. This is the fixed vector section.
Updated.


================
Comment at: llvm/test/CodeGen/RISCV/rvv/vdiv-sdnode.ll:3
+; RUN: llc -mtriple=riscv32 -mattr=+v -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK,RV32,V,RV32-V
+; RUN: llc -mtriple=riscv32 -mattr=+zve64x -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK,RV32,ZVE64X,RV32-ZVE64X
+; RUN: llc -mtriple=riscv64 -mattr=+v -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK,RV64,V,RV64-V
----------------
craig.topper wrote:
> Did you run the make check-llvm after running the script? FileCheck doesn't like prefixes to appear in check-prefixes if it doesn't appear in the test file. RV32-ZVE64X does not appear on any lines.
Updated. Thank you.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D117947/new/

https://reviews.llvm.org/D117947



More information about the llvm-commits mailing list