1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 3
2 # RUN: llc -mtriple=amdgcn -mcpu=gfx900 -verify-machineinstrs -run-pass=si-fold-operands -o - %s | FileCheck -check-prefix=GCN %s
4 # The constant is 0xffffffff80000000. It is 64-bit negative constant, but it passes the test
5 # isInt<32>(). Nonetheless it is not a legal literal for a binary or unsigned operand and
6 # cannot be used right in the shift as HW will zero extend it.
9 name: imm64_shift_int32_const_0xffffffff80000000
12 ; GCN-LABEL: name: imm64_shift_int32_const_0xffffffff80000000
13 ; GCN: [[S_MOV_B:%[0-9]+]]:sreg_64 = S_MOV_B64_IMM_PSEUDO -2147483648
14 ; GCN-NEXT: [[S_LSHL_B64_:%[0-9]+]]:sreg_64 = S_LSHL_B64 [[S_MOV_B]], 1, implicit-def $scc
15 ; GCN-NEXT: S_ENDPGM 0, implicit [[S_LSHL_B64_]]
16 %0:sreg_64 = S_MOV_B64_IMM_PSEUDO 18446744071562067968
17 %1:sreg_64 = S_LSHL_B64 %0, 1, implicit-def $scc
18 S_ENDPGM 0, implicit %1
23 name: imm64_shift_int32_const_0xffffffff
26 ; GCN-LABEL: name: imm64_shift_int32_const_0xffffffff
27 ; GCN: [[S_MOV_B:%[0-9]+]]:sreg_64 = S_MOV_B64_IMM_PSEUDO 4294967295
28 ; GCN-NEXT: [[S_LSHL_B64_:%[0-9]+]]:sreg_64 = S_LSHL_B64 [[S_MOV_B]], 1, implicit-def $scc
29 ; GCN-NEXT: S_ENDPGM 0, implicit [[S_LSHL_B64_]]
30 %0:sreg_64 = S_MOV_B64_IMM_PSEUDO 4294967295
31 %1:sreg_64 = S_LSHL_B64 %0, 1, implicit-def $scc
32 S_ENDPGM 0, implicit %1
37 name: imm64_shift_int32_const_0x80000000
40 ; GCN-LABEL: name: imm64_shift_int32_const_0x80000000
41 ; GCN: [[S_MOV_B:%[0-9]+]]:sreg_64 = S_MOV_B64_IMM_PSEUDO 2147483648
42 ; GCN-NEXT: [[S_LSHL_B64_:%[0-9]+]]:sreg_64 = S_LSHL_B64 [[S_MOV_B]], 1, implicit-def $scc
43 ; GCN-NEXT: S_ENDPGM 0, implicit [[S_LSHL_B64_]]
44 %0:sreg_64 = S_MOV_B64_IMM_PSEUDO 2147483648
45 %1:sreg_64 = S_LSHL_B64 %0, 1, implicit-def $scc
46 S_ENDPGM 0, implicit %1
51 name: imm64_shift_int32_const_0x7fffffff
54 ; GCN-LABEL: name: imm64_shift_int32_const_0x7fffffff
55 ; GCN: [[S_LSHL_B64_:%[0-9]+]]:sreg_64 = S_LSHL_B64 2147483647, 1, implicit-def $scc
56 ; GCN-NEXT: S_ENDPGM 0, implicit [[S_LSHL_B64_]]
57 %0:sreg_64 = S_MOV_B64_IMM_PSEUDO 2147483647
58 %1:sreg_64 = S_LSHL_B64 %0, 1, implicit-def $scc
59 S_ENDPGM 0, implicit %1
64 name: imm64_shift_int32_const_0x1ffffffff
67 ; GCN-LABEL: name: imm64_shift_int32_const_0x1ffffffff
68 ; GCN: [[S_MOV_B:%[0-9]+]]:sreg_64 = S_MOV_B64_IMM_PSEUDO 8589934591
69 ; GCN-NEXT: [[S_LSHL_B64_:%[0-9]+]]:sreg_64 = S_LSHL_B64 [[S_MOV_B]], 1, implicit-def $scc
70 ; GCN-NEXT: S_ENDPGM 0, implicit [[S_LSHL_B64_]]
71 %0:sreg_64 = S_MOV_B64_IMM_PSEUDO 8589934591
72 %1:sreg_64 = S_LSHL_B64 %0, 1, implicit-def $scc
73 S_ENDPGM 0, implicit %1
78 name: imm64_shift_int32_const_0xffffffffffffffff
81 ; GCN-LABEL: name: imm64_shift_int32_const_0xffffffffffffffff
82 ; GCN: [[S_LSHL_B64_:%[0-9]+]]:sreg_64 = S_LSHL_B64 -1, 1, implicit-def $scc
83 ; GCN-NEXT: S_ENDPGM 0, implicit [[S_LSHL_B64_]]
84 %0:sreg_64 = S_MOV_B64_IMM_PSEUDO -1
85 %1:sreg_64 = S_LSHL_B64 %0, 1, implicit-def $scc
86 S_ENDPGM 0, implicit %1
91 name: imm64_ashr_int32_const_0xffffffff
94 ; GCN-LABEL: name: imm64_ashr_int32_const_0xffffffff
95 ; GCN: [[S_MOV_B:%[0-9]+]]:sreg_64 = S_MOV_B64_IMM_PSEUDO 4294967295
96 ; GCN-NEXT: [[S_ASHR_I64_:%[0-9]+]]:sreg_64 = S_ASHR_I64 [[S_MOV_B]], 1, implicit-def $scc
97 ; GCN-NEXT: S_ENDPGM 0, implicit [[S_ASHR_I64_]]
98 %0:sreg_64 = S_MOV_B64_IMM_PSEUDO 4294967295
99 %1:sreg_64 = S_ASHR_I64 %0, 1, implicit-def $scc
100 S_ENDPGM 0, implicit %1
105 name: imm64_ashr_int32_const_0x7fffffff
108 ; GCN-LABEL: name: imm64_ashr_int32_const_0x7fffffff
109 ; GCN: [[S_ASHR_I64_:%[0-9]+]]:sreg_64 = S_ASHR_I64 2147483647, 1, implicit-def $scc
110 ; GCN-NEXT: S_ENDPGM 0, implicit [[S_ASHR_I64_]]
111 %0:sreg_64 = S_MOV_B64_IMM_PSEUDO 2147483647
112 %1:sreg_64 = S_ASHR_I64 %0, 1, implicit-def $scc
113 S_ENDPGM 0, implicit %1
118 name: imm64_ashr_int32_const_0xffffffffffffffff
121 ; GCN-LABEL: name: imm64_ashr_int32_const_0xffffffffffffffff
122 ; GCN: [[S_ASHR_I64_:%[0-9]+]]:sreg_64 = S_ASHR_I64 -1, 1, implicit-def $scc
123 ; GCN-NEXT: S_ENDPGM 0, implicit [[S_ASHR_I64_]]
124 %0:sreg_64 = S_MOV_B64_IMM_PSEUDO -1
125 %1:sreg_64 = S_ASHR_I64 %0, 1, implicit-def $scc
126 S_ENDPGM 0, implicit %1