[llvm] [RISCV][GISel] Add ISel supports for SHXADD from Zba extension (PR #67863)

Min-Yih Hsu via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 3 15:17:34 PDT 2023


================
@@ -235,10 +235,7 @@ def SimmShiftRightBy3XForm : SDNodeXForm<imm, [{
 }]>;
 
 // Pattern to exclude simm12 immediates from matching.
-def non_imm12 : PatLeaf<(XLenVT GPR:$a), [{
-  auto *C = dyn_cast<ConstantSDNode>(N);
-  return !C || !isInt<12>(C->getSExtValue());
-}]>;
+def non_imm12 : ComplexPattern<XLenVT, 1, "selectNonImm12", [], [], 0>;
----------------
mshockwave wrote:

> Would add GISelPredicateCode to something like this work [topperc at 01205c1](https://github.com/topperc/llvm-project/commit/01205c136d77f682063a1218790f7cf0b3760fdc)

Done: it's no longer using ComplexPattern of `non_imm12` but PatFrag of `<op>_with_non_imm12` instead

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


More information about the llvm-commits mailing list