File: inner_scev_sdiv_in_rtc.ll

package info (click to toggle)
llvm-toolchain-13 1%3A13.0.1-11
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,418,840 kB
  • sloc: cpp: 5,290,826; ansic: 996,570; asm: 544,593; python: 188,212; objc: 72,027; lisp: 30,291; f90: 25,395; sh: 24,898; javascript: 9,780; pascal: 9,398; perl: 7,484; ml: 5,432; awk: 3,523; makefile: 2,913; xml: 953; cs: 573; fortran: 539
file content (41 lines) | stat: -rw-r--r-- 1,173 bytes parent folder | download | duplicates (19)
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
41
; RUN: opt %loadPolly -polly-codegen \
; RUN:     -S < %s | FileCheck %s
;
; This will just check that we generate valid code here.
;
; CHECK: polly.start:
;
;    void f(int *A, int *B) {
;      for (int i = 0; i < 1024; i++)
;        A[i % 3] = B[i / 42];
;    }
;
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"

define void @f(i32* %A, i32* %B, i32 %N) {
bb:
  br label %bb1

bb1:                                              ; preds = %bb9, %bb
  %i.0 = phi i32 [ 0, %bb ], [ %tmp10, %bb9 ]
  %exitcond = icmp ne i32 %i.0, %N
  br i1 %exitcond, label %bb2, label %bb11

bb2:                                              ; preds = %bb1
  %tmp = sdiv i32 %i.0, 42
  %tmp3 = sext i32 %tmp to i64
  %tmp4 = getelementptr inbounds i32, i32* %B, i64 %tmp3
  %tmp5 = load i32, i32* %tmp4, align 4
  %tmp6 = srem i32 %i.0, 3
  %tmp7 = sext i32 %tmp6 to i64
  %tmp8 = getelementptr inbounds i32, i32* %A, i64 %tmp7
  store i32 %tmp5, i32* %tmp8, align 4
  br label %bb9

bb9:                                              ; preds = %bb2
  %tmp10 = add nuw nsw i32 %i.0, 1
  br label %bb1

bb11:                                             ; preds = %bb1
  ret void
}