Demonstrate how to model RISC-V V intrinsics and lower them to V instructions.
The CodeGen strategy is designed by @rogfer01 from BSC.
Paths
| Differential D93013
[RISCV] Define vadd/vsub/vrsub intrinsics and lower to V instructions. ClosedPublic Authored by HsiangKai on Dec 10 2020, 1:54 AM.
Details Summary Demonstrate how to model RISC-V V intrinsics and lower them to V instructions. The CodeGen strategy is designed by @rogfer01 from BSC.
Diff Detail
Unit TestsFailed Event TimelineHerald added subscribers: NickHung, apazos, sameer.abuasal and 23 others. · View Herald TranscriptDec 10 2020, 1:54 AM
Comment Actions
evandro added a parent revision: D92715: [Clang][RISCV] Define RISC-V V builtin types.Dec 10 2020, 4:12 PM HsiangKai retitled this revision from [RISCV] Define vadd intrinsics and lower to V instructions. to [RISCV] Define vadd/vsub/vrsub intrinsics and lower to V instructions..Dec 10 2020, 5:34 PM evandro removed a parent revision: D92715: [Clang][RISCV] Define RISC-V V builtin types.Dec 10 2020, 5:54 PM evandro added a parent revision: D93012: [RISCV] Separate masked and unmasked definitions for pseudo instructions..Dec 10 2020, 6:08 PM HsiangKai added inline comments. Comment Actions The destination vector register group for a masked vector instruction cannot overlap the source mask register (v0), unless the destination vector register is being written with a mask value (e.g., comparisons) or the scalar result of a reduction.
Comment Actions Address @craig.topper's comments. I will create pseudo instructions for vector register move later. HsiangKai added a child revision: D93108: [RISCV] Define vwadd/vwaddu/vwsub/vwsubu intrinsics..Dec 14 2020, 7:43 AM Comment Actions This looks good to me other than that one comment.
Comment Actions LGTM, but, please, see if any of the lint notices can be addressed before committing. This revision is now accepted and ready to land.Dec 14 2020, 3:47 PM This revision was landed with ongoing or failed builds.Dec 14 2020, 9:00 PM Closed by commit rGa6805a0e02c9: [RISCV] Define vadd/vsub/vrsub intrinsics and lower to V instructions. (authored by HsiangKai). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 311123 llvm/include/llvm/IR/IntrinsicsRISCV.td
llvm/lib/Target/RISCV/RISCVISelLowering.h
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
llvm/lib/Target/RISCV/RISCVInstrInfo.cpp
llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td
llvm/lib/Target/RISCV/RISCVRegisterInfo.td
llvm/lib/Target/RISCV/Utils/RISCVBaseInfo.h
llvm/lib/Target/RISCV/Utils/RISCVBaseInfo.cpp
llvm/test/CodeGen/RISCV/rvv/vadd.ll
llvm/test/CodeGen/RISCV/rvv/vrsub.ll
llvm/test/CodeGen/RISCV/rvv/vsub.ll
|
The comment block above this is about atomics which should stay with the atomic intrinsics. Can we start a new section for vectors after closing the "let TargetPrefix = "riscv" in {" portion for atomics. Same as what I did in D92973.