[all-commits] [llvm/llvm-project] 618dec: [GISel][KnownBits] Add a cache mechanism to speed ...

qcolombet via All-commits all-commits at lists.llvm.org
Fri Feb 21 14:32:11 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 618dec2aeffd9d7778b581176e0897b10731e273
      https://github.com/llvm/llvm-project/commit/618dec2aeffd9d7778b581176e0897b10731e273
  Author: Quentin Colombet <qcolombet at apple.com>
  Date:   2020-02-21 (Fri, 21 Feb 2020)

  Changed paths:
    M llvm/include/llvm/CodeGen/GlobalISel/GISelKnownBits.h
    M llvm/lib/CodeGen/GlobalISel/GISelKnownBits.cpp

  Log Message:
  -----------
  [GISel][KnownBits] Add a cache mechanism to speed compile time

This patch adds a cache that is valid only for the duration of a call
to getKnownBits. With such short lived cache we avoid all the problems
of cache invalidation while still getting the benefits of reusing
the information we already computed.

This cache is useful whenever an instruction occurs more than once
in a chain of computation.
E.g.,
v0 = G_ADD v1, v2
v3 = G_ADD v0, v1

Previously we would compute the known bits for:
v1, v2, v0, then v1 again and finally v3.

With the patch, now we won't have to recompute v1 again.

NFC




More information about the All-commits mailing list