[clang] [Clang] Track alloca element types to avoid getAllocatedType() calls (PR #181740)

Oliver Hunt via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 20 20:57:16 PST 2026


================
@@ -119,7 +119,17 @@ enum TypeEvaluationKind {
 /// Helper class with most of the code for saving a value for a
 /// conditional expression cleanup.
 struct DominatingLLVMValue {
-  typedef llvm::PointerIntPair<llvm::Value *, 1, bool> saved_type;
+  struct saved_type {
+    llvm::Value *Value; // Original value if not saved, alloca if saved
+    llvm::Type *Type;   // nullptr if not saved, element type if saved
----------------
ojhunt wrote:

This seems like it would have a significant impact on memory use based on the use in dominating sets - @mizvekov I'm not sufficiently familiar with this level of codegen, is this something you know? or know who would?

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


More information about the cfe-commits mailing list