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

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 11 09:06:19 PDT 2018


dmgreen added a comment.

Hello.



================
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(
----------------
arsenm wrote:
> This should just use getAlignment() rather than looking at the two underlying alignments?
I'm not sure what you mean by two underlying alignments. Do you mean use LD->getAlignment(), not LD->getOriginalAlignment()?

The Align passed to getExtLoad seems to be treated as a base align, not a base+offset align.


https://reviews.llvm.org/D48029





More information about the llvm-commits mailing list