[llvm] [GlobalISel] Introduce `G_POISON` (PR #127825)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 21 04:10:43 PDT 2025


Mateusz =?utf-8?q?Sokół?= <mat646 at gmail.com>,
Mateusz =?utf-8?q?Sokół?= <mat646 at gmail.com>,
Mateusz =?utf-8?q?Sokół?= <mat646 at gmail.com>,
Mateusz =?utf-8?q?Sokół?= <mat646 at gmail.com>,
Mateusz =?utf-8?q?Sokół?= <mat646 at gmail.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/127825 at github.com>


================
@@ -140,6 +140,15 @@ def fullrev: GICombineRule <
   (apply [{ applyFullRev(*${root}, MRI); }])
 >;
 
+def fullrevpoison: GICombineRule <
+  (defs root:$root, shuffle_matchdata:$matchinfo),
+  (match (G_POISON $src2),
+         (G_SHUFFLE_VECTOR $src, $src1, $src2, $mask):$root,
+         [{ return ShuffleVectorInst::isReverseMask(${mask}.getShuffleMask(),
+                                                    ${mask}.getShuffleMask().size()); }]),
+  (apply [{ applyFullRev(*${root}, MRI); }])
+>;
----------------
arsenm wrote:

You can repeat the existing pattern for the opcodes with foreach, e.g. see idempotent_prop_frags in the generic combines 

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


More information about the llvm-commits mailing list