Rail Shafigulin via llvm-dev
2015-Oct-19 18:58 UTC
[llvm-dev] Is there a way to determine what CPU resource is used by which instruction?
I'm trying to figure out if there is a way to figure out what processor resource is used by which instruction during scheduling. This is purely for debugging purposes. Since I'm somewhat new to LLVM it is a bit difficult for me to figure this out. Initial idea was to insert comments in the generated assembly which would tell me what what resource is used. MachineInstr has a uint8_t AsmPrinterFlags, which I want to use to pass information from the scheduler to AsmPrinter about which resource is used. I've asked on the IRC channel how to do it but nobody seems to know. A scheduling debug log was also mentioned (supposedly it should provide me with the same information) but I don't know how to generate one. I'd appreciate any help on the issue. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20151019/5fa67c7c/attachment.html>
John Criswell via llvm-dev
2015-Oct-19 20:07 UTC
[llvm-dev] Is there a way to determine what CPU resource is used by which instruction?
Dear Rail, Can you clarify what you mean by "processor resource?" Are you talking about architecture-visible state (like registers) or micro-architecture state (like ALUs) that are typically not visible at the ISA-level? Regards, John Criswell On 10/19/15 2:58 PM, Rail Shafigulin via llvm-dev wrote:> I'm trying to figure out if there is a way to figure out what > processor resource is used by which instruction during scheduling. > This is purely for debugging purposes. Since I'm somewhat new to LLVM > it is a bit difficult for me to figure this out. > > Initial idea was to insert comments in the generated assembly which > would tell me what what resource is used. MachineInstr has a uint8_t > AsmPrinterFlags, which I want to use to pass information from the > scheduler to AsmPrinter about which resource is used. I've asked on > the IRC channel how to do it but nobody seems to know. A scheduling > debug log was also mentioned (supposedly it should provide me with the > same information) but I don't know how to generate one. > > I'd appreciate any help on the issue. > > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev-- John Criswell Assistant Professor Department of Computer Science, University of Rochester http://www.cs.rochester.edu/u/criswell -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20151019/035496f7/attachment.html>
Rail Shafigulin via llvm-dev
2015-Oct-19 20:20 UTC
[llvm-dev] Is there a way to determine what CPU resource is used by which instruction?
On Mon, Oct 19, 2015 at 1:07 PM, John Criswell <jtcriswel at gmail.com> wrote:> Dear Rail, > > Can you clarify what you mean by "processor resource?" Are you talking > about architecture-visible state (like registers) or micro-architecture > state (like ALUs) that are typically not visible at the ISA-level? > > Regards, > > John Criswell >John, Thanks for the reply. I'm talking about micro-architecture state, i.e. number of ALUs currently available (i.e. that are not preforming any computation at the moment), number of Load and Store units, number of floating point multiply and divide units etc. I would greatly appreciate any help on this. Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20151019/2fd6b1dd/attachment.html>
Matthias Braun via llvm-dev
2015-Oct-20 14:20 UTC
[llvm-dev] Is there a way to determine what CPU resource is used by which instruction?
> On Oct 19, 2015, at 11:58 AM, Rail Shafigulin via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > I'm trying to figure out if there is a way to figure out what processor resource is used by which instruction during scheduling. This is purely for debugging purposes. Since I'm somewhat new to LLVM it is a bit difficult for me to figure this out. > > Initial idea was to insert comments in the generated assembly which would tell me what what resource is used. MachineInstr has a uint8_t AsmPrinterFlags, which I want to use to pass information from the scheduler to AsmPrinter about which resource is used. I've asked on the IRC channel how to do it but nobody seems to know. A scheduling debug log was also mentioned (supposedly it should provide me with the same information) but I don't know how to generate one.Look for a #define like this in the llvm CodeGen files: #define DEBUG_TYPE “misched" This allows you to use llc -debug-only=misched or clang -mllvm -ldebug-only=misched to enable the debugging output for that file/topic. You may use the flag multiple times to enable multiple debugging outputs. - Matthias
Rail Shafigulin via llvm-dev
2015-Oct-20 18:06 UTC
[llvm-dev] Is there a way to determine what CPU resource is used by which instruction?
> > Look for a #define like this in the llvm CodeGen files: > #define DEBUG_TYPE “misched" > > This allows you to use > llc -debug-only=misched > or > clang -mllvm -ldebug-only=misched > > to enable the debugging output for that file/topic. You may use the flag > multiple times to enable multiple debugging outputs. > > - MatthiasMathias, Thanks. I think this is what I was looking for. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20151020/8fbdc79c/attachment.html>