[RISCV] Assume no-op addrspacecasts by default
authorFraser Cormack <fraser@codeplay.com>
Fri, 18 Dec 2020 12:51:48 +0000 (12:51 +0000)
committerFraser Cormack <fraser@codeplay.com>
Fri, 18 Dec 2020 21:03:37 +0000 (21:03 +0000)
commitd4ed253d0b8487d9e9fd95a3895f83c437e5e7bb
tree841d1ec4b27b055113ffa5065fb29fd0ceb1e05e
parent08c4b4054b3ded660fc87ccbaa9a6bc4e390f6ff
[RISCV] Assume no-op addrspacecasts by default

To support OpenCL, which typically uses SPIR as an IR, non-zero address
spaces must be accounted for. This patch makes the RISC-V target assume
no-op address space casts across the board, which effectively removes
the need to support addrspacecast instructions in the backend.

For a RISC-V implementation with different configurations or specialized
address spaces where casts aren't no-ops, the function can be adjusted
as required.

Reviewed By: jrtc27

Differential Revision: https://reviews.llvm.org/D93536
llvm/lib/Target/RISCV/RISCVTargetMachine.cpp
llvm/lib/Target/RISCV/RISCVTargetMachine.h
llvm/test/CodeGen/RISCV/addrspacecast.ll [new file with mode: 0644]