[all-commits] [llvm/llvm-project] a0e9a8: [flang][NFC] speedup BoxedProcedure for derived ty...

jeanPerier via All-commits all-commits at lists.llvm.org
Mon Mar 25 03:32:12 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a0e9a8da45402eea0db71976ab78d195a7287222
      https://github.com/llvm/llvm-project/commit/a0e9a8da45402eea0db71976ab78d195a7287222
  Author: jeanPerier <jperier at nvidia.com>
  Date:   2024-03-25 (Mon, 25 Mar 2024)

  Changed paths:
    M flang/lib/Optimizer/CodeGen/BoxedProcedure.cpp
    M flang/test/Fir/boxproc-2.fir

  Log Message:
  -----------
  [flang][NFC] speedup BoxedProcedure for derived types with many components (#86144)

This patch speeds up the compilation time of the example in
https://github.com/llvm/llvm-project/issues/76478#issuecomment-2011023289
from 2 minutes with my builds to about 2 seconds.

MLIR timers showed more than 98% of the time was spend in BoxedProcedure
trying to figure out if a type needs to be converted.

This is because walking the fir.type members is very expansive for types
containing many components and/or components with many sub-components.

Increase the caching time of visited types from "the type being visited"
to "the whole pass". Use DenseMap since it is not ok anymore to assume
this container will only have a few elements.



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