[PATCH] D11033: Respect alignment when loading up a coerced function argument
John McCall
rjmccall at gmail.com
Wed Jul 8 17:03:58 PDT 2015
rjmccall added a comment.
This is great, thank you for tackling it.
================
Comment at: lib/CodeGen/CGCall.cpp:929
@@ -927,3 +928,3 @@
if (SrcTy == Ty)
return CGF.Builder.CreateLoad(SrcPtr);
----------------
Missed this one.
================
Comment at: lib/CodeGen/CGCall.cpp:988
@@ -988,5 +987,3 @@
llvm::Value *Elt = CGF.Builder.CreateExtractValue(Val, i);
- llvm::StoreInst *SI = CGF.Builder.CreateStore(Elt, EltPtr,
- DestIsVolatile);
- if (LowAlignment)
- SI->setAlignment(1);
+ CGF.Builder.CreateAlignedStore(Elt, EltPtr, DestAlign.getQuantity(),
+ DestIsVolatile);
----------------
Only DestPtr has alignment DestAlign. For the individual elements, you'll need to use alignmentAtOffset.
================
Comment at: lib/CodeGen/CGCall.cpp:1012
@@ -1013,3 +1011,3 @@
if (SrcTy == DstTy) {
CGF.Builder.CreateStore(Src, DstPtr, DstIsVolatile);
return;
----------------
Missed this one.
http://reviews.llvm.org/D11033
More information about the cfe-commits
mailing list