1 ; RUN: llc -mtriple=x86_64-unknown-linux-gnu -o - -global-isel < %s 2>&1 | FileCheck %s
5 define i32 @test_01(ptr %p, i64 %len, i32 %x) {
9 %scevgep = getelementptr i32, ptr %p, i64 -1
12 loop: ; preds = %backedge, %entry
13 %iv = phi i64 [ %iv.next, %backedge ], [ %len, %entry ]
14 %iv.next = add i64 %iv, -1
15 %cond_1 = icmp eq i64 %iv, 0
16 br i1 %cond_1, label %exit, label %backedge
18 backedge: ; preds = %loop
19 %scevgep1 = getelementptr i32, ptr %scevgep, i64 %iv
20 %loaded = load atomic i32, ptr %scevgep1 unordered, align 4
21 %cond_2 = icmp eq i32 %loaded, %x
22 br i1 %cond_2, label %failure, label %loop