[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)
commit3b67c8d0f7c6a15d802c6db377af7a57e39d67ba
treef49a4ac4985d70ff91a4e6e982222a462e6a54b8
parenta14b0114a3a8e400ba1da9d4c71207a27e611c5b
[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

llvm-svn: 231799
llvm/include/llvm/CodeGen/MachineInstr.h
llvm/include/llvm/CodeGen/MachineMemOperand.h
llvm/lib/CodeGen/BranchFolding.cpp