diff options
author | Evan Cheng <evan.cheng@apple.com> | 2009-06-04 01:15:28 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2009-06-04 01:15:28 +0000 |
commit | 1488326156741063fa7a23e1638c13e81d167e22 (patch) | |
tree | 8b2a0ea708db72af273726830d003b83f93b0bd4 /lib/Target | |
parent | fcad1720066fe88c33c1d6007f36e57a82894302 (diff) | |
download | external_llvm-1488326156741063fa7a23e1638c13e81d167e22.zip external_llvm-1488326156741063fa7a23e1638c13e81d167e22.tar.gz external_llvm-1488326156741063fa7a23e1638c13e81d167e22.tar.bz2 |
Re-apply 72756 with fixes. One of those was introduced by we changed MachineInstrBuilder::addReg() interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72826 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r-- | lib/Target/ARM/ARMLoadStoreOptimizer.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/Target/ARM/ARMLoadStoreOptimizer.cpp b/lib/Target/ARM/ARMLoadStoreOptimizer.cpp index 09b8ce0..9b3b65a 100644 --- a/lib/Target/ARM/ARMLoadStoreOptimizer.cpp +++ b/lib/Target/ARM/ARMLoadStoreOptimizer.cpp @@ -530,7 +530,7 @@ static bool mergeBaseUpdateLoadStore(MachineBasicBlock &MBB, if (isAM2) // STR_PRE, STR_POST; BuildMI(MBB, MBBI, dl, TII->get(NewOpc), Base) - .addReg(MO.getReg(), getKillRegState(BaseKill)) + .addReg(MO.getReg(), getKillRegState(MO.isKill())) .addReg(Base).addReg(0).addImm(Offset).addImm(Pred).addReg(PredReg); else // FSTMS, FSTMD @@ -709,6 +709,13 @@ bool ARMLoadStoreOpt::LoadStoreMultipleOpti(MachineBasicBlock &MBB) { // RS may be pointing to an instruction that's deleted. RS->skipTo(prior(MBBI)); + } else if (NumMemOps == 1) { + // Try folding preceeding/trailing base inc/dec into the single + // load/store. + if (mergeBaseUpdateLoadStore(MBB, MemOps[0].MBBI, TII, Advance, MBBI)) { + ++NumMerges; + RS->forward(prior(MBBI)); + } } CurrBase = 0; |