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

Philip Reames listmail at philipreames.com
Mon Apr 20 17:24:48 PDT 2015

With Pete's comments addressed and the missing setPointerOperand(gep struct, 0) added, LGTM.

Comment at: lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp:517
@@ +516,3 @@
+                                               ".unpack");
+      Instruction *V = InsertValueInst::Create(
+        UndefValue::get(T), NewLoad, 0, LI.getName());
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.



More information about the llvm-commits mailing list