[PATCH] D45372: [AMDGPU] Fix issues for backend divergence tracking

David Stuttard via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 6 08:27:17 PDT 2018


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

A change to use divergence analysis in the AMDGPU backend was getting formal
arguments incorrect (not tagged as divergent) unless they were VGPR0, VGPR1 or
VGPR2

For graphics shaders it is possible to have more than these passed in as VGPR

Modified the checking code to check for any VGPR registers passed in as formal
arguments.

Also, some intrinsics that are sources of divergence may have been lowered
during instruction selection and are missed on subsequent calls to
isSDNodeSourceOfDivergence - added the relevant AMDGPUISD checks as well.

Finally, the FunctionLoweringInfo tracks virtual registers that are live across
basic block boundaries. This is used to check for divergence of CopyFromRegister
registers using the DivergenceAnalysis analysis. For multiple blocks the lazily
evaluated inverted map VirtReg2Value was not cleared when the ValueMap map was.


Repository:
  rL LLVM

https://reviews.llvm.org/D45372

Files:
  lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
  lib/Target/AMDGPU/AMDGPUISelLowering.cpp
  test/CodeGen/AMDGPU/diverge-extra-formal-args.ll
  test/CodeGen/AMDGPU/diverge-interp-mov-lower.ll
  test/CodeGen/AMDGPU/diverge-multi-func.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D45372.141350.patch
Type: text/x-patch
Size: 9686 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180406/855b289d/attachment.bin>


More information about the llvm-commits mailing list