67 lines · plain
1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 52# RUN: llc -mtriple=amdgcn -mcpu=gfx1030 -run-pass=si-fold-operands -o - %s | FileCheck %s3 4# The same literal may be used multiple times in different operands,5# as long as it is the same value.6 7---8name: fold_multiple_same_literal_use_09tracksRegLiveness: true10body: |11 bb.0:12 liveins: $vgpr013 14 ; CHECK-LABEL: name: fold_multiple_same_literal_use_015 ; CHECK: liveins: $vgpr016 ; CHECK-NEXT: {{ $}}17 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr018 ; CHECK-NEXT: [[V_DIV_SCALE_F32_e64_:%[0-9]+]]:vgpr_32, [[V_DIV_SCALE_F32_e64_1:%[0-9]+]]:sreg_32_xm0_xexec = V_DIV_SCALE_F32_e64 0, 1178657792, 0, 1178657792, 0, 1178657792, 0, 0, implicit $mode, implicit $exec19 ; CHECK-NEXT: S_ENDPGM 0, implicit [[V_DIV_SCALE_F32_e64_]]20 %0:vgpr_32 = COPY $vgpr021 %1:sreg_32 = S_MOV_B32 117865779222 %2:vgpr_32 = COPY %123 %3:vgpr_32, %4:sreg_32_xm0_xexec = V_DIV_SCALE_F32_e64 0, %2, 0, %2, 0, %2, 0, 0, implicit $mode, implicit $exec24 S_ENDPGM 0, implicit %325...26 27---28name: fold_multiple_same_literal_use_129tracksRegLiveness: true30body: |31 bb.0:32 liveins: $vgpr033 34 ; CHECK-LABEL: name: fold_multiple_same_literal_use_135 ; CHECK: liveins: $vgpr036 ; CHECK-NEXT: {{ $}}37 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr038 ; CHECK-NEXT: [[V_DIV_SCALE_F32_e64_:%[0-9]+]]:vgpr_32, [[V_DIV_SCALE_F32_e64_1:%[0-9]+]]:sreg_32_xm0_xexec = V_DIV_SCALE_F32_e64 0, 1178657792, 0, 1178657792, 0, 1178657792, 0, 0, implicit $mode, implicit $exec39 ; CHECK-NEXT: S_ENDPGM 0, implicit [[V_DIV_SCALE_F32_e64_]]40 %0:vgpr_32 = COPY $vgpr041 %1:sreg_32 = S_MOV_B32 117865779242 %2:vgpr_32 = COPY %143 %3:vgpr_32, %4:sreg_32_xm0_xexec = V_DIV_SCALE_F32_e64 0, 1178657792, 0, 1178657792, 0, %2, 0, 0, implicit $mode, implicit $exec44 S_ENDPGM 0, implicit %345...46 47---48name: no_fold_multiple_same_literal_different_value49tracksRegLiveness: true50body: |51 bb.0:52 liveins: $vgpr053 54 ; CHECK-LABEL: name: no_fold_multiple_same_literal_different_value55 ; CHECK: liveins: $vgpr056 ; CHECK-NEXT: {{ $}}57 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr058 ; CHECK-NEXT: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 1178657793, implicit $exec59 ; CHECK-NEXT: [[V_DIV_SCALE_F32_e64_:%[0-9]+]]:vgpr_32, [[V_DIV_SCALE_F32_e64_1:%[0-9]+]]:sreg_32_xm0_xexec = V_DIV_SCALE_F32_e64 0, 1178657792, 0, 1178657792, 0, [[V_MOV_B32_e32_]], 0, 0, implicit $mode, implicit $exec60 ; CHECK-NEXT: S_ENDPGM 0, implicit [[V_DIV_SCALE_F32_e64_]]61 %0:vgpr_32 = COPY $vgpr062 %1:sreg_32 = S_MOV_B32 117865779363 %2:vgpr_32 = COPY %164 %3:vgpr_32, %4:sreg_32_xm0_xexec = V_DIV_SCALE_F32_e64 0, 1178657792, 0, 1178657792, 0, %2, 0, 0, implicit $mode, implicit $exec65 S_ENDPGM 0, implicit %366...67