1 # RUN: llc -run-pass implicit-null-checks -mtriple=x86_64-apple-macosx -o - %s | FileCheck %s
4 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
5 target triple = "x86_64-apple-macosx"
8 define i32 @imp_null_check_with_bitwise_op_0(i32* %x, i32 %val) {
10 br i1 undef, label %is_null, label %not_null, !make.implicit !0
16 br i1 undef, label %ret_100, label %ret_200
25 ;; Negative test. The regalloc is such that we cannot hoist the
26 ;; instruction materializing 2200000 into $eax
27 define i32 @imp_null_check_with_bitwise_op_1(i32* %x, i32 %val, i32* %ptr) {
29 br i1 undef, label %is_null, label %not_null, !make.implicit !0
35 br i1 undef, label %ret_100, label %ret_200
44 ;; Negative test: IR is identical to
45 ;; @imp_null_check_with_bitwise_op_0 but MIR differs.
46 define i32 @imp_null_check_with_bitwise_op_2(i32* %x, i32 %val) {
48 br i1 undef, label %is_null, label %not_null, !make.implicit !0
54 br i1 undef, label %ret_100, label %ret_200
63 ;; Negative test: IR is identical to
64 ;; @imp_null_check_with_bitwise_op_0 but MIR differs.
65 define i32 @imp_null_check_with_bitwise_op_3(i32* %x, i32 %val) {
67 br i1 undef, label %is_null, label %not_null, !make.implicit !0
73 br i1 undef, label %ret_100, label %ret_200
83 define i32 @imp_null_check_with_bitwise_op_4(i32* %x, i32 %val) {
85 br i1 undef, label %is_null, label %not_null, !make.implicit !0
91 br i1 undef, label %ret_100, label %ret_200
100 declare void @f() readonly
102 define i32 @no_hoist_across_call(i32* %ptr) {
104 %is_null = icmp eq i32* %ptr, null
105 br i1 %is_null, label %leave, label %stay, !make.implicit !0
109 %val = load i32, i32* %ptr
116 define i32 @dependency_live_in_hazard(i32* %ptr, i32** %ptr2, i32* %ptr3) #0 {
118 %val = load i32*, i32** %ptr2
119 %ptr_is_null = icmp eq i32* %ptr, null
120 br i1 %ptr_is_null, label %is_null, label %not_null, !make.implicit !0
122 not_null: ; preds = %entry
123 %addend = load i32, i32* %val
124 %result = load i32, i32* %ptr
125 %result.shr = lshr i32 %result, 4
126 %result.and = and i32 %result.shr, 4095
127 %result.add = add i32 %addend, %result.and
130 is_null: ; preds = %entry
134 define i32 @use_alternate_load_op(i32* %ptr, i32* %ptr2) {
136 %ptr_is_null = icmp eq i32* %ptr, null
137 br i1 %ptr_is_null, label %is_null, label %not_null, !make.implicit !0
146 define i32 @imp_null_check_gep_load_with_use_dep(i32* %x, i32 %a) {
148 %c = icmp eq i32* %x, null
149 br i1 %c, label %is_null, label %not_null, !make.implicit !0
151 is_null: ; preds = %entry
154 not_null: ; preds = %entry
155 %x.loc = getelementptr i32, i32* %x, i32 1
156 %y = ptrtoint i32* %x.loc to i32
158 %t = load i32, i32* %x
163 define i32 @imp_null_check_load_with_base_sep(i32* %x, i32 %a) {
165 %c = icmp eq i32* %x, null
166 br i1 %c, label %is_null, label %not_null, !make.implicit !0
168 is_null: ; preds = %entry
171 not_null: ; preds = %entry
175 define void @inc_store(i32* %ptr, i32 %val) {
177 %ptr_is_null = icmp eq i32* %ptr, null
178 br i1 %ptr_is_null, label %is_null, label %not_null, !make.implicit !0
187 define void @inc_store_plus_offset(i32* %ptr, i32 %val) {
189 %ptr_is_null = icmp eq i32* %ptr, null
190 br i1 %ptr_is_null, label %is_null, label %not_null, !make.implicit !0
199 define void @inc_store_with_dep(i32* %ptr, i32 %val) {
201 %ptr_is_null = icmp eq i32* %ptr, null
202 br i1 %ptr_is_null, label %is_null, label %not_null, !make.implicit !0
211 define i32 @inc_store_with_dep_in_null(i32* %ptr, i32 %val) {
213 %ptr_is_null = icmp eq i32* %ptr, null
214 br i1 %ptr_is_null, label %is_null, label %not_null, !make.implicit !0
223 define void @inc_store_with_volatile(i32* %ptr, i32 %val) {
225 %ptr_is_null = icmp eq i32* %ptr, null
226 br i1 %ptr_is_null, label %is_null, label %not_null, !make.implicit !0
235 define void @inc_store_with_two_dep(i32* %ptr, i32 %val) {
237 %ptr_is_null = icmp eq i32* %ptr, null
238 br i1 %ptr_is_null, label %is_null, label %not_null, !make.implicit !0
247 define void @inc_store_with_redefined_base(i32* %ptr, i32 %val) {
249 %ptr_is_null = icmp eq i32* %ptr, null
250 br i1 %ptr_is_null, label %is_null, label %not_null, !make.implicit !0
259 define i32 @inc_store_with_reused_base(i32* %ptr, i32 %val) {
261 %ptr_is_null = icmp eq i32* %ptr, null
262 br i1 %ptr_is_null, label %is_null, label %not_null, !make.implicit !0
271 define i32 @inc_store_across_call(i32* %ptr) {
273 %ptr_is_null = icmp eq i32* %ptr, null
274 br i1 %ptr_is_null, label %is_null, label %not_null, !make.implicit !0
284 define i32 @inc_store_with_dep_in_dep(i32* %ptr, i32 %val) {
286 %ptr_is_null = icmp eq i32* %ptr, null
287 br i1 %ptr_is_null, label %is_null, label %not_null, !make.implicit !0
296 define i32 @inc_store_with_load_over_store(i32* %ptr, i32* %ptr2) {
298 %ptr_is_null = icmp eq i32* %ptr, null
299 br i1 %ptr_is_null, label %is_null, label %not_null, !make.implicit !0
308 define i32 @inc_store_with_store_over_load(i32* %ptr, i32* %ptr2) {
310 %ptr_is_null = icmp eq i32* %ptr, null
311 br i1 %ptr_is_null, label %is_null, label %not_null, !make.implicit !0
320 define void @inc_store_with_store_over_store(i32* %ptr, i32* %ptr2) {
322 %ptr_is_null = icmp eq i32* %ptr, null
323 br i1 %ptr_is_null, label %is_null, label %not_null, !make.implicit !0
332 define void @inc_store_with_load_and_store(i32* %ptr, i32* %ptr2) {
334 %ptr_is_null = icmp eq i32* %ptr, null
335 br i1 %ptr_is_null, label %is_null, label %not_null, !make.implicit !0
344 define i32 @inc_store_and_load_no_alias(i32* noalias %ptr, i32* noalias %ptr2) {
346 %ptr_is_null = icmp eq i32* %ptr, null
347 br i1 %ptr_is_null, label %is_null, label %not_null, !make.implicit !0
356 define i32 @inc_store_and_load_alias(i32* %ptr, i32* %ptr2) {
358 %ptr_is_null = icmp eq i32* %ptr, null
359 br i1 %ptr_is_null, label %is_null, label %not_null, !make.implicit !0
368 define i32 @inc_spill_dep(i32* %ptr, i32 %val) {
370 %ptr_is_null = icmp eq i32* %ptr, null
371 br i1 %ptr_is_null, label %is_null, label %not_null, !make.implicit !0
380 attributes #0 = { "target-features"="+bmi,+bmi2" }
385 name: imp_null_check_with_bitwise_op_0
386 # CHECK-LABEL: name: imp_null_check_with_bitwise_op_0
388 tracksRegLiveness: true
393 # CHECK: $eax = MOV32ri 2200000
394 # CHECK-NEXT: $eax = FAULTING_OP 1, %bb.3, {{[0-9]+}}, $eax, $rdi, 1, $noreg, 0, $noreg, implicit-def $eflags :: (load 4 from %ir.x)
395 # CHECK-NEXT: JMP_1 %bb.1
401 TEST64rr $rdi, $rdi, implicit-def $eflags
402 JCC_1 %bb.3, 4, implicit $eflags
407 $eax = MOV32ri 2200000
408 $eax = AND32rm killed $eax, killed $rdi, 1, $noreg, 0, $noreg, implicit-def dead $eflags :: (load 4 from %ir.x)
409 CMP32rr killed $eax, killed $esi, implicit-def $eflags
410 JCC_1 %bb.4, 4, implicit $eflags
426 name: imp_null_check_with_bitwise_op_1
428 tracksRegLiveness: true
434 # CHECK: $eax = MOV32rm killed $rdx, 1, $noreg, 0, $noreg :: (volatile load 4 from %ir.ptr)
435 # CHECK-NEXT: TEST64rr $rdi, $rdi, implicit-def $eflags
436 # CHECK-NEXT: JCC_1 %bb.3, 4, implicit $eflags
440 liveins: $esi, $rdi, $rdx
442 $eax = MOV32rm killed $rdx, 1, $noreg, 0, $noreg :: (volatile load 4 from %ir.ptr)
443 TEST64rr $rdi, $rdi, implicit-def $eflags
444 JCC_1 %bb.3, 4, implicit $eflags
449 $eax = MOV32ri 2200000
450 $eax = AND32rm killed $eax, killed $rdi, 1, $noreg, 0, $noreg, implicit-def dead $eflags :: (load 4 from %ir.x)
451 CMP32rr killed $eax, killed $esi, implicit-def $eflags
452 JCC_1 %bb.4, 4, implicit $eflags
459 liveins: $eax, $ah, $al, $ax, $bh, $bl, $bp, $bpl, $bx, $eax, $ebp, $ebx, $rax, $rbp, $rbx, $r12, $r13, $r14, $r15, $r12b, $r13b, $r14b, $r15b, $r12d, $r13d, $r14d, $r15d, $r12w, $r13w, $r14w, $r15w
469 name: imp_null_check_with_bitwise_op_2
470 # CHECK-LABEL: name: imp_null_check_with_bitwise_op_2
472 tracksRegLiveness: true
477 # CHECK: TEST64rr $rdi, $rdi, implicit-def $eflags
478 # CHECK-NEXT: JCC_1 %bb.3, 4, implicit $eflags
484 TEST64rr $rdi, $rdi, implicit-def $eflags
485 JCC_1 %bb.3, 4, implicit $eflags
490 $eax = MOV32ri 2200000
491 $eax = ADD32ri killed $eax, 100, implicit-def dead $eflags
492 $eax = AND32rm killed $eax, killed $rdi, 1, $noreg, 0, $noreg, implicit-def dead $eflags :: (load 4 from %ir.x)
493 CMP32rr killed $eax, killed $esi, implicit-def $eflags
494 JCC_1 %bb.4, 4, implicit $eflags
510 name: imp_null_check_with_bitwise_op_3
511 # CHECK-LABEL: name: imp_null_check_with_bitwise_op_3
513 tracksRegLiveness: true
518 # CHECK: TEST64rr $rdi, $rdi, implicit-def $eflags
519 # CHECK-NEXT: JCC_1 %bb.3, 4, implicit $eflags
525 TEST64rr $rdi, $rdi, implicit-def $eflags
526 JCC_1 %bb.3, 4, implicit $eflags
532 $rdi = AND64rm killed $rdi, killed $rdi, 1, $noreg, 0, $noreg, implicit-def dead $eflags :: (load 4 from %ir.x)
533 CMP64rr killed $rdi, killed $rsi, implicit-def $eflags
534 JCC_1 %bb.4, 4, implicit $eflags
550 name: imp_null_check_with_bitwise_op_4
551 # CHECK-LABEL: name: imp_null_check_with_bitwise_op_4
553 tracksRegLiveness: true
558 # CHECK: $rbx = MOV64rr $rdx
559 # CHECK-NEXT: $rbx = FAULTING_OP 1, %bb.3, {{[0-9]+}}, $rbx, $rdi, 1, $noreg, 0, $noreg, implicit-def $eflags :: (load 4 from %ir.x)
563 liveins: $rsi, $rdi, $rdx
565 TEST64rr $rdi, $rdi, implicit-def $eflags
566 JCC_1 %bb.3, 4, implicit $eflags
569 liveins: $rsi, $rdi, $rdx
572 $rbx = AND64rm killed $rbx, killed $rdi, 1, $noreg, 0, $noreg, implicit-def dead $eflags :: (load 4 from %ir.x)
574 CMP64rr killed $rbx, killed $rsi, implicit-def $eflags
575 JCC_1 %bb.4, 4, implicit $eflags
591 name: no_hoist_across_call
592 # CHECK-LABEL: name: no_hoist_across_call
594 tracksRegLiveness: true
597 calleeSavedRegisters: [ '$bh', '$bl', '$bp', '$bpl', '$bx', '$ebp', '$ebx',
598 '$rbp', '$rbx', '$r12', '$r13', '$r14', '$r15',
599 '$r12b', '$r13b', '$r14b', '$r15b', '$r12d', '$r13d',
600 '$r14d', '$r15d', '$r12w', '$r13w', '$r14w', '$r15w' ]
602 # CHECK-NOT: FAULTING_OP
604 # CHECK: CALL64pcrel32
609 frame-setup PUSH64r killed $rbx, implicit-def $rsp, implicit $rsp
610 CFI_INSTRUCTION def_cfa_offset 16
611 CFI_INSTRUCTION offset $rbx, -16
613 TEST64rr $rbx, $rbx, implicit-def $eflags
614 JCC_1 %bb.2, 4, implicit killed $eflags
619 CALL64pcrel32 @f, csr_64, implicit $rsp, implicit-def $rsp
620 $eax = MOV32rm killed $rbx, 1, $noreg, 0, $noreg :: (load 4 from %ir.ptr)
621 $rbx = POP64r implicit-def $rsp, implicit $rsp
625 $eax = XOR32rr undef $eax, undef $eax, implicit-def dead $eflags
626 $rbx = POP64r implicit-def $rsp, implicit $rsp
631 name: dependency_live_in_hazard
632 # CHECK-LABEL: name: dependency_live_in_hazard
634 # CHECK-NOT: FAULTING_OP
635 # CHECK: bb.1.not_null:
637 # Make sure that the BEXTR32rm instruction below is not used to emit
638 # an implicit null check -- hoisting it will require hosting the move
639 # to $esi and we cannot do that without clobbering the use of $rsi in
640 # the first instruction in bb.1.not_null.
642 tracksRegLiveness: true
650 TEST64rr $rdi, $rdi, implicit-def $eflags
651 JCC_1 %bb.2, 4, implicit killed $eflags
656 $rcx = MOV64rm killed $rsi, 1, $noreg, 0, $noreg :: (load 8 from %ir.ptr2)
658 $eax = BEXTR32rm killed $rdi, 1, $noreg, 0, $noreg, killed $esi, implicit-def dead $eflags :: (load 4 from %ir.ptr)
659 $eax = ADD32rm killed $eax, killed $rcx, 1, $noreg, 0, $noreg, implicit-def dead $eflags :: (load 4 from %ir.val)
663 $eax = XOR32rr undef $eax, undef $eax, implicit-def dead $eflags
668 name: use_alternate_load_op
669 # CHECK-LABEL: name: use_alternate_load_op
671 # CHECK: $rax = FAULTING_OP 1, %bb.2, {{[0-9]+}}, $rdi, 1, $noreg, 0, $noreg
672 # CHECK-NEXT: JMP_1 %bb.1
673 # CHECK: bb.1.not_null
676 tracksRegLiveness: true
684 TEST64rr $rdi, $rdi, implicit-def $eflags
685 JCC_1 %bb.2, 4, implicit killed $eflags
690 $rcx = MOV64rm killed $rsi, 1, $noreg, 0, $noreg
691 $rcx = AND64rm killed $rcx, $rdi, 1, $noreg, 0, $noreg, implicit-def dead $eflags
692 $rax = MOV64rm killed $rdi, 1, $noreg, 0, $noreg
696 $eax = XOR32rr undef $eax, undef $eax, implicit-def dead $eflags
701 name: imp_null_check_gep_load_with_use_dep
702 # CHECK-LABEL: name: imp_null_check_gep_load_with_use_dep
704 # CHECK: $eax = FAULTING_OP 1, %bb.2, {{[0-9]+}}, $rdi, 1, $noreg, 0, $noreg, implicit-def $rax :: (load 4 from %ir.x)
705 # CHECK-NEXT: JMP_1 %bb.1
707 tracksRegLiveness: true
715 TEST64rr $rdi, $rdi, implicit-def $eflags
716 JCC_1 %bb.1, 4, implicit $eflags
721 $rsi = ADD64rr $rsi, $rdi, implicit-def dead $eflags
722 $eax = MOV32rm killed $rdi, 1, $noreg, 0, $noreg, implicit-def $rax :: (load 4 from %ir.x)
723 $eax = LEA64_32r killed $rax, 1, killed $rsi, 4, $noreg
732 name: imp_null_check_load_with_base_sep
733 # CHECK-LABEL: name: imp_null_check_load_with_base_sep
735 # CHECK: $rsi = ADD64rr $rsi, $rdi, implicit-def dead $eflags
736 # CHECK-NEXT: $esi = FAULTING_OP 1, %bb.2, {{[0-9]+}}, $esi, $rdi, 1, $noreg, 0, $noreg, implicit-def $eflags
737 # CHECK-NEXT: JMP_1 %bb.1
739 tracksRegLiveness: true
747 TEST64rr $rdi, $rdi, implicit-def $eflags
748 JCC_1 %bb.1, 4, implicit $eflags
753 $rsi = ADD64rr $rsi, $rdi, implicit-def dead $eflags
754 $esi = AND32rm killed $esi, $rdi, 1, $noreg, 0, $noreg, implicit-def dead $eflags
765 # CHECK-LABEL: name: inc_store
767 # CHECK: $noreg = FAULTING_OP 3, %bb.2, {{[0-9]+}}, $rdi, 1, $noreg, 0, $noreg, $rsi
768 # CHECK-NEXT: JMP_1 %bb.1
769 # CHECK: bb.1.not_null
772 tracksRegLiveness: true
780 TEST64rr $rdi, $rdi, implicit-def $eflags
781 JCC_1 %bb.2, 4, implicit killed $eflags
786 MOV64mr killed $rdi, 1, $noreg, 0, $noreg, killed $rsi
794 name: inc_store_plus_offset
795 # CHECK-LABEL: inc_store_plus_offset
797 # CHECK: $noreg = FAULTING_OP 3, %bb.2, {{[0-9]+}}, $rdi, 1, $noreg, 16, $noreg, $rsi
798 # CHECK-NEXT: JMP_1 %bb.1
799 # CHECK: bb.1.not_null
802 tracksRegLiveness: true
810 TEST64rr $rdi, $rdi, implicit-def $eflags
811 JCC_1 %bb.2, 4, implicit killed $eflags
816 MOV64mr killed $rdi, 1, $noreg, 16, $noreg, killed $rsi
824 name: inc_store_with_dep
825 # CHECK-LABEL: inc_store_with_dep
827 # CHECK: $esi = ADD32rr killed $esi, killed $esi, implicit-def dead $eflags
828 # CHECK-NEXT: $noreg = FAULTING_OP 3, %bb.2, {{[0-9]+}}, $rdi, 1, $noreg, 16, $noreg, $esi
829 # CHECK-NEXT: JMP_1 %bb.1
830 # CHECK: bb.1.not_null
833 tracksRegLiveness: true
841 TEST64rr $rdi, $rdi, implicit-def $eflags
842 JCC_1 %bb.2, 4, implicit killed $eflags
847 $esi = ADD32rr killed $esi, killed $esi, implicit-def dead $eflags
848 MOV32mr killed $rdi, 1, $noreg, 16, $noreg, killed $esi
856 name: inc_store_with_dep_in_null
857 # CHECK-LABEL: inc_store_with_dep_in_null
859 # CHECK: TEST64rr $rdi, $rdi, implicit-def $eflags
860 # CHECK-NEXT: JCC_1 %bb.2, 4, implicit killed $eflags
861 # CHECK: bb.1.not_null
864 tracksRegLiveness: true
872 TEST64rr $rdi, $rdi, implicit-def $eflags
873 JCC_1 %bb.2, 4, implicit killed $eflags
878 $esi = ADD32rr $esi, $esi, implicit-def dead $eflags
879 MOV32mr killed $rdi, 1, $noreg, 0, $noreg, $esi
880 $eax = MOV32rr killed $esi
886 $eax = MOV32rr killed $esi
891 name: inc_store_with_volatile
892 # CHECK-LABEL: inc_store_with_volatile
894 # CHECK: TEST64rr $rdi, $rdi, implicit-def $eflags
895 # CHECK-NEXT: JCC_1 %bb.2, 4, implicit killed $eflags
896 # CHECK: bb.1.not_null
899 tracksRegLiveness: true
907 TEST64rr $rdi, $rdi, implicit-def $eflags
908 JCC_1 %bb.2, 4, implicit killed $eflags
913 MOV32mr killed $rdi, 1, $noreg, 0, $noreg, killed $esi :: (volatile store 4 into %ir.ptr)
921 name: inc_store_with_two_dep
922 # CHECK-LABEL: inc_store_with_two_dep
924 # CHECK: TEST64rr $rdi, $rdi, implicit-def $eflags
925 # CHECK-NEXT: JCC_1 %bb.2, 4, implicit killed $eflags
926 # CHECK: bb.1.not_null
929 tracksRegLiveness: true
937 TEST64rr $rdi, $rdi, implicit-def $eflags
938 JCC_1 %bb.2, 4, implicit killed $eflags
943 $esi = ADD32rr killed $esi, killed $esi, implicit-def dead $eflags
944 $esi = ADD32ri killed $esi, 15, implicit-def dead $eflags
945 MOV32mr killed $rdi, 1, $noreg, 16, $noreg, killed $esi
953 name: inc_store_with_redefined_base
954 # CHECK-LABEL: inc_store_with_redefined_base
956 # CHECK: TEST64rr $rdi, $rdi, implicit-def $eflags
957 # CHECK-NEXT: JCC_1 %bb.2, 4, implicit killed $eflags
958 # CHECK: bb.1.not_null
961 tracksRegLiveness: true
969 TEST64rr $rdi, $rdi, implicit-def $eflags
970 JCC_1 %bb.2, 4, implicit killed $eflags
975 $rdi = ADD64rr killed $rdi, killed $rdi, implicit-def dead $eflags
976 MOV32mr killed $rdi, 1, $noreg, 16, $noreg, killed $esi
984 name: inc_store_with_reused_base
985 # CHECK-LABEL: inc_store_with_reused_base
987 # CHECK: $noreg = FAULTING_OP 3, %bb.2, {{[0-9]+}}, $rdi, 1, $noreg, 16, $noreg, $esi
988 # CHECK-NEXT: JMP_1 %bb.1
989 # CHECK: bb.1.not_null
992 tracksRegLiveness: true
1000 TEST64rr $rdi, $rdi, implicit-def $eflags
1001 JCC_1 %bb.2, 4, implicit killed $eflags
1007 MOV32mr killed $rdi, 1, $noreg, 16, $noreg, killed $esi
1011 $rax = XOR64rr undef $rax, undef $rax, implicit-def dead $eflags
1016 name: inc_store_across_call
1017 # CHECK-LABEL: inc_store_across_call
1018 # CHECK: bb.0.entry:
1019 # CHECK: TEST64rr $rbx, $rbx, implicit-def $eflags
1020 # CHECK-NEXT: JCC_1 %bb.2, 4, implicit killed $eflags
1021 # CHECK: bb.1.not_null
1024 tracksRegLiveness: true
1027 calleeSavedRegisters: [ '$bh', '$bl', '$bp', '$bpl', '$bx', '$ebp', '$ebx',
1028 '$rbp', '$rbx', '$r12', '$r13', '$r14', '$r15',
1029 '$r12b', '$r13b', '$r14b', '$r15b', '$r12d', '$r13d',
1030 '$r14d', '$r15d', '$r12w', '$r13w', '$r14w', '$r15w' ]
1035 frame-setup PUSH64r killed $rbx, implicit-def $rsp, implicit $rsp
1036 CFI_INSTRUCTION def_cfa_offset 16
1037 CFI_INSTRUCTION offset $rbx, -16
1038 $rbx = MOV64rr killed $rdi
1039 TEST64rr $rbx, $rbx, implicit-def $eflags
1040 JCC_1 %bb.2, 4, implicit killed $eflags
1045 CALL64pcrel32 @f, csr_64, implicit $rsp, implicit-def $rsp
1046 MOV32mi $rbx, 1, $noreg, 0, $noreg, 20
1047 $rax = MOV64rr killed $rbx
1048 $rbx = POP64r implicit-def $rsp, implicit $rsp
1052 $eax = XOR32rr undef $eax, undef $eax, implicit-def dead $eflags
1053 $rbx = POP64r implicit-def $rsp, implicit $rsp
1058 name: inc_store_with_dep_in_dep
1059 # CHECK-LABEL: inc_store_with_dep_in_dep
1060 # CHECK: bb.0.entry:
1061 # CHECK: TEST64rr $rdi, $rdi, implicit-def $eflags
1062 # CHECK-NEXT: JCC_1 %bb.2, 4, implicit killed $eflags
1063 # CHECK: bb.1.not_null
1066 tracksRegLiveness: true
1074 TEST64rr $rdi, $rdi, implicit-def $eflags
1075 JCC_1 %bb.2, 4, implicit killed $eflags
1081 $esi = ADD32ri killed $esi, 15, implicit-def dead $eflags
1082 MOV32mr killed $rdi, 1, $noreg, 0, $noreg, killed $esi
1086 $eax = XOR32rr undef $eax, undef $eax, implicit-def dead $eflags
1091 name: inc_store_with_load_over_store
1092 # CHECK-LABEL: inc_store_with_load_over_store
1093 # CHECK: bb.0.entry:
1094 # CHECK: TEST64rr $rdi, $rdi, implicit-def $eflags
1095 # CHECK-NEXT: JCC_1 %bb.2, 4, implicit killed $eflags
1096 # CHECK: bb.1.not_null
1099 tracksRegLiveness: true
1107 TEST64rr $rdi, $rdi, implicit-def $eflags
1108 JCC_1 %bb.2, 4, implicit killed $eflags
1113 MOV32mi killed $rsi, 1, $noreg, 0, $noreg, 2
1114 $eax = MOV32rm killed $rdi, 1, $noreg, 0, $noreg
1118 $eax = XOR32rr undef $eax, undef $eax, implicit-def dead $eflags
1123 name: inc_store_with_store_over_load
1124 # CHECK-LABEL: inc_store_with_store_over_load
1125 # CHECK: bb.0.entry:
1126 # CHECK: TEST64rr $rdi, $rdi, implicit-def $eflags
1127 # CHECK-NEXT: JCC_1 %bb.2, 4, implicit killed $eflags
1128 # CHECK: bb.1.not_null
1131 tracksRegLiveness: true
1139 TEST64rr $rdi, $rdi, implicit-def $eflags
1140 JCC_1 %bb.2, 4, implicit killed $eflags
1145 $eax = MOV32rm killed $rsi, 1, $noreg, 0, $noreg
1146 MOV32mi killed $rdi, 1, $noreg, 0, $noreg, 2
1150 $eax = XOR32rr undef $eax, undef $eax, implicit-def dead $eflags
1155 name: inc_store_with_store_over_store
1156 # CHECK-LABEL: inc_store_with_store_over_store
1157 # CHECK: bb.0.entry:
1158 # CHECK: TEST64rr $rdi, $rdi, implicit-def $eflags
1159 # CHECK-NEXT: JCC_1 %bb.2, 4, implicit killed $eflags
1160 # CHECK: bb.1.not_null
1163 tracksRegLiveness: true
1171 TEST64rr $rdi, $rdi, implicit-def $eflags
1172 JCC_1 %bb.2, 4, implicit killed $eflags
1177 MOV32mi killed $rsi, 1, $noreg, 0, $noreg, 3
1178 MOV32mi killed $rdi, 1, $noreg, 0, $noreg, 2
1186 name: inc_store_with_load_and_store
1187 # CHECK-LABEL: inc_store_with_load_and_store
1188 # CHECK: bb.0.entry:
1189 # CHECK: $noreg = FAULTING_OP 2, %bb.2, {{[0-9]+}}, $rdi, 1, $noreg, 0, $noreg, $esi, implicit-def $eflags
1190 # CHECK-NEXT: JMP_1 %bb.1
1191 # CHECK: bb.1.not_null
1194 tracksRegLiveness: true
1202 TEST64rr $rdi, $rdi, implicit-def $eflags
1203 JCC_1 %bb.2, 4, implicit killed $eflags
1208 $esi = ADD32rr $esi, $esi, implicit-def dead $eflags
1209 ADD32mr killed $rdi, 1, $noreg, 0, $noreg, killed $esi, implicit-def dead $eflags
1217 name: inc_store_and_load_no_alias
1218 # CHECK-LABEL: inc_store_and_load_no_alias
1219 # CHECK: bb.0.entry:
1220 # CHECK: $eax = FAULTING_OP 1, %bb.2, {{[0-9]+}}, $rdi, 1, $noreg, 0, $noreg :: (load 4 from %ir.ptr)
1221 # CHECK-NEXT: JMP_1 %bb.1
1222 # CHECK: bb.1.not_null
1225 tracksRegLiveness: true
1233 TEST64rr $rdi, $rdi, implicit-def $eflags
1234 JCC_1 %bb.2, 4, implicit killed $eflags
1239 MOV32mi killed $rsi, 1, $noreg, 0, $noreg, 3 :: (store 4 into %ir.ptr2)
1240 $eax = MOV32rm killed $rdi, 1, $noreg, 0, $noreg :: (load 4 from %ir.ptr)
1244 $eax = XOR32rr undef $eax, undef $eax, implicit-def dead $eflags
1249 name: inc_store_and_load_alias
1250 # CHECK-LABEL: inc_store_and_load_alias
1251 # CHECK: bb.0.entry:
1252 # CHECK: TEST64rr $rdi, $rdi, implicit-def $eflags
1253 # CHECK-NEXT: JCC_1 %bb.2, 4, implicit killed $eflags
1254 # CHECK: bb.1.not_null
1257 tracksRegLiveness: true
1265 TEST64rr $rdi, $rdi, implicit-def $eflags
1266 JCC_1 %bb.2, 4, implicit killed $eflags
1271 MOV32mi killed $rsi, 1, $noreg, 0, $noreg, 3 :: (store 4 into %ir.ptr2)
1272 $eax = MOV32rm killed $rdi, 1, $noreg, 0, $noreg :: (load 4 from %ir.ptr)
1276 $eax = XOR32rr undef $eax, undef $eax, implicit-def dead $eflags
1282 # CHECK-LABEL: inc_spill_dep
1283 # CHECK: bb.0.entry:
1284 # CHECK: TEST64rr $rdi, $rdi, implicit-def $eflags
1285 # CHECK-NEXT: JCC_1 %bb.2, 4, implicit killed $eflags
1286 # CHECK: bb.1.not_null
1289 tracksRegLiveness: true
1291 - { id: 0, type: spill-slot, offset: -8, size: 8, alignment: 8}
1299 $rsp = frame-setup SUB64ri8 $rsp, 8, implicit-def dead $eflags
1300 MOV32mr $rsp, 1, $noreg, 0, $noreg, $esi :: (store 4 into %stack.0)
1301 TEST64rr $rdi, $rdi, implicit-def $eflags
1302 JCC_1 %bb.2, 4, implicit killed $eflags
1307 $r14d = MOV32rm $rsp, 1, $noreg, 0, $noreg :: (load 4 from %stack.0)
1308 MOV64mr $rsp, 1, $noreg, 0, $noreg, $rdi :: (store 8 into %stack.0)
1309 $edi = MOV32rm $rdi, 1, $noreg, 8, $noreg :: (load 4 from %ir.ptr)
1314 $eax = XOR32rr undef $eax, undef $eax, implicit-def dead $eflags