https://github.com/WenleiHe requested changes to this pull request. I don't understand the use case either. It seems hacky to bypass the attribute in IR - why is the attribute not present in IR if sample profile is used? https://github.com/llvm/llvm-project/pull/66178