llvm.org GIT mirror llvm / 9d5fb98
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 Evan Cheng 10 years ago
2 changed file(s) with 21 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
696696 // LDM/STM ops.
697697 for (unsigned i = 0, e = MBBII.size(); i < e; ++i)
698698 if (mergeBaseUpdateLSMultiple(MBB, MBBII[i], Advance, MBBI))
699 NumMerges++;
699 ++NumMerges;
700700 NumMerges += MBBII.size();
701701
702702 // Try folding preceeding/trailing base inc/dec into those load/store
704704 for (unsigned i = 0; i != NumMemOps; ++i)
705705 if (!MemOps[i].Merged)
706706 if (mergeBaseUpdateLoadStore(MBB, MemOps[i].MBBI, TII,Advance,MBBI))
707 NumMerges++;
707 ++NumMerges;
708708
709709 // RS may be pointing to an instruction that's deleted.
710710 RS->skipTo(prior(MBBI));
711 } else if (NumMemOps == 1) {
712 // Try folding preceeding/trailing base inc/dec into the single
713 // load/store.
714 if (mergeBaseUpdateLoadStore(MBB, MemOps[0].MBBI, TII, Advance, MBBI)) {
715 ++NumMerges;
716 RS->skipTo(prior(MBBI));
717 }
711718 }
712719
713720 CurrBase = 0;
0 ; RUN: llvm-as < %s | llc -mtriple=arm-linux-gnu | grep {str.*\\!}
1 ; RUN: llvm-as < %s | llc -mtriple=arm-linux-gnu | grep {ldr.*\\\[.*\], #+4}
2
3 @b = external global i64*
4
5 define i64 @t(i64 %a) nounwind readonly {
6 entry:
7 %0 = load i64** @b, align 4
8 %1 = load i64* %0, align 4
9 %2 = mul i64 %1, %a
10 ret i64 %2
11 }