<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/69060>69060</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [BOLT] Lots of "BOLT-WARNING: interprocedural reference between unrelated fragments" and CMake Error at cmake/modules/CheckCompilerVersion.cmake:55
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            BOLT
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          ms178
      </td>
    </tr>
</table>

<pre>
    With today's clang version 18.0.0 (5e1c2bf3e6fca35ee0445b2a81d47e8576024186), I see two problems when using my BOLT-script with instrumentation.
[build_stage3-bolt-without-sampling.bash.txt](https://github.com/llvm/llvm-project/files/12906680/build_stage3-bolt-without-sampling.bash.txt)


1. I get a lot of `BOLT-WARNING: interprocedural reference between unrelated fragments` which lead to lots of the following failed patch entries later on:
```
BOLT-WARNING: failed to patch entries in _ZN4llvm9GraphDiffIPNS_10BasicBlockELb1EE30popUpdateForIncrementalUpdatesEv.cold/1. The function will not be optimized.
BOLT-WARNING: failed to patch entries in _ZN4llvm18ilist_alloc_traitsINS_11GlobalAliasEE10deleteNodeEPS1_.cold/1. The function will not be optimized.
BOLT-WARNING: failed to patch entries in _ZNK4llvm13IRBuilderBase23getCurrentDebugLocationEv.cold/1. The function will not be optimized.
BOLT-WARNING: failed to patch entries in _ZN4llvm11Instruction10andIRFlagsEPKNS_5ValueE.cold/1. The function will not be optimized.
BOLT-WARNING: failed to patch entries in _ZN4llvm11Instruction12setSuccessorEjPNS_10BasicBlockE.cold/1. The function will not be optimized.
BOLT-WARNING: failed to patch entries in _ZN4llvm8CallBase25getBundleOpInfoForOperandEj.cold/1. The function will not be optimized.
BOLT-WARNING: failed to patch entries in _ZN4llvm17GetElementPtrInst14getIndexedTypeEPNS_4TypeENS_8ArrayRefIPNS_5ValueEEE.cold/1. The function will not be optimized.
BOLT-WARNING: failed to patch entries in _ZN4llvm17GetElementPtrInst14getIndexedTypeEPNS_4TypeENS_8ArrayRefIPNS_8ConstantEEE.cold/1. The function will not be optimized.
BOLT-WARNING: failed to patch entries in _ZN4llvm27SwitchInstProfUpdateWrapper24buildProfBranchWeightsMDEv.cold/1. The function will not be optimized.
BOLT-WARNING: failed to patch entries in _ZN4llvm6MDNodeC2ERNS_11LLVMContextEjNS_8Metadata11StorageTypeENS_8ArrayRefIPS3_EES7_.cold/1. The function will not be optimized.
BOLT-WARNING: failed to patch entries in _ZN4llvm6MDNode8uniquifyEv.cold/1. The function will not be optimized.
BOLT-WARNING: failed to patch entries in _ZN4llvm13MDAttachments6insertEjRNS_6MDNodeE.cold/1. The function will not be optimized.
BOLT-WARNING: failed to patch entries in _ZN4llvm5Value11setMetadataEjPNS_6MDNodeE.cold/1. The function will not be optimized.
BOLT-WARNING: failed to patch entries in _ZN4llvm11Instruction11setMetadataEjPNS_6MDNodeE.cold/1. The function will not be optimized.
BOLT-WARNING: failed to patch entries in _ZNK4llvm5Value30getPointerDereferenceableBytesERKNS_10DataLayoutERbS4_.cold/1. The function will not be optimized.
```

 
2. I also see the following Cmake-Error right before the instrumentation run is supposed to start:

```
-- Found Python3: /usr/bin/python3.11 (found suitable version "3.11.5", minimum required is "3.6") found components: Interpreter 
CMake Error at cmake/modules/CheckCompilerVersion.cmake:55 (if):
  if given arguments:

    "(" "STREQUAL" "MSVC" ")" "AND" "(" "19.24" "VERSION_LESS_EQUAL" ")" "AND" "(" "VERSION_LESS" "19.25" ")"

  Unknown arguments specified
Call Stack (most recent call first):
  cmake/config-ix.cmake:16 (include)
 CMakeLists.txt:885 (include)
```

The last known good version I have on my system is: clang version 18.0.0 (0468fa07f87fe3b33e2bb56c9012ecf3de6a6a87) from September 29th 2023.

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzEV12P4jrS_jXhptQocUgIF1zwEUZoaKZfmOmR3hvkJJXE3Y6dY1eaYX_9yg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