[llvm] [DAG] Improved handling of ISD::ROTL and ISD::ROTR in isKnownToBeAPowerOfTwo (PR #182744)

Mir Immad via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 22 07:54:58 PST 2026


================
@@ -4733,8 +4733,7 @@ bool SelectionDAG::isKnownToBeAPowerOfTwo(SDValue Val,
 
   case ISD::ROTL:
   case ISD::ROTR:
-    return isKnownToBeAPowerOfTwo(Val.getOperand(0), /*OrZero=*/false,
-                                  Depth + 1);
+    return isKnownToBeAPowerOfTwo(Val.getOperand(0), false, Depth + 1);
----------------
mirimmad wrote:

I seem have messed my commits. 

Got it, I'll also add tests to account for "DemandedElts".

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


More information about the llvm-commits mailing list