Rail Shafigulin via llvm-dev
2015-Nov-17 18:26 UTC
[llvm-dev] DFAPacketizer, Scheduling and LoadLatency
> In particular, the LoadLatency is used in defaultDefLatency: > > /// Return the default expected latency for a def based on it's opcode. > unsigned TargetInstrInfo::defaultDefLatency( > const MCSchedModel &SchedModel, const MachineInstr *DefMI) const { > if (DefMI->isTransient()) > return 0; > if (DefMI->mayLoad()) > return SchedModel.LoadLatency; > if (isHighLatencyDef(DefMI->getOpcode())) > return SchedModel.HighLatency; > return 1; > } > > > -Krzysztof > > -- > Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted > by The Linux Foundation > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >I tried setting let mayLoad = 1 { class InstrLD .... { } } But that didn't seem to work. When I looked at the debug output the latency for the load instruction was set to 1. However when I changed load itinerary description in the schedule to def MyTargetItineraries : .............. InstrItinData<LD, [InstrStage<2, [BranchSlot, NonBranchSlot], 1>]>, .............. That seem to produce correct latency in the debug output. Do you know what could be the problem? Am I missing something? To give you a full disclosure, I'm using LLVM 3.5 and at the moment I can't switch to the latest version. Any help is appreciated. -- R -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20151117/52d47324/attachment.html>
Krzysztof Parzyszek via llvm-dev
2015-Nov-17 19:15 UTC
[llvm-dev] DFAPacketizer, Scheduling and LoadLatency
On 11/17/2015 12:26 PM, Rail Shafigulin wrote:> > I tried setting > let mayLoad = 1 { > class InstrLD .... { > } > } > > But that didn't seem to work. When I looked at the debug output the > latency for the load instruction was set to 1. > > However when I changed load itinerary description in the schedule to > > def MyTargetItineraries : > .............. > InstrItinData<LD, [InstrStage<2, [BranchSlot, NonBranchSlot], 1>]>, > .............. > > That seem to produce correct latency in the debug output. > > Do you know what could be the problem? Am I missing something? To give > you a full disclosure, I'm using LLVM 3.5 and at the moment I can't > switch to the latest version. > > Any help is appreciated.I think that the LoadLatency is used as a last resort when there is no itinerary available for a given instruction. In your case, there is one and so the LoadLatency is ignored, and instead the latency from the itinerary is used. -Krzysztof -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
Rail Shafigulin via llvm-dev
2016-Jan-06 19:59 UTC
[llvm-dev] DFAPacketizer, Scheduling and LoadLatency
On Tue, Nov 17, 2015 at 11:15 AM, Krzysztof Parzyszek < kparzysz at codeaurora.org> wrote:> On 11/17/2015 12:26 PM, Rail Shafigulin wrote: > >> >> I tried setting >> let mayLoad = 1 { >> class InstrLD .... { >> } >> } >> >> But that didn't seem to work. When I looked at the debug output the >> latency for the load instruction was set to 1. >> >> However when I changed load itinerary description in the schedule to >> >> def MyTargetItineraries : >> .............. >> InstrItinData<LD, [InstrStage<2, [BranchSlot, NonBranchSlot], 1>]>, >> .............. >> >> That seem to produce correct latency in the debug output. >> >> Do you know what could be the problem? Am I missing something? To give >> you a full disclosure, I'm using LLVM 3.5 and at the moment I can't >> switch to the latest version. >> >> Any help is appreciated. >> > > I think that the LoadLatency is used as a last resort when there is no > itinerary available for a given instruction. In your case, there is one > and so the LoadLatency is ignored, and instead the latency from the > itinerary is used. > > > -Krzysztof > > -- > Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted > by The Linux Foundation >I had a chance to test this and I'm somewhat confused. Earlier we concluded that the connection between LoadLatency and a given instruction is through mayLoad variable. In other words an instruction will set its latency value to LoadLatency if mayLoad is set to 1. However this doesn't seem to be happening in my case. Here is my load instruction definition: class InstLD<bits<4> op, dag outs, dag ins, string asmstr, list<dag> pattern> : InstEscala<outs, ins, asmstr, pattern> { let optype = 0b10; let opcode = op; } class LOAD<bits<4> subop, string asmstring, list<dag> pattern> : InstLD<subop, (outs GPR:$rD), (ins MEMri:$src), !strconcat(asmstring, "\t$rD, $src"), pattern> { bits<5> rD; bits<21> src; let Inst{25-21} = rD; let Inst{20-0} = src; } class LOADi32<bits<4> subop, string asmstring, PatFrag opNode> : LOAD<subop, asmstring, [(set (i32 GPR:$rD), (opNode ADDRri:$src))]>; let Itinerary = l_lwz in def LWZ : LOADi32<0x1, "l.lwz", load>; My instruction itinerary data looks like the following InstrItinData<l_lwz , [InstrStage<1, [Slot0, Slot1]>]>, and my LoadLatency is set to 2. As you can see mayLoad is never really set to 1 anywhere however it still seems to be using a LoadLatency of 2. What am I missing? Any help is appreciated. -- Rail Shafigulin Software Engineer Esencia Technologies -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160106/6847e1d9/attachment.html>