GlobalISel: Handle llvm.read_register
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 1 Oct 2019 02:07:16 +0000 (02:07 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 1 Oct 2019 02:07:16 +0000 (02:07 +0000)
commitbdcc6d3d2638b3a2c99ab3b9bfaa9c02e584993a
treee8af9d8561e063eb1612cc02690a373b651a155a
parent8f6bdb76684fdb053166f6fa615a109bfc535709
GlobalISel: Handle llvm.read_register

SelectionDAG has a bunch of machinery to defer this to selection time
for some reason. Just directly emit a copy during IRTranslator. The
x86 usage does somewhat questionably check hasFP, which could depend
on the whole function being at minimum translated.

This does lose the convergent bit if the callsite had it, which may be
a problem. We also lose that in general for intrinsics, which may also
be a problem.

llvm-svn: 373294
llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
llvm/test/CodeGen/AMDGPU/GlobalISel/read_register.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/read_register.ll