• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc -asm-verbose=false < %s | FileCheck %s
2; PR26063
3
4target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
5target triple = "armv7--linux-gnueabihf"
6
7; CHECK: .LBB0_1:
8; CHECK-NEXT: bl      f{{$}}
9; CHECK-NEXT: ldrb    r[[T0:[0-9]+]], [r{{[0-9]+}}, #1]!{{$}}
10; CHECK-NEXT: cmp     r{{[0-9]+}}, #1{{$}}
11; CHECK-NEXT: cmpne   r[[T0]], #0{{$}}
12; CHECK-NEXT: bne     .LBB0_1{{$}}
13define i8* @h(i8* readonly %a, i32 %b, i32 %c) {
14entry:
15  %0 = load i8, i8* %a, align 1
16  %tobool4 = icmp ne i8 %0, 0
17  %cmp5 = icmp ne i32 %b, 1
18  %1 = and i1 %cmp5, %tobool4
19  br i1 %1, label %while.body.preheader, label %while.end
20
21while.body.preheader:                             ; preds = %entry
22  br label %while.body
23
24while.body:                                       ; preds = %while.body.preheader, %while.body
25  %a.addr.06 = phi i8* [ %incdec.ptr, %while.body ], [ %a, %while.body.preheader ]
26  %call = tail call i32 bitcast (i32 (...)* @f to i32 ()*)()
27  %incdec.ptr = getelementptr inbounds i8, i8* %a.addr.06, i32 1
28  %2 = load i8, i8* %incdec.ptr, align 1
29  %tobool = icmp ne i8 %2, 0
30  %cmp = icmp ne i32 %call, 1
31  %3 = and i1 %cmp, %tobool
32  br i1 %3, label %while.body, label %while.end.loopexit
33
34while.end.loopexit:                               ; preds = %while.body
35  %incdec.ptr.lcssa = phi i8* [ %incdec.ptr, %while.body ]
36  br label %while.end
37
38while.end:                                        ; preds = %while.end.loopexit, %entry
39  %a.addr.0.lcssa = phi i8* [ %a, %entry ], [ %incdec.ptr.lcssa, %while.end.loopexit ]
40  ret i8* %a.addr.0.lcssa
41}
42
43declare i32 @f(...)
44