[llvm] AMDGPU/GlobalISel: Bitcasting G_TRUNC combine (PR #217634)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 7 00:01:20 PDT 2026
================
@@ -255,6 +255,17 @@ def combine_or_s64_s32 : GICombineRule<
(G_OR $or, $x_lo, $y),
(G_MERGE_VALUES $dst, $or, $x_hi))>;
+// (bitcast (trunc i32:$src)) -> (trunc i32:$src) with the bitcast result type.
+// Both are scalars of the same size, so only the LLT kind differs; keeping the
+// trunc alone lets matchers that look through a trunc chain still fire.
+def bitcast_of_trunc : GICombineRule<
----------------
arsenm wrote:
No, 2 distinct casts. You have to truncate to i16, then perform the bitcast.
The SGPR + 16-bit type to 32-bit class resolution is a problem for selection
https://github.com/llvm/llvm-project/pull/217634
More information about the llvm-commits
mailing list