[llvm] [AMDGPU] Shrink to SOPK with 32-bit signed literals (PR #70263)
Jay Foad via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 27 03:41:27 PDT 2023
================
@@ -0,0 +1,57 @@
+# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 3
+# RUN: llc -march=amdgcn -mcpu=gfx900 -verify-machineinstrs -run-pass=si-shrink-instructions -o - %s | FileCheck -check-prefix=GCN %s
+
+---
+name: shrink_kimm32_mov_b32
+tracksRegLiveness: true
+body: |
+ bb.0:
+
+ ; GCN-LABEL: name: shrink_kimm32_mov_b32
+ ; GCN: $sgpr0 = S_MOVK_I32 -2048
+ $sgpr0 = S_MOV_B32 4294965248
+...
+
+---
+name: shrink_kimm32_cmp_eq_u32
+tracksRegLiveness: true
+body: |
+ bb.0:
+
+ ; GCN-LABEL: name: shrink_kimm32_cmp_eq_u32
+ ; GCN: S_CMPK_EQ_I32 undef $sgpr0, -2048, implicit-def $scc
+ S_CMP_EQ_U32 undef $sgpr0, 4294965248, implicit-def $scc
+...
+
+---
+name: shrink_kimm32_cmp_gt_i32
+tracksRegLiveness: true
+body: |
+ bb.0:
+
+ ; GCN-LABEL: name: shrink_kimm32_cmp_gt_i32
+ ; GCN: S_CMPK_GT_I32 undef $sgpr0, -2048, implicit-def $scc
+ S_CMP_GT_I32 undef $sgpr0, 4294965248, implicit-def $scc
+...
+
+---
+name: shrink_kimm32_add_i32
+tracksRegLiveness: true
+body: |
+ bb.0:
+
+ ; GCN-LABEL: name: shrink_kimm32_add_i32
+ ; GCN: $sgpr0 = S_ADDK_I32 undef $sgpr0, -2048, implicit-def $scc
+ $sgpr0 = S_ADD_I32 undef $sgpr0, 4294965248, implicit-def $scc
+...
+
+---
+name: shrink_kimm32_mul_i32
+tracksRegLiveness: true
+body: |
+ bb.0:
+
+ ; GCN-LABEL: name: shrink_kimm32_mul_i32
+ ; GCN: $sgpr0 = S_MULK_I32 undef $sgpr0, -2048, implicit-def $scc
+ $sgpr0 = S_MUL_I32 undef $sgpr0, 4294965248, implicit-def $scc
----------------
jayfoad wrote:
Good point, but this is just a harmless oversight in the handwritten MIR input. LLVM codegen knows that S_MUL_I32 doesn't write $scc.
https://github.com/llvm/llvm-project/pull/70263
More information about the llvm-commits
mailing list