File: splitgep.ll

package info (click to toggle)
llvm-toolchain-14 1%3A14.0.6-12
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 1,496,180 kB
  • sloc: cpp: 5,593,972; ansic: 986,872; asm: 585,869; python: 184,223; objc: 72,530; lisp: 31,119; f90: 27,793; javascript: 9,780; pascal: 9,762; sh: 9,482; perl: 7,468; ml: 5,432; awk: 3,523; makefile: 2,538; xml: 953; cs: 573; fortran: 567
file content (40 lines) | stat: -rw-r--r-- 1,363 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
; RUN: opt -S -codegenprepare %s | FileCheck %s

target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
target triple = "thumbv6m-arm-none-eabi"

; Check that we have deterministic output
define void @test([65536 x i32]** %sp, [65536 x i32]* %t, i32 %n) {
; CHECK-LABEL: @test(
; CHECK-NEXT:  entry:
; CHECK-NEXT:    %0 = bitcast [65536 x i32]* %t to i8*
; CHECK-NEXT:    %splitgep1 = getelementptr i8, i8* %0, i32 80000
; CHECK-NEXT:    %s = load [65536 x i32]*, [65536 x i32]** %sp
; CHECK-NEXT:    %1 = bitcast [65536 x i32]* %s to i8*
; CHECK-NEXT:    %splitgep = getelementptr i8, i8* %1, i32 80000
entry:
  %s = load [65536 x i32]*, [65536 x i32]** %sp
  br label %while_cond

while_cond:
  %phi = phi i32 [ 0, %entry ], [ %i, %while_body ]
  %gep0 = getelementptr [65536 x i32], [65536 x i32]* %s, i64 0, i32 20000
  %gep1 = getelementptr [65536 x i32], [65536 x i32]* %s, i64 0, i32 20001
  %gep2 = getelementptr [65536 x i32], [65536 x i32]* %t, i64 0, i32 20000
  %gep3 = getelementptr [65536 x i32], [65536 x i32]* %t, i64 0, i32 20001
  %cmp = icmp slt i32 %phi, %n
  br i1 %cmp, label %while_body, label %while_end

while_body:
  %i = add i32 %phi, 1
  %j = add i32 %phi, 2
  store i32 %i, i32* %gep0
  store i32 %phi, i32* %gep1
  store i32 %i, i32* %gep2
  store i32 %phi, i32* %gep3
  br label %while_cond

while_end:
  ret void
}