[RISCV] Change the immediate argument to Zk* intrinsics/builtins from i8 to i32.
authorCraig Topper <craig.topper@sifive.com>
Tue, 13 Jun 2023 16:52:26 +0000 (09:52 -0700)
committerCraig Topper <craig.topper@sifive.com>
Tue, 13 Jun 2023 17:39:43 +0000 (10:39 -0700)
commit2f2af2d01763374ed55f5fb598e5005c1b9af957
treecba160b1c3a7af887f4df7664dd14085c8ba937b
parent335c0f775d96536b94dd4703362b5386d056aa6d
[RISCV] Change the immediate argument to Zk* intrinsics/builtins from i8 to i32.

This matches gcc. It also lets us fix a bug that the byteselect
predicate was not being evaluated in tablegen. We can't have i8
TImmLeaf in tablegen because i8 isn't a type for any register class.

I've added AutoUpgrade support for the IR intrinsics.

Reviewed By: asb

Differential Revision: https://reviews.llvm.org/D152627
16 files changed:
clang/include/clang/Basic/BuiltinsRISCV.def
clang/test/CodeGen/RISCV/rvk-intrinsics/riscv32-zknd.c
clang/test/CodeGen/RISCV/rvk-intrinsics/riscv32-zkne.c
clang/test/CodeGen/RISCV/rvk-intrinsics/riscv32-zksed.c
clang/test/CodeGen/RISCV/rvk-intrinsics/riscv64-zksed.c
llvm/include/llvm/IR/IntrinsicsRISCV.td
llvm/lib/IR/AutoUpgrade.cpp
llvm/lib/Target/RISCV/RISCVInstrInfoZk.td
llvm/test/CodeGen/RISCV/rv32zknd-intrinsic-autoupgrade.ll [new file with mode: 0644]
llvm/test/CodeGen/RISCV/rv32zknd-intrinsic.ll
llvm/test/CodeGen/RISCV/rv32zkne-intrinsic-autoupgrade.ll [new file with mode: 0644]
llvm/test/CodeGen/RISCV/rv32zkne-intrinsic.ll
llvm/test/CodeGen/RISCV/rv32zksed-intrinsic-autoupgrade.ll [new file with mode: 0644]
llvm/test/CodeGen/RISCV/rv32zksed-intrinsic.ll
llvm/test/CodeGen/RISCV/rv64zksed-intrinsic-autoupgrade.ll [new file with mode: 0644]
llvm/test/CodeGen/RISCV/rv64zksed-intrinsic.ll