[all-commits] [llvm/llvm-project] e240e6: [IRSim] Check largest sections first when analyzin...

Andrew Litteken via All-commits all-commits at lists.llvm.org
Tue Mar 21 12:50:00 PDT 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e240e6b8b7cc68a29bc8a5d6a7d0e3b7eaa61dc0
  Author: Andrew Litteken <andrew.litteken at gmail.com>
  Date:   2023-03-21 (Tue, 21 Mar 2023)

  Changed paths:
    M llvm/include/llvm/Analysis/IRSimilarityIdentifier.h
    M llvm/lib/Analysis/IRSimilarityIdentifier.cpp
    M llvm/test/Analysis/IRSimilarityIdentifier/basic.ll
    M llvm/test/Analysis/IRSimilarityIdentifier/debug-inst-starts-block.ll
    M llvm/test/Analysis/IRSimilarityIdentifier/different.ll
    M llvm/test/Analysis/IRSimilarityIdentifier/nothing.ll
    M llvm/test/Transforms/IROutliner/illegal-assumes.ll
    M llvm/test/tools/llvm-sim/single-sim-file.test
    M llvm/test/tools/llvm-sim/single-sim.test

  Log Message:
  [IRSim] Check largest sections first when analyzing similarity

When we check for similarity, right now there is no order to how it is checked, except for via the suffix tree ordering.

We can reduce how much structural analysis we perform by checking the the regions in decreasing size. In doing so, we know that if two large sections match, each of their contained regions also match. This allows us to skip the structural checking for each smaller section. IT does require that we use the large regions as a "bridge" to create the canonical mapping between the two regions.

This reduces compile time significantly for some benchmarks. It will not perform as well for programs with many small items.

Recommit fixes the IRSimilarity tests.

Recommit of: 805ec19d7d9915989be8a8a626176b5e29e19eee

Recommit fixes llvm-sim tests

Recommit of: 082ec267583100455fee356bb0d4ebd55aba2d46

Reviewer: paquette
Differential Revision: https://reviews.llvm.org/D139338

More information about the All-commits mailing list