[all-commits] [llvm/llvm-project] f2e4ba: Avoid repeated checks and context lookup in llvm::...

serge-sans-paille via All-commits all-commits at lists.llvm.org
Fri Oct 21 23:43:19 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f2e4ba0e3d40b9f3d5630dcda5e82b1a98f28410
      https://github.com/llvm/llvm-project/commit/f2e4ba0e3d40b9f3d5630dcda5e82b1a98f28410
  Author: serge-sans-paille <sguelton at mozilla.com>
  Date:   2022-10-22 (Sat, 22 Oct 2022)

  Changed paths:
    M llvm/lib/IR/Metadata.cpp

  Log Message:
  -----------
  Avoid repeated checks and context lookup in llvm::Instruction::getAAMetadata

Repeated call to Instruction::hasMetadata() and lookup in
getContext().pImpl->ValueMetadata are not needed when we always work on
the same instruction, avoid them.

This simple change leads to interesting and consistent speedups in
compile time, around -0.5% according to http://llvm-compile-time-tracker.com, see

        http://llvm-compile-time-tracker.com/compare.php?from=9708d88017d0c9adaea65a4f5a5b589b67f292e2&to=88482b9addd5917e9c5226847efeb5451c5f78c0&stat=instructions

Differential Revision: https://reviews.llvm.org/D136503




More information about the All-commits mailing list