summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/AMDGPU
diff options
context:
space:
mode:
authorManuel Jacob <me@manueljacob.de>2016-01-16 20:30:46 +0000
committerManuel Jacob <me@manueljacob.de>2016-01-16 20:30:46 +0000
commit5f6eaac6115a44f4ef3d819123f8694d3d5825ea (patch)
tree4f2535126e469abb4e8af765dcd1692ec466424a /llvm/lib/Target/AMDGPU
parent7cdedc1e029ea5860f9077abb39013ae7cc6e9cf (diff)
downloadbcm5719-llvm-5f6eaac6115a44f4ef3d819123f8694d3d5825ea.tar.gz
bcm5719-llvm-5f6eaac6115a44f4ef3d819123f8694d3d5825ea.zip
GlobalValue: use getValueType() instead of getType()->getPointerElementType().
Reviewers: mjacob Subscribers: jholewinski, arsenm, dsanders, dblaikie Patch by Eduard Burtescu. Differential Revision: http://reviews.llvm.org/D16260 llvm-svn: 257999
Diffstat (limited to 'llvm/lib/Target/AMDGPU')
-rw-r--r--llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp4
-rw-r--r--llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp5
2 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp b/llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
index 1a59a460ee7..3589a0daceb 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
@@ -808,7 +808,7 @@ SDValue AMDGPUTargetLowering::LowerGlobalAddress(AMDGPUMachineFunction* MFI,
unsigned Offset;
if (MFI->LocalMemoryObjects.count(GV) == 0) {
- uint64_t Size = DL.getTypeAllocSize(GV->getType()->getElementType());
+ uint64_t Size = DL.getTypeAllocSize(GV->getValueType());
Offset = MFI->LDSSize;
MFI->LocalMemoryObjects[GV] = Offset;
// XXX: Account for alignment?
@@ -822,7 +822,7 @@ SDValue AMDGPUTargetLowering::LowerGlobalAddress(AMDGPUMachineFunction* MFI,
}
case AMDGPUAS::CONSTANT_ADDRESS: {
MachineFrameInfo *FrameInfo = DAG.getMachineFunction().getFrameInfo();
- Type *EltType = GV->getType()->getElementType();
+ Type *EltType = GV->getValueType();
unsigned Size = DL.getTypeAllocSize(EltType);
unsigned Alignment = DL.getPrefTypeAlignment(EltType);
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp b/llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp
index 87d50d58705..393cb791931 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp
@@ -78,8 +78,7 @@ bool AMDGPUPromoteAlloca::runOnFunction(Function &F) {
for (Module::global_iterator I = Mod->global_begin(),
E = Mod->global_end(); I != E; ++I) {
GlobalVariable *GV = &*I;
- PointerType *GVTy = GV->getType();
- if (GVTy->getAddressSpace() != AMDGPUAS::LOCAL_ADDRESS)
+ if (GV->getType()->getAddressSpace() != AMDGPUAS::LOCAL_ADDRESS)
continue;
for (Value::use_iterator U = GV->use_begin(),
UE = GV->use_end(); U != UE; ++U) {
@@ -88,7 +87,7 @@ bool AMDGPUPromoteAlloca::runOnFunction(Function &F) {
continue;
if (Use->getParent()->getParent() == &F)
LocalMemAvailable -=
- Mod->getDataLayout().getTypeAllocSize(GVTy->getElementType());
+ Mod->getDataLayout().getTypeAllocSize(GV->getValueType());
}
}
}
OpenPOWER on IntegriCloud