File: 2012-03-16-Crash-because-of-unsigned-in-scev.ll

package info (click to toggle)
llvm-toolchain-6.0 1%3A6.0.1-10
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 598,080 kB
  • sloc: cpp: 3,046,253; ansic: 595,057; asm: 271,965; python: 128,926; objc: 106,554; sh: 21,906; lisp: 10,191; pascal: 6,094; ml: 5,544; perl: 5,265; makefile: 2,227; cs: 2,027; xml: 686; php: 212; csh: 117
file content (31 lines) | stat: -rw-r--r-- 810 bytes parent folder | download | duplicates (18)
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
; RUN: opt %loadPolly -polly-scops -analyze < %s | FileCheck %s

target datalayout = "e-p:32:32:32-i64:64:64-i32:32:32-i16:16:16-i1:32:32-f64:64:64-f32:32:32-a0:0-n32"

@array = external global [64 x i8], align 8

define void @foo(i32* %A) nounwind {
entry:
  br label %if.then132

if.then132:
  %loaded = load i32, i32* %A
  %0 = icmp ugt i32 %loaded, 10
  %umax = select i1 %0, i32 %loaded, i32 10
  br label %do.body

do.body:
  %indvar = phi i32 [ %3, %do.body ], [ 0, %if.then132 ]
  %1 = add i32 0, %umax
  %2 = sub i32 %1, %indvar
  %arrayidx = getelementptr [64 x i8], [64 x i8]* @array, i32 0, i32 %2
  store i8 1, i8* %arrayidx, align 1
  %3 = add i32 %indvar, 1
  %exitcond = icmp eq i32 %3, 20
  br i1 %exitcond, label %for.end, label %do.body

for.end:
  ret void
}

;CHECK: p0: (10 umax %loaded)