Is it possible to use Propeller iteratively?

I found ‘-fbasic-block-sections=list’ is conflict with ‘-fbasic-block-sections=labels’. In other words, Propeller can’t be used iteratively. So my question is whether propeller can be used iteratively?

I think it’s possibile to use propeller iteratively by adding some information in .llvm_bb_addr_map section.
For example:
We have one function foo and foo have 4 basic block. The cluster.txt looks like:

!!0 2

Then we use the flag ‘-fbasic-block-sections=list=cluster.txt’, LLVM will split foo into foo and foo.cold, foo has 0th and 2th bb and foo.cold has 1th and 3th bb. In my opinion, we can record the foo has origin foo’s 0th and 2th bb and foo.cold has origin foo’s 1th and 3th bb in .llvm_bb_addr_map section.

Yes. This is doable, but we have not prioritized it yet. Please take a look at ⚙ D97526 [Propeller] Allow basic-block-sections and labels be used together by decoupling the handling of the two features.. If interested, I can help you land this feature.

Yes, I’m interested in this. I have read your MR, it’s good idea for ‘treat each basic block section similar to a function’ .
I think there maybe exist lighter changes. For examples, we just add BB Entry one member variable ‘origin bb id’ and add AddrMapEntry one member variable ‘origin function address’. These information are enough to help create_llvm_prof build bb’s cfg in one function.

Thanks for the interest. Let me mention that the BB Id patch (⚙ D100808 [Propeller] Use Fixed MBB ID instead of volatile MachineBasicBlock::Number.) is a prerequisite for this feature. It has been attempted but it was reverted due to a windows issue and I am working to fix it.

I didn’t fully understand your suggestion, but ideally, we would like to have a solution which works even for cases with any number of sections per function and it should also be concise. Would you please elaborate on the new format?

Yes. That’s what we want to do.

I didn’t think about it as much as you did. I will read your code/comment more carefully and try to do something.