[PATCH] D118943: [DAGCombiner] Fix dependency analysis in checkMergeStoreCandidatesForDependencies

Bjorn Pettersson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 3 13:20:52 PST 2022


bjope created this revision.
bjope added reviewers: nadav, hoy, niravd, spatel.
Herald added subscribers: ecnelises, hiraditya, kristof.beyls.
bjope requested review of this revision.
Herald added a project: LLVM.

In the aftermath of D116895 <https://reviews.llvm.org/D116895> a problem was found in the analysis of
dependencies between store merge candidates in
checkMergeStoreCandidatesForDependencies, that is needed to avoid
the cycles are introduced in the DAG.

In the past it has been enough (or assumed to be enough) to start
scanning from non-chain operands when analysing the store merge
candidates for dependencies, assuming that the analysis of chain
dependencies performed when finding the candidates would cover
up for potential dependencies that exist involving the chain operands.
It was however discovered that one could end up with scenarios such
as descibed in the aarch64-checkMergeStoreCandidatesForDependencies.ll
test case, when the dependency between two stores is given by a mix
of chain operand dependencies and non-chain operand dependencies.

The fix in this patch make sure that we also account for chain operand
dependencies when doing the more elaborate analysis in
checkMergeStoreCandidatesForDependencies, no longer relying on that
the earlier check involving chain operands is enough.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D118943

Files:
  llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  llvm/test/CodeGen/AArch64/aarch64-checkMergeStoreCandidatesForDependencies.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D118943.405766.patch
Type: text/x-patch
Size: 5751 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220203/0408573c/attachment.bin>


More information about the llvm-commits mailing list