From 68b6cabd9e5511d22ba6f0a4102705dbc85d150f Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Fri, 6 Jan 2023 18:34:04 -0500 Subject: [PATCH] AMDGPU: Use getTypeAllocSize --- llvm/lib/Target/AMDGPU/AMDGPUPrintfRuntimeBinding.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/llvm/lib/Target/AMDGPU/AMDGPUPrintfRuntimeBinding.cpp b/llvm/lib/Target/AMDGPU/AMDGPUPrintfRuntimeBinding.cpp index bafe83d..b11b954 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPUPrintfRuntimeBinding.cpp +++ b/llvm/lib/Target/AMDGPU/AMDGPUPrintfRuntimeBinding.cpp @@ -213,8 +213,7 @@ bool AMDGPUPrintfRuntimeBindingImpl::lowerPrintfForGpu(Module &M) { ArgCount++) { Value *Arg = CI->getArgOperand(ArgCount); Type *ArgType = Arg->getType(); - unsigned ArgSize = TD->getTypeAllocSizeInBits(ArgType); - ArgSize = ArgSize / 8; + unsigned ArgSize = TD->getTypeAllocSize(ArgType); // // ArgSize by design should be a multiple of DWORD_ALIGN, // expand the arguments that do not follow this rule. @@ -235,8 +234,7 @@ bool AMDGPUPrintfRuntimeBindingImpl::lowerPrintfForGpu(Module &M) { else Arg = Builder.CreateSExt(Arg, ResType); ArgType = Arg->getType(); - ArgSize = TD->getTypeAllocSizeInBits(ArgType); - ArgSize = ArgSize / 8; + ArgSize = TD->getTypeAllocSize(ArgType); CI->setOperand(ArgCount, Arg); } if (OpConvSpecifiers[ArgCount - 1] == 'f') { @@ -516,7 +514,7 @@ bool AMDGPUPrintfRuntimeBindingImpl::lowerPrintfForGpu(Module &M) { } for (unsigned I = 0, E = WhatToStore.size(); I != E; ++I) { Value *TheBtCast = WhatToStore[I]; - unsigned ArgSize = TD->getTypeAllocSizeInBits(TheBtCast->getType()) / 8; + unsigned ArgSize = TD->getTypeAllocSize(TheBtCast->getType()); SmallVector BuffOffset; BuffOffset.push_back(ConstantInt::get(I32Ty, ArgSize)); -- 2.7.4