diff options
Diffstat (limited to 'llvm/lib/Target/AMDGPU/SIFoldOperands.cpp')
-rw-r--r-- | llvm/lib/Target/AMDGPU/SIFoldOperands.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Target/AMDGPU/SIFoldOperands.cpp b/llvm/lib/Target/AMDGPU/SIFoldOperands.cpp index 7bf6ec22469..3d59f8d82ae 100644 --- a/llvm/lib/Target/AMDGPU/SIFoldOperands.cpp +++ b/llvm/lib/Target/AMDGPU/SIFoldOperands.cpp @@ -173,6 +173,13 @@ static bool tryAddToFoldList(std::vector<FoldCandidate> &FoldList, MI->setDesc(TII->get(Opc)); } + // Special case for s_setreg_b32 + if (Opc == AMDGPU::S_SETREG_B32 && OpToFold->isImm()) { + MI->setDesc(TII->get(AMDGPU::S_SETREG_IMM32_B32)); + FoldList.push_back(FoldCandidate(MI, OpNo, OpToFold)); + return true; + } + // If we are already folding into another operand of MI, then // we can't commute the instruction, otherwise we risk making the // other fold illegal. |