| # RUN: llc -mtriple=x86_64 -run-pass=implicit-null-checks %s -o - | FileCheck %s |
| define i32 @reg-rewrite(ptr %x, i1 %arg) { |
| br i1 %arg, label %is_null, label %not_null, !make.implicit !0 |
| # Check that the TEST instruction is replaced with |
| # FAULTING_OP only if there are no instructions |
| # between the TEST and conditional jump |
| # that clobber the register used in TEST. |
| TEST64rr $rdi, $rdi, implicit-def $eflags |
| ; CHECK-LABEL: bb.0.entry |
| renamable $rdi = MOV64ri 5000 |
| JCC_1 %bb.2, 4, implicit $eflags |
| $rax = MOV64rm renamable $rdi, 1, $noreg, 4, $noreg |