File: no_superflous_induction_vars.ll

package info (click to toggle)
llvm-toolchain-20 1%3A20.1.6-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,111,304 kB
  • sloc: cpp: 7,438,677; ansic: 1,393,822; asm: 1,012,926; python: 241,650; f90: 86,635; objc: 75,479; lisp: 42,144; pascal: 17,286; sh: 10,027; ml: 5,082; perl: 4,730; awk: 3,523; makefile: 3,349; javascript: 2,251; xml: 892; fortran: 672
file content (49 lines) | stat: -rw-r--r-- 1,506 bytes parent folder | download | duplicates (6)
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
42
43
44
45
46
47
48
49
; RUN: opt -S -loop-reduce -mcpu=corei7-avx -mtriple=x86_64-apple-macosx < %s | FileCheck %s

target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"

define void @indvar_expansion(ptr nocapture readonly %rowsptr, i1 %arg) {
entry:
  br label %for.cond

; SCEVExpander used to create induction variables in the loop %for.cond while
; expanding the recurrence start value of loop strength reduced values from
; %vector.body.

; CHECK-LABEL: indvar_expansion
; CHECK: for.cond:
; CHECK-NOT: phi i3
; CHECK: br i1 {{.+}}, label %for.cond

for.cond:
  %indvars.iv44 = phi i64 [ %indvars.iv.next45, %for.cond ], [ 0, %entry ]
  %cmp = icmp eq i8 undef, 0
  %indvars.iv.next45 = add nuw nsw i64 %indvars.iv44, 1
  br i1 %cmp, label %for.cond, label %for.cond2

for.cond2:
  br i1 %arg, label %for.cond2, label %for.body14.lr.ph

for.body14.lr.ph:
  %sext = shl i64 %indvars.iv44, 32
  %0 = ashr exact i64 %sext, 32
  %1 = sub i64 undef, %indvars.iv44
  %2 = and i64 %1, 4294967295
  %3 = add i64 %2, 1
  %fold = add i64 %1, 1
  %n.mod.vf = and i64 %fold, 7
  %n.vec = sub i64 %3, %n.mod.vf
  %end.idx.rnd.down = add i64 %n.vec, %0
  br label %vector.body

vector.body:
  %index = phi i64 [ %index.next, %vector.body ], [ %0, %for.body14.lr.ph ]
  %4 = getelementptr inbounds i8, ptr %rowsptr, i64 %index
  %wide.load = load <4 x i8>, ptr %4, align 1
  %index.next = add i64 %index, 8
  %5 = icmp eq i64 %index.next, %end.idx.rnd.down
  br i1 %5, label %for.end24, label %vector.body

for.end24:
  ret void
}