64 lines · plain
1# RUN: llc -mtriple=x86_64-- -run-pass=register-coalescer -run-pass=regallocbasic -run-pass=virtregrewriter -late-remat-update-threshold=0 %s -o - | FileCheck %s2#3# PR40061: %t2 = %t1 is rematerialized and %t1 is added into toBeUpdated set4# to postpone its live interval update. After the rematerialization, the live5# interval of %t1 is larger than necessary. Then %t1 is merged into %t3 and %t16# gets removed. After the merge, %t3 contains live interval larger than7# necessary. Because %t3 is not in toBeUpdated set so its live interval is not8# updated after register coalescing, and it will break some assumption in9# regalloc. This test wants to check the live interval is up-to-date after10# register coalescing.11#12# To prevent the test from taking effect only in assert enabled mode, we want13# to achieve the test goal without dumping regalloc trace. We add strong hint14# to allocate both %t1 and %t2 to $rax register. If the %t1's live interval is15# not shrinked properly after register coalescing, %t1 and %t2 will not be16# both allocated to $rax because of inference, and we utilize the fact to17# achieve the test goal. But note that the assumption only holds when we use18# regallocbasic instead of greedy because greedy can update the live interval19# in the process of splitting.20#21# CHECK-LABEL: name: foo22# CHECK: bb.0.entry:23# CHECK: $rax = MOV64ri32 -1124# CHECK: bb.1:25# CHECK: $rax = MOV64ri32 -1126# CHECK: $rax = ADD64ri8 killed renamable $rax, 527# CHECK: CMP64ri8 renamable $rax28# CHECK: RET 0, $rax29# CHECK: bb.2:30# CHECK: $rax = ADD64ri8 killed renamable $rax, 1031# CHECK: bb.3:32# CHECK: RET 0, $rax33---34name: foo35body: |36 bb.0.entry:37 successors: %bb.1(0x15555555), %bb.2(0x6aaaaaab)38 39 %t1:gr64 = MOV64ri32 -1140 CMP64ri8 %t1, 1, implicit-def $eflags41 JCC_1 %bb.2, 4, implicit killed $eflags42 JMP_1 %bb.143 44 bb.1:45 successors: %bb.1(0x80000000)46 47 %t2:gr64 = COPY %t148 %t2:gr64 = ADD64ri8 %t2, 5, implicit-def $eflags49 $rax = COPY %t250 CMP64ri8 %t2, 1, implicit-def $eflags51 JCC_1 %bb.1, 4, implicit killed $eflags52 RET 0, $rax53 54 bb.2:55 successors: %bb.3(0x80000000)56 %t3:gr64 = COPY %t157 %t3:gr64 = ADD64ri8 %t3, 10, implicit-def $eflags58 59 bb.3:60 $rax = COPY %t361 RET 0, $rax62 63...64