[all-commits] [llvm/llvm-project] 958a3d: [FS-AFDO] Do not load non-FS profile in MIR loader.

Hongtao Yu via All-commits all-commits at lists.llvm.org
Wed May 10 16:39:47 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 958a3d8e2dec95a878dfc9d823861b3a6c674534
      https://github.com/llvm/llvm-project/commit/958a3d8e2dec95a878dfc9d823861b3a6c674534
  Author: Hongtao Yu <hoy at fb.com>
  Date:   2023-05-10 (Wed, 10 May 2023)

  Changed paths:
    M llvm/include/llvm/ProfileData/SampleProfReader.h
    M llvm/lib/CodeGen/MIRSampleProfile.cpp
    M llvm/test/CodeGen/X86/fsafdo_test2.ll

  Log Message:
  -----------
  [FS-AFDO] Do not load non-FS profile in MIR loader.

I was seeing a regression when enabling FS discriminators on an non-FS CSSPGO build. This is because a probe can get a zero-valued discriminator at a specific pass and that could lead to accidentally loading the corresponding base counter in the non-FS profile, while a non-zeo discriminator would end up getting zero samples. This could in turn undo the sample distribution effort done by previous BFI maintenance work and the probe distribution factor work for pseudo probes specifically. To mitigate that I'm disabling loading a non-FS profile against FS discriminators. The problem should also exist with non-CS AutoFDO, so I'm doing this for it too.

Reviewed By: wenlei

Differential Revision: https://reviews.llvm.org/D149597




More information about the All-commits mailing list