1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 3
2 ; RUN: llc < %s -mtriple=x86_64-- | FileCheck %s
4 define void @prefault(ptr noundef %range_start, ptr noundef readnone %range_end) {
5 ; CHECK-LABEL: prefault:
6 ; CHECK: # %bb.0: # %entry
7 ; CHECK-NEXT: cmpq %rsi, %rdi
8 ; CHECK-NEXT: jae .LBB0_3
9 ; CHECK-NEXT: .p2align 4, 0x90
10 ; CHECK-NEXT: .LBB0_1: # %while.body
11 ; CHECK-NEXT: # =>This Inner Loop Header: Depth=1
12 ; CHECK-NEXT: lock orb $0, (%rdi)
13 ; CHECK-NEXT: addq $4096, %rdi # imm = 0x1000
14 ; CHECK-NEXT: cmpq %rsi, %rdi
15 ; CHECK-NEXT: jb .LBB0_1
16 ; CHECK-NEXT: .LBB0_3: # %while.end
19 %cmp3 = icmp ult ptr %range_start, %range_end
20 br i1 %cmp3, label %while.body, label %while.end
22 while.body: ; preds = %entry, %while.body
23 %start.04 = phi ptr [ %add.ptr, %while.body ], [ %range_start, %entry ]
24 %0 = atomicrmw volatile or ptr %start.04, i8 0 monotonic, align 1
25 %add.ptr = getelementptr inbounds i8, ptr %start.04, i64 4096
26 %cmp = icmp ult ptr %add.ptr, %range_end
27 br i1 %cmp, label %while.body, label %while.end
29 while.end: ; preds = %while.body, %entry