Hi list,
Is it possible to simulate load to store forwarding on aarch64 with MI scheduling model on AArch64?
For instance $x0 data latency in the example below should be 1 cycle
ldr $x0, [$x1]
str $x0, [$x2]
But it should be 4 cycles if we have another instruction:
ldr $x0, [$x1]
add $x0, $x0, 4
For ALU instructions it’s possible to use either ReadAdvance or SchedReadAdvance, but I don’t see how
to do this with WriteLD or WriteST. Is there some workaround?
Thanks for prompt response, Andy
This will work for cases when address is not modified. However this doesn’t seem to work for pre/post increment load stores.
Consider data to address forwarding:
$x0 = ldr x0, [x1]
$x0, $x2 = ldr x2, [x0, 16]!
The second instruction will have it’s own latency for address modification ($x0 register). So I don’t see how we can use ReadAdr stuff
here. May be forwarding is not supposed to work in such cases for ARM cpus? Cortex-A55 software optimization guide says this:
“load data from a limited set of load instructions can be forwarded from the beginning of the wr pipeline stage to either the load or store AGU base operand”
However nothing is said about pre/post indexed forms.
From: Andrew Trick
Sent: 15 сентября 2020 г. 7:04
To: Evgeny Leviant
Cc: llvm...@lists.llvm.org
Subject: [EXTERNAL] Re: [llvm-dev] Simulation of load-store forwarding with MI scheduler on AArch64
Sorry, it seems I have figured out the answer myself:
Instruction
$x0, $x2 = LDRXpre $x0, 1
will have 4 arguments, so it seems possible to assign both SchedRead and SchedWrite for $x0 and the result sched
list for LDRXpre would be:
[WriteAdr, WriteLD, ReadAdr]
Strange that AArch64InstrFormats.td doesn’t implement this
Sent from Mail for Windows 10
On Sep 15, 2020, at 5:01 AM, Evgeny Leviant <elev...@accesssoftek.com> wrote:Sorry, it seems I have figured out the answer myself:
Instruction$x0, $x2 = LDRXpre $x0, 1
will have 4 arguments, so it seems possible to assign both SchedRead and SchedWrite for $x0 and the result schedlist for LDRXpre would be:
[WriteAdr, WriteLD, ReadAdr]
Strange that AArch64InstrFormats.td doesn’t implement this