[llvm] [GlobalIsel][NFC] Refactor ext of trunc (PR #92533)

Thorsten Schütt via llvm-commits llvm-commits at lists.llvm.org
Fri May 17 07:18:55 PDT 2024


================
@@ -735,18 +735,20 @@ def redundant_sext_inreg: GICombineRule <
 // the destination type.
 def anyext_trunc_fold: GICombineRule <
   (defs root:$root, register_matchinfo:$matchinfo),
-  (match (wip_match_opcode G_ANYEXT):$root,
-         [{ return Helper.matchCombineAnyExtTrunc(*${root}, ${matchinfo}); }]),
-  (apply [{ Helper.replaceSingleDefInstWithReg(*${root}, ${matchinfo}); }])
+  (match (G_TRUNC $input, $x),
----------------
tschuett wrote:

It makes an optimization for COPY, but it did never support G_ASSERT_ZEXT.
https://github.com/llvm/llvm-project/blob/30d0850e0f780b17a37522e6503c98ebe197c5fa/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp#L2438

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


More information about the llvm-commits mailing list