This is an archive of the discontinued LLVM Phabricator instance.

[ARM][SchedModels] Let ldm* instruction scheduling use MCSchedPredicate
ClosedPublic

Authored by evgeny777 on Oct 22 2020, 6:36 AM.

Diff Detail

Event Timeline

evgeny777 created this revision.Oct 22 2020, 6:36 AM
evgeny777 requested review of this revision.Oct 22 2020, 6:36 AM
evgeny777 added inline comments.Oct 22 2020, 6:41 AM
llvm/test/tools/llvm-mca/ARM/cortex-a57-memory-instructions.s
255

Cortex-A57 ldm* scheduling seems to be broken in terms of number of uops for instructions having base reg in register list. Patch doesn't address this.

dmgreen added inline comments.Oct 22 2020, 8:52 AM
llvm/lib/Target/ARM/ARMScheduleA57.td
511

Can you explain the operands this uses? Two from the predicate, And then N*2 for the variable number of regs split into groups of 2?

I think the _UPD forms will have an extra operand, and LDMIA looks like it has 3 + 2*N.

t2LDMIA killed $lr, 14 /* CC::al */, $noreg, def $r2, def $r3

vs

$sp = t2LDMIA_UPD $sp, 14 /* CC::al */, $noreg, def $r7, def $lr
llvm/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.h
52

I think it's common to use I and E for the variables.

evgeny777 added inline comments.Oct 22 2020, 9:31 AM
llvm/lib/Target/ARM/ARMScheduleA57.td
511

Can you explain the operands this uses? Two from the predicate, And then N*2 for the variable number of regs split into groups of 2?

Normal (no update) forms of LDM have N + 3 operands, where N is number of memory accesses. Cortex-a57 model defines same write lists for N and N+1 memory accesses, where N is odd. So A57LMAddrPred1 will trigger for N = 1 and N = 2 (with total number of operands being 4 and 5 respectively), A57LMAddrPred2 for N = 3 and N = 4 and so on

I think the _UPD forms will have an extra operand, and LDMIA looks like it has 3 + 2*N

Right, that's a bug. I'll update the diff.

evgeny777 updated this revision to Diff 300021.Oct 22 2020, 9:47 AM

Fixed issue with update forms of ldm* instructions

evgeny777 updated this revision to Diff 300023.Oct 22 2020, 9:52 AM

Fixed variable names

dmgreen accepted this revision.Oct 22 2020, 10:57 AM

OK thanks. Looks like a good improvement to me.

This revision is now accepted and ready to land.Oct 22 2020, 10:57 AM