[PATCH] Update InstCombine to transform aggregate loads into scalar loads.

Philip Reames listmail at philipreames.com
Mon Apr 20 18:51:06 PDT 2015


================
Comment at: lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp:517
@@ +516,3 @@
+                                               ".unpack");
+      Instruction *V = InsertValueInst::Create(
+        UndefValue::get(T), NewLoad, 0, LI.getName());
----------------
deadalnix wrote:
> reames wrote:
> > You're missing the setPointerOperand step.  Technically, the first element doesn't have to start at the beginning of the object.  I think this is fine in practice, but there's a theoretical issue here.  
> I'm not sure how this is possible at all.
Unless the struct is packed, the data layout alignment could require that the internal field be aligned to a higher alignment than the struct.  This would be a weird arrangement, but I believe it's possible.

http://reviews.llvm.org/D8339

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list