[PATCH] D86938: [AMDGPU] Fix offset for REL32_HI relocs

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 1 06:56:05 PDT 2020


foad created this revision.
Herald added subscribers: llvm-commits, kerbowa, arphaman, hiraditya, t-tye, tpr, dstuttard, yaxunl, nhaehnle, jvesely, kzhuravl, arsenm.
Herald added a reviewer: jdoerfert.
Herald added a project: LLVM.
foad requested review of this revision.
Herald added a subscriber: wdng.

The addend in a REL32 reloc needs to be adjusted to account for the
offset from the PC value returned by the s_getpc instruction to the
point where the reloc is applied. This was being done correctly for
(GOTPC)REL32_LO but not for (GOTPC)REL32_HI. This will only make a
difference if the target symbol happens to get loaded almost exactly
a multiple of 4G away from the relocated instructions.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D86938

Files:
  llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
  llvm/lib/Target/AMDGPU/SIISelLowering.cpp
  llvm/test/CodeGen/AMDGPU/GlobalISel/divergent-control-flow.ll
  llvm/test/CodeGen/AMDGPU/GlobalISel/dynamic-alloca-uniform.ll
  llvm/test/CodeGen/AMDGPU/GlobalISel/global-value.ll
  llvm/test/CodeGen/AMDGPU/GlobalISel/localizer.ll
  llvm/test/CodeGen/AMDGPU/amdgpu-codegenprepare-fold-binop-select.ll
  llvm/test/CodeGen/AMDGPU/asm-printer-check-vcc.mir
  llvm/test/CodeGen/AMDGPU/call-argument-types.ll
  llvm/test/CodeGen/AMDGPU/call-constexpr.ll
  llvm/test/CodeGen/AMDGPU/call-preserved-registers.ll
  llvm/test/CodeGen/AMDGPU/call-waitcnt.ll
  llvm/test/CodeGen/AMDGPU/callee-special-input-sgprs.ll
  llvm/test/CodeGen/AMDGPU/captured-frame-index.ll
  llvm/test/CodeGen/AMDGPU/cc-update.ll
  llvm/test/CodeGen/AMDGPU/cross-block-use-is-not-abi-copy.ll
  llvm/test/CodeGen/AMDGPU/function-call-relocs.ll
  llvm/test/CodeGen/AMDGPU/global-constant.ll
  llvm/test/CodeGen/AMDGPU/global-variable-relocs.ll
  llvm/test/CodeGen/AMDGPU/indirect-call.ll
  llvm/test/CodeGen/AMDGPU/mem-builtins.ll
  llvm/test/CodeGen/AMDGPU/mul24-pass-ordering.ll
  llvm/test/CodeGen/AMDGPU/propagate-attributes-bitcast-function.ll
  llvm/test/CodeGen/AMDGPU/propagate-attributes-clone.ll
  llvm/test/CodeGen/AMDGPU/propagate-attributes-single-set.ll
  llvm/test/CodeGen/AMDGPU/reassoc-scalar.ll
  llvm/test/CodeGen/AMDGPU/rel32.ll
  llvm/test/CodeGen/AMDGPU/sibling-call.ll
  llvm/test/CodeGen/AMDGPU/stack-pointer-offset-relative-frameindex.ll
  llvm/test/CodeGen/AMDGPU/vgpr-tuple-allocation.ll
  llvm/test/CodeGen/MIR/AMDGPU/target-flags.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D86938.289156.patch
Type: text/x-patch
Size: 62330 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200901/2efb29ec/attachment.bin>


More information about the llvm-commits mailing list