[llvm-branch-commits] [llvm] AMDGPU/GlobalISel: Import D16 load patterns and add combines for them (PR #153178)

Pierre van Houtryve via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Aug 26 02:51:44 PDT 2025


================
@@ -71,6 +71,14 @@ def int_minmax_to_med3 : GICombineRule<
          [{ return matchIntMinMaxToMed3(*${min_or_max}, ${matchinfo}); }]),
   (apply [{ applyMed3(*${min_or_max}, ${matchinfo}); }])>;
 
+def d16_matchdata : GIDefMatchData<"D16MatchInfo">;
+
+def d16_load : GICombineRule<
+  (defs root:$bitcast, d16_matchdata:$matchinfo),
+  (match (wip_match_opcode G_BITCAST):$bitcast,
+         [{ return matchD16Load(*${bitcast}, ${matchinfo}); }]),
+  (apply [{ applyD16Load(*${bitcast}, ${matchinfo}); }])>;
----------------
Pierre-vh wrote:

You could use the `(combine ...` rule to do match + apply in one go, that avoids passing the complex MatchInfo object around

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


More information about the llvm-branch-commits mailing list