[llvm] [RISCV] Use DefaultAttrsIntrinsic for some vector intrinsics. (PR #94819)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 7 16:59:49 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-backend-risc-v
Author: Craig Topper (topperc)
<details>
<summary>Changes</summary>
This adds IntrWillReturn, IntrNoSync, IntrNoFree, and IntrNoCallback. The IntrWillReturn is needed to make the intrinsic eligible for being dead code eliminated if they are unused.
We already use this for most intrinsics. I wonder if the rounding mode intrinsics were in review when the other intrinsics were changed to DefaultAttrsIntrinsic.
---
Full diff: https://github.com/llvm/llvm-project/pull/94819.diff
1 Files Affected:
- (modified) llvm/include/llvm/IR/IntrinsicsRISCV.td (+4-4)
``````````diff
diff --git a/llvm/include/llvm/IR/IntrinsicsRISCV.td b/llvm/include/llvm/IR/IntrinsicsRISCV.td
index 4c4e7351212f8..2da154c300344 100644
--- a/llvm/include/llvm/IR/IntrinsicsRISCV.td
+++ b/llvm/include/llvm/IR/IntrinsicsRISCV.td
@@ -144,14 +144,14 @@ class RISCVVIntrinsic {
let TargetPrefix = "riscv" in {
// We use anyint here but we only support XLen.
- def int_riscv_vsetvli : Intrinsic<[llvm_anyint_ty],
+ def int_riscv_vsetvli : DefaultAttrsIntrinsic<[llvm_anyint_ty],
/* AVL */ [LLVMMatchType<0>,
/* VSEW */ LLVMMatchType<0>,
/* VLMUL */ LLVMMatchType<0>],
[IntrNoMem,
ImmArg<ArgIndex<1>>,
ImmArg<ArgIndex<2>>]>;
- def int_riscv_vsetvlimax : Intrinsic<[llvm_anyint_ty],
+ def int_riscv_vsetvlimax : DefaultAttrsIntrinsic<[llvm_anyint_ty],
/* VSEW */ [LLVMMatchType<0>,
/* VLMUL */ LLVMMatchType<0>],
[IntrNoMem,
@@ -669,7 +669,7 @@ let TargetPrefix = "riscv" in {
// The destination vector type is the same as first source vector.
// Input: (passthru, vector_in, vector_in/scalar_in, vxrm, vl)
class RISCVSaturatingBinaryAAXUnMaskedRoundingMode
- : Intrinsic<[llvm_anyvector_ty],
+ : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
[LLVMMatchType<0>, LLVMMatchType<0>, llvm_any_ty,
llvm_anyint_ty, LLVMMatchType<2>],
[ImmArg<ArgIndex<3>>, IntrNoMem]>, RISCVVIntrinsic {
@@ -692,7 +692,7 @@ let TargetPrefix = "riscv" in {
// The destination vector type is the same as first source vector.
// Input: (maskedoff, vector_in, vector_in/scalar_in, mask, vxrm, vl, policy)
class RISCVSaturatingBinaryAAXMaskedRoundingMode
- : Intrinsic<[llvm_anyvector_ty],
+ : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
[LLVMMatchType<0>, LLVMMatchType<0>, llvm_any_ty,
LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, llvm_anyint_ty,
LLVMMatchType<2>, LLVMMatchType<2>],
``````````
</details>
https://github.com/llvm/llvm-project/pull/94819
More information about the llvm-commits
mailing list