[llvm] [GlobalISel] Cache split LLTs in IRTranslator (PR #195267)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri May 1 07:16:39 PDT 2026


================
@@ -133,13 +144,23 @@ class IRTranslator : public MachineFunctionPass {
       TypeToOffsets[V.getType()] = OffsetList;
       return OffsetList;
     }
+
+    SplitTypeListT *insertSplitTys(const Value &V) {
+      assert(!TypeToSplitTys.contains(V.getType()) && "Type already exists");
+
+      auto *SplitTyList = new (SplitTyAlloc.Allocate()) SplitTypeListT();
+      TypeToSplitTys[V.getType()] = SplitTyList;
----------------
arsenm wrote:

Use .insert + llvm_unreachable instead of the double map lookup in the assert 

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


More information about the llvm-commits mailing list