[PATCH] D28251: [AArch64] Fix over-eager early-exit in load-store combiner

Chad Rosier via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 4 11:46:20 PST 2017


mcrosier added a comment.

If Jun doesn't oppose, this change LGTM.  However, before committing please rebase the patch with a more straight forward test case (i.e., see my previous comment).



================
Comment at: lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp:1473-1474
   int OffsetStride = IsUnscaled ? getMemScale(MI) : 1;
+  if (Offset > 0)
+    Offset -= OffsetStride;
   if (!inBoundsForPair(IsUnscaled, Offset, OffsetStride))
----------------
junbuml wrote:
> In which case, can you see better st/ld pairs with this change ?   Can you add a case if you have? Also, is there a case on which this change cause worse combinations of st/ld pairs? 
> 
> In some case, this change may unnecessarily call findMatchingInsn() : 
>  e.g., 
>   STR %XZR, %X0, 64  <--- we don't even need to try to look up pair for this
>   STR %XZR, %X0, 65
> 
In my limited testing (i.e., SPEC2006), this strictly increased the number of load/store pairs.


https://reviews.llvm.org/D28251





More information about the llvm-commits mailing list