[all-commits] [llvm/llvm-project] c3959f: [MachineLICM] Remove CurPreheader parameter that i...

Peter Collingbourne via All-commits all-commits at lists.llvm.org
Mon Apr 14 20:12:57 PDT 2025


  Branch: refs/heads/users/pcc/spr/introduce-funique-source-file-names-flag
  Home:   https://github.com/llvm/llvm-project
  Commit: c3959f22abc62882be6c9df2fe4151c924ac3d9a
      https://github.com/llvm/llvm-project/commit/c3959f22abc62882be6c9df2fe4151c924ac3d9a
  Author: Sergei Barannikov <barannikov88 at gmail.com>
  Date:   2025-04-15 (Tue, 15 Apr 2025)

  Changed paths:
    M llvm/lib/CodeGen/MachineLICM.cpp

  Log Message:
  -----------
  [MachineLICM] Remove CurPreheader parameter that is always nullptr (#135554)

Also, rename `getCurPreheader` -> `getOrCreatePreheader` to make it
clear that this method may alter CFG.

Update `Changed` if the method modified a loop by splitting a critical
edge (this change is not strictly NFC).

The removed parameter was probably intended to save compile time by not
trying to a critical edge after the first attempt has failed, but it is
only tried once per loop.

PR: https://github.com/llvm/llvm-project/pull/135554


  Commit: 8c22f569b3b19450034832769ef77d5b2ec997d7
      https://github.com/llvm/llvm-project/commit/8c22f569b3b19450034832769ef77d5b2ec997d7
  Author: Matt <mattstark75 at gmail.com>
  Date:   2025-04-15 (Tue, 15 Apr 2025)

  Changed paths:
    M clang/lib/Sema/AnalysisBasedWarnings.cpp
    M clang/test/Modules/safe_buffers_optout.cpp

  Log Message:
  -----------
  [Fix] Speedup -Wunsafe-buffer-usage when using clang modules. (#127161)

Each piece of code should have analysis run on it precisely once.
However, if you build a module, and then build another module depending
on it, the header file of the module you depend on will have
`-Wunsafe-buffer-usage` run on it twice. This normally isn't a huge
issue, but in the case of using the standard library as a module, simply
adding the line `#include <cstddef>` increases compile times by 900ms
(from 100ms to 1 second) on my machine. I believe this is because the
standard library has massive modules, of which only a small part is used
(the AST is ~700k lines), and because if what I've been told is correct,
the AST is lazily generated, and `-Wunsafe-buffer-usage` forces it to be
evaluated every time.

See https://issues.chromium.org/issues/351909443 for details and
benchmarks.


  Commit: 984ec70b61cb57b00e622a21b259aaf11775c5f0
      https://github.com/llvm/llvm-project/commit/984ec70b61cb57b00e622a21b259aaf11775c5f0
  Author: Peter Collingbourne <peter at pcc.me.uk>
  Date:   2025-04-14 (Mon, 14 Apr 2025)

  Changed paths:
    M clang/docs/ControlFlowIntegrity.rst

  Log Message:
  -----------
  Minor documentation update.


  Commit: 1cf9f764ac41fb3492e10c78640dd50e616388db
      https://github.com/llvm/llvm-project/commit/1cf9f764ac41fb3492e10c78640dd50e616388db
  Author: Jan Svoboda <jan_svoboda at apple.com>
  Date:   2025-04-14 (Mon, 14 Apr 2025)

  Changed paths:
    M clang/include/clang/Frontend/CompilerInstance.h
    M clang/lib/Frontend/CompilerInstance.cpp

  Log Message:
  -----------
  [clang][frontend] Make `CompilerInstance::FailedModules` thread-safe (#135473)

This PR makes some progress towards making it possible to create clones
of `CompilerInstance` that are independent of each other and can be used
in a multi-threaded setting. This PR tackles
`CompilerInstance::FailedModules`, makes it a value-type instead of a
mutable shared pointer, and adds explicit copies & moves where
appropriate.

Besides that change, this PR also turns two previously free functions
with internal linkage into member functions of `CompilerInstance`, which
makes it possible to reduce the public API of that class that relates to
`FailedModules`. This reduces some API churn that was necessary for each
new member of `CompilerInstance` that needs to be cloned.


  Commit: 9585f9eec0323bf378129c9e6ad7b07a7e4bb8a5
      https://github.com/llvm/llvm-project/commit/9585f9eec0323bf378129c9e6ad7b07a7e4bb8a5
  Author: Peter Collingbourne <peter at pcc.me.uk>
  Date:   2025-04-14 (Mon, 14 Apr 2025)

  Changed paths:
    M clang/include/clang/Frontend/CompilerInstance.h
    M clang/lib/Frontend/CompilerInstance.cpp
    M clang/lib/Sema/AnalysisBasedWarnings.cpp
    M clang/test/Modules/safe_buffers_optout.cpp
    M llvm/lib/CodeGen/MachineLICM.cpp
    M llvm/lib/Transforms/Utils/ModuleUtils.cpp

  Log Message:
  -----------
  Address comments

Created using spr 1.3.6-beta.1


Compare: https://github.com/llvm/llvm-project/compare/4ddc4d6fcd93...9585f9eec032

To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list