[PATCH] D145171: [FSAFDO] Improve FS discriminator encoding
Hongtao Yu via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 2 17:14:24 PST 2023
hoy added inline comments.
================
Comment at: llvm/include/llvm/Transforms/Utils/SampleProfileLoaderBaseImpl.h:310
ErrorOr<uint64_t>
SampleProfileLoaderBaseImpl<BT>::getInstWeightImpl(const InstructionT &Inst) {
const FunctionSamples *FS = findFunctionSamples(Inst);
----------------
hoy wrote:
> How about making this function virtual and override it in MIR sample loader? Something like
>
>
>
> ErrorOr<uint64_t> getInstWeightImpl(const MachineInstr &Inst) {
> if (ImprovedFSDiscriminator && Inst.isMetaInstruction())
> return std::error_code();
> return SampleProfileLoaderBaseImpl<MachineBasicBlock>::getInstWeightImpl(
> Inst);
> }
Or maybe just override the existing virtual function `getInstWeight`, just like `SampleProfileLoader::getInstWeight`
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D145171/new/
https://reviews.llvm.org/D145171
More information about the llvm-commits
mailing list