71 lines · plain
1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py2# RUN: llc -mcpu=z13 -O3 -misched=ilpmin -systemz-subreg-liveness -verify-machineinstrs -start-before register-coalescer %s -mtriple s390x-ibm-linux -stop-after machine-scheduler -o - | FileCheck %s3 4# Check that when the register coalescer rematerializes a register to set5# only a sub register, it sets the subranges of the unused lanes as being dead6# at the definition point.7#8# The way that test exercises that comes in two steps:9# - First, we need the register coalescer to rematerialize something.10# In that test, %0 is rematerializable and will be rematerialized in11# %1 since %1 and %0 cannot be directly coalesced (they interfere).12# - Second, we indirectly check that the subranges are valid for %113# when, in the machine scheduler, we move the instructions that define %114# closer to the return instruction (i.e., we move MSFI and the rematerialized15# definition of %0 (i.e., %1 = LGHI 25) down). When doing that displacement,16# the scheduler updates the live-ranges of %1. When the subrange for the17# unused lane (here the subrange for %1.subreg_h32) was not correct, the18# scheduler would hit an assertion or access some invalid memory location19# making the compiler crash.20#21# Bottom line, this test checks what was intended if at the end, both %0 and %122# are defined with `LGHI 25` and the instructions defining %1 are right before23# the return instruction.24#25# PR4137226---27name: main28tracksRegLiveness: true29body: |30 bb.0:31 32 ; CHECK-LABEL: name: main33 ; CHECK: [[LGHI:%[0-9]+]]:gr64bit = LGHI 2534 ; CHECK-NEXT: CHIMux [[LGHI]].subreg_l32, 0, implicit-def $cc35 ; CHECK-NEXT: [[LGHI1:%[0-9]+]]:gr64bit = LGHI 2536 ; CHECK-NEXT: undef [[LGHI1:%[0-9]+]].subreg_l32:gr64bit = MSFI [[LGHI1]].subreg_l32, -11744051237 ; CHECK-NEXT: Return implicit [[LGHI1]].subreg_l3238 %0:gr64bit = LGHI 2539 %1:gr32bit = COPY %0.subreg_l3240 %1:gr32bit = MSFI %1, -11744051241 %2:grx32bit = COPY %0.subreg_l3242 CHIMux killed %2, 0, implicit-def $cc43 %3:gr32bit = COPY killed %144 Return implicit %345...46 47---48name: test_dead_at_remat_later_defined49tracksRegLiveness: true50body: |51 bb.0:52 ; CHECK-LABEL: name: test_dead_at_remat_later_defined53 ; CHECK: undef [[LHI:%[0-9]+]].subreg_l32:gr128bit = LHI 054 ; CHECK-NEXT: [[LHI:%[0-9]+]].subreg_l64:gr128bit = LGHI 255 ; CHECK-NEXT: [[LHI1:%[0-9]+]]:gr32bit = LHI 156 ; CHECK-NEXT: [[LHI:%[0-9]+]].subreg_lh32:gr128bit = COPY [[LHI1]]57 ; CHECK-NEXT: [[LGHI:%[0-9]+]]:gr64bit = LGHI 258 ; CHECK-NEXT: [[LHI:%[0-9]+]].subreg_h32:gr128bit = COPY [[LGHI]].subreg_l3259 ; CHECK-NEXT: $r0q = COPY [[LHI]]60 ; CHECK-NEXT: $r4d = COPY [[LGHI]].subreg_h3261 %0:gr64bit = LGHI 262 %1:gr32bit = LHI 063 %2:gr32bit = LHI 164 undef %3.subreg_ll32:gr128bit = COPY %0.subreg_l3265 %3.subreg_lh32:gr128bit = COPY %266 %3.subreg_l32:gr128bit = COPY %167 %3.subreg_h32:gr128bit = COPY %0.subreg_l3268 $r0q = COPY %369 $r4d = COPY %0.subreg_h3270...71