summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2015-12-16 18:37:19 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2015-12-16 18:37:19 +0000
commite05ff151866610c53a8730a51a5cabef3cc09138 (patch)
tree2dd012ae1f54552debb36e77729685e77ac94938 /llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
parent5ce530608f4acfbb76e47757c07b6d349aacb8c0 (diff)
downloadbcm5719-llvm-e05ff151866610c53a8730a51a5cabef3cc09138.tar.gz
bcm5719-llvm-e05ff151866610c53a8730a51a5cabef3cc09138.zip
AMDGPU: Override getCFInstrCost
The default cost was 0 with the assumption that it is predictable. llvm-svn: 255796
Diffstat (limited to 'llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp')
-rw-r--r--llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp b/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
index c7ea412ce22..eb9e837d291 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
@@ -81,6 +81,17 @@ unsigned AMDGPUTTIImpl::getMaxInterleaveFactor(unsigned VF) {
return 64;
}
+unsigned AMDGPUTTIImpl::getCFInstrCost(unsigned Opcode) {
+ // XXX - For some reason this isn't called for switch.
+ switch (Opcode) {
+ case Instruction::Br:
+ case Instruction::Ret:
+ return 10;
+ default:
+ return BaseT::getCFInstrCost(Opcode);
+ }
+}
+
int AMDGPUTTIImpl::getVectorInstrCost(unsigned Opcode, Type *ValTy,
unsigned Index) {
switch (Opcode) {
OpenPOWER on IntegriCloud