47 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; RUN: opt -S -passes=instcombine < %s | FileCheck %s3target datalayout = "E-m:e-i64:64-n32:64"4target triple = "powerpc64-unknown-linux-gnu"5 6@d = global i32 15, align 47@b = global ptr @d, align 88@a = common global i32 0, align 49 10; Check that both InstCombine and InstSimplify can use computeKnownBits to11; realize that:12; ((2072 >> (L == 0)) >> 7) & 113; is always zero.14define signext i32 @main() #1 {15; CHECK-LABEL: @main(16; CHECK-NEXT: entry:17; CHECK-NEXT: [[TMP0:%.*]] = load ptr, ptr @b, align 818; CHECK-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 419; CHECK-NEXT: ret i32 [[TMP1]]20;21entry:22 %0 = load ptr, ptr @b, align 823 %1 = load i32, ptr @a, align 424 %lnot = icmp eq i32 %1, 025 %lnot.ext = zext i1 %lnot to i3226 %shr.i = lshr i32 2072, %lnot.ext27 %call.lobit = lshr i32 %shr.i, 728 %2 = and i32 %call.lobit, 129 %3 = load i32, ptr %0, align 430 %or = or i32 %2, %331 store i32 %or, ptr %0, align 432 %4 = load i32, ptr @a, align 433 %lnot.1 = icmp eq i32 %4, 034 %lnot.ext.1 = zext i1 %lnot.1 to i3235 %shr.i.1 = lshr i32 2072, %lnot.ext.136 %call.lobit.1 = lshr i32 %shr.i.1, 737 %5 = and i32 %call.lobit.1, 138 %or.1 = or i32 %5, %or39 store i32 %or.1, ptr %0, align 440 ret i32 %or.141 42}43 44attributes #0 = { nounwind readnone }45attributes #1 = { nounwind }46 47