diff options
| author | Tom Stellard <thomas.stellard@amd.com> | 2016-02-11 21:45:07 +0000 |
|---|---|---|
| committer | Tom Stellard <thomas.stellard@amd.com> | 2016-02-11 21:45:07 +0000 |
| commit | 1397d49ef5772833179e9edb53697c156e074dcc (patch) | |
| tree | 2ca0f4291c75564ca551561dfc7ecb76f418d1ca /llvm/lib/Target/AMDGPU/SIInstrInfo.h | |
| parent | f9de0d6904cde91fb4b9c7701be2f907717f2c07 (diff) | |
| download | bcm5719-llvm-1397d49ef5772833179e9edb53697c156e074dcc.tar.gz bcm5719-llvm-1397d49ef5772833179e9edb53697c156e074dcc.zip | |
AMDGPU/SI: Make sure MIMG descriptors and samplers stay in SGPRs
Summary:
It's possible to have resource descriptors and samplers stored in
VGPRs, either by a VMEM instruction or in the case of samplers,
floating-point calculations. When this happens, we need to use
v_readfirstlane to copy these values back to sgprs.
Reviewers: mareko, arsenm
Subscribers: arsenm, llvm-commits
Differential Revision: http://reviews.llvm.org/D17102
llvm-svn: 260599
Diffstat (limited to 'llvm/lib/Target/AMDGPU/SIInstrInfo.h')
| -rw-r--r-- | llvm/lib/Target/AMDGPU/SIInstrInfo.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Target/AMDGPU/SIInstrInfo.h b/llvm/lib/Target/AMDGPU/SIInstrInfo.h index c2d51a56d5c..66e80c3f272 100644 --- a/llvm/lib/Target/AMDGPU/SIInstrInfo.h +++ b/llvm/lib/Target/AMDGPU/SIInstrInfo.h @@ -396,6 +396,13 @@ public: /// \brief Fix operands in \p MI to satisfy constant bus requirements. void legalizeOperandsVOP3(MachineRegisterInfo &MRI, MachineInstr *MI) const; + /// Copy a value from a VGPR (\p SrcReg) to SGPR. This function can only + /// be used when it is know that the value in SrcReg is same across all + /// threads in the wave. + /// \returns The SGPR register that \p SrcReg was copied to. + unsigned readlaneVGPRToSGPR(unsigned SrcReg, MachineInstr *UseMI, + MachineRegisterInfo &MRI) const; + /// \brief Legalize all operands in this instruction. This function may /// create new instruction and insert them before \p MI. void legalizeOperands(MachineInstr *MI) const; |

