[llvm] 68b6cab - AMDGPU: Use getTypeAllocSize

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 6 18:37:28 PST 2023


Author: Matt Arsenault
Date: 2023-01-06T21:33:19-05:00
New Revision: 68b6cabd9e5511d22ba6f0a4102705dbc85d150f

URL: https://github.com/llvm/llvm-project/commit/68b6cabd9e5511d22ba6f0a4102705dbc85d150f
DIFF: https://github.com/llvm/llvm-project/commit/68b6cabd9e5511d22ba6f0a4102705dbc85d150f.diff

LOG: AMDGPU: Use getTypeAllocSize

Added: 
    

Modified: 
    llvm/lib/Target/AMDGPU/AMDGPUPrintfRuntimeBinding.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AMDGPU/AMDGPUPrintfRuntimeBinding.cpp b/llvm/lib/Target/AMDGPU/AMDGPUPrintfRuntimeBinding.cpp
index bafe83d149ab..b11b9546e7d1 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<Value *, 1> BuffOffset;
         BuffOffset.push_back(ConstantInt::get(I32Ty, ArgSize));
 


        


More information about the llvm-commits mailing list