[llvm] [AMDGPU] Select trunc(srl x, 16) as hi16 subregister on true16 (PR #221960)

Harrison Hao via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 8 22:00:50 PDT 2026


================
@@ -3554,6 +3554,12 @@ def : GCNPat <
   (EXTRACT_SUBREG $a, sub0)
 >;
 
+let True16Predicate = UseRealTrue16Insts in
+def : GCNPat <
+  (i16 (DivergentUnaryFrag<trunc> (i32 (srl_oneuse VGPR_32:$src, (i32 16))))),
+  (EXTRACT_SUBREG VGPR_32:$src, hi16)
----------------
harrisonGPU wrote:

Thanks, I have updated.

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


More information about the llvm-commits mailing list