~pali/+junk/llvm-toolchain-3.7

« back to all changes in this revision

Viewing changes to test/Transforms/LoopStrengthReduce/2011-12-19-PostincQuadratic.ll

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2015-07-15 17:51:08 UTC
  • Revision ID: package-import@ubuntu.com-20150715175108-l8mynwovkx4zx697
Tags: upstream-3.7~+rc2
ImportĀ upstreamĀ versionĀ 3.7~+rc2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
; RUN: opt -loop-reduce -S < %s | FileCheck %s
 
2
;
 
3
; PR11571: handle a postinc user outside of for.body7 that requires
 
4
; recursive expansion of a quadratic recurrence within for.body7. LSR
 
5
; needs to forget that for.body7 is a postinc loop during expansion.
 
6
 
 
7
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32-S128"
 
8
target triple = "i386-unknown-freebsd10.0"
 
9
 
 
10
@b = external global [121 x i32]
 
11
 
 
12
; CHECK-LABEL: @vb(
 
13
;   Outer recurrence:
 
14
; CHECK: %lsr.iv1 = phi [121 x i32]*
 
15
;   Inner recurrence:
 
16
; CHECK: %lsr.iv = phi i32
 
17
;   Outer step (relative to inner recurrence):
 
18
; CHECK: %scevgep = getelementptr i1, i1* %{{.*}}, i32 %lsr.iv
 
19
;   Outer use:
 
20
; CHECK: %lsr.iv3 = phi [121 x i32]* [ %lsr.iv1, %for.body43.preheader ]
 
21
define void @vb() nounwind {
 
22
for.cond.preheader:
 
23
  br label %for.body7
 
24
 
 
25
for.body7:
 
26
  %indvars.iv77 = phi i32 [ %indvars.iv.next78, %for.body7 ], [ 1, %for.cond.preheader ]
 
27
  %bf.072 = phi i32 [ %t1, %for.body7 ], [ 0, %for.cond.preheader ]
 
28
  %t1 = add i32 %bf.072, %indvars.iv77
 
29
  %indvars.iv.next78 = add i32 %indvars.iv77, 1
 
30
  br i1 undef, label %for.body43, label %for.body7
 
31
 
 
32
for.body43:
 
33
  %bf.459 = phi i32 [ %inc44, %for.body43 ], [ %t1, %for.body7 ]
 
34
  %inc44 = add nsw i32 %bf.459, 1
 
35
  %arrayidx45 = getelementptr inbounds [121 x i32], [121 x i32]* @b, i32 0, i32 %bf.459
 
36
  %t2 = load i32, i32* %arrayidx45, align 4
 
37
  br label %for.body43
 
38
}
 
39