[PATCH] D133845: [llvm] increase upper bound for size in global structs

Ofek Shochat via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 15 00:32:11 PDT 2022


OfekShochat updated this revision to Diff 460311.
OfekShochat added a comment.
Herald added a subscriber: pengfei.

Add test


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D133845/new/

https://reviews.llvm.org/D133845

Files:
  llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
  llvm/test/CodeGen/X86/big-array-init.ll


Index: llvm/test/CodeGen/X86/big-array-init.ll
===================================================================
--- /dev/null
+++ llvm/test/CodeGen/X86/big-array-init.ll
@@ -0,0 +1,3 @@
+; CHECK-LABEL: bad_int:
+; CHECK-NEXT: 
+ at bad_int = global <{ i32, [1073741823 x i32] }> <{ i32 1, [1073741823 x i32] zeroinitializer }>, align 16
Index: llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
===================================================================
--- llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -3164,7 +3164,7 @@
                                      const Constant *BaseCV, uint64_t Offset,
                                      AsmPrinter::AliasMapTy *AliasList) {
   // Print the fields in successive locations. Pad to align if needed!
-  unsigned Size = DL.getTypeAllocSize(CS->getType());
+  uint64_t Size = DL.getTypeAllocSize(CS->getType());
   const StructLayout *Layout = DL.getStructLayout(CS->getType());
   uint64_t SizeSoFar = 0;
   for (unsigned I = 0, E = CS->getNumOperands(); I != E; ++I) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D133845.460311.patch
Type: text/x-patch
Size: 1066 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220915/1be9032b/attachment.bin>


More information about the llvm-commits mailing list