[Mlir-commits] [mlir] [mlir] Don't rely on values of MLIR_(CURDA|ROCM)_CONVERSIONS_ENABLED. (PR #82988)

Ingo Müller llvmlistbot at llvm.org
Mon Feb 26 03:49:54 PST 2024


ingomueller-net wrote:

As a comparison, these are the macros where `#if` is being used. (I removed manually some tests like `__clang_major__ <= 5`.) Note that the majority of those also doesn't rely on the values of the macros.

```
> git grep -E "^#if " -- mlir | cut -f2 -d: | sort -u
...
#if LLVM_ENABLE_ABI_BREAKING_CHECKS
#if LLVM_ENABLE_STATS
#if LLVM_ENABLE_THREADS != 0
#if LLVM_HAS_NVPTX_TARGET
#if LLVM_NATIVE_TARGET_TEST_ENABLED == 0
#if MLIR_CAPI_BUILDING_LIBRARY
#if MLIR_DEPRECATED_GPU_SERIALIZATION_ENABLE == 1
#if MLIR_ENABLE_EXPENSIVE_PATTERN_API_CHECKS
#if MLIR_ENABLE_PDL_IN_PATTERNMATCH
#if MLIR_GPU_TO_HSACO_PASS_ENABLE
#if MLIR_NVPTXCOMPILER_ENABLED == 1
```

And this is where `#ifdef` is being used:

```
> git grep -E "^#ifdef" -- mlir | cut -f2 -d: | sort -u
#ifdef __cplusplus
#ifdef CUSPARSE_COO_AOS
#ifdef CUSPARSE_COO_AOS // deprecated in cuSPARSE 11.2
#ifdef ERROR1
#ifdef ERROR10
#ifdef ERROR11
#ifdef ERROR12
#ifdef ERROR13
#ifdef ERROR2
#ifdef ERROR3
#ifdef ERROR4
#ifdef ERROR5
#ifdef ERROR6
#ifdef ERROR7
#ifdef ERROR8
#ifdef ERROR9
#ifdef EXPENSIVE_CHECKS
#ifdef GEN_PASS_DECL_MYPASS
#ifdef __has_attribute
#ifdef __linux__
#ifdef LLVM_ENABLE_ABI_BREAKING_CHECKS
#ifdef mlir_arm_sme_abi_stubs_EXPORTS
#ifdef mlir_async_runtime_EXPORTS
#ifdef MLIR_CRUNNERUTILS_DEFINE_FUNCTIONS
#ifdef mlir_c_runner_utils_EXPORTS
#ifdef MLIR_CUDA_CONVERSIONS_ENABLED
#ifdef MLIR_ENABLE_CUDA_CUSPARSE
#ifdef MLIR_ENABLE_CUDA_CUSPARSELT
#ifdef MLIR_FLOAT16_DEFINE_FUNCTIONS // We are building this library
#ifdef mlir_float16_utils_EXPORTS // We are building this library
#ifdef MLIR_GREEDY_REWRITE_RANDOMIZER_SEED
#ifdef MLIR_INCLUDE_TESTS
#ifdef MLIR_ROCM_CONVERSIONS_ENABLED
#ifdef mlir_runner_utils_EXPORTS
#ifdef NDEBUG
#ifdef __sparc__
#ifdef _WIN32
```

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


More information about the Mlir-commits mailing list