[NVPTX] Add MoveParam instruction for TargetExternalSymbol operand
authorAndrew Savonichev <andrew.savonichev@gmail.com>
Wed, 3 Nov 2021 11:42:32 +0000 (14:42 +0300)
committerAndrew Savonichev <andrew.savonichev@gmail.com>
Wed, 3 Nov 2021 11:43:41 +0000 (14:43 +0300)
commit0e707855386f6bbd5f4705bd525ad78537e43875
treed04f35d3acaf94810e7cf4ed5c7a560d14c28fed
parent3bc586b9aa6f33e8acdea0fa80362879f26a8be7
[NVPTX] Add MoveParam instruction for TargetExternalSymbol operand

TargetExternalSymbol is considered to be an immediate and not a
register, so machine verifier emits an error:

    *** Bad machine code: Expected a register operand. ***
    - function:    static_offset
    - basic block: %bb.0 bb (0x560e9b306028)
    - instruction: %3:int64regs = MoveParamI64 &static_offset_param_1
    - operand 1:   &static_offset_param_1

The patch adds variants of this instruction with an immediate operand
for byval arguments on 64-bit and 32-bit targets.

Differential Revision: https://reviews.llvm.org/D113006
llvm/lib/Target/NVPTX/NVPTXInstrInfo.td
llvm/test/CodeGen/NVPTX/lower-byval-args.ll