[llvm] [RISCV][GISel] Added GISelPredicateCodes to LeadingOnes*Mask (PR #119886)

Sam Elliott via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 13 15:48:53 PST 2024


================
@@ -493,7 +493,15 @@ def LeadingOnesMask : PatLeaf<(imm), [{
   if (!N->hasOneUse())
     return false;
   return !isInt<32>(N->getSExtValue()) && isMask_64(~N->getSExtValue());
-}], TrailingZeros>;
+}], TrailingZeros> {
+  let GISelPredicateCode = [{
+    if (!MRI.hasOneNonDBGUse(MI.getOperand(0).getReg()))
+      return false;
+    const auto &MO = MI.getOperand(1);
----------------
lenary wrote:

Thanks for the explanations, now I see what's going on.


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


More information about the llvm-commits mailing list