[llvm] [GlobalIsel] Add Gallery to MIR Patterns (PR #89974)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 25 03:17:21 PDT 2024


Thorsten =?utf-8?q?Sch=C3=BCtt?= <schuett at gmail.com>,
Thorsten =?utf-8?q?Sch=C3=BCtt?= <schuett at gmail.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/89974 at github.com>


================
@@ -514,3 +514,29 @@ of operands.
     (match (does_not_bind $tmp, $x)
            (G_MUL $dst, $x, $tmp)),
     (apply (COPY $dst, $x))>;
+
+
+ Gallery
+----------------
+
+We should use precise patterns that state our intentions. Please avoid
+using wip_match_opcode in patterns.
+
+.. code-block:: text
+  :caption: Example fold ext(trunc:nuw)
----------------
jayfoad wrote:

```suggestion
  :caption: Example fold zext(trunc:nuw)
```

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


More information about the llvm-commits mailing list