diff options
author | Francis Visoiu Mistrih <francisvm@yahoo.com> | 2018-03-14 17:10:58 +0000 |
---|---|---|
committer | Francis Visoiu Mistrih <francisvm@yahoo.com> | 2018-03-14 17:10:58 +0000 |
commit | 084e7d8770a27a7caf80a6eb63fbe07d61c6b198 (patch) | |
tree | 9250e3ef9743a42581e9b8d06fd6e7ae6713afba /llvm/lib/CodeGen/MachineInstr.cpp | |
parent | bec5df2d05de26b136192d1a57e7638a703d2f06 (diff) | |
download | llvm-084e7d8770a27a7caf80a6eb63fbe07d61c6b198.zip llvm-084e7d8770a27a7caf80a6eb63fbe07d61c6b198.tar.gz llvm-084e7d8770a27a7caf80a6eb63fbe07d61c6b198.tar.bz2 |
[AArch64] Keep track of MIFlags in the LoadStoreOptimizer
Merging:
* $x26, $x25 = frame-setup LDPXi $sp, 0
* $sp = frame-destroy ADDXri $sp, 64, 0
into an LDPXpost should preserve the flags from both instructions as
following:
* frame-setup frame-destroy LDPXpost
Differential Revision: https://reviews.llvm.org/D44446
llvm-svn: 327533
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstr.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineInstr.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp index 5f3989b..3fbf50d 100644 --- a/llvm/lib/CodeGen/MachineInstr.cpp +++ b/llvm/lib/CodeGen/MachineInstr.cpp @@ -381,6 +381,12 @@ MachineInstr::mergeMemRefsWith(const MachineInstr& Other) { return std::make_pair(MemBegin, CombinedNumMemRefs); } +uint8_t MachineInstr::mergeFlagsWith(const MachineInstr &Other) const { + // For now, the just return the union of the flags. If the flags get more + // complicated over time, we might need more logic here. + return getFlags() | Other.getFlags(); +} + bool MachineInstr::hasPropertyInBundle(unsigned Mask, QueryType Type) const { assert(!isBundledWithPred() && "Must be called on bundle header"); for (MachineBasicBlock::const_instr_iterator MII = getIterator();; ++MII) { |