[all-commits] [llvm/llvm-project] 0c2b09: [IR] Lazily number instructions for local dominanc...

Reid Kleckner via All-commits all-commits at lists.llvm.org
Tue Feb 18 14:46:16 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 0c2b09a9b6246aebd301ad75b5d78ac1e7daa9c4
      https://github.com/llvm/llvm-project/commit/0c2b09a9b6246aebd301ad75b5d78ac1e7daa9c4
  Author: Reid Kleckner <rnk at google.com>
  Date:   2020-02-18 (Tue, 18 Feb 2020)

  Changed paths:
    M llvm/include/llvm/Analysis/AliasAnalysis.h
    M llvm/include/llvm/Analysis/CaptureTracking.h
    M llvm/include/llvm/Analysis/MemoryDependenceAnalysis.h
    R llvm/include/llvm/Analysis/OrderedBasicBlock.h
    M llvm/include/llvm/Analysis/OrderedInstructions.h
    M llvm/include/llvm/IR/BasicBlock.h
    M llvm/include/llvm/IR/Instruction.h
    M llvm/lib/Analysis/AliasAnalysis.cpp
    M llvm/lib/Analysis/CMakeLists.txt
    M llvm/lib/Analysis/CaptureTracking.cpp
    M llvm/lib/Analysis/InstructionPrecedenceTracking.cpp
    M llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
    R llvm/lib/Analysis/OrderedBasicBlock.cpp
    M llvm/lib/Analysis/OrderedInstructions.cpp
    M llvm/lib/IR/BasicBlock.cpp
    M llvm/lib/IR/Instruction.cpp
    M llvm/lib/IR/SymbolTableListTraitsImpl.h
    M llvm/lib/Target/ARM/ARMParallelDSP.cpp
    M llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
    M llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp
    M llvm/unittests/Analysis/CMakeLists.txt
    M llvm/unittests/Analysis/CaptureTrackingTest.cpp
    R llvm/unittests/Analysis/OrderedBasicBlockTest.cpp
    M llvm/unittests/IR/BasicBlockTest.cpp
    M llvm/utils/gn/secondary/llvm/lib/Analysis/BUILD.gn
    M llvm/utils/gn/secondary/llvm/unittests/Analysis/BUILD.gn

  Log Message:
  -----------
  [IR] Lazily number instructions for local dominance queries

Essentially, fold OrderedBasicBlock into BasicBlock, and make it
auto-invalidate the instruction ordering when new instructions are
added. Notably, we don't need to invalidate it when removing
instructions, which is helpful when a pass mostly delete dead
instructions rather than transforming them.

The downside is that Instruction grows from 56 bytes to 64 bytes.  The
resulting LLVM code is substantially simpler and automatically handles
invalidation, which makes me think that this is the right speed and size
tradeoff.

The important change is in SymbolTableTraitsImpl.h, where the numbering
is invalidated. Everything else should be straightforward.

We probably want to implement a fancier re-numbering scheme so that
local updates don't invalidate the ordering, but I plan for that to be
future work, maybe for someone else.

Reviewed By: lattner, vsk, fhahn, dexonsmith

Differential Revision: https://reviews.llvm.org/D51664




More information about the All-commits mailing list