[llvm] Optimize count leading ones if promoted type (PR #99591)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 25 10:56:36 PDT 2024


================
@@ -646,6 +648,39 @@ SDValue DAGTypeLegalizer::PromoteIntRes_Constant(SDNode *N) {
   return Result;
 }
 
+// (CTLZ (XOR Op -1)) --> (CTLZ_ZERO_UNDEF (XOR (SHIFT (ANYEXTEND Op1)
+//                                                     ShiftAmount)
+//                                               -1))
+static bool ExtendCtlzNot(SDNode *Node, SDValue &Result, SDLoc &dl, EVT OVT,
----------------
topperc wrote:

Return an SDValue instead of using a reference parameter. You can return a default SDValue for the current `return false` case.

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


More information about the llvm-commits mailing list