[all-commits] [llvm/llvm-project] a4798b: [flang][NFC] use mlir::SymbolTable in lowering (#8...

jeanPerier via All-commits all-commits at lists.llvm.org
Tue Apr 2 05:29:50 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a4798bb0b67533b37d6b34fd5292714aac3b17d9
      https://github.com/llvm/llvm-project/commit/a4798bb0b67533b37d6b34fd5292714aac3b17d9
  Author: jeanPerier <jperier at nvidia.com>
  Date:   2024-04-02 (Tue, 02 Apr 2024)

  Changed paths:
    M flang/include/flang/Lower/AbstractConverter.h
    M flang/include/flang/Optimizer/Builder/FIRBuilder.h
    M flang/include/flang/Optimizer/Dialect/FIROpsSupport.h
    M flang/lib/Lower/Bridge.cpp
    M flang/lib/Lower/CallInterface.cpp
    M flang/lib/Lower/OpenACC.cpp
    M flang/lib/Optimizer/Builder/FIRBuilder.cpp
    M flang/lib/Optimizer/Builder/IntrinsicCall.cpp
    M flang/lib/Optimizer/Builder/LowLevelIntrinsics.cpp
    M flang/lib/Optimizer/Builder/PPCIntrinsicCall.cpp
    M flang/lib/Optimizer/Dialect/FIROps.cpp
    M flang/lib/Optimizer/Transforms/SimplifyIntrinsics.cpp

  Log Message:
  -----------
  [flang][NFC] use mlir::SymbolTable in lowering (#86673)

Whenever lowering is checking if a function or global already exists in
the mlir::Module, it was doing module->lookup.

On big programs (~5000 globals and functions), this causes important
slowdowns because these lookups are linear. Use mlir::SymbolTable to
speed-up these lookups. The SymbolTable has to be created from the
ModuleOp and maintained in sync. It is therefore placed in the
converter, and FirOPBuilders can take a pointer to it to speed-up the
lookups.

This patch does not bring mlir::SymbolTable to FIR/HLFIR passes, but
some passes creating a lot of runtime calls could benefit from it too.
More analysis will be needed.

As an example of the speed-ups, this patch speeds-up compilation of
Whizard compare_amplitude_UFO.F90 from 5 mins to 2 mins on my machine
(there is still room for speed-ups).



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