[llvm] [RISCV] Codegen support for XCVmem extension (PR #76916)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 4 08:10:35 PST 2024


================
@@ -19324,6 +19334,26 @@ bool RISCVTargetLowering::getPostIndexedAddressParts(SDNode *N, SDNode *Op,
                                                      SDValue &Offset,
                                                      ISD::MemIndexedMode &AM,
                                                      SelectionDAG &DAG) const {
+  if (Subtarget.hasVendorXCVmem()) {
+    if (Op->getOpcode() != ISD::ADD)
+      return false;
+
+    if (LSBaseSDNode *LS = dyn_cast<LSBaseSDNode>(N)) {
+      Base = LS->getBasePtr();
+    } else {
+      return false;
+    }
+
+    if (Base == Op->getOperand(0)) {
----------------
topperc wrote:

Drop curly braces

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


More information about the llvm-commits mailing list