[clang-tools-extra] [llvm] [clang] [PGO] Add ability to mark cold functions as optsize/minsize/optnone (PR #69030)

2024-02-05 Thread via cfe-commits
WenleiHe wrote: > I don't understand, if you're saying the profile is accurate, then those > functions are actually cold, so we should be able to mark them as optsize? Accurate is not black or white. The current heuristic requires certain level of accuracy to be effective. If you make the

[llvm] [clang] [PGO] Add ability to mark cold functions as optsize/minsize/optnone (PR #69030)

2024-02-05 Thread Arthur Eubanks via cfe-commits
@@ -0,0 +1,73 @@ +//===--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[llvm] [clang] [PGO] Add ability to mark cold functions as optsize/minsize/optnone (PR #69030)

2024-02-05 Thread Arthur Eubanks via cfe-commits
aeubanks wrote: > FWIW we've tried this with sampling PGO in the past. While on paper this > seems like an obvious thing to do, in reality aggressively tuning down opt > level for cold functions can lead to regression since profile isn't always > accurate. > > That said, as long as this

[llvm] [clang] [PGO] Add ability to mark cold functions as optsize/minsize/optnone (PR #69030)

2024-02-05 Thread Arthur Eubanks via cfe-commits
aeubanks wrote: > How does this relate to the existing `shouldOptimizeForSize(Function&, ...)` > and `shouldOptimizeForSize(MachineFunction&, ...)` APIs which appear to > provide similar functionality at a first glance. If they are the same, then > we should have a plan in place to cleanup

[llvm] [clang] [PGO] Add ability to mark cold functions as optsize/minsize/optnone (PR #69030)

2024-01-30 Thread via cfe-commits
WenleiHe wrote: > > How does this relate to the existing `shouldOptimizeForSize(Function&, > > ...)` and `shouldOptimizeForSize(MachineFunction&, ...)` APIs which appear > > to provide similar functionality at a first glance. If they are the same, > > then we should have a plan in place to

[llvm] [clang] [PGO] Add ability to mark cold functions as optsize/minsize/optnone (PR #69030)

2024-01-30 Thread via cfe-commits
@@ -0,0 +1,73 @@ +//===--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[llvm] [clang] [PGO] Add ability to mark cold functions as optsize/minsize/optnone (PR #69030)

2024-01-30 Thread Matthias Braun via cfe-commits
MatzeB wrote: How does this relate to the existing `shouldOptimizeForSize(Function&)` and similar APIs which appear to provide similar functionality at a first glance. If they are the same, then we should have a plan in place to cleanup and only have one system afterwards, if there are

[llvm] [clang] [PGO] Add ability to mark cold functions as optsize/minsize/optnone (PR #69030)

2024-01-30 Thread David Li via cfe-commits
@@ -0,0 +1,73 @@ +//===--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: