1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -passes=simplifycfg,instcombine -simplifycfg-require-and-preserve-domtree=1 -S < %s | FileCheck %s
4 %struct.test = type { i8, [3 x i8] }
6 define i32 @get(ptr nocapture readonly %arg) {
9 ; CHECK-NEXT: [[I1:%.*]] = load i8, ptr [[ARG:%.*]], align 4
10 ; CHECK-NEXT: [[TMP0:%.*]] = and i8 [[I1]], 3
11 ; CHECK-NEXT: [[TMP1:%.*]] = icmp ne i8 [[TMP0]], 0
12 ; CHECK-NEXT: [[I9:%.*]] = zext i1 [[TMP1]] to i32
13 ; CHECK-NEXT: ret i32 [[I9]]
16 %i1 = load i8, ptr %arg, align 4
18 %i3 = icmp eq i8 %i2, 0
19 br i1 %i3, label %bb4, label %bb8
24 %i7 = zext i8 %i6 to i32
28 %i9 = phi i32 [ 1, %bb ], [ %i7, %bb4 ]