[AMDGPU] Add Relocation Constant Support
authorJakub Kuderski <kubak@google.com>
Mon, 30 Mar 2020 17:42:14 +0000 (13:42 -0400)
committerJakub Kuderski <kubak@google.com>
Mon, 30 Mar 2020 17:49:20 +0000 (13:49 -0400)
commit77ce2e21a87768370b97a027e5053b73e8f438a7
treec9de3e4fdce23cbcda82e97d5a2c33f07ecac7bb
parent7842e7ebbf3b68ebe52592d51aaf7a20f94d047b
[AMDGPU] Add Relocation Constant Support

Summary:
This change adds amdgcn.reloc.constant intrinsic to the amdgpu backend, which will compile into a relocation entry in the resulting elf.

The intrinsics takes a MetadataNode (String) as its only argument, which specifies the symbol name of the relocation entry.

`SelectionDAGBuilder::getValueImpl` is changed to allow metadata operands passed through to ISel.

Author: csyonghe <yonghe@google.com>

Reviewers: tpr, nhaehnle

Reviewed By: nhaehnle

Subscribers: arsenm, kzhuravl, jvesely, wdng, yaxunl, dstuttard, t-tye, hiraditya, kerbowa, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D76440
llvm/include/llvm/IR/IntrinsicsAMDGPU.td
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp
llvm/lib/Target/AMDGPU/SIISelLowering.cpp
llvm/test/CodeGen/AMDGPU/amdgcn-load-offset-from-reg.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/amdgpu-reloc-const.ll [new file with mode: 0644]