]> granicus.if.org Git - llvm/commit
CodeGen: Add a hook for getFenceOperandTy
authorYaxun Liu <Yaxun.Liu@amd.com>
Mon, 24 Apr 2017 18:26:27 +0000 (18:26 +0000)
committerYaxun Liu <Yaxun.Liu@amd.com>
Mon, 24 Apr 2017 18:26:27 +0000 (18:26 +0000)
commit76c532ddba8577842db46fc46dc50bf45d407ab0
tree2e254f95532317c95dab2fb0c043b74a3eb2fa9e
parent724559be8d800ad5359508ff5733425db5de617a
CodeGen: Add a hook for getFenceOperandTy

Currently the operand type for ATOMIC_FENCE assumes value type of a pointer in address space 0.
This is fine for most targets. However for amdgcn target, the size of pointer in address space 0
depends on triple environment. For amdgiz environment, it is 64 bit but for other environment it is
32 bit. On the other hand, amdgcn target expects 32 bit fence operands independent of the target
triple environment. Therefore a hook is need in target lowering for getting the fence operand type.

This patch has no effect on targets other than amdgcn.

Differential Revision: https://reviews.llvm.org/D32186

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301215 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Target/TargetLowering.h
lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
lib/Target/AMDGPU/AMDGPUISelLowering.h
lib/Target/AMDGPU/SIInstructions.td
test/CodeGen/AMDGPU/fence-amdgiz.ll [new file with mode: 0644]