[llvm] [RISCV] Select and/or/xor with certain constants to Zbb ANDN/ORN/XNOR (PR #120221)
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 19 09:32:18 PST 2024
================
@@ -3236,6 +3236,35 @@ bool RISCVDAGToDAGISel::selectSHXADD_UWOp(SDValue N, unsigned ShAmt,
return false;
}
+bool RISCVDAGToDAGISel::selectInvLogicImm(SDValue N, SDValue &Val) {
+ if (!isa<ConstantSDNode>(N))
+ return false;
+
+ int64_t Imm = cast<ConstantSDNode>(N)->getSExtValue();
+ if ((Imm & 0xfff) != 0xfff || Imm == -1)
+ return false;
+
+ for (const SDNode *U : N->uses()) {
----------------
topperc wrote:
This needs to change `N->users()` now.
https://github.com/llvm/llvm-project/pull/120221
More information about the llvm-commits
mailing list