[PATCH] D48978: AMDGPU: Fix handling of alignment padding in DAG argument lowering

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 5 09:35:16 PDT 2018


arsenm created this revision.
arsenm added reviewers: tstellar, kzhuravl.
Herald added subscribers: t-tye, tpr, dstuttard, yaxunl, nhaehnle, wdng.

This was completely broken if there was ever a struct argument, as
this information is thrown away during the argument analysis.

      

The offsets as passed in to LowerFormalArguments are not useful,
as they partially depend on the legalized result register type,
and they don't consider the alignment in the first place.

      

Ignore the Ins array, and instead figure out from the raw IR type
what we need to do. This seems to fix the padding computation
if the DAG lowering is forced (and stops breaking arguments
following padded arguments if the arguments were only partially
lowered in the IR)


https://reviews.llvm.org/D48978

Files:
  lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
  lib/Target/AMDGPU/AMDGPUISelLowering.cpp
  lib/Target/AMDGPU/AMDGPUISelLowering.h
  lib/Target/AMDGPU/AMDGPULowerKernelArguments.cpp
  lib/Target/AMDGPU/AMDGPUMachineFunction.cpp
  lib/Target/AMDGPU/AMDGPUMachineFunction.h
  lib/Target/AMDGPU/AMDGPUSubtarget.cpp
  lib/Target/AMDGPU/AMDGPUSubtarget.h
  lib/Target/AMDGPU/R600.td
  lib/Target/AMDGPU/R600ISelLowering.cpp
  lib/Target/AMDGPU/SIISelLowering.cpp
  lib/Target/AMDGPU/SIMachineFunctionInfo.cpp
  test/CodeGen/AMDGPU/kernel-args.ll
  test/CodeGen/AMDGPU/kernel-argument-dag-lowering.ll
  test/CodeGen/AMDGPU/llvm.amdgcn.implicitarg.ptr.ll
  test/CodeGen/AMDGPU/llvm.amdgcn.kernarg.segment.ptr.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48978.154256.patch
Type: text/x-patch
Size: 39659 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180705/bc9c6640/attachment.bin>


More information about the llvm-commits mailing list