summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/AMDGPU/SIFoldOperands.cpp
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2016-12-07 02:42:15 +0000
committerTom Stellard <thomas.stellard@amd.com>2016-12-07 02:42:15 +0000
commit8485fa096e0baf95790a8b1ba7f8ea8806f50a3e (patch)
tree4571875722107bcf446cf548964cfc23a39b08e7 /llvm/lib/Target/AMDGPU/SIFoldOperands.cpp
parent2f50fef095298706e7dbe1f47b7d9421c74a790b (diff)
downloadbcm5719-llvm-8485fa096e0baf95790a8b1ba7f8ea8806f50a3e.tar.gz
bcm5719-llvm-8485fa096e0baf95790a8b1ba7f8ea8806f50a3e.zip
AMDGPU : Add S_SETREG instructions to fix fdiv precision issues.
Patch By: Wei Ding Summary: This patch fixes the fdiv precision issues. Reviewers: b-sumner, cfang, wdng, arsenm Subscribers: kzhuravl, nhaehnle, yaxunl, tony-tye Differential Revision: https://reviews.llvm.org/D26424 llvm-svn: 288879
Diffstat (limited to 'llvm/lib/Target/AMDGPU/SIFoldOperands.cpp')
-rw-r--r--llvm/lib/Target/AMDGPU/SIFoldOperands.cpp7
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.
OpenPOWER on IntegriCloud