[BranchFolding] Remove MMOs during tail merge to preserve dependencies.
authorChad Rosier <mcrosier@codeaurora.org>
Tue, 10 Mar 2015 16:22:52 +0000 (16:22 +0000)
committerChad Rosier <mcrosier@codeaurora.org>
Tue, 10 Mar 2015 16:22:52 +0000 (16:22 +0000)
commite891f49ad55fdca73093423b510ed4fb1ae75be6
tree1a43e24d12f63b785ce7514a4190f0d36b38104e
parentd472057ca23285b8d6cf3d4e203900272804e508
[BranchFolding] Remove MMOs during tail merge to preserve dependencies.

When tail merging it may be necessary to remove MMOs from memory operations to
ensures later passes (e.g., MI sched) conservatively compute dependencies.
Currently, we only remove the MMO from the common tail if the MMO doesn't match
with the relative instruction in the non-common tail(s).

A more robust solution would be to add multiple MMOs from the duplicate MIs to
the new MI. Currently ScheduleDAGInstrs.cpp ignores all MMOs on instructions
with multiple MMOs, so this solution is equivalent for the time being.

No test case included as this is incredibly difficult to reproduce.

Patch was a collaborative effort between Ana Pazos and myself.
Phabricator: http://reviews.llvm.org/D7769

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231799 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/MachineInstr.h
include/llvm/CodeGen/MachineMemOperand.h
lib/CodeGen/BranchFolding.cpp