summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2017-04-13 23:12:13 +0000
committerReid Kleckner <rnk@google.com>2017-04-13 23:12:13 +0000
commitf021fab2afdc3d9534dbddcccecf892986b9654b (patch)
treecd67c5baeda9bf396894c99f325324a735cbf066 /llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
parent9a016602e9246c5e76e7b8443ba968f35e7b0b88 (diff)
downloadbcm5719-llvm-f021fab2afdc3d9534dbddcccecf892986b9654b.tar.gz
bcm5719-llvm-f021fab2afdc3d9534dbddcccecf892986b9654b.zip
[IR] Make getParamAttributes take argument numbers, not ArgNo+1
Add hasParamAttribute() and use it instead of hasAttribute(ArgNo+1, Kind) everywhere. The fact that the AttributeList index for an argument is ArgNo+1 should be a hidden implementation detail. NFC llvm-svn: 300272
Diffstat (limited to 'llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp')
-rw-r--r--llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp b/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
index f6d33740a4f..01ac9968181 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
@@ -430,8 +430,8 @@ static bool isArgPassedInSGPR(const Argument *A) {
return true;
// For non-compute shaders, SGPR inputs are marked with either inreg or byval.
- if (F->getAttributes().hasAttribute(A->getArgNo() + 1, Attribute::InReg) ||
- F->getAttributes().hasAttribute(A->getArgNo() + 1, Attribute::ByVal))
+ if (F->getAttributes().hasParamAttribute(A->getArgNo(), Attribute::InReg) ||
+ F->getAttributes().hasParamAttribute(A->getArgNo(), Attribute::ByVal))
return true;
// Everything else is in VGPRs.
OpenPOWER on IntegriCloud