|
| 1 | +; RUN: opt --mtriple=loongarch64 -S --passes='require<profile-summary>,function(codegenprepare)' %s | FileCheck %s |
| 2 | + |
| 3 | +; Check that we have deterministic output |
| 4 | +define void @test(ptr %sp, ptr %t, i32 %n) { |
| 5 | +; CHECK-LABEL: @test( |
| 6 | +; CHECK-NEXT: entry: |
| 7 | +; CHECK-NEXT: %s = load ptr, ptr %sp, align 8 |
| 8 | +; CHECK-NEXT: br label %while_cond |
| 9 | + |
| 10 | +entry: |
| 11 | + %s = load ptr, ptr %sp |
| 12 | + br label %while_cond |
| 13 | + |
| 14 | +while_cond: |
| 15 | + %phi = phi i32 [ 0, %entry ], [ %i, %while_body ] |
| 16 | + %gep0 = getelementptr [65536 x i32], ptr %s, i64 0, i64 20000 |
| 17 | + %gep1 = getelementptr [65536 x i32], ptr %s, i64 0, i64 20001 |
| 18 | + %gep2 = getelementptr [65536 x i32], ptr %t, i64 0, i64 20000 |
| 19 | + %gep3 = getelementptr [65536 x i32], ptr %t, i64 0, i64 20001 |
| 20 | + %cmp = icmp slt i32 %phi, %n |
| 21 | + br i1 %cmp, label %while_body, label %while_end |
| 22 | + |
| 23 | +while_body: |
| 24 | + %i = add i32 %phi, 1 |
| 25 | + store i32 %i, ptr %gep0 |
| 26 | + store i32 %phi, ptr %gep1 |
| 27 | + store i32 %i, ptr %gep2 |
| 28 | + store i32 %phi, ptr %gep3 |
| 29 | + br label %while_cond |
| 30 | + |
| 31 | +while_end: |
| 32 | + ret void |
| 33 | +} |
| 34 | + |
0 commit comments