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(ptr %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(ptr %x, i32 %val, ptr %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(ptr %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(ptr %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(ptr %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(ptr %ptr) {
104 %is_null = icmp eq ptr %ptr, null
105 br i1 %is_null, label %leave, label %stay, !make.implicit !0
109 %val = load i32, ptr %ptr
116 define i32 @dependency_live_in_hazard(ptr %ptr, ptr %ptr2, ptr %ptr3) #0 {
118 %val = load ptr, ptr %ptr2
119 %ptr_is_null = icmp eq ptr %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, ptr %val
124 %result = load i32, ptr %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(ptr %ptr, ptr %ptr2) {
136 %ptr_is_null = icmp eq ptr %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(ptr %x, i32 %a) {
148 %c = icmp eq ptr %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, ptr %x, i32 1
156 %y = ptrtoint ptr %x.loc to i32
158 %t = load i32, ptr %x
163 define i32 @imp_null_check_load_with_base_sep(ptr %x, i32 %a) {
165 %c = icmp eq ptr %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(ptr %ptr, i32 %val) {
177 %ptr_is_null = icmp eq ptr %ptr, null
178 br i1 %ptr_is_null, label %is_null, label %not_null, !make.implicit !0
187 define void @inc_store_plus_offset(ptr %ptr, i32 %val) {
189 %ptr_is_null = icmp eq ptr %ptr, null
190 br i1 %ptr_is_null, label %is_null, label %not_null, !make.implicit !0
199 define void @inc_store_with_dep(ptr %ptr, i32 %val) {
201 %ptr_is_null = icmp eq ptr %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(ptr %ptr, i32 %val) {
213 %ptr_is_null = icmp eq ptr %ptr, null
214 br i1 %ptr_is_null, label %is_null, label %not_null, !make.implicit !0
223 define void @inc_store_with_volatile(ptr %ptr, i32 %val) {
225 %ptr_is_null = icmp eq ptr %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(ptr %ptr, i32 %val) {
237 %ptr_is_null = icmp eq ptr %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(ptr %ptr, i32 %val) {
249 %ptr_is_null = icmp eq ptr %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(ptr %ptr, i32 %val) {
261 %ptr_is_null = icmp eq ptr %ptr, null
262 br i1 %ptr_is_null, label %is_null, label %not_null, !make.implicit !0
271 define i32 @inc_store_across_call(ptr %ptr) {
273 %ptr_is_null = icmp eq ptr %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(ptr %ptr, i32 %val) {
286 %ptr_is_null = icmp eq ptr %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(ptr %ptr, ptr %ptr2) {
298 %ptr_is_null = icmp eq ptr %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(ptr %ptr, ptr %ptr2) {
310 %ptr_is_null = icmp eq ptr %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(ptr %ptr, ptr %ptr2) {
322 %ptr_is_null = icmp eq ptr %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(ptr %ptr, ptr %ptr2) {
334 %ptr_is_null = icmp eq ptr %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(ptr noalias %ptr, ptr noalias %ptr2) {
346 %ptr_is_null = icmp eq ptr %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(ptr %ptr, ptr %ptr2) {
358 %ptr_is_null = icmp eq ptr %ptr, null
359 br i1 %ptr_is_null, label %is_null, label %not_null, !make.implicit !0
368 define i32 @inc_spill_dep(ptr %ptr, i32 %val) {
370 %ptr_is_null = icmp eq ptr %ptr, null
371 br i1 %ptr_is_null, label %is_null, label %not_null, !make.implicit !0
380 define i32 @imp_null_check_address_mul_overflow(ptr %x, i32 %a) {
382 %c = icmp eq ptr %x, null
383 br i1 %c, label %is_null, label %not_null, !make.implicit !0
385 is_null: ; preds = %entry
388 not_null: ; preds = %entry
389 %y = ptrtoint ptr %x to i32
390 %y64 = zext i32 %y to i64
391 %b = mul i64 %y64, 9223372036854775807 ; 0X0FFFF.. i.e. 2^63 - 1
392 %z = trunc i64 %b to i32
396 attributes #0 = { "target-features"="+bmi,+bmi2" }
401 name: imp_null_check_with_bitwise_op_0
402 # CHECK-LABEL: name: imp_null_check_with_bitwise_op_0
404 tracksRegLiveness: true
409 # CHECK: $eax = MOV32ri 2200000
410 # CHECK-NEXT: $eax = FAULTING_OP 1, %bb.3, {{[0-9]+}}, $eax, $rdi, 1, $noreg, 0, $noreg, implicit-def $eflags :: (load (s32) from %ir.x)
411 # CHECK-NEXT: JMP_1 %bb.1
417 TEST64rr $rdi, $rdi, implicit-def $eflags
418 JCC_1 %bb.3, 4, implicit $eflags
423 $eax = MOV32ri 2200000
424 $eax = AND32rm killed $eax, killed $rdi, 1, $noreg, 0, $noreg, implicit-def dead $eflags :: (load (s32) from %ir.x)
425 CMP32rr killed $eax, killed $esi, implicit-def $eflags
426 JCC_1 %bb.4, 4, implicit $eflags
442 name: imp_null_check_with_bitwise_op_1
444 tracksRegLiveness: true
450 # CHECK: $eax = MOV32rm killed $rdx, 1, $noreg, 0, $noreg :: (volatile load (s32) from %ir.ptr)
451 # CHECK-NEXT: TEST64rr $rdi, $rdi, implicit-def $eflags
452 # CHECK-NEXT: JCC_1 %bb.3, 4, implicit $eflags
456 liveins: $esi, $rdi, $rdx
458 $eax = MOV32rm killed $rdx, 1, $noreg, 0, $noreg :: (volatile load (s32) from %ir.ptr)
459 TEST64rr $rdi, $rdi, implicit-def $eflags
460 JCC_1 %bb.3, 4, implicit $eflags
465 $eax = MOV32ri 2200000
466 $eax = AND32rm killed $eax, killed $rdi, 1, $noreg, 0, $noreg, implicit-def dead $eflags :: (load (s32) from %ir.x)
467 CMP32rr killed $eax, killed $esi, implicit-def $eflags
468 JCC_1 %bb.4, 4, implicit $eflags
475 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
485 name: imp_null_check_with_bitwise_op_2
486 # CHECK-LABEL: name: imp_null_check_with_bitwise_op_2
488 tracksRegLiveness: true
493 # CHECK: TEST64rr $rdi, $rdi, implicit-def $eflags
494 # CHECK-NEXT: JCC_1 %bb.3, 4, implicit $eflags
500 TEST64rr $rdi, $rdi, implicit-def $eflags
501 JCC_1 %bb.3, 4, implicit $eflags
506 $eax = MOV32ri 2200000
507 $eax = ADD32ri killed $eax, 100, implicit-def dead $eflags
508 $eax = AND32rm killed $eax, killed $rdi, 1, $noreg, 0, $noreg, implicit-def dead $eflags :: (load (s32) from %ir.x)
509 CMP32rr killed $eax, killed $esi, implicit-def $eflags
510 JCC_1 %bb.4, 4, implicit $eflags
526 name: imp_null_check_with_bitwise_op_3
527 # CHECK-LABEL: name: imp_null_check_with_bitwise_op_3
529 tracksRegLiveness: true
534 # CHECK: TEST64rr $rdi, $rdi, implicit-def $eflags
535 # CHECK-NEXT: JCC_1 %bb.3, 4, implicit $eflags
541 TEST64rr $rdi, $rdi, implicit-def $eflags
542 JCC_1 %bb.3, 4, implicit $eflags
548 $rdi = AND64rm killed $rdi, killed $rdi, 1, $noreg, 0, $noreg, implicit-def dead $eflags :: (load (s32) from %ir.x)
549 CMP64rr killed $rdi, killed $rsi, implicit-def $eflags
550 JCC_1 %bb.4, 4, implicit $eflags
566 name: imp_null_check_with_bitwise_op_4
567 # CHECK-LABEL: name: imp_null_check_with_bitwise_op_4
569 tracksRegLiveness: true
574 # CHECK: $rbx = MOV64rr $rdx
575 # CHECK-NEXT: $rbx = FAULTING_OP 1, %bb.3, {{[0-9]+}}, $rbx, $rdi, 1, $noreg, 0, $noreg, implicit-def $eflags :: (load (s32) from %ir.x)
579 liveins: $rsi, $rdi, $rdx
581 TEST64rr $rdi, $rdi, implicit-def $eflags
582 JCC_1 %bb.3, 4, implicit $eflags
585 liveins: $rsi, $rdi, $rdx
588 $rbx = AND64rm killed $rbx, killed $rdi, 1, $noreg, 0, $noreg, implicit-def dead $eflags :: (load (s32) from %ir.x)
590 CMP64rr killed $rbx, killed $rsi, implicit-def $eflags
591 JCC_1 %bb.4, 4, implicit $eflags
607 name: no_hoist_across_call
608 # CHECK-LABEL: name: no_hoist_across_call
610 tracksRegLiveness: true
613 calleeSavedRegisters: [ '$bh', '$bl', '$bp', '$bpl', '$bx', '$ebp', '$ebx',
614 '$rbp', '$rbx', '$r12', '$r13', '$r14', '$r15',
615 '$r12b', '$r13b', '$r14b', '$r15b', '$r12d', '$r13d',
616 '$r14d', '$r15d', '$r12w', '$r13w', '$r14w', '$r15w' ]
618 # CHECK-NOT: FAULTING_OP
620 # CHECK: CALL64pcrel32
625 frame-setup PUSH64r killed $rbx, implicit-def $rsp, implicit $rsp
626 CFI_INSTRUCTION def_cfa_offset 16
627 CFI_INSTRUCTION offset $rbx, -16
629 TEST64rr $rbx, $rbx, implicit-def $eflags
630 JCC_1 %bb.2, 4, implicit killed $eflags
635 CALL64pcrel32 @f, csr_64, implicit $rsp, implicit-def $rsp
636 $eax = MOV32rm killed $rbx, 1, $noreg, 0, $noreg :: (load (s32) from %ir.ptr)
637 $rbx = POP64r implicit-def $rsp, implicit $rsp
641 $eax = XOR32rr undef $eax, undef $eax, implicit-def dead $eflags
642 $rbx = POP64r implicit-def $rsp, implicit $rsp
647 name: dependency_live_in_hazard
648 # CHECK-LABEL: name: dependency_live_in_hazard
650 # CHECK-NOT: FAULTING_OP
651 # CHECK: bb.1.not_null:
653 # Make sure that the BEXTR32rm instruction below is not used to emit
654 # an implicit null check -- hoisting it will require hosting the move
655 # to $esi and we cannot do that without clobbering the use of $rsi in
656 # the first instruction in bb.1.not_null.
658 tracksRegLiveness: true
666 TEST64rr $rdi, $rdi, implicit-def $eflags
667 JCC_1 %bb.2, 4, implicit killed $eflags
672 $rcx = MOV64rm killed $rsi, 1, $noreg, 0, $noreg :: (load (s64) from %ir.ptr2)
674 $eax = BEXTR32rm killed $rdi, 1, $noreg, 0, $noreg, killed $esi, implicit-def dead $eflags :: (load (s32) from %ir.ptr)
675 $eax = ADD32rm killed $eax, killed $rcx, 1, $noreg, 0, $noreg, implicit-def dead $eflags :: (load (s32) from %ir.val)
679 $eax = XOR32rr undef $eax, undef $eax, implicit-def dead $eflags
684 name: use_alternate_load_op
685 # CHECK-LABEL: name: use_alternate_load_op
687 # CHECK: $rax = FAULTING_OP 1, %bb.2, {{[0-9]+}}, $rdi, 1, $noreg, 0, $noreg
688 # CHECK-NEXT: JMP_1 %bb.1
689 # CHECK: bb.1.not_null
692 tracksRegLiveness: true
700 TEST64rr $rdi, $rdi, implicit-def $eflags
701 JCC_1 %bb.2, 4, implicit killed $eflags
706 $rcx = MOV64rm killed $rsi, 1, $noreg, 0, $noreg
707 $rcx = AND64rm killed $rcx, $rdi, 1, $noreg, 0, $noreg, implicit-def dead $eflags
708 $rax = MOV64rm killed $rdi, 1, $noreg, 0, $noreg
712 $eax = XOR32rr undef $eax, undef $eax, implicit-def dead $eflags
717 name: imp_null_check_gep_load_with_use_dep
718 # CHECK-LABEL: name: imp_null_check_gep_load_with_use_dep
720 # CHECK: $eax = FAULTING_OP 1, %bb.2, {{[0-9]+}}, $rdi, 1, $noreg, 0, $noreg, implicit-def $rax :: (load (s32) from %ir.x)
721 # CHECK-NEXT: JMP_1 %bb.1
723 tracksRegLiveness: true
731 TEST64rr $rdi, $rdi, implicit-def $eflags
732 JCC_1 %bb.1, 4, implicit $eflags
737 $rsi = ADD64rr $rsi, $rdi, implicit-def dead $eflags
738 $eax = MOV32rm killed $rdi, 1, $noreg, 0, $noreg, implicit-def $rax :: (load (s32) from %ir.x)
739 $eax = LEA64_32r killed $rax, 1, killed $rsi, 4, $noreg
748 name: imp_null_check_load_with_base_sep
749 # CHECK-LABEL: name: imp_null_check_load_with_base_sep
751 # CHECK: $rsi = ADD64rr $rsi, $rdi, implicit-def dead $eflags
752 # CHECK-NEXT: $esi = FAULTING_OP 1, %bb.2, {{[0-9]+}}, $esi, $rdi, 1, $noreg, 0, $noreg, implicit-def $eflags
753 # CHECK-NEXT: JMP_1 %bb.1
755 tracksRegLiveness: true
763 TEST64rr $rdi, $rdi, implicit-def $eflags
764 JCC_1 %bb.1, 4, implicit $eflags
769 $rsi = ADD64rr $rsi, $rdi, implicit-def dead $eflags
770 $esi = AND32rm killed $esi, $rdi, 1, $noreg, 0, $noreg, implicit-def dead $eflags
781 # CHECK-LABEL: name: inc_store
783 # CHECK: $noreg = FAULTING_OP 3, %bb.2, {{[0-9]+}}, $rdi, 1, $noreg, 0, $noreg, $rsi
784 # CHECK-NEXT: JMP_1 %bb.1
785 # CHECK: bb.1.not_null
788 tracksRegLiveness: true
796 TEST64rr $rdi, $rdi, implicit-def $eflags
797 JCC_1 %bb.2, 4, implicit killed $eflags
802 MOV64mr killed $rdi, 1, $noreg, 0, $noreg, killed $rsi
810 name: inc_store_plus_offset
811 # CHECK-LABEL: inc_store_plus_offset
813 # CHECK: $noreg = FAULTING_OP 3, %bb.2, {{[0-9]+}}, $rdi, 1, $noreg, 16, $noreg, $rsi
814 # CHECK-NEXT: JMP_1 %bb.1
815 # CHECK: bb.1.not_null
818 tracksRegLiveness: true
826 TEST64rr $rdi, $rdi, implicit-def $eflags
827 JCC_1 %bb.2, 4, implicit killed $eflags
832 MOV64mr killed $rdi, 1, $noreg, 16, $noreg, killed $rsi
840 name: inc_store_with_dep
841 # CHECK-LABEL: inc_store_with_dep
843 # CHECK: $esi = ADD32rr killed $esi, killed $esi, implicit-def dead $eflags
844 # CHECK-NEXT: $noreg = FAULTING_OP 3, %bb.2, {{[0-9]+}}, $rdi, 1, $noreg, 16, $noreg, $esi
845 # CHECK-NEXT: JMP_1 %bb.1
846 # CHECK: bb.1.not_null
847 # CHECK-NOT: liveins: {{.*}} $eflags
850 tracksRegLiveness: true
858 TEST64rr $rdi, $rdi, implicit-def $eflags
859 JCC_1 %bb.2, 4, implicit killed $eflags
864 $esi = ADD32rr killed $esi, killed $esi, implicit-def dead $eflags
865 MOV32mr killed $rdi, 1, $noreg, 16, $noreg, killed $esi
873 name: inc_store_with_dep_in_null
874 # CHECK-LABEL: inc_store_with_dep_in_null
876 # CHECK: TEST64rr $rdi, $rdi, implicit-def $eflags
877 # CHECK-NEXT: JCC_1 %bb.2, 4, implicit killed $eflags
878 # CHECK: bb.1.not_null
881 tracksRegLiveness: true
889 TEST64rr $rdi, $rdi, implicit-def $eflags
890 JCC_1 %bb.2, 4, implicit killed $eflags
895 $esi = ADD32rr $esi, $esi, implicit-def dead $eflags
896 MOV32mr killed $rdi, 1, $noreg, 0, $noreg, $esi
897 $eax = MOV32rr killed $esi
903 $eax = MOV32rr killed $esi
908 name: inc_store_with_volatile
909 # CHECK-LABEL: inc_store_with_volatile
911 # CHECK: TEST64rr $rdi, $rdi, implicit-def $eflags
912 # CHECK-NEXT: JCC_1 %bb.2, 4, implicit killed $eflags
913 # CHECK: bb.1.not_null
916 tracksRegLiveness: true
924 TEST64rr $rdi, $rdi, implicit-def $eflags
925 JCC_1 %bb.2, 4, implicit killed $eflags
930 MOV32mr killed $rdi, 1, $noreg, 0, $noreg, killed $esi :: (volatile store (s32) into %ir.ptr)
938 name: inc_store_with_two_dep
939 # CHECK-LABEL: inc_store_with_two_dep
941 # CHECK: TEST64rr $rdi, $rdi, implicit-def $eflags
942 # CHECK-NEXT: JCC_1 %bb.2, 4, implicit killed $eflags
943 # CHECK: bb.1.not_null
946 tracksRegLiveness: true
954 TEST64rr $rdi, $rdi, implicit-def $eflags
955 JCC_1 %bb.2, 4, implicit killed $eflags
960 $esi = ADD32rr killed $esi, killed $esi, implicit-def dead $eflags
961 $esi = ADD32ri killed $esi, 15, implicit-def dead $eflags
962 MOV32mr killed $rdi, 1, $noreg, 16, $noreg, killed $esi
970 name: inc_store_with_redefined_base
971 # CHECK-LABEL: inc_store_with_redefined_base
973 # CHECK: TEST64rr $rdi, $rdi, implicit-def $eflags
974 # CHECK-NEXT: JCC_1 %bb.2, 4, implicit killed $eflags
975 # CHECK: bb.1.not_null
978 tracksRegLiveness: true
986 TEST64rr $rdi, $rdi, implicit-def $eflags
987 JCC_1 %bb.2, 4, implicit killed $eflags
992 $rdi = ADD64rr killed $rdi, killed $rdi, implicit-def dead $eflags
993 MOV32mr killed $rdi, 1, $noreg, 16, $noreg, killed $esi
1001 name: inc_store_with_reused_base
1002 # CHECK-LABEL: inc_store_with_reused_base
1003 # CHECK: bb.0.entry:
1004 # CHECK: $noreg = FAULTING_OP 3, %bb.2, {{[0-9]+}}, $rdi, 1, $noreg, 16, $noreg, $esi
1005 # CHECK-NEXT: JMP_1 %bb.1
1006 # CHECK: bb.1.not_null
1009 tracksRegLiveness: true
1017 TEST64rr $rdi, $rdi, implicit-def $eflags
1018 JCC_1 %bb.2, 4, implicit killed $eflags
1024 MOV32mr killed $rdi, 1, $noreg, 16, $noreg, killed $esi
1028 $rax = XOR64rr undef $rax, undef $rax, implicit-def dead $eflags
1033 name: inc_store_across_call
1034 # CHECK-LABEL: inc_store_across_call
1035 # CHECK: bb.0.entry:
1036 # CHECK: TEST64rr $rbx, $rbx, implicit-def $eflags
1037 # CHECK-NEXT: JCC_1 %bb.2, 4, implicit killed $eflags
1038 # CHECK: bb.1.not_null
1041 tracksRegLiveness: true
1044 calleeSavedRegisters: [ '$bh', '$bl', '$bp', '$bpl', '$bx', '$ebp', '$ebx',
1045 '$rbp', '$rbx', '$r12', '$r13', '$r14', '$r15',
1046 '$r12b', '$r13b', '$r14b', '$r15b', '$r12d', '$r13d',
1047 '$r14d', '$r15d', '$r12w', '$r13w', '$r14w', '$r15w' ]
1052 frame-setup PUSH64r killed $rbx, implicit-def $rsp, implicit $rsp
1053 CFI_INSTRUCTION def_cfa_offset 16
1054 CFI_INSTRUCTION offset $rbx, -16
1055 $rbx = MOV64rr killed $rdi
1056 TEST64rr $rbx, $rbx, implicit-def $eflags
1057 JCC_1 %bb.2, 4, implicit killed $eflags
1062 CALL64pcrel32 @f, csr_64, implicit $rsp, implicit-def $rsp
1063 MOV32mi $rbx, 1, $noreg, 0, $noreg, 20
1064 $rax = MOV64rr killed $rbx
1065 $rbx = POP64r implicit-def $rsp, implicit $rsp
1069 $eax = XOR32rr undef $eax, undef $eax, implicit-def dead $eflags
1070 $rbx = POP64r implicit-def $rsp, implicit $rsp
1075 name: inc_store_with_dep_in_dep
1076 # CHECK-LABEL: inc_store_with_dep_in_dep
1077 # CHECK: bb.0.entry:
1078 # CHECK: TEST64rr $rdi, $rdi, implicit-def $eflags
1079 # CHECK-NEXT: JCC_1 %bb.2, 4, implicit killed $eflags
1080 # CHECK: bb.1.not_null
1083 tracksRegLiveness: true
1091 TEST64rr $rdi, $rdi, implicit-def $eflags
1092 JCC_1 %bb.2, 4, implicit killed $eflags
1098 $esi = ADD32ri killed $esi, 15, implicit-def dead $eflags
1099 MOV32mr killed $rdi, 1, $noreg, 0, $noreg, killed $esi
1103 $eax = XOR32rr undef $eax, undef $eax, implicit-def dead $eflags
1108 name: inc_store_with_load_over_store
1109 # CHECK-LABEL: inc_store_with_load_over_store
1110 # CHECK: bb.0.entry:
1111 # CHECK: TEST64rr $rdi, $rdi, implicit-def $eflags
1112 # CHECK-NEXT: JCC_1 %bb.2, 4, implicit killed $eflags
1113 # CHECK: bb.1.not_null
1116 tracksRegLiveness: true
1124 TEST64rr $rdi, $rdi, implicit-def $eflags
1125 JCC_1 %bb.2, 4, implicit killed $eflags
1130 MOV32mi killed $rsi, 1, $noreg, 0, $noreg, 2
1131 $eax = MOV32rm killed $rdi, 1, $noreg, 0, $noreg
1135 $eax = XOR32rr undef $eax, undef $eax, implicit-def dead $eflags
1140 name: inc_store_with_store_over_load
1141 # CHECK-LABEL: inc_store_with_store_over_load
1142 # CHECK: bb.0.entry:
1143 # CHECK: TEST64rr $rdi, $rdi, implicit-def $eflags
1144 # CHECK-NEXT: JCC_1 %bb.2, 4, implicit killed $eflags
1145 # CHECK: bb.1.not_null
1148 tracksRegLiveness: true
1156 TEST64rr $rdi, $rdi, implicit-def $eflags
1157 JCC_1 %bb.2, 4, implicit killed $eflags
1162 $eax = MOV32rm killed $rsi, 1, $noreg, 0, $noreg
1163 MOV32mi killed $rdi, 1, $noreg, 0, $noreg, 2
1167 $eax = XOR32rr undef $eax, undef $eax, implicit-def dead $eflags
1172 name: inc_store_with_store_over_store
1173 # CHECK-LABEL: inc_store_with_store_over_store
1174 # CHECK: bb.0.entry:
1175 # CHECK: TEST64rr $rdi, $rdi, implicit-def $eflags
1176 # CHECK-NEXT: JCC_1 %bb.2, 4, implicit killed $eflags
1177 # CHECK: bb.1.not_null
1180 tracksRegLiveness: true
1188 TEST64rr $rdi, $rdi, implicit-def $eflags
1189 JCC_1 %bb.2, 4, implicit killed $eflags
1194 MOV32mi killed $rsi, 1, $noreg, 0, $noreg, 3
1195 MOV32mi killed $rdi, 1, $noreg, 0, $noreg, 2
1203 name: inc_store_with_load_and_store
1204 # CHECK-LABEL: inc_store_with_load_and_store
1205 # CHECK: bb.0.entry:
1206 # CHECK: $noreg = FAULTING_OP 2, %bb.2, {{[0-9]+}}, $rdi, 1, $noreg, 0, $noreg, $esi, implicit-def $eflags
1207 # CHECK-NEXT: JMP_1 %bb.1
1208 # CHECK: bb.1.not_null
1211 tracksRegLiveness: true
1219 TEST64rr $rdi, $rdi, implicit-def $eflags
1220 JCC_1 %bb.2, 4, implicit killed $eflags
1225 $esi = ADD32rr $esi, $esi, implicit-def dead $eflags
1226 ADD32mr killed $rdi, 1, $noreg, 0, $noreg, killed $esi, implicit-def dead $eflags
1234 name: inc_store_and_load_no_alias
1235 # CHECK-LABEL: inc_store_and_load_no_alias
1236 # CHECK: bb.0.entry:
1237 # CHECK: $eax = FAULTING_OP 1, %bb.2, {{[0-9]+}}, $rdi, 1, $noreg, 0, $noreg :: (load (s32) from %ir.ptr)
1238 # CHECK-NEXT: JMP_1 %bb.1
1239 # CHECK: bb.1.not_null
1242 tracksRegLiveness: true
1250 TEST64rr $rdi, $rdi, implicit-def $eflags
1251 JCC_1 %bb.2, 4, implicit killed $eflags
1256 MOV32mi killed $rsi, 1, $noreg, 0, $noreg, 3 :: (store (s32) into %ir.ptr2)
1257 $eax = MOV32rm killed $rdi, 1, $noreg, 0, $noreg :: (load (s32) from %ir.ptr)
1261 $eax = XOR32rr undef $eax, undef $eax, implicit-def dead $eflags
1266 name: inc_store_and_load_alias
1267 # CHECK-LABEL: inc_store_and_load_alias
1268 # CHECK: bb.0.entry:
1269 # CHECK: TEST64rr $rdi, $rdi, implicit-def $eflags
1270 # CHECK-NEXT: JCC_1 %bb.2, 4, implicit killed $eflags
1271 # CHECK: bb.1.not_null
1274 tracksRegLiveness: true
1282 TEST64rr $rdi, $rdi, implicit-def $eflags
1283 JCC_1 %bb.2, 4, implicit killed $eflags
1288 MOV32mi killed $rsi, 1, $noreg, 0, $noreg, 3 :: (store (s32) into %ir.ptr2)
1289 $eax = MOV32rm killed $rdi, 1, $noreg, 0, $noreg :: (load (s32) from %ir.ptr)
1293 $eax = XOR32rr undef $eax, undef $eax, implicit-def dead $eflags
1299 # CHECK-LABEL: inc_spill_dep
1300 # CHECK: bb.0.entry:
1301 # CHECK: TEST64rr $rdi, $rdi, implicit-def $eflags
1302 # CHECK-NEXT: JCC_1 %bb.2, 4, implicit killed $eflags
1303 # CHECK: bb.1.not_null
1306 tracksRegLiveness: true
1308 - { id: 0, type: spill-slot, offset: -8, size: 8, alignment: 8}
1316 $rsp = frame-setup SUB64ri8 $rsp, 8, implicit-def dead $eflags
1317 MOV32mr $rsp, 1, $noreg, 0, $noreg, $esi :: (store (s32) into %stack.0)
1318 TEST64rr $rdi, $rdi, implicit-def $eflags
1319 JCC_1 %bb.2, 4, implicit killed $eflags
1324 $r14d = MOV32rm $rsp, 1, $noreg, 0, $noreg :: (load (s32) from %stack.0)
1325 MOV64mr $rsp, 1, $noreg, 0, $noreg, $rdi :: (store (s64) into %stack.0)
1326 $edi = MOV32rm $rdi, 1, $noreg, 8, $noreg :: (load (s32) from %ir.ptr)
1331 $eax = XOR32rr undef $eax, undef $eax, implicit-def dead $eflags
1336 name: imp_null_check_address_mul_overflow
1337 # CHECK-LABEL: name: imp_null_check_address_mul_overflow
1338 # CHECK: bb.0.entry:
1339 # CHECK-NOT: FAULTING_OP
1341 tracksRegLiveness: true
1349 TEST64rr $rdi, $rdi, implicit-def $eflags
1350 JCC_1 %bb.1, 4, implicit $eflags
1355 $rcx = MOV64ri -9223372036854775808
1356 $eax = MOV32rm killed $rdi, 2, $rcx, 0, $noreg, implicit-def $rax