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

Daniel Sanders via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 21 11:27:34 PST 2020


dsanders accepted this revision.
dsanders added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: llvm/include/llvm/CodeGen/GlobalISel/GISelKnownBits.h:37
+  /// Cache maintained during a computeKnownBits request.
+  DenseMap<const MachineInstr *, KnownBits> ComputeKnownBitsCache;
 
----------------
qcolombet wrote:
> arsenm wrote:
> > This assumes an instruction with a single def
> Good point. I'll do the mapping with a Register instead.
Thanks. My long term plan for the intra/inter-pass cache is based about caching based on the register too. The thinking being that passes can't cause known bits of a vreg to become unknown or change without also breaking their contracts (you might not be able to tell that a known bit is still known but it still is). Legalize/Combine/ISel/etc. are all required to emit functionally equivalent replacements. They'll sometimes make undefined bits known so the stale cache issue still matters for optimization but not for correctness.


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