[llvm] r341806 - AMDGPU: Remove function pointer type hack
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 10 05:16:12 PDT 2018
Author: arsenm
Date: Mon Sep 10 05:16:11 2018
New Revision: 341806
URL: http://llvm.org/viewvc/llvm-project?rev=341806&view=rev
Log:
AMDGPU: Remove function pointer type hack
Now the pointer size should always be correct and
we don't need to improperly inspect the pointee type.
Modified:
llvm/trunk/lib/Target/AMDGPU/SIISelLowering.cpp
Modified: llvm/trunk/lib/Target/AMDGPU/SIISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/SIISelLowering.cpp?rev=341806&r1=341805&r2=341806&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/SIISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/SIISelLowering.cpp Mon Sep 10 05:16:11 2018
@@ -4418,18 +4418,15 @@ SDValue SITargetLowering::LowerGlobalAdd
SelectionDAG &DAG) const {
GlobalAddressSDNode *GSD = cast<GlobalAddressSDNode>(Op);
const GlobalValue *GV = GSD->getGlobal();
-
- if (GSD->getAddressSpace() != AMDGPUAS::CONSTANT_ADDRESS &&
- GSD->getAddressSpace() != AMDGPUAS::CONSTANT_ADDRESS_32BIT &&
- GSD->getAddressSpace() != AMDGPUAS::GLOBAL_ADDRESS &&
- // FIXME: It isn't correct to rely on the type of the pointer. This should
- // be removed when address space 0 is 64-bit.
- !GV->getType()->getElementType()->isFunctionTy())
+ if (GSD->getAddressSpace() == AMDGPUAS::LOCAL_ADDRESS ||
+ GSD->getAddressSpace() == AMDGPUAS::REGION_ADDRESS ||
+ GSD->getAddressSpace() == AMDGPUAS::PRIVATE_ADDRESS)
return AMDGPUTargetLowering::LowerGlobalAddress(MFI, Op, DAG);
SDLoc DL(GSD);
EVT PtrVT = Op.getValueType();
+ // FIXME: Should not make address space based decisions here.
if (shouldEmitFixup(GV))
return buildPCRelGlobalAddress(DAG, GV, DL, GSD->getOffset(), PtrVT);
else if (shouldEmitPCReloc(GV))
More information about the llvm-commits
mailing list