diff options
author | Tom Stellard <thomas.stellard@amd.com> | 2016-09-16 21:53:00 +0000 |
---|---|---|
committer | Tom Stellard <thomas.stellard@amd.com> | 2016-09-16 21:53:00 +0000 |
commit | bbeb45aff64e888cd7db72ca3dac862c7233490c (patch) | |
tree | fe3655066f8b7ca7f9e28d1162e790f718dd0c19 /llvm/lib/Target/AMDGPU/R600ISelLowering.cpp | |
parent | 7ccf6cd104648c2ed6873e00161567d5deb6f938 (diff) | |
download | bcm5719-llvm-bbeb45aff64e888cd7db72ca3dac862c7233490c.tar.gz bcm5719-llvm-bbeb45aff64e888cd7db72ca3dac862c7233490c.zip |
AMDGPU: Refactor kernel argument lowering
Summary:
The main challenge in lowering kernel arguments for AMDGPU is determing the
memory type of the argument. The generic calling convention code assumes
that only legal register types can be stored in memory, but this is not the
case for AMDGPU.
This consolidates all the logic AMDGPU uses for deducing memory types into a single
function. This will make it much easier to support different ABIs in the future.
Reviewers: arsenm
Subscribers: arsenm, wdng, nhaehnle, llvm-commits, yaxunl
Differential Revision: https://reviews.llvm.org/D24614
llvm-svn: 281781
Diffstat (limited to 'llvm/lib/Target/AMDGPU/R600ISelLowering.cpp')
-rw-r--r-- | llvm/lib/Target/AMDGPU/R600ISelLowering.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/Target/AMDGPU/R600ISelLowering.cpp b/llvm/lib/Target/AMDGPU/R600ISelLowering.cpp index 6b391de00d1..35e6c9d036b 100644 --- a/llvm/lib/Target/AMDGPU/R600ISelLowering.cpp +++ b/llvm/lib/Target/AMDGPU/R600ISelLowering.cpp @@ -1512,9 +1512,11 @@ SDValue R600TargetLowering::LowerFormalArguments( SmallVector<ISD::InputArg, 8> LocalIns; - getOriginalFunctionArgs(DAG, MF.getFunction(), Ins, LocalIns); - - AnalyzeFormalArguments(CCInfo, LocalIns); + if (AMDGPU::isShader(CallConv)) { + AnalyzeFormalArguments(CCInfo, Ins); + } else { + analyzeFormalArgumentsCompute(CCInfo, Ins); + } for (unsigned i = 0, e = Ins.size(); i < e; ++i) { CCValAssign &VA = ArgLocs[i]; |