# REQUIRES: asserts # RUN: llc -mtriple=riscv64-linux-gnu -x=mir < %s \ # RUN: -debug-only=machine-scheduler -start-before=machine-scheduler 2>&1 \ # RUN: -mattr=+lui-addi-fusion,+auipc-addi-fusion,+zexth-fusion,+zextw-fusion,+shifted-zextw-fusion,+ld-add-fusion \ # RUN: | FileCheck %s # CHECK: lui_addi:%bb.0 # CHECK: Macro fuse: {{.*}}LUI - ADDI --- name: lui_addi tracksRegLiveness: true body: | bb.0.entry: liveins: $x10 %1:gpr = COPY $x10 %2:gpr = LUI 1 %3:gpr = XORI %1, 2 %4:gpr = ADDI %2, 3 $x10 = COPY %3 $x11 = COPY %4 PseudoRET ... # CHECK: auipc_addi # CHECK: Macro fuse: {{.*}}AUIPC - ADDI --- name: auipc_addi tracksRegLiveness: true body: | bb.0.entry: liveins: $x10 %1:gpr = COPY $x10 %2:gpr = AUIPC 1 %3:gpr = XORI %1, 2 %4:gpr = ADDI %2, 3 $x10 = COPY %3 $x11 = COPY %4 PseudoRET ... # CHECK: slli_srli_shifted_zext # CHECK: Macro fuse: {{.*}}SLLI - SRLI --- name: slli_srli_shifted_zext tracksRegLiveness: true body: | bb.0.entry: liveins: $x10 %1:gpr = COPY $x10 %2:gpr = SLLI %1, 32 %3:gpr = XORI %1, 3 %4:gpr = SRLI %2, 4 $x10 = COPY %3 $x11 = COPY %4 PseudoRET ... # CHECK: slli_srli_zexth # CHECK: Macro fuse: {{.*}}SLLI - SRLI --- name: slli_srli_zexth tracksRegLiveness: true body: | bb.0.entry: liveins: $x10 %1:gpr = COPY $x10 %2:gpr = SLLI %1, 48 %3:gpr = XORI %1, 3 %4:gpr = SRLI %2, 48 $x10 = COPY %3 $x11 = COPY %4 PseudoRET ... # CHECK: slli_srli_zextw # CHECK: Macro fuse: {{.*}}SLLI - SRLI --- name: slli_srli_zextw tracksRegLiveness: true body: | bb.0.entry: liveins: $x10 %1:gpr = COPY $x10 %2:gpr = SLLI %1, 32 %3:gpr = XORI %1, 3 %4:gpr = SRLI %2, 32 $x10 = COPY %3 $x11 = COPY %4 PseudoRET ... # CHECK: slli_srli_no_fusion_0 # CHECK-NOT: Macro fuse: {{.*}}SLLI - SRLI --- name: slli_srli_no_fusion_0 tracksRegLiveness: true body: | bb.0.entry: liveins: $x10 %1:gpr = COPY $x10 %2:gpr = SLLI %1, 32 %3:gpr = XORI %1, 3 %4:gpr = SRLI %2, 33 $x10 = COPY %3 $x11 = COPY %4 PseudoRET ... # CHECK: slli_srli_no_fusion_1 # CHECK-NOT: Macro fuse: {{.*}}SLLI - SRLI --- name: slli_srli_no_fusion_1 tracksRegLiveness: true body: | bb.0.entry: liveins: $x10 %1:gpr = COPY $x10 %2:gpr = SLLI %1, 48 %3:gpr = XORI %1, 3 %4:gpr = SRLI %2, 4 $x10 = COPY %3 $x11 = COPY %4 PseudoRET ... # CHECK: slli_srli_no_fusion_2 # CHECK-NOT: Macro fuse: {{.*}}SLLI - SRLI --- name: slli_srli_no_fusion_2 tracksRegLiveness: true body: | bb.0.entry: liveins: $x10 %1:gpr = COPY $x10 %2:gpr = SLLI %1, 31 %3:gpr = XORI %1, 3 %4:gpr = SRLI %2, 4 $x10 = COPY %3 $x11 = COPY %4 PseudoRET ... # CHECK: slli_srli_no_fusion_3 # CHECK-NOT: Macro fuse: {{.*}}SLLI - SRLI --- name: slli_srli_no_fusion_3 tracksRegLiveness: true body: | bb.0.entry: liveins: $x10 %1:gpr = COPY $x10 %2:gpr = SLLI %1, 31 %3:gpr = XORI %1, 3 %4:gpr = SRLI %2, 48 $x10 = COPY %3 $x11 = COPY %4 PseudoRET ... # CHECK: ld_add # CHECK: Macro fuse: {{.*}}ADD - LD --- name: ld_add tracksRegLiveness: true body: | bb.0.entry: liveins: $x10, $x11 %1:gpr = COPY $x10 %2:gpr = COPY $x11 %3:gpr = ADD %1, %2 %4:gpr = XORI %2, 3 %5:gpr = LD %3, 0 $x10 = COPY %4 $x11 = COPY %5 PseudoRET ...