[llvm] [SCEV] Store type of expression inline, compute up front (NFC). (PR #211891)

Eli Friedman via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 24 13:02:21 PDT 2026


================
@@ -268,6 +268,9 @@ class SCEV : public FoldingSetNode {
   /// have no SCEVUse flags.
   const SCEV *CanonicalSCEV = nullptr;
 
+  /// Immutable type of the SCEV.
+  Type *const Ty;
----------------
efriedma-quic wrote:

We have 16 padding bits here... we could also consider also caching some common queries like "is this a pointer" or "what's the bit width of the effective type"?  Not sure where most of the calls to getType() are coming from.

https://github.com/llvm/llvm-project/pull/211891


More information about the llvm-commits mailing list