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

Andrew Litteken via All-commits all-commits at lists.llvm.org
Tue Mar 21 09:01:11 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 082ec267583100455fee356bb0d4ebd55aba2d46
      https://github.com/llvm/llvm-project/commit/082ec267583100455fee356bb0d4ebd55aba2d46
  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

  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

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




More information about the All-commits mailing list