[PATCH] D48029: [DAGCombine] Fix alignment for offset loads/stores

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 11 08:38:39 PDT 2018


arsenm added inline comments.


================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:12185-12186
     if (unsigned Align = DAG.InferPtrAlignment(Ptr)) {
-      if (Align > LD->getMemOperand()->getBaseAlignment()) {
+      if (Align > LD->getOriginalAlignment() &&
+          LD->getSrcValueOffset() % Align == 0) {
         SDValue NewLoad = DAG.getExtLoad(
----------------
This should just use getAlignment() rather than looking at the two underlying alignments?


https://reviews.llvm.org/D48029





More information about the llvm-commits mailing list