[llvm] [SwitchLowering] Support merging 0 and power-of-2 case. (PR #139736)

Amara Emerson via llvm-commits llvm-commits at lists.llvm.org
Tue May 27 10:59:43 PDT 2025


================
@@ -362,6 +362,41 @@ void SwitchCG::SwitchLowering::findBitTestClusters(CaseClusterVector &Clusters,
     }
   }
   Clusters.resize(DstIndex);
+
+  // Check if the clusters contain one checking for 0 and another one checking
+  // for a power-of-2 constant with matching destinations. Those clusters can be
+  // combined to a single ane with CC_And.
----------------
aemerson wrote:

typo `ane`

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


More information about the llvm-commits mailing list