Module::setProfileSummary currently calls addModuelFlag. This prevents from
updating the ProfileSummary metadata in the module and results in a second
ProfileSummary added instead of replacing an existing one. I don't think this is
the expected behavior. It prevents updating the ProfileSummary and it does not
make sense to have more than one. To address this, add Module::setModuleFlag and
use it from setProfileSummary.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/IR/Module.cpp | ||
---|---|---|
361–362 | It has some code similar as getModuleFlagsMetadata. Can they be shared? |
Comment Actions
Yes, it uses a different key "CSProfileSummary". So it does not conflict with the regular summary.
Comment Actions
I noticed the same issue when I implemented CSFDO -- I initially reused the same summary name for CSFDO as in FDO.
Exiting of two module flags with the same name sometime breaks the build (not always, if I remember correctly).
This fix looks to me.
It has some code similar as getModuleFlagsMetadata. Can they be shared?