[PATCH] D59366: [NewPM][TimePasses] allow -time-passes reporting into a custom stream

Fedor Sergeev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 14 09:23:37 PDT 2019


fedor.sergeev added a comment.

In D59366#1429383 <https://reviews.llvm.org/D59366#1429383>, @philip.pfaffe wrote:

> > CreateInfoOutputFile creates a new stream and unless we retake the ownership it will be destroyed.
>
> True, but that's what it is doing right now. Do you see reason to change that?


Okey, let me enumerate all the possible solutions that I see:

1. own stream in TimePassesHandler (my initial implementation)
2. create TimePasses disabled/no-stream, enable from NewPMDriver (current state), own by NewPMDriver
3. pass the stream to StandardInstrumentation constructor, pass through into TimePassesHandler constructor, own by NewPMDriver
4. change behavior of CreateInfoOutputFile and make it handle the ownership itself

I cant do 4. because that will change -stats behavior as well as -time-passes behavior with old-pm.
We have already decided that 1. is no-go.
So we are left with either 2. or 3.

And 3. requires StandardInstrumentation to decide on how to pass this stream around.
What if PrintIR will be changed to take the stream as well? Should StandardInstrumentation decide to pass the same stream there?
If no then should we add one more stream parameter to StandardInstrumentation constructor?
It does not seem to scale that much....


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59366/new/

https://reviews.llvm.org/D59366





More information about the llvm-commits mailing list