1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -passes='loop-mssa(indvars,loop-rotate)' -verify-scev -S %s | FileCheck %s
4 define void @pr59534(i16 %c.0, ptr %A) {
5 ; CHECK-LABEL: @pr59534(
7 ; CHECK-NEXT: br label [[LOOP_HEADER:%.*]]
9 ; CHECK-NEXT: [[C_1:%.*]] = icmp ne i16 [[C_0:%.*]], 0
10 ; CHECK-NEXT: br i1 [[C_1]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]
12 ; CHECK-NEXT: [[L:%.*]] = load i32, ptr [[A:%.*]], align 1
13 ; CHECK-NEXT: [[CMP:%.*]] = icmp sgt i32 [[L]], 0
14 ; CHECK-NEXT: [[CONV:%.*]] = zext i1 [[CMP]] to i16
15 ; CHECK-NEXT: store i16 [[CONV]], ptr [[A]], align 2
16 ; CHECK-NEXT: br label [[IF_END]]
18 ; CHECK-NEXT: br i1 false, label [[LOOP_HEADER]], label [[EXIT:%.*]]
20 ; CHECK-NEXT: ret void
26 %e.0 = phi i32 [ 0, %entry ], [ 1, %loop.latch ]
27 %c.1 = icmp ne i16 %c.0, 0
28 br i1 %c.1, label %if.then, label %if.end
31 %l = load i32, ptr %A, align 1
32 %cmp = icmp sgt i32 %l, %e.0
33 %conv = zext i1 %cmp to i16
34 store i16 %conv, ptr %A
38 br i1 false, label %loop.latch, label %exit