1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -instcombine < %s | FileCheck %s
3 target datalayout = "E-m:e-i64:64-n32:64"
4 target triple = "powerpc64-unknown-linux-gnu"
6 @d = global i32 15, align 4
7 @b = global i32* @d, align 8
8 @a = common global i32 0, align 4
10 ; Check that both InstCombine and InstSimplify can use computeKnownBits to
12 ; ((2072 >> (L == 0)) >> 7) & 1
14 define signext i32 @main() #1 {
17 ; CHECK-NEXT: [[TMP0:%.*]] = load i32*, i32** @b, align 8
18 ; CHECK-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP0]], align 4
19 ; CHECK-NEXT: ret i32 [[TMP1]]
22 %0 = load i32*, i32** @b, align 8
23 %1 = load i32, i32* @a, align 4
24 %lnot = icmp eq i32 %1, 0
25 %lnot.ext = zext i1 %lnot to i32
26 %shr.i = lshr i32 2072, %lnot.ext
27 %call.lobit = lshr i32 %shr.i, 7
28 %2 = and i32 %call.lobit, 1
29 %3 = load i32, i32* %0, align 4
31 store i32 %or, i32* %0, align 4
32 %4 = load i32, i32* @a, align 4
33 %lnot.1 = icmp eq i32 %4, 0
34 %lnot.ext.1 = zext i1 %lnot.1 to i32
35 %shr.i.1 = lshr i32 2072, %lnot.ext.1
36 %call.lobit.1 = lshr i32 %shr.i.1, 7
37 %5 = and i32 %call.lobit.1, 1
38 %or.1 = or i32 %5, %or
39 store i32 %or.1, i32* %0, align 4
44 attributes #0 = { nounwind readnone }
45 attributes #1 = { nounwind }