]> granicus.if.org Git - llvm/commit
[DAG] Improve candidate pruning in store merge failure case. NFCI
authorNirav Dave <niravd@google.com>
Wed, 2 Aug 2017 16:35:58 +0000 (16:35 +0000)
committerNirav Dave <niravd@google.com>
Wed, 2 Aug 2017 16:35:58 +0000 (16:35 +0000)
commit29e9cdbd0d70fac18c2e6c652b3e9cdc6ceae064
tree8ce73b397847f9023f9bd4e2b04f30bb9a0406fb
parent749993640bf6072a68b0a52dbda5555944190beb
[DAG] Improve candidate pruning in store merge failure case. NFCI

During store merge we construct a sorted list of consecutive store
candidates and consider subsequences for merging into a single
store. For each subsequence we check if the stored value type is legal
the merged store would have valid and fast and if the constructed
value to be stored is valid. The only properties that affect this
check between subsequences is the size of the subsequence, the
alignment of the first store, the alignment of the stored load value
(when merging stores-of-loads), and whether the merged value is a
constant zero.

If we do not find a viable mergeable subsequence starting from the
first store of length N, we know that a subsequence starting at a
later store of length N will also fail unless the new store's
alignment, the new load's alignment (if we're merging store-of-loads),
or we've dropped stores of nonzero value and could construct a merged
stores of zero (for merging constants).

As a result if we fail to find a valid subsequence starting from the
first store we can safely skip considering subsequences that start
with subsequent stores unless one of the above properties is
true. This significantly (2x) improves compile time in some
pathological cases.

Reviewers: RKSimon, efriedma, zvi, spatel, waltl

Subscribers: grandinj, llvm-commits

Differential Revision: https://reviews.llvm.org/D35901

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309830 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/DAGCombiner.cpp