diff --git a/llvm/lib/Target/AMDGPU/SIInstructions.td b/llvm/lib/Target/AMDGPU/SIInstructions.td index c7837748ebd6a..380b6dd7a6e76 100644 --- a/llvm/lib/Target/AMDGPU/SIInstructions.td +++ b/llvm/lib/Target/AMDGPU/SIInstructions.td @@ -1123,6 +1123,8 @@ def : BitConvert ; def : BitConvert ; def : BitConvert ; def : BitConvert ; +def : BitConvert ; +def : BitConvert ; // 160-bit bitcast def : BitConvert ; diff --git a/llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.ll b/llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.ll index 8afe401746bbe..ce1b7ef01f82a 100644 --- a/llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.ll +++ b/llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.ll @@ -287,3 +287,14 @@ define amdgpu_kernel void @v2i32_to_v4f16(<4 x half> addrspace(1)* %out, <2 x i3 store <4 x half> %add.bitcast, <4 x half> addrspace(1)* %out ret void } + +declare <4 x float> @llvm.amdgcn.s.buffer.load.v4f32(<4 x i32>, i32, i32 immarg) + +; FUNC-LABEL: {{^}}bitcast_v4f32_to_v2i64: +; GCN: s_buffer_load_dwordx4 +define <2 x i64> @bitcast_v4f32_to_v2i64(<2 x i64> %arg) { + %val = call <4 x float> @llvm.amdgcn.s.buffer.load.v4f32(<4 x i32> undef, i32 0, i32 0) + %cast = bitcast <4 x float> %val to <2 x i64> + %div = udiv <2 x i64> %cast, %arg + ret <2 x i64> %div +}