diff options
author | Evan Cheng <evan.cheng@apple.com> | 2009-06-03 06:14:58 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2009-06-03 06:14:58 +0000 |
commit | 9d5fb981b0ebc00e068b9bcb4df7388a8ea94b71 (patch) | |
tree | 137ff9da5e8372e49fce010be73a2cb14828f759 /lib/Target | |
parent | 95299c194d4f852d17554779117c4125c3fae73d (diff) | |
download | external_llvm-9d5fb981b0ebc00e068b9bcb4df7388a8ea94b71.zip external_llvm-9d5fb981b0ebc00e068b9bcb4df7388a8ea94b71.tar.gz external_llvm-9d5fb981b0ebc00e068b9bcb4df7388a8ea94b71.tar.bz2 |
Fold preceding / trailing base inc / dec into the single load / store as well.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72756 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r-- | lib/Target/ARM/ARMLoadStoreOptimizer.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/Target/ARM/ARMLoadStoreOptimizer.cpp b/lib/Target/ARM/ARMLoadStoreOptimizer.cpp index 047552f..108c6dd 100644 --- a/lib/Target/ARM/ARMLoadStoreOptimizer.cpp +++ b/lib/Target/ARM/ARMLoadStoreOptimizer.cpp @@ -697,7 +697,7 @@ bool ARMLoadStoreOpt::LoadStoreMultipleOpti(MachineBasicBlock &MBB) { // LDM/STM ops. for (unsigned i = 0, e = MBBII.size(); i < e; ++i) if (mergeBaseUpdateLSMultiple(MBB, MBBII[i], Advance, MBBI)) - NumMerges++; + ++NumMerges; NumMerges += MBBII.size(); // Try folding preceeding/trailing base inc/dec into those load/store @@ -705,10 +705,17 @@ bool ARMLoadStoreOpt::LoadStoreMultipleOpti(MachineBasicBlock &MBB) { for (unsigned i = 0; i != NumMemOps; ++i) if (!MemOps[i].Merged) if (mergeBaseUpdateLoadStore(MBB, MemOps[i].MBBI, TII,Advance,MBBI)) - NumMerges++; + ++NumMerges; // 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->skipTo(prior(MBBI)); + } } CurrBase = 0; |