[PATCH] [Polly] Align copied load/store instructions as the original.

David Peixotto dpeixott at codeaurora.org
Wed Oct 1 09:52:04 PDT 2014


LGTM. Could also fold the alignment setting into the creation.

================
Comment at: lib/CodeGen/BlockGenerators.cpp:226
@@ -226,1 +225,3 @@
+  LoadInst *ScalarLoad =
       Builder.CreateLoad(NewPointer, Load->getName() + "_p_scalar_");
+  ScalarLoad->setAlignment(Load->getAlignment());
----------------
You could use `Builder.CreateAlignedLoad` here.

================
Comment at: lib/CodeGen/BlockGenerators.cpp:241
@@ -239,2 +240,3 @@
 
-  return Builder.CreateStore(ValueOperand, NewPointer);
+  StoreInst *NewStore = Builder.CreateStore(ValueOperand, NewPointer);
+  NewStore->setAlignment(Store->getAlignment());
----------------
Could use `Builder.CreateAlignedStore` here.

http://reviews.llvm.org/D5559






More information about the llvm-commits mailing list