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

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Nov 27 22:07:15 PST 2016

rjmccall added a comment.

Thanks for doing this!  A couple minor questions / comments.

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);
Why 4?

Comment at: clang/lib/CodeGen/TargetInfo.cpp:3560
+        TyHi, CGF.Builder.CreateBitCast(RegHiAddr, PTyHi),
+        CharUnits::fromQuantity(getDataLayout().getABITypeAlignment(TyHi)));
     CharUnits Offset = CharUnits::fromQuantity(
Please leave a comment mentioning that this is probably pessimistic.


More information about the cfe-commits mailing list