vivek pandya via llvm-dev
2016-Dec-08 05:46 UTC
[llvm-dev] Issues with DummyCGSCCPass used for IPRA
> > Hello, > > I'm trying to enable interprocedural register allocation (IPRA).Hi Maxime, I don't understand here why you need to enable IPRA as that is already scheduled based on option -mllvm -enable-ipra. So I think easy way to make IPRA execute every time is to set default value of EnableIPRA option to true. you can find this option defined in lib/CodeGen/TargetMachine.cpp and you may also need to change its initialization to true in TargetOptions constructor in include/llvm/Target/TargetOptions.h - Vivek> In order to do this, I’ve added the DummyCGSCCPass to our pipeline, as is > done in TargetPassConfig::addISelPrepare. My understanding is that this > pass wraps the following passes into an SCC pass manager, so that they are > run in bottom-up order, which is necessary to enable register allocation > info from callees to be available at call sites. > > The problem I’m running into is that we have an ImmutablePass which is run > early in our pipeline (and needed in later machine code generation stages), > and for some reason, this pass gets finalized and re-run multiple times, > destroying the information we need in the process. I’m really not sure what > is happening. The pass is clearly marked as required by later passes, but > somehow it is found to be “dead”, finalized, and then re-run. To make > matters more confusing, we have another ImmutablePass which is run early > and used late, but this one doesn’t get finalized. My coworkers and I are > really not sure what the difference might be. > > Could someone more familiar with IPRA or the PassManager provide some > hints as to what might be happening? > > Regards, > > - Maxime >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20161208/c6f3299f/attachment.html>
Maxime Chevalier-Boisvert via llvm-dev
2016-Dec-08 18:58 UTC
[llvm-dev] Issues with DummyCGSCCPass used for IPRA
We have our own subtarget, with its own pipeline and set of passes. The problem I’m facing, as explained, is that adding the DummyCGSCCPass to our pipeline causes an early pass to be finalized when it shouldn’t be. The information then becomes unavailable when needed, in the machine code generation part of our pipeline. It’s unclear to us why this is happening. I was hoping someone familiar with the pass manager may have advice, or that someone may have run into a similar problem before. - Maxime> On Dec 7, 2016, at 9:46 PM, vivek pandya via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > > > Hello, > > I'm trying to enable interprocedural register allocation (IPRA). > Hi Maxime, > > I don't understand here why you need to enable IPRA as that is already scheduled based on option -mllvm -enable-ipra. So I think easy way to make IPRA execute every time is to set default value of EnableIPRA option to true. > you can find this option defined in lib/CodeGen/TargetMachine.cpp and you may also need to change its initialization to true in TargetOptions constructor in include/llvm/Target/TargetOptions.h > > - Vivek > In order to do this, I’ve added the DummyCGSCCPass to our pipeline, as is done in TargetPassConfig::addISelPrepare. My understanding is that this pass wraps the following passes into an SCC pass manager, so that they are run in bottom-up order, which is necessary to enable register allocation info from callees to be available at call sites. > > The problem I’m running into is that we have an ImmutablePass which is run early in our pipeline (and needed in later machine code generation stages), and for some reason, this pass gets finalized and re-run multiple times, destroying the information we need in the process. I’m really not sure what is happening. The pass is clearly marked as required by later passes, but somehow it is found to be “dead”, finalized, and then re-run. To make matters more confusing, we have another ImmutablePass which is run early and used late, but this one doesn’t get finalized. My coworkers and I are really not sure what the difference might be. > > Could someone more familiar with IPRA or the PassManager provide some hints as to what might be happening? > > Regards, > > - Maxime > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20161208/0ae23f36/attachment-0001.html>
Mehdi Amini via llvm-dev
2016-Dec-09 00:13 UTC
[llvm-dev] Issues with DummyCGSCCPass used for IPRA
Hi, There are two relevant hooks for you immutable pass: 1) releaseMemory() 2) doFinalization() Are you looking at the first one? I think you should act on the second instead and it should solve your issue. — Mehdi> On Dec 8, 2016, at 10:58 AM, Maxime Chevalier-Boisvert via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > We have our own subtarget, with its own pipeline and set of passes. > > The problem I’m facing, as explained, is that adding the DummyCGSCCPass to our pipeline causes an early pass to be finalized when it shouldn’t be. The information then becomes unavailable when needed, in the machine code generation part of our pipeline. > > It’s unclear to us why this is happening. I was hoping someone familiar with the pass manager may have advice, or that someone may have run into a similar problem before. > > - Maxime > >> On Dec 7, 2016, at 9:46 PM, vivek pandya via llvm-dev <llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>> wrote: >> >> >> >> Hello, >> >> I'm trying to enable interprocedural register allocation (IPRA). >> Hi Maxime, >> >> I don't understand here why you need to enable IPRA as that is already scheduled based on option -mllvm -enable-ipra. So I think easy way to make IPRA execute every time is to set default value of EnableIPRA option to true. >> you can find this option defined in lib/CodeGen/TargetMachine.cpp and you may also need to change its initialization to true in TargetOptions constructor in include/llvm/Target/TargetOptions.h >> >> - Vivek >> In order to do this, I’ve added the DummyCGSCCPass to our pipeline, as is done in TargetPassConfig::addISelPrepare. My understanding is that this pass wraps the following passes into an SCC pass manager, so that they are run in bottom-up order, which is necessary to enable register allocation info from callees to be available at call sites. >> >> The problem I’m running into is that we have an ImmutablePass which is run early in our pipeline (and needed in later machine code generation stages), and for some reason, this pass gets finalized and re-run multiple times, destroying the information we need in the process. I’m really not sure what is happening. The pass is clearly marked as required by later passes, but somehow it is found to be “dead”, finalized, and then re-run. To make matters more confusing, we have another ImmutablePass which is run early and used late, but this one doesn’t get finalized. My coworkers and I are really not sure what the difference might be. >> >> Could someone more familiar with IPRA or the PassManager provide some hints as to what might be happening? >> >> Regards, >> >> - Maxime >> _______________________________________________ >> LLVM Developers mailing list >> llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org> >> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20161208/193cedbc/attachment.html>
Possibly Parallel Threads
- Issues with DummyCGSCCPass used for IPRA
- IPRA, interprocedural register allocation, question
- IPRA, interprocedural register allocation, question
- What kind of testcases should be required to test IPRA?
- [GSoC 2016] [Weekly Status] Interprocedural Register Allocation