1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00
llvm-mirror/test/CodeGen/AMDGPU/propagate-attributes-bitcast-function.ll
Jay Foad 02f664086c [AMDGPU] Fix offset for REL32_HI relocs
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.

Differential Revision: https://reviews.llvm.org/D86938
2020-09-02 10:55:55 +01:00

24 lines
634 B
LLVM

; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1010 -verify-machineinstrs < %s | FileCheck -check-prefix=GCN %s
; GCN: foo1:
; v_cndmask_b32_e64 v0, 0, 1, vcc_lo{{$}}
; GCN: kernel1:
; GCN: foo1@gotpcrel32@lo+4
; GCN: foo1@gotpcrel32@hi+12
define void @foo1(i32 %x) #1 {
entry:
%cc = icmp eq i32 %x, 0
store volatile i1 %cc, i1* undef
ret void
}
define amdgpu_kernel void @kernel1(float %x) #0 {
entry:
call void bitcast (void (i32)* @foo1 to void (float)*)(float %x)
ret void
}
attributes #0 = { nounwind "target-features"="+wavefrontsize32" }
attributes #1 = { noinline nounwind "target-features"="+wavefrontsize64" }