[PATCH] D14138: Fix two issues in MergeConsecutiveStores:

James Y Knight via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 27 20:24:58 PDT 2015


jyknight created this revision.
jyknight added reviewers: spatel, majnemer.
jyknight added a subscriber: llvm-commits.

1) PR25154. This is basically a repeat of PR18102, which was fixed in
r200201, and broken again by r234430. The latter changed which of the
store nodes was merged into from the first to the last. Thus, we now
also need to prefer merging a later store at a given address into the
target node, instead of an earlier one.

2) While investigating that, I also realized I'd introduced a bug in
r236850. There, I removed a check for alignment -- not realizing that
nothing except the alignment check was ensuring that none of the stores
were overlapping! This is a really bogus way to ensure there's no
aliased stores.

A better solution to both of these issues is likely to always use the
code added in the 'if (UseAA)' branches which rearrange the chain based
on a more principled analysis. I'll look into whether that can be used
always, but in the interest of getting things back to working, I think a
minimal change makes sense.

http://reviews.llvm.org/D14138

Files:
  lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  test/CodeGen/X86/MergeConsecutiveStores.ll
  test/CodeGen/X86/dag-merge-fast-accesses.ll
  test/CodeGen/X86/stores-merging.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14138.38625.patch
Type: text/x-patch
Size: 6049 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151028/79335b71/attachment.bin>


More information about the llvm-commits mailing list