1 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s
3 ; Test that we recognize that an 'and' instruction that feeds a comparison
4 ; to zero can be simplifed by using the record form when one of its operands
5 ; is known to be zero extended.
7 @k = local_unnamed_addr global i32 0, align 4
9 ; Function Attrs: norecurse nounwind
10 define signext i32 @cmplwi(ptr nocapture readonly %p, ptr nocapture readonly %q, i32 signext %j, i32 signext %r10) {
12 %0 = load i32, ptr %q, align 4
14 %1 = load i32, ptr %p, align 4
15 %and = and i32 %shl, %r10
16 %and1 = and i32 %and, %1
17 %tobool = icmp eq i32 %and1, 0
18 br i1 %tobool, label %cleanup, label %if.then
21 store i32 %j, ptr @k, align 4
25 %retval.0 = phi i32 [ 0, %if.then ], [ 1, %entry ]
29 ; CHECK-LABEL: cmplwi:
30 ; CHECK: lwz [[T1:[0-9]+]], 0(3)
31 ; CHECK: and. {{[0-9]+}}, {{[0-9]+}}, [[T1]]