[llvm] [NFC][PGO] Factor downscaling of branch weights out of `Instrumentation` into `ProfileData` (PR #153735)

LLVM Continuous Integration via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 14 22:47:59 PDT 2025


llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder `amdgpu-offload-ubuntu-22-cmake-build-only` running on `rocm-docker-ubu-22` while building `llvm` at step 4 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/203/builds/19921

<details>
<summary>Here is the relevant piece of the build log for the reference</summary>

```
Step 4 (annotate) failure: '../llvm-zorg/zorg/buildbot/builders/annotated/amdgpu-offload-cmake.py --jobs=32' (failure)
...
[1986/8006] Building CXX object lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/MachinePipeliner.cpp.o
[1987/8006] Building CXX object lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/MachineRegionInfo.cpp.o
[1988/8006] Building CXX object lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/MachineScheduler.cpp.o
[1989/8006] Building CXX object lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/MachineRegisterInfo.cpp.o
[1990/8006] Building CXX object lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/MachineSink.cpp.o
[1991/8006] Building CXX object lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/MachineSSAContext.cpp.o
[1992/8006] Building CXX object lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/MachineSizeOpts.cpp.o
[1993/8006] Building CXX object lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/MachineSSAUpdater.cpp.o
[1994/8006] Building CXX object lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/MachineStripDebug.cpp.o
[1995/8006] Building CXX object lib/IR/CMakeFiles/LLVMCore.dir/ProfDataUtils.cpp.o
FAILED: lib/IR/CMakeFiles/LLVMCore.dir/ProfDataUtils.cpp.o 
ccache /usr/bin/c++ -DGTEST_HAS_RTTI=0 -DLLVM_EXPORTS -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/build/lib/IR -I/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/llvm/lib/IR -I/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/build/include -I/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/llvm/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -fPIC  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -std=c++17 -MD -MT lib/IR/CMakeFiles/LLVMCore.dir/ProfDataUtils.cpp.o -MF lib/IR/CMakeFiles/LLVMCore.dir/ProfDataUtils.cpp.o.d -o lib/IR/CMakeFiles/LLVMCore.dir/ProfDataUtils.cpp.o -c /home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/llvm/lib/IR/ProfDataUtils.cpp
/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/llvm/lib/IR/ProfDataUtils.cpp: In function ‘llvm::SmallVector<unsigned int> llvm::downscaleWeights(llvm::ArrayRef<long unsigned int>, std::optional<long unsigned int>)’:
/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/llvm/lib/IR/ProfDataUtils.cpp:282:10: error: could not convert ‘DownscaledWeights’ from ‘SmallVector<[...],4>’ to ‘SmallVector<[...],12>’
  282 |   return DownscaledWeights;
      |          ^~~~~~~~~~~~~~~~~
      |          |
      |          SmallVector<[...],4>
[1996/8006] Building CXX object lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/MachineUniformityAnalysis.cpp.o
[1997/8006] Building CXX object lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/MachineTraceMetrics.cpp.o
[1998/8006] Building CXX object lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/MachineVerifier.cpp.o
[1999/8006] Building CXX object lib/IR/CMakeFiles/LLVMCore.dir/MDBuilder.cpp.o
[2000/8006] Building X86GenGlobalISel.inc...
[2001/8006] Building X86GenFastISel.inc...
[2002/8006] Building X86GenSubtargetInfo.inc...
[2003/8006] Building X86GenDAGISel.inc...
[2004/8006] Building CXX object lib/IR/CMakeFiles/LLVMCore.dir/Function.cpp.o
[2005/8006] Building CXX object lib/IR/CMakeFiles/LLVMCore.dir/Instruction.cpp.o
[2006/8006] Building CXX object lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/MachineCFGPrinter.cpp.o
[2007/8006] Building X86GenInstrInfo.inc...
[2008/8006] Building CXX object lib/IR/CMakeFiles/LLVMCore.dir/Instructions.cpp.o
[2009/8006] Building CXX object lib/Transforms/Instrumentation/CMakeFiles/LLVMInstrumentation.dir/HWAddressSanitizer.cpp.o
[2010/8006] Building AMDGPUGenMCPseudoLowering.inc...
[2011/8006] Building AMDGPUGenRegBankGICombiner.inc...
[2012/8006] Building AMDGPUGenPostLegalizeGICombiner.inc...
[2013/8006] Building AMDGPUGenPreLegalizeGICombiner.inc...
[2014/8006] Building AMDGPUGenMCCodeEmitter.inc...
[2015/8006] Building CXX object lib/IR/CMakeFiles/LLVMCore.dir/Verifier.cpp.o
[2016/8006] Building CXX object lib/IR/CMakeFiles/LLVMCore.dir/Metadata.cpp.o
[2017/8006] Building AMDGPUGenDisassemblerTables.inc...
[2018/8006] Building AMDGPUGenSubtargetInfo.inc...
[2019/8006] Building AMDGPUGenCallingConv.inc...
[2020/8006] Building AMDGPUGenSearchableTables.inc...
[2021/8006] Building AMDGPUGenAsmWriter.inc...
[2022/8006] Building AMDGPUGenGlobalISel.inc...
[2023/8006] Building AMDGPUGenAsmMatcher.inc...
[2024/8006] Building CXX object lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/CodeGenPrepare.cpp.o
[2025/8006] Building AMDGPUGenDAGISel.inc...
[2026/8006] Building AMDGPUGenRegisterBank.inc...
Step 7 (build cmake config) failure: build cmake config (failure)
...
[1986/8006] Building CXX object lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/MachinePipeliner.cpp.o
[1987/8006] Building CXX object lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/MachineRegionInfo.cpp.o
[1988/8006] Building CXX object lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/MachineScheduler.cpp.o
[1989/8006] Building CXX object lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/MachineRegisterInfo.cpp.o
[1990/8006] Building CXX object lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/MachineSink.cpp.o
[1991/8006] Building CXX object lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/MachineSSAContext.cpp.o
[1992/8006] Building CXX object lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/MachineSizeOpts.cpp.o
[1993/8006] Building CXX object lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/MachineSSAUpdater.cpp.o
[1994/8006] Building CXX object lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/MachineStripDebug.cpp.o
[1995/8006] Building CXX object lib/IR/CMakeFiles/LLVMCore.dir/ProfDataUtils.cpp.o
FAILED: lib/IR/CMakeFiles/LLVMCore.dir/ProfDataUtils.cpp.o 
ccache /usr/bin/c++ -DGTEST_HAS_RTTI=0 -DLLVM_EXPORTS -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/build/lib/IR -I/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/llvm/lib/IR -I/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/build/include -I/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/llvm/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -fPIC  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -std=c++17 -MD -MT lib/IR/CMakeFiles/LLVMCore.dir/ProfDataUtils.cpp.o -MF lib/IR/CMakeFiles/LLVMCore.dir/ProfDataUtils.cpp.o.d -o lib/IR/CMakeFiles/LLVMCore.dir/ProfDataUtils.cpp.o -c /home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/llvm/lib/IR/ProfDataUtils.cpp
/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/llvm/lib/IR/ProfDataUtils.cpp: In function ‘llvm::SmallVector<unsigned int> llvm::downscaleWeights(llvm::ArrayRef<long unsigned int>, std::optional<long unsigned int>)’:
/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/llvm/lib/IR/ProfDataUtils.cpp:282:10: error: could not convert ‘DownscaledWeights’ from ‘SmallVector<[...],4>’ to ‘SmallVector<[...],12>’
  282 |   return DownscaledWeights;
      |          ^~~~~~~~~~~~~~~~~
      |          |
      |          SmallVector<[...],4>
[1996/8006] Building CXX object lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/MachineUniformityAnalysis.cpp.o
[1997/8006] Building CXX object lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/MachineTraceMetrics.cpp.o
[1998/8006] Building CXX object lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/MachineVerifier.cpp.o
[1999/8006] Building CXX object lib/IR/CMakeFiles/LLVMCore.dir/MDBuilder.cpp.o
[2000/8006] Building X86GenGlobalISel.inc...
[2001/8006] Building X86GenFastISel.inc...
[2002/8006] Building X86GenSubtargetInfo.inc...
[2003/8006] Building X86GenDAGISel.inc...
[2004/8006] Building CXX object lib/IR/CMakeFiles/LLVMCore.dir/Function.cpp.o
[2005/8006] Building CXX object lib/IR/CMakeFiles/LLVMCore.dir/Instruction.cpp.o
[2006/8006] Building CXX object lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/MachineCFGPrinter.cpp.o
[2007/8006] Building X86GenInstrInfo.inc...
[2008/8006] Building CXX object lib/IR/CMakeFiles/LLVMCore.dir/Instructions.cpp.o
[2009/8006] Building CXX object lib/Transforms/Instrumentation/CMakeFiles/LLVMInstrumentation.dir/HWAddressSanitizer.cpp.o
[2010/8006] Building AMDGPUGenMCPseudoLowering.inc...
[2011/8006] Building AMDGPUGenRegBankGICombiner.inc...
[2012/8006] Building AMDGPUGenPostLegalizeGICombiner.inc...
[2013/8006] Building AMDGPUGenPreLegalizeGICombiner.inc...
[2014/8006] Building AMDGPUGenMCCodeEmitter.inc...
[2015/8006] Building CXX object lib/IR/CMakeFiles/LLVMCore.dir/Verifier.cpp.o
[2016/8006] Building CXX object lib/IR/CMakeFiles/LLVMCore.dir/Metadata.cpp.o
[2017/8006] Building AMDGPUGenDisassemblerTables.inc...
[2018/8006] Building AMDGPUGenSubtargetInfo.inc...
[2019/8006] Building AMDGPUGenCallingConv.inc...
[2020/8006] Building AMDGPUGenSearchableTables.inc...
[2021/8006] Building AMDGPUGenAsmWriter.inc...
[2022/8006] Building AMDGPUGenGlobalISel.inc...
[2023/8006] Building AMDGPUGenAsmMatcher.inc...
[2024/8006] Building CXX object lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/CodeGenPrepare.cpp.o
[2025/8006] Building AMDGPUGenDAGISel.inc...
[2026/8006] Building AMDGPUGenRegisterBank.inc...

```

</details>

https://github.com/llvm/llvm-project/pull/153735


More information about the llvm-commits mailing list