File: addi-opt-predicated-def-bug.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 (36 lines) | stat: -rw-r--r-- 1,553 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
; RUN: llc -O3 -mtriple=hexagon < %s | FileCheck %s

; We do not want the opt-addr-mode pass to modify the addi instructions whose
; base register has a predicated register definition
; CHECK: if ({{.*}}) [[REG1:r([0-9]+)]] = {{.*}}
; CHECK: r{{[0-9]+}} = add([[REG1]],#{{[0-9]+}})
; CHECK: r{{[0-9]+}} = add([[REG1]],#{{[0-9]+}})

@seqToUnseq = external dso_local local_unnamed_addr global [256 x i8], align 8
@unseqToSeq = external dso_local local_unnamed_addr global [256 x i8], align 8

define dso_local void @makeMaps() local_unnamed_addr {
entry:
  br label %for.body

for.body:                                         ; preds = %for.inc.3, %entry
  %0 = phi i32 [ 0, %entry ], [ %inc.7, %for.inc.3 ]
  %inc.1 = add nsw i32 %0, 1
  br i1 undef, label %for.inc.3, label %if.then.3

if.then.3:                                        ; preds = %for.body
  %arrayidx1.3 = getelementptr inbounds [256 x i8], [256 x i8]* @seqToUnseq, i32 0, i32 %inc.1
  store i8 undef, i8* %arrayidx1.3, align 1
  br label %for.inc.3

for.inc.3:                                        ; preds = %if.then.3, %for.body
  %1 = phi i32 [ %inc.1, %for.body ], [ 0, %if.then.3 ]
  %arrayidx3.4 = getelementptr inbounds [256 x i8], [256 x i8]* @unseqToSeq, i32 0, i32 undef
  store i8 0, i8* %arrayidx3.4, align 4
  %inc.4 = add nsw i32 %1, 1
  %conv2.7 = trunc i32 %inc.4 to i8
  %arrayidx3.7 = getelementptr inbounds [256 x i8], [256 x i8]* @unseqToSeq, i32 0, i32 undef
  store i8 %conv2.7, i8* %arrayidx3.7, align 1
  %inc.7 = add nsw i32 %inc.4, 1
  br label %for.body
}