This is an archive of the discontinued LLVM Phabricator instance.

[NVPTX] Add MoveParam instruction for TargetExternalSymbol operand
ClosedPublic

Authored by asavonic on Nov 2 2021, 4:55 AM.

Details

Summary

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.

Diff Detail

Event Timeline

asavonic created this revision.Nov 2 2021, 4:55 AM
asavonic requested review of this revision.Nov 2 2021, 4:55 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 2 2021, 4:55 AM
tra accepted this revision.Nov 2 2021, 10:50 AM
tra added inline comments.
llvm/test/CodeGen/NVPTX/lower-byval-args.ll
1–3

Do we want to enable verifier here, too?

This revision is now accepted and ready to land.Nov 2 2021, 10:50 AM
This revision was landed with ongoing or failed builds.Nov 3 2021, 4:44 AM
This revision was automatically updated to reflect the committed changes.
asavonic added inline comments.Nov 3 2021, 4:46 AM
llvm/test/CodeGen/NVPTX/lower-byval-args.ll
1–3

Thanks, fixed that before landing.