50 lines · plain
1# RUN: llc -mtriple=x86_64 -run-pass=implicit-null-checks %s -o - | FileCheck %s2--- |3 4 define i32 @reg-rewrite(ptr %x, i1 %arg) {5 entry:6 br i1 %arg, label %is_null, label %not_null, !make.implicit !07 8 is_null:9 ret i32 4210 11 not_null:12 ret i32 10013 }14 15 !0 = !{}16 17...18---19# Check that the TEST instruction is replaced with 20# FAULTING_OP only if there are no instructions21# between the TEST and conditional jump22# that clobber the register used in TEST.23name: reg-rewrite24 25alignment: 1626tracksRegLiveness: true27liveins:28 - { reg: '$rdi' }29 30body: |31 bb.0.entry:32 liveins: $rdi33 34 TEST64rr $rdi, $rdi, implicit-def $eflags35 ; CHECK-LABEL: bb.0.entry36 ; CHECK-NOT: FAULTING_OP37 renamable $rdi = MOV64ri 500038 JCC_1 %bb.2, 4, implicit $eflags39 40 bb.1.not_null:41 liveins: $rdi, $rsi42 43 $rax = MOV64rm renamable $rdi, 1, $noreg, 4, $noreg44 RET64 $eax45 46 bb.2.is_null:47 $eax = MOV32ri 20048 RET64 $eax49...50