From 603544863f747985eb3801ea5f43836c6bbc7df5 Mon Sep 17 00:00:00 2001 From: Siddharth Bhat Date: Tue, 22 Aug 2017 09:27:41 +0000 Subject: [PATCH] [ManagedMemoryRewrite] Get size in bytes rather than in bits and dividing by 8. llvm-svn: 311439 --- polly/lib/CodeGen/ManagedMemoryRewrite.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polly/lib/CodeGen/ManagedMemoryRewrite.cpp b/polly/lib/CodeGen/ManagedMemoryRewrite.cpp index 4546dcb458c9..5f62ea6b3d3c 100644 --- a/polly/lib/CodeGen/ManagedMemoryRewrite.cpp +++ b/polly/lib/CodeGen/ManagedMemoryRewrite.cpp @@ -244,7 +244,7 @@ replaceGlobalArray(Module &M, const DataLayout &DL, GlobalVariable &Array, BasicBlock *Start = BasicBlock::Create(M.getContext(), "entry", F); Builder.SetInsertPoint(Start); - int ArraySizeInt = DL.getTypeAllocSizeInBits(ArrayTy) / 8; + const uint64_t ArraySizeInt = DL.getTypeAllocSize(ArrayTy); Value *ArraySize = Builder.getInt64(ArraySizeInt); ArraySize->setName("array.size");