[llvm] [DAG] ISD::matchUnaryPredicate / matchUnaryFpPredicate / matchBinaryPredicate - add DemandedElts variant (PR #183013)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 6 07:45:58 PDT 2026


================
@@ -4675,26 +4683,11 @@ bool SelectionDAG::isKnownToBeAPowerOfTwo(SDValue Val,
   };
 
   // Is the constant a known power of 2 or zero?
-  if (ISD::matchUnaryPredicate(Val, IsPowerOfTwoOrZero))
+  if (ISD::matchUnaryPredicate(Val, DemandedElts, IsPowerOfTwoOrZero,
+                               /*AllowUndefs=*/false, /*AllowTruncation=*/true))
----------------
RKSimon wrote:

in which case we should probably do that part as a separate follow up PR 

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


More information about the llvm-commits mailing list