[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
================
@@ -520,7 +528,17 @@ def LeadingOnesWMask : PatLeaf<(imm), [{
int64_t Imm = N->getSExtValue();
return !isInt<32>(Imm) && isUInt<32>(Imm) && isShiftedMask_64(Imm) &&
Imm != UINT64_C(0xffffffff);
-}], TrailingZeros>;
+}], TrailingZeros> {
+ let GISelPredicateCode = [{
+ if (!MRI.hasOneNonDBGUse(MI.getOperand(0).getReg()))
+ return false;
+ const auto &MO = MI.getOperand(1);
+ int64_t Imm = MO.getCImm()->getSExtValue();
+ return !isInt<32>(Imm) && isUInt<32>(Imm) && isShiftedMask_64(Imm) &&
+ Imm != UINT64_C(0xffffffff);
----------------
topperc wrote:
Line this line up with `!` on the previous line.
https://github.com/llvm/llvm-project/pull/119886
More information about the llvm-commits
mailing list