34 lines · plain
1; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s2 3; Test that we recognize that an 'and' instruction that feeds a comparison4; to zero can be simplifed by using the record form when one of its operands5; is known to be zero extended.6 7@k = local_unnamed_addr global i32 0, align 48 9; Function Attrs: norecurse nounwind10define signext i32 @cmplwi(ptr nocapture readonly %p, ptr nocapture readonly %q, i32 signext %j, i32 signext %r10) {11entry:12 %0 = load i32, ptr %q, align 413 %shl = shl i32 %0, %j14 %1 = load i32, ptr %p, align 415 %and = and i32 %shl, %r1016 %and1 = and i32 %and, %117 %tobool = icmp eq i32 %and1, 018 br i1 %tobool, label %cleanup, label %if.then19 20if.then:21 store i32 %j, ptr @k, align 422 br label %cleanup23 24cleanup:25 %retval.0 = phi i32 [ 0, %if.then ], [ 1, %entry ]26 ret i32 %retval.027}28 29; CHECK-LABEL: cmplwi:30; CHECK: lwz [[T1:[0-9]+]], 0(3)31; CHECK: and. {{[0-9]+}}, {{[0-9]+}}, [[T1]]32; CHECK-NOT: cmplwi33; CHECK-NEXT: beq 0,34