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

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 13 09:19:46 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);
+    return !isInt<32>(MO.getCImm()->getSExtValue()) && 
+            isMask_64(~MO.getCImm()->getSExtValue());
----------------
topperc wrote:

This last line is indent 1 space to far.

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


More information about the llvm-commits mailing list