[llvm] [AArch64][GlobalISel] FP Info implementation for AArch64. (PR #177158)

David Green via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 20 08:23:21 PDT 2026


================
@@ -667,25 +679,43 @@ bool SwitchMatcher::addMatcher(Matcher &Candidate) {
   if (!candidateConditionMatches(Predicate))
     return false;
   const auto Value = Predicate.getValue();
-  Values.insert(Value);
-
+  auto It = Buckets.find(Value.RawValue);
+  if (It == Buckets.end())
+    It = Buckets.emplace(Value.RawValue, Bucket(Value)).first;
+#ifndef NDEBUG
+  else
+    assert(It->second.Value.Record.EmitStr == Value.Record.EmitStr &&
+           "Mismatched records for identical switch value");
+#endif
+  It->second.Matchers.push_back(&Candidate);
   Matchers.push_back(&Candidate);
   return true;
 }
 
 void SwitchMatcher::finalize() {
   assert(Condition == nullptr && "Already finalized");
-  assert(Values.size() == Matchers.size() && "Broken SwitchMatcher");
+  unsigned NumBucketedMatchers = 0;
----------------
davemgreen wrote:

I'll take a look - thanks for the heads up.

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


More information about the llvm-commits mailing list