[all-commits] [llvm/llvm-project] 774b95: [SPIR-V] improve performance of Module Analysis st...

Vyacheslav Levytskyy via All-commits all-commits at lists.llvm.org
Thu Jan 18 08:48:50 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 774b9577866239f577180fdd8b78159f0a5794a5
      https://github.com/llvm/llvm-project/commit/774b9577866239f577180fdd8b78159f0a5794a5
  Author: Vyacheslav Levytskyy <89994100+VyacheslavLevytskyy at users.noreply.github.com>
  Date:   2024-01-18 (Thu, 18 Jan 2024)

  Changed paths:
    M llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.cpp

  Log Message:
  -----------
  [SPIR-V] improve performance of Module Analysis stage in the part of processing "other instructions" (#76047)

The goal of this PR is to fix an issue when Module Analysis stage is not
able to complete processing of a really big LLVM source:
https://github.com/llvm/llvm-project/issues/76048.

There is an example of a bulky LLVM source:
https://github.com/KhronosGroup/SPIRV-LLVM-Translator/blob/main/test/SpecConstants/long-spec-const-composite.ll

Processing of this file with
`llc -mtriple=spirv64-unknown-unknown -O0 long-spec-const-composite.ll
-o long-spec-const-composite.spvt`
to produce SPIR-V output using LLVM SPIR-V backend takes too long, and
I've never been able to see it actually completes. After the patch from
this PR applied elapsed time for me is ~30 sec.

The fix changes underlying data structure to be `std::set` to trace
instructions with identical operands instead of the existing approach of
the `findSameInstrInMS()` function.




More information about the All-commits mailing list