[llvm] 0faac15 - [RISCV] Remove duplicate SDNodeXForm. NFC
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 4 17:26:30 PDT 2022
Author: Craig Topper
Date: 2022-11-04T17:26:20-07:00
New Revision: 0faac15089af4f75172e48b2580dfc46eedcc3b7
URL: https://github.com/llvm/llvm-project/commit/0faac15089af4f75172e48b2580dfc46eedcc3b7
DIFF: https://github.com/llvm/llvm-project/commit/0faac15089af4f75172e48b2580dfc46eedcc3b7.diff
LOG: [RISCV] Remove duplicate SDNodeXForm. NFC
Added:
Modified:
llvm/lib/Target/RISCV/RISCVInstrInfoZb.td
Removed:
################################################################################
diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfoZb.td b/llvm/lib/Target/RISCV/RISCVInstrInfoZb.td
index 50ecd8b8da99..90ae2ac39843 100644
--- a/llvm/lib/Target/RISCV/RISCVInstrInfoZb.td
+++ b/llvm/lib/Target/RISCV/RISCVInstrInfoZb.td
@@ -101,12 +101,6 @@ def BSETINVTwoBitsMask : PatLeaf<(imm), [{
return countPopulation(N->getZExtValue()) == 2;
}]>;
-def TrailingZerosXForm : SDNodeXForm<imm, [{
- uint64_t I = N->getZExtValue();
- return CurDAG->getTargetConstant(countTrailingZeros(I), SDLoc(N),
- N->getValueType(0));
-}]>;
-
def BSETINVTwoBitsMaskHigh : SDNodeXForm<imm, [{
uint64_t I = N->getZExtValue();
return CurDAG->getTargetConstant(63 - countLeadingZeros(I), SDLoc(N),
@@ -562,10 +556,10 @@ def : Pat<(seteq (and GPR:$rs1, SingleBitSetMask:$mask), 0),
(BEXTI (XORI GPR:$rs1, -1), SingleBitSetMask:$mask)>;
def : Pat<(or GPR:$r, BSETINVTwoBitsMask:$i),
- (BSETI (BSETI GPR:$r, (TrailingZerosXForm BSETINVTwoBitsMask:$i)),
+ (BSETI (BSETI GPR:$r, (TrailingZeros BSETINVTwoBitsMask:$i)),
(BSETINVTwoBitsMaskHigh BSETINVTwoBitsMask:$i))>;
def : Pat<(xor GPR:$r, BSETINVTwoBitsMask:$i),
- (BINVI (BINVI GPR:$r, (TrailingZerosXForm BSETINVTwoBitsMask:$i)),
+ (BINVI (BINVI GPR:$r, (TrailingZeros BSETINVTwoBitsMask:$i)),
(BSETINVTwoBitsMaskHigh BSETINVTwoBitsMask:$i))>;
def : Pat<(or GPR:$r, BSETINVORIMask:$i),
(BSETI (ORI GPR:$r, (BSETINVORIMaskLow BSETINVORIMask:$i)),
@@ -702,13 +696,13 @@ def : Pat<(add GPR:$r, CSImm12MulBy8:$i),
def : Pat<(mul GPR:$r, C3LeftShift:$i),
(SLLI (SH1ADD GPR:$r, GPR:$r),
- (TrailingZerosXForm C3LeftShift:$i))>;
+ (TrailingZeros C3LeftShift:$i))>;
def : Pat<(mul GPR:$r, C5LeftShift:$i),
(SLLI (SH2ADD GPR:$r, GPR:$r),
- (TrailingZerosXForm C5LeftShift:$i))>;
+ (TrailingZeros C5LeftShift:$i))>;
def : Pat<(mul GPR:$r, C9LeftShift:$i),
(SLLI (SH3ADD GPR:$r, GPR:$r),
- (TrailingZerosXForm C9LeftShift:$i))>;
+ (TrailingZeros C9LeftShift:$i))>;
def : Pat<(mul_const_oneuse GPR:$r, (XLenVT 11)),
(SH1ADD (SH2ADD GPR:$r, GPR:$r), GPR:$r)>;
@@ -771,14 +765,14 @@ def : Pat<(i64 (add (and GPR:$rs1, 0x7FFFFFFF8), non_imm12:$rs2)),
(SH3ADD_UW (SRLI GPR:$rs1, 3), GPR:$rs2)>;
def : Pat<(mul (binop_oneuse<and> GPR:$r, 0xFFFFFFFF), C3LeftShiftUW:$i),
- (SH1ADD (SLLI_UW GPR:$r, (TrailingZerosXForm C3LeftShiftUW:$i)),
- (SLLI_UW GPR:$r, (TrailingZerosXForm C3LeftShiftUW:$i)))>;
+ (SH1ADD (SLLI_UW GPR:$r, (TrailingZeros C3LeftShiftUW:$i)),
+ (SLLI_UW GPR:$r, (TrailingZeros C3LeftShiftUW:$i)))>;
def : Pat<(mul (binop_oneuse<and> GPR:$r, 0xFFFFFFFF), C5LeftShiftUW:$i),
- (SH2ADD (SLLI_UW GPR:$r, (TrailingZerosXForm C5LeftShiftUW:$i)),
- (SLLI_UW GPR:$r, (TrailingZerosXForm C5LeftShiftUW:$i)))>;
+ (SH2ADD (SLLI_UW GPR:$r, (TrailingZeros C5LeftShiftUW:$i)),
+ (SLLI_UW GPR:$r, (TrailingZeros C5LeftShiftUW:$i)))>;
def : Pat<(mul (binop_oneuse<and> GPR:$r, 0xFFFFFFFF), C9LeftShiftUW:$i),
- (SH3ADD (SLLI_UW GPR:$r, (TrailingZerosXForm C9LeftShiftUW:$i)),
- (SLLI_UW GPR:$r, (TrailingZerosXForm C9LeftShiftUW:$i)))>;
+ (SH3ADD (SLLI_UW GPR:$r, (TrailingZeros C9LeftShiftUW:$i)),
+ (SLLI_UW GPR:$r, (TrailingZeros C9LeftShiftUW:$i)))>;
} // Predicates = [HasStdExtZba, IsRV64]
let Predicates = [HasStdExtZbcOrZbkc] in {
More information about the llvm-commits
mailing list