Should the compile phase options be retained in the backend opt phase of distributed thinlto?

Regarding the distributed thinlto introduced in ThinLTO: Scalable and Incremental LTO, should some options in the compilation phase be preserved in the backend optimization phase? For example -march -fPIC -g

Is there any reason you want to preserve -g?

Sampling-based FDO (AFDO) uses debug info to try and match branch addresses back to IR. Afaik, so does CSSPGO for call sites. You need line table info, so definitely not full -g, but definitely need debug info.

| zcfh
February 7 |

  • | - |

Regarding the distributed thinlto introduced in ThinLTO: Scalable and Incremental LTO, should some options in the compilation phase be preserved in the backend optimization phase? For example -march -fPIC -g

It’s safest to just pass all the same options to the pre-LTO link compile and the backend compile, because some do affect the LTO backend optimization and code generation (e.g. -march is going to be in this category), and unless they are preserved in the IR they would need to be specified to the backend compile.

Teresa

2 Likes

-g is compile parameter, I don’t know if it needs to be retained. I want distributed thinlto to behave the same as no-distributed thinlto.

Got it, thank you for your answer.