[PATCH] D107345: Introduce LowerGCLeafIntrinsics pass
Artur Pilipenko via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 4 21:16:22 PDT 2021
apilipenko added a comment.
There is a target-specific hook to emit code for regular (non-atomic) memcpys: EmitTargetCodeForMemcpy. Maybe we should just implement a similar hook for element-atomic copy?
================
Comment at: llvm/lib/Transforms/Scalar/LowerGCLeafIntrinsics.cpp:67-68
+ if (!LenType->isIntegerTy(64)) {
+ assert(LenInBytes->getType()->isIntegerTy(32) &&
+ "Only 32 and 64-bit lengths are allowed!");
+ LenInBytes = Builder.CreateZExt(LenInBytes, Type::getInt64Ty(C),
----------------
LangRef doesn't prohibit other length types.
================
Comment at: llvm/lib/Transforms/Scalar/LowerGCLeafIntrinsics.cpp:128-131
+ LoadInst *Val = Builder.CreateLoad(ValueType, SrcBC, "vec");
+ Val->setAlignment(Align(ElementSizeInBytes));
+ Value *DestBC = Builder.CreateBitCast(Dest, DestValuePtrType, "dst.vec");
+ StoreInst *Store = Builder.CreateStore(Val, DestBC);
----------------
These loads and stores must be at least ElementSizeInBytes-atomic. I'm not sure you can express this in the IR at the moment.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D107345/new/
https://reviews.llvm.org/D107345
More information about the llvm-commits
mailing list