[PATCH] D16425: [opaque pointer types] [NFC] isDereferenceable{, AndAligned}Pointer: take the accessed size (and alignment) as arguments.

Eduard Burtescu via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 21 18:39:55 PST 2016


eddyb added inline comments.

================
Comment at: lib/Transforms/IPO/ArgumentPromotion.cpp:432
@@ -430,3 +431,3 @@
 /// arguments passed in.
-bool ArgPromotion::isSafeToPromoteArgument(Argument *Arg,
+bool ArgPromotion::isSafeToPromoteArgument(Argument *Arg, Type *ElemTy,
                                            bool isByValOrInAlloca,
----------------
mjacob wrote:
> eddyb wrote:
> > mjacob wrote:
> > > Can we pass the size instead of pointee type here?
> > Yes, but the method is local to this file and all the callers already have a type.
> > Passing a size means using `DL.getTypeStoreSize` at each call site, which is anti-DRY IMO.
> This is a tradeoff we have to make anyway. E.g. in this revision you introduce more calls to `DL.getTypeStoreSize()` than you remove. IMHO there is no way to avoid this if we want to make pointers opaque.
> 
> Anyway, `isSafeToPromoteArgument()` has only two callers, one of these is the method itself.
Odd, I must've misread something else, I thought I saw half a dozen calls. Fair enough then.


http://reviews.llvm.org/D16425





More information about the llvm-commits mailing list