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

    <tr>
        <th>Summary</th>
        <td>
            clangBasic's dependency on FrontendOpenMP pulls in many unnecessary deps
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

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

<pre>
    A dependency from clangBasic to FrontendOpenMP was added in https://github.com/llvm/llvm-project/commit/d033f51a0aafd8149f5059bc0f89ffd300093356#diff-38a59f1dae4ff81afb7f138bb93e86f2470b6e114b3438a3fb87e2af7be53233.

Currently this increases the input size for clangBasic from 348 cpp files ([without_omp_cc.txt](https://github.com/user-attachments/files/18842407/without_omp_cc.txt)) to 1128 cpp files ([with_omp_cc.txt](https://github.com/user-attachments/files/18842406/with_omp_cc.txt)), more than 3 times the original.

This in turn adds up to compilation times for all the clang's frontend only tools like clang-format, clang-tidy, etc. Most of these bloat is coming from dependencies like LLVM IR, MC, Transforms, Analysis, .. basically backend/codegen related logic that isn't needed for almost any of these tools.

I believe having this dependency edge from clangBasic was a layering violation that was missed during the review. It'd be great to:
1. prune this dependency to save up development time for all LLVM contributors
2. have some enforcement in the future to prevent backsliding

For 1. cc @SunilKuravinakop @sandeepkosuri as authors from the patch. Do you have some cycles to restructure this dependency so that we don't pull in most of LLVM backend into clangBasic ?

For 2. An idea, cc @nikic as owner of http://llvm-compile-time-tracker.com/. I think this tracker has proven quite useful in the past for detecting overall increases in dependency graph, but detecting regressions around such inter-dependencies isn't really possible today. As we're mostly tracking the cost associated with building overall `clang`, that'll mostly build everything (and only once thanks to caching). Hence even if we have some increases in the inputs of certain targets they go unnoticed. Do you think it'd be possible to add some build graph dimension here, e.g. track `ninja -t inputs clangBasic` (and some others) so that we can track any big jumps like this ?
</pre>
<img width="1" height="1" alt="" src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