[PATCH] D27157: IRGen: Remove all uses of CreateDefaultAlignedLoad.

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 28 13:33:19 PST 2016


rjmccall added inline comments.


================
Comment at: clang/lib/CodeGen/CGBuilder.h:126
   // FIXME: these "default-aligned" APIs should be removed,
   // but I don't feel like fixing all the builtin code right now.
   llvm::StoreInst *CreateDefaultAlignedStore(llvm::Value *Val,
----------------
Oh, please remove this comment, too, since you've now achieved it. :)


================
Comment at: clang/lib/CodeGen/CGBuiltin.cpp:2195
     LoadInst *Load =
-        Builder.CreateDefaultAlignedLoad(IntToPtr, /*isVolatile=*/true);
+        Builder.CreateAlignedLoad(IntTy, IntToPtr, CharUnits::fromQuantity(4));
+    Load->setVolatile(true);
----------------
pcc wrote:
> rjmccall wrote:
> > Why 4?
> __readfsdword is a Windows intrinsic which returns an unsigned long, which always has size/alignment 4 on Windows.
> 
> But now that I think about it I suppose we can get here on other platforms with MS extensions enabled, so I've changed this  to query the alignment.
Thanks.


https://reviews.llvm.org/D27157





More information about the cfe-commits mailing list