Prevent construction of cycle in DAG store merge
authorNirav Dave <niravd@google.com>
Fri, 25 Mar 2016 21:06:30 +0000 (21:06 +0000)
committerNirav Dave <niravd@google.com>
Fri, 25 Mar 2016 21:06:30 +0000 (21:06 +0000)
commitfa250cad3715a5df114cc5916e3b6f70560f9116
tree6823aa57153ca93a14ecd0ba2acf7adf901fdb2b
parent7dcae2e14ad46ce59aa9e283210e098abd773ecc
Prevent construction of cycle in DAG store merge

When merging stores in DAGCombiner, add check to ensure that no
dependenices exist that would cause the construction of a cycle in our
DAG.  This may happen if one store has a data dependence on another
instruction (e.g. a load) which itself has a (chain) dependence on
another store being merged. These stores cannot be merged safely and
doing so results in a cycle that is discovered in LegalizeDAG.

This test is only done in cases where Antialias analysis is used (UseAA)
as non-AA store merge candidates will be merged logically after all
loads which have been checked to not alias.

Reviewers: ahatanak, spatel, niravd, arsenm, hfinkel, tstellarAMD, jyknight

Subscribers: llvm-commits, tberghammer, danalbert, srhines

Differential Revision: http://reviews.llvm.org/D18336

llvm-svn: 264461
llvm/include/llvm/CodeGen/SelectionDAGNodes.h
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
llvm/test/CodeGen/AArch64/vector_merge_dep_check.ll [new file with mode: 0644]