[PATCH] D16160: Make sure we preserve alignment information after hoisting invariant load

Johannes Doerfert via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 14 06:18:41 PST 2016


jdoerfert added a subscriber: jdoerfert.
jdoerfert added a comment.

Suggestion for a small improvement.


================
Comment at: lib/CodeGen/IslNodeBuilder.cpp:945
@@ +944,3 @@
+    if (LoadInst *PreloadInst = dyn_cast<LoadInst>(PreloadVal))
+      PreloadInst->setAlignment(dyn_cast<LoadInst>(AccInst)->getAlignment());
+
----------------
Why do you try to find LoadInst after the call to "preloadUnconditionally" and set the alignment there instead of in the ditonally function when the load is actually created?

I would suggest to change the last argument from AccInstTy to AccInst and set the alignment then inside the function. What do you say?


Repository:
  rL LLVM

http://reviews.llvm.org/D16160





More information about the llvm-commits mailing list