summaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/BranchFolding.cpp
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2016-01-13 19:58:01 +0000
committerdim <dim@FreeBSD.org>2016-01-13 19:58:01 +0000
commite39b9e36e5f2d2dd312004cf5f84bb382be47dcd (patch)
tree7376a0c71aad05d327e5b1dcbceb3311a10f9f29 /lib/CodeGen/BranchFolding.cpp
parentff2ba393a56d9d99dcb76ceada542233db28af9a (diff)
downloadFreeBSD-src-e39b9e36e5f2d2dd312004cf5f84bb382be47dcd.zip
FreeBSD-src-e39b9e36e5f2d2dd312004cf5f84bb382be47dcd.tar.gz
Vendor import of llvm trunk r257626:
https://llvm.org/svn/llvm-project/llvm/trunk@257626
Diffstat (limited to 'lib/CodeGen/BranchFolding.cpp')
-rw-r--r--lib/CodeGen/BranchFolding.cpp15
1 files changed, 1 insertions, 14 deletions
diff --git a/lib/CodeGen/BranchFolding.cpp b/lib/CodeGen/BranchFolding.cpp
index 604feed..df5cac5 100644
--- a/lib/CodeGen/BranchFolding.cpp
+++ b/lib/CodeGen/BranchFolding.cpp
@@ -744,18 +744,6 @@ bool BranchFolder::CreateCommonTailOnlyBlock(MachineBasicBlock *&PredBB,
return true;
}
-static bool hasIdenticalMMOs(const MachineInstr *MI1, const MachineInstr *MI2) {
- auto I1 = MI1->memoperands_begin(), E1 = MI1->memoperands_end();
- auto I2 = MI2->memoperands_begin(), E2 = MI2->memoperands_end();
- if ((E1 - I1) != (E2 - I2))
- return false;
- for (; I1 != E1; ++I1, ++I2) {
- if (**I1 != **I2)
- return false;
- }
- return true;
-}
-
static void
removeMMOsFromMemoryOperations(MachineBasicBlock::iterator MBBIStartPos,
MachineBasicBlock &MBBCommon) {
@@ -792,8 +780,7 @@ removeMMOsFromMemoryOperations(MachineBasicBlock::iterator MBBIStartPos,
assert(MBBICommon->isIdenticalTo(&*MBBI) && "Expected matching MIIs!");
if (MBBICommon->mayLoad() || MBBICommon->mayStore())
- if (!hasIdenticalMMOs(&*MBBI, &*MBBICommon))
- MBBICommon->dropMemRefs();
+ MBBICommon->setMemRefs(MBBICommon->mergeMemRefsWith(*MBBI));
++MBBI;
++MBBICommon;
OpenPOWER on IntegriCloud