[PATCH] D139531: [Docs] Update PatFrag definition in documentation

Luke Lau via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 7 05:05:37 PST 2022


luke created this revision.
luke added a reviewer: asb.
Herald added subscribers: pmatos, StephenFan.
Herald added a project: All.
luke requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

The old definition for store was outdated


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D139531

Files:
  llvm/docs/WritingAnLLVMBackend.rst


Index: llvm/docs/WritingAnLLVMBackend.rst
===================================================================
--- llvm/docs/WritingAnLLVMBackend.rst
+++ llvm/docs/WritingAnLLVMBackend.rst
@@ -1316,13 +1316,20 @@
 
 .. code-block:: text
 
+  def st : SDNode<"ISD::STORE", SDTStore,
+                  [SDNPHasChain, SDNPMayStore, SDNPMemOperand]>;
+
+  def unindexedstore : PatFrag<(ops node:$val, node:$ptr),
+                               (st node:$val, node:$ptr)> {
+    let IsStore = true;
+    let IsUnindexed = true;
+  }
+
   def store : PatFrag<(ops node:$val, node:$ptr),
-                      (st node:$val, node:$ptr), [{
-    if (StoreSDNode *ST = dyn_cast<StoreSDNode>(N))
-      return !ST->isTruncatingStore() &&
-             ST->getAddressingMode() == ISD::UNINDEXED;
-    return false;
-  }]>;
+                      (unindexedstore node:$val, node:$ptr)> {
+    let IsStore = true;
+    let IsTruncStore = false;
+  }
 
 ``XXXInstrInfo.td`` also generates (in ``XXXGenDAGISel.inc``) the
 ``SelectCode`` method that is used to call the appropriate processing method


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139531.480862.patch
Type: text/x-patch
Size: 1086 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221207/758205c7/attachment-0001.bin>


More information about the llvm-commits mailing list