[llvm] [RISCV] Add isel optimization for (add x, (and (sra y, c2), c1)) to recover regression from #101751. (PR #104114)
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Sat Aug 17 10:13:33 PDT 2024
================
@@ -1479,6 +1479,27 @@ void RISCVDAGToDAGISel::Select(SDNode *Node) {
return;
}
}
+
+ // Look for (and (sra y, c2), c1) where c1 is a shifted mask with c3
+ // leading zeros and c4 trailing zeros. If c2 is greater than c3, we can
+ // use (slli (srli (srai y, c2 - c3), c3 + c4), c4).
+ if (isShiftedMask_64(C1) && !Skip) {
----------------
topperc wrote:
The one you put in #101571? Or a new one?
https://github.com/llvm/llvm-project/pull/104114
More information about the llvm-commits
mailing list