[PATCH] D36841: [SimplifyCFG] Fix for PR34219: Preserve alignment after merging conditional stores.

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 28 13:21:29 PDT 2017


ABataev added inline comments.


================
Comment at: lib/Transforms/Utils/SimplifyCFG.cpp:2969
   PStore->getAAMetadata(AAMD, /*Merge=*/false);
   PStore->getAAMetadata(AAMD, /*Merge=*/true);
   SI->setAAMetadata(AAMD);
----------------
efriedma wrote:
> efriedma wrote:
> > This looks weird; why are we calling "PStore->getAAMetadata" twice?
> No comment on the getAAMetadata() calls?
I don't know what's going here, it is another problem. I just want to fix one PR here. 


================
Comment at: lib/Transforms/Utils/SimplifyCFG.cpp:2976
+    // Choose the first non-zero alignment, if any.
+    SI->setAlignment(MaxAlignment);
 
----------------
efriedma wrote:
> This isn't really handling zero alignment correctly; to get the right number here, you have to convert to the actual alignment using datalayout.  (I'm planning to write a patch soon to get rid of this whole zero alignment crap; it's unnecessary given that datalayout is now mandatory, and it's bitten us too many times.)
> 
> It would be nice to have a comment briefly explaining why we pick the minimum.
Ok, will do this, but tomorrow.


https://reviews.llvm.org/D36841





More information about the llvm-commits mailing list