[llvm-dev] Making an analysis availble during call lowering

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

[llvm-dev] Making an analysis availble during call lowering

Alex Bradbury via llvm-dev

Hi,


I want to be able to access a custom analysis pass during call lowering, but there isn't a way to access this now and I'm not sure the least bad way to thread this information into the DAG.


I want to be able to use knowledge of the callee function to change the lowering of a call. Since AMDGPUDAGToDAGISel is ultimately a normal MachineFunction pass, I'm able to get the interprocedural analysis pass there but don't have a way to pass this into the call lowering where it's actually needed.


The laziest option would be to stash the pointer to the analysis in the TargetMachine and get it from there, but is probably not the best idea. Another option might be to store a pointer to the SelectionDAGISel pass in SelectionDAG, so then there's a way to access the pass to get analysis directly. Is there another option?


-Matt



_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] Making an analysis availble during call lowering

Alex Bradbury via llvm-dev


On 06/13/2017 12:46 PM, Arsenault, Matthew via llvm-dev wrote:

Hi,


I want to be able to access a custom analysis pass during call lowering, but there isn't a way to access this now and I'm not sure the least bad way to thread this information into the DAG.


I want to be able to use knowledge of the callee function to change the lowering of a call. Since AMDGPUDAGToDAGISel is ultimately a normal MachineFunction pass, I'm able to get the interprocedural analysis pass there but don't have a way to pass this into the call lowering where it's actually needed.


The laziest option would be to stash the pointer to the analysis in the TargetMachine and get it from there, but is probably not the best idea. Another option might be to store a pointer to the SelectionDAGISel pass in SelectionDAG, so then there's a way to access the pass to get analysis directly. Is there another option?


With the legacy pass manager, are you planning to schedule the analysis pass manually and then use getAnalysisIfAvailable?

Thanks again,
Hal


-Matt




_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

-- 
Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory

_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] Making an analysis availble during call lowering

Alex Bradbury via llvm-dev

On Jul 24, 2017, at 13:52, Hal Finkel via llvm-dev <[hidden email]> wrote:


On 06/13/2017 12:46 PM, Arsenault, Matthew via llvm-dev wrote:
Hi,

I want to be able to access a custom analysis pass during call lowering, but there isn't a way to access this now and I'm not sure the least bad way to thread this information into the DAG.

I want to be able to use knowledge of the callee function to change the lowering of a call. Since AMDGPUDAGToDAGISel is ultimately a normal MachineFunction pass, I'm able to get the interprocedural analysis pass there but don't have a way to pass this into the call lowering where it's actually needed.

The laziest option would be to stash the pointer to the analysis in the TargetMachine and get it from there, but is probably not the best idea. Another option might be to store a pointer to the SelectionDAGISel pass in SelectionDAG, so then there's a way to access the pass to get analysis directly. Is there another option?

With the legacy pass manager, are you planning to schedule the analysis pass manually and then use getAnalysisIfAvailable?

Thanks again,
Hal


I didn’t need to do anything special. addRequired/getAnalysis work.

-Matt


_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] Making an analysis availble during call lowering

Alex Bradbury via llvm-dev

On Jul 24, 2017, at 14:00, Matt Arsenault <[hidden email]> wrote:


On Jul 24, 2017, at 13:52, Hal Finkel via llvm-dev <[hidden email]> wrote:


On 06/13/2017 12:46 PM, Arsenault, Matthew via llvm-dev wrote:
Hi,

I want to be able to access a custom analysis pass during call lowering, but there isn't a way to access this now and I'm not sure the least bad way to thread this information into the DAG.

I want to be able to use knowledge of the callee function to change the lowering of a call. Since AMDGPUDAGToDAGISel is ultimately a normal MachineFunction pass, I'm able to get the interprocedural analysis pass there but don't have a way to pass this into the call lowering where it's actually needed.

The laziest option would be to stash the pointer to the analysis in the TargetMachine and get it from there, but is probably not the best idea. Another option might be to store a pointer to the SelectionDAGISel pass in SelectionDAG, so then there's a way to access the pass to get analysis directly. Is there another option?

With the legacy pass manager, are you planning to schedule the analysis pass manually and then use getAnalysisIfAvailable?

Thanks again,
Hal


I didn’t need to do anything special. addRequired/getAnalysis work.

-Matt

ping

_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] Making an analysis availble during call lowering

Alex Bradbury via llvm-dev


On 07/31/2017 02:31 PM, Matt Arsenault wrote:

On Jul 24, 2017, at 14:00, Matt Arsenault <[hidden email]> wrote:


On Jul 24, 2017, at 13:52, Hal Finkel via llvm-dev <[hidden email]> wrote:


On 06/13/2017 12:46 PM, Arsenault, Matthew via llvm-dev wrote:
Hi,

I want to be able to access a custom analysis pass during call lowering, but there isn't a way to access this now and I'm not sure the least bad way to thread this information into the DAG.

I want to be able to use knowledge of the callee function to change the lowering of a call. Since AMDGPUDAGToDAGISel is ultimately a normal MachineFunction pass, I'm able to get the interprocedural analysis pass there but don't have a way to pass this into the call lowering where it's actually needed.

The laziest option would be to stash the pointer to the analysis in the TargetMachine and get it from there, but is probably not the best idea. Another option might be to store a pointer to the SelectionDAGISel pass in SelectionDAG, so then there's a way to access the pass to get analysis directly. Is there another option?

With the legacy pass manager, are you planning to schedule the analysis pass manually and then use getAnalysisIfAvailable?

Thanks again,
Hal


I didn’t need to do anything special. addRequired/getAnalysis work.

Did you add INITIALIZE_PASS_DEPENDENCY somewhere?

 -Hal


-Matt

ping

-- 
Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory

_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] Making an analysis availble during call lowering

Alex Bradbury via llvm-dev

On Jul 31, 2017, at 21:47, Hal Finkel <[hidden email]> wrote:


Did you add INITIALIZE_PASS_DEPENDENCY somewhere?

 -Hal

Yes, the selector is ultimately a target defined, normal MachineFunction pass you can add dependencies on.

-Matt


_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] Making an analysis availble during call lowering

Alex Bradbury via llvm-dev


On 08/01/2017 12:00 AM, Matt Arsenault wrote:

On Jul 31, 2017, at 21:47, Hal Finkel <[hidden email]> wrote:


Did you add INITIALIZE_PASS_DEPENDENCY somewhere?

 -Hal

Yes, the selector is ultimately a target defined, normal MachineFunction pass you can add dependencies on.

Sounds good.

 -Hal


-Matt


-- 
Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory

_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] Making an analysis availble during call lowering

Alex Bradbury via llvm-dev


On 08/01/2017 11:51 AM, Hal Finkel via llvm-dev wrote:


On 08/01/2017 12:00 AM, Matt Arsenault wrote:

On Jul 31, 2017, at 21:47, Hal Finkel <[hidden email]> wrote:


Did you add INITIALIZE_PASS_DEPENDENCY somewhere?

 -Hal

Yes, the selector is ultimately a target defined, normal MachineFunction pass you can add dependencies on.

Sounds good.

Although I don't see this in D35389/D35390.

 -Hal


 -Hal


-Matt


-- 
Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory


_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

-- 
Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory

_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] Making an analysis availble during call lowering

Alex Bradbury via llvm-dev

On Aug 1, 2017, at 10:08, Hal Finkel <[hidden email]> wrote:


On 08/01/2017 11:51 AM, Hal Finkel via llvm-dev wrote:


On 08/01/2017 12:00 AM, Matt Arsenault wrote:

On Jul 31, 2017, at 21:47, Hal Finkel <[hidden email]> wrote:


Did you add INITIALIZE_PASS_DEPENDENCY somewhere?

 -Hal

Yes, the selector is ultimately a target defined, normal MachineFunction pass you can add dependencies on.

Sounds good.

Although I don't see this in D35389/D35390.

 -Hal

I just added that to D35389, though it was somehow working before.

-Matt


_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev