1 ; RUN: opt --mtriple=loongarch64 -mattr=+d -S --passes='require<profile-summary>,function(codegenprepare)' %s | FileCheck %s
3 ; Check that we have deterministic output
4 define void @test(ptr %sp, ptr %t, i32 %n) {
7 ; CHECK-NEXT: %splitgep1 = getelementptr i8, ptr %t, i64 80000
8 ; CHECK-NEXT: %s = load ptr, ptr %sp
9 ; CHECK-NEXT: %splitgep = getelementptr i8, ptr %s, i64 80000
11 %s = load ptr, ptr %sp
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
25 store i32 %i, ptr %gep0
26 store i32 %phi, ptr %gep1
27 store i32 %i, ptr %gep2
28 store i32 %phi, ptr %gep3