[llvm] [mlir] Introduce LDBG_OS() macro as a variant of LDBG() (PR #157194)

LLVM Continuous Integration via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 11 05:13:00 PDT 2025


llvm-ci wrote:

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

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

<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)
...
[3939/8061] Building CXX object tools/mlir/lib/IR/CMakeFiles/obj.MLIRIR.dir/Remarks.cpp.o
[3940/8061] Building CXX object tools/mlir/lib/IR/CMakeFiles/obj.MLIRIR.dir/SymbolTable.cpp.o
[3941/8061] Building CXX object tools/mlir/lib/IR/CMakeFiles/obj.MLIRIR.dir/TensorEncoding.cpp.o
[3942/8061] Building CXX object tools/mlir/lib/IR/CMakeFiles/obj.MLIRIR.dir/Types.cpp.o
[3943/8061] Building CXX object tools/mlir/lib/IR/CMakeFiles/obj.MLIRIR.dir/TypeRange.cpp.o
[3944/8061] Building CXX object tools/mlir/lib/IR/CMakeFiles/obj.MLIRIR.dir/TypeUtilities.cpp.o
[3945/8061] Building CXX object tools/mlir/lib/IR/CMakeFiles/obj.MLIRIR.dir/Unit.cpp.o
[3946/8061] Building CXX object tools/mlir/lib/IR/CMakeFiles/obj.MLIRIR.dir/Value.cpp.o
[3947/8061] Building CXX object tools/mlir/lib/IR/CMakeFiles/obj.MLIRIR.dir/ValueRange.cpp.o
[3948/8061] Building CXX object tools/mlir/lib/Bytecode/Writer/CMakeFiles/obj.MLIRBytecodeWriter.dir/BytecodeWriter.cpp.o
FAILED: tools/mlir/lib/Bytecode/Writer/CMakeFiles/obj.MLIRBytecodeWriter.dir/BytecodeWriter.cpp.o 
ccache /usr/bin/c++ -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GLIBCXX_USE_CXX11_ABI=1 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/build/tools/mlir/lib/Bytecode/Writer -I/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/mlir/lib/Bytecode/Writer -I/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/build/tools/mlir/include -I/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/mlir/include -I/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/build/include -I/home/botworker/bbot/amdgpu-offload-rhel-9-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 -Wundef -Wno-unused-but-set-parameter -Wno-deprecated-copy -O3 -DNDEBUG -std=c++17  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT tools/mlir/lib/Bytecode/Writer/CMakeFiles/obj.MLIRBytecodeWriter.dir/BytecodeWriter.cpp.o -MF tools/mlir/lib/Bytecode/Writer/CMakeFiles/obj.MLIRBytecodeWriter.dir/BytecodeWriter.cpp.o.d -o tools/mlir/lib/Bytecode/Writer/CMakeFiles/obj.MLIRBytecodeWriter.dir/BytecodeWriter.cpp.o -c /home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/mlir/lib/Bytecode/Writer/BytecodeWriter.cpp
In file included from /home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/mlir/lib/Bytecode/Writer/BytecodeWriter.cpp:22:
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/mlir/lib/Bytecode/Writer/BytecodeWriter.cpp: In lambda function:
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/llvm/include/llvm/Support/DebugLog.h:210:23: error: static assertion failed: DEBUG_TYPE is not defined
  210 |         static_assert(false, "DEBUG_TYPE is not defined");                     \
      |                       ^~~~~
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/llvm/include/llvm/Support/DebugLog.h:109:43: note: in definition of macro ‘LDBG_STREAM_LEVEL_TYPE_FILE_AND_LINE’
  109 |                                           TYPE_OR_LEVEL, LEVEL_OR_TYPE);       \
      |                                           ^~~~~~~~~~~~~
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/llvm/include/llvm/Support/DebugLog.h:124:3: note: in expansion of macro ‘LDBG_STREAM_LEVEL_TYPE_AND_FILE’
  124 |   LDBG_STREAM_LEVEL_TYPE_AND_FILE(STREAM, LEVEL_OR_TYPE, TYPE_OR_LEVEL,        \
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/llvm/include/llvm/Support/DebugLog.h:139:3: note: in expansion of macro ‘LDGB_STREAM_LEVEL_AND_TYPE’
  139 |   LDGB_STREAM_LEVEL_AND_TYPE(LDBG_STREAM, (LEVEL_OR_TYPE),                     \
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/llvm/include/llvm/Support/DebugLog.h:140:30: note: in expansion of macro ‘LDBG_GET_DEFAULT_TYPE_OR_LEVEL’
  140 |                              LDBG_GET_DEFAULT_TYPE_OR_LEVEL(LEVEL_OR_TYPE))
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/llvm/include/llvm/Support/DebugLog.h:141:23: note: in expansion of macro ‘LDBG_LEVEL_OR_TYPE’
  141 | #define LDBG_NO_ARG() LDBG_LEVEL_OR_TYPE(1)
      |                       ^~~~~~~~~~~~~~~~~~
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/llvm/include/llvm/Support/DebugLog.h:95:47: note: in expansion of macro ‘LDBG_NO_ARG’
   95 | #define LDBG_FUNC_CHOOSER(_f1, _f2, _f3, ...) _f3
      |                                               ^~~
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/llvm/include/llvm/Support/DebugLog.h:97:3: note: in expansion of macro ‘LDBG_FUNC_CHOOSER’
   97 |   LDBG_FUNC_CHOOSER argsWithParentheses
      |   ^~~~~~~~~~~~~~~~~
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/llvm/include/llvm/Support/DebugLog.h:99:3: note: in expansion of macro ‘LDBG_FUNC_RECOMPOSER’
   99 |   LDBG_FUNC_RECOMPOSER((__VA_ARGS__, LDBG_TYPE_AND_LEVEL, LDBG_LEVEL_OR_TYPE, ))
      |   ^~~~~~~~~~~~~~~~~~~~
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/llvm/include/llvm/Support/DebugLog.h:102:3: note: in expansion of macro ‘LDBG_CHOOSE_FROM_ARG_COUNT’
  102 |   LDBG_CHOOSE_FROM_ARG_COUNT(LDBG_NO_ARG_EXPANDER __VA_ARGS__())
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/llvm/include/llvm/Support/DebugLog.h:102:30: note: in expansion of macro ‘LDBG_NO_ARG_EXPANDER’
  102 |   LDBG_CHOOSE_FROM_ARG_COUNT(LDBG_NO_ARG_EXPANDER __VA_ARGS__())
      |                              ^~~~~~~~~~~~~~~~~~~~
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/llvm/include/llvm/Support/DebugLog.h:50:19: note: in expansion of macro ‘_GET_LDBG_MACRO’
   50 | #define LDBG(...) _GET_LDBG_MACRO(__VA_ARGS__)(__VA_ARGS__)
Step 7 (build cmake config) failure: build cmake config (failure)
...
[3939/8061] Building CXX object tools/mlir/lib/IR/CMakeFiles/obj.MLIRIR.dir/Remarks.cpp.o
[3940/8061] Building CXX object tools/mlir/lib/IR/CMakeFiles/obj.MLIRIR.dir/SymbolTable.cpp.o
[3941/8061] Building CXX object tools/mlir/lib/IR/CMakeFiles/obj.MLIRIR.dir/TensorEncoding.cpp.o
[3942/8061] Building CXX object tools/mlir/lib/IR/CMakeFiles/obj.MLIRIR.dir/Types.cpp.o
[3943/8061] Building CXX object tools/mlir/lib/IR/CMakeFiles/obj.MLIRIR.dir/TypeRange.cpp.o
[3944/8061] Building CXX object tools/mlir/lib/IR/CMakeFiles/obj.MLIRIR.dir/TypeUtilities.cpp.o
[3945/8061] Building CXX object tools/mlir/lib/IR/CMakeFiles/obj.MLIRIR.dir/Unit.cpp.o
[3946/8061] Building CXX object tools/mlir/lib/IR/CMakeFiles/obj.MLIRIR.dir/Value.cpp.o
[3947/8061] Building CXX object tools/mlir/lib/IR/CMakeFiles/obj.MLIRIR.dir/ValueRange.cpp.o
[3948/8061] Building CXX object tools/mlir/lib/Bytecode/Writer/CMakeFiles/obj.MLIRBytecodeWriter.dir/BytecodeWriter.cpp.o
FAILED: tools/mlir/lib/Bytecode/Writer/CMakeFiles/obj.MLIRBytecodeWriter.dir/BytecodeWriter.cpp.o 
ccache /usr/bin/c++ -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GLIBCXX_USE_CXX11_ABI=1 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/build/tools/mlir/lib/Bytecode/Writer -I/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/mlir/lib/Bytecode/Writer -I/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/build/tools/mlir/include -I/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/mlir/include -I/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/build/include -I/home/botworker/bbot/amdgpu-offload-rhel-9-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 -Wundef -Wno-unused-but-set-parameter -Wno-deprecated-copy -O3 -DNDEBUG -std=c++17  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT tools/mlir/lib/Bytecode/Writer/CMakeFiles/obj.MLIRBytecodeWriter.dir/BytecodeWriter.cpp.o -MF tools/mlir/lib/Bytecode/Writer/CMakeFiles/obj.MLIRBytecodeWriter.dir/BytecodeWriter.cpp.o.d -o tools/mlir/lib/Bytecode/Writer/CMakeFiles/obj.MLIRBytecodeWriter.dir/BytecodeWriter.cpp.o -c /home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/mlir/lib/Bytecode/Writer/BytecodeWriter.cpp
In file included from /home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/mlir/lib/Bytecode/Writer/BytecodeWriter.cpp:22:
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/mlir/lib/Bytecode/Writer/BytecodeWriter.cpp: In lambda function:
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/llvm/include/llvm/Support/DebugLog.h:210:23: error: static assertion failed: DEBUG_TYPE is not defined
  210 |         static_assert(false, "DEBUG_TYPE is not defined");                     \
      |                       ^~~~~
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/llvm/include/llvm/Support/DebugLog.h:109:43: note: in definition of macro ‘LDBG_STREAM_LEVEL_TYPE_FILE_AND_LINE’
  109 |                                           TYPE_OR_LEVEL, LEVEL_OR_TYPE);       \
      |                                           ^~~~~~~~~~~~~
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/llvm/include/llvm/Support/DebugLog.h:124:3: note: in expansion of macro ‘LDBG_STREAM_LEVEL_TYPE_AND_FILE’
  124 |   LDBG_STREAM_LEVEL_TYPE_AND_FILE(STREAM, LEVEL_OR_TYPE, TYPE_OR_LEVEL,        \
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/llvm/include/llvm/Support/DebugLog.h:139:3: note: in expansion of macro ‘LDGB_STREAM_LEVEL_AND_TYPE’
  139 |   LDGB_STREAM_LEVEL_AND_TYPE(LDBG_STREAM, (LEVEL_OR_TYPE),                     \
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/llvm/include/llvm/Support/DebugLog.h:140:30: note: in expansion of macro ‘LDBG_GET_DEFAULT_TYPE_OR_LEVEL’
  140 |                              LDBG_GET_DEFAULT_TYPE_OR_LEVEL(LEVEL_OR_TYPE))
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/llvm/include/llvm/Support/DebugLog.h:141:23: note: in expansion of macro ‘LDBG_LEVEL_OR_TYPE’
  141 | #define LDBG_NO_ARG() LDBG_LEVEL_OR_TYPE(1)
      |                       ^~~~~~~~~~~~~~~~~~
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/llvm/include/llvm/Support/DebugLog.h:95:47: note: in expansion of macro ‘LDBG_NO_ARG’
   95 | #define LDBG_FUNC_CHOOSER(_f1, _f2, _f3, ...) _f3
      |                                               ^~~
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/llvm/include/llvm/Support/DebugLog.h:97:3: note: in expansion of macro ‘LDBG_FUNC_CHOOSER’
   97 |   LDBG_FUNC_CHOOSER argsWithParentheses
      |   ^~~~~~~~~~~~~~~~~
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/llvm/include/llvm/Support/DebugLog.h:99:3: note: in expansion of macro ‘LDBG_FUNC_RECOMPOSER’
   99 |   LDBG_FUNC_RECOMPOSER((__VA_ARGS__, LDBG_TYPE_AND_LEVEL, LDBG_LEVEL_OR_TYPE, ))
      |   ^~~~~~~~~~~~~~~~~~~~
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/llvm/include/llvm/Support/DebugLog.h:102:3: note: in expansion of macro ‘LDBG_CHOOSE_FROM_ARG_COUNT’
  102 |   LDBG_CHOOSE_FROM_ARG_COUNT(LDBG_NO_ARG_EXPANDER __VA_ARGS__())
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/llvm/include/llvm/Support/DebugLog.h:102:30: note: in expansion of macro ‘LDBG_NO_ARG_EXPANDER’
  102 |   LDBG_CHOOSE_FROM_ARG_COUNT(LDBG_NO_ARG_EXPANDER __VA_ARGS__())
      |                              ^~~~~~~~~~~~~~~~~~~~
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/llvm/include/llvm/Support/DebugLog.h:50:19: note: in expansion of macro ‘_GET_LDBG_MACRO’
   50 | #define LDBG(...) _GET_LDBG_MACRO(__VA_ARGS__)(__VA_ARGS__)

```

</details>

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


More information about the llvm-commits mailing list