[PATCH] D102822: [Clang][CodeGen] Set the size of llvm.lifetime to unknown for scalable types.
    Sander de Smalen via Phabricator via cfe-commits 
    cfe-commits at lists.llvm.org
       
    Thu Jun  3 00:36:31 PDT 2021
    
    
  
sdesmalen added inline comments.
================
Comment at: clang/lib/CodeGen/CGDecl.cpp:1327
+  if (Size.isScalable())
+    Size = llvm::TypeSize::Fixed(-1);
+
----------------
Instead of updating `Size` here, can you change line 1332 to be:
  llvm::Value *SizeV = llvm::ConstantInt::get(Int64Ty, Size.isScalable() ? -1 : Size.getFixedValue())
================
Comment at: clang/lib/CodeGen/CGDecl.cpp:1332
          "Pointer should be in alloca address space");
   llvm::Value *SizeV = llvm::ConstantInt::get(Int64Ty, Size);
   Addr = Builder.CreateBitCast(Addr, AllocaInt8PtrTy);
----------------
Does `ConstantInt` take `TypeSize Size` as argument?
================
Comment at: clang/lib/CodeGen/CGDecl.cpp:1558
           emission.SizeForLifetimeMarkers =
-              size.isScalable() ? EmitLifetimeStart(-1, AllocaAddr.getPointer())
-                                : EmitLifetimeStart(size.getFixedSize(),
-                                                    AllocaAddr.getPointer());
+              EmitLifetimeStart(size, AllocaAddr.getPointer());
         }
----------------
nit: Given you have to update this line, maybe also to capitalize `size -> Size`?
Repository:
  rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102822/new/
https://reviews.llvm.org/D102822
    
    
More information about the cfe-commits
mailing list