[PATCH] D74943: [GISel][KnownBits]{NFC} Add a cache mechanism to speed compile time

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 20 18:33:47 PST 2020


arsenm added inline comments.


================
Comment at: llvm/include/llvm/CodeGen/GlobalISel/GISelKnownBits.h:37
+  /// Cache maintained during a computeKnownBits request.
+  DenseMap<const MachineInstr *, KnownBits> ComputeKnownBitsCache;
 
----------------
This assumes an instruction with a single def


================
Comment at: llvm/lib/CodeGen/GlobalISel/GISelKnownBits.cpp:119
   unsigned BitWidth = DstTy.getSizeInBits();
+  auto CacheEntry = ComputeKnownBitsCache.find(&MI);
+  if (CacheEntry != ComputeKnownBitsCache.end()) {
----------------
This should at least skip for instructions with multiple defs if not handle them


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74943/new/

https://reviews.llvm.org/D74943





More information about the llvm-commits mailing list