1; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 -mattr=-crbits | FileCheck %s 2; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 | FileCheck --check-prefix=CHECK-CRB %s 3; RUN: llc -verify-machineinstrs -ppc-gen-isel=false < %s -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 | FileCheck --check-prefix=CHECK-NO-ISEL %s 4target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f128:128:128-v128:128:128-n32:64" 5target triple = "powerpc64-unknown-linux-gnu" 6 7define i32 @test1(i1 %a, i32 %c) nounwind { 8 %x = select i1 %a, i32 %c, i32 0 9 ret i32 %x 10 11; CHECK-LABEL: @test1 12; CHECK-NOT: li {{[0-9]+}}, 0 13; CHECK: iseleq 3, 0, 14; CHECK: blr 15; CHECK-NO-ISEL-LABEL: @test1 16; CHECK-NO-ISEL: li 3, 0 17; CHECK-NO-ISEL-NEXT: bc 12, 1, [[TRUE:.LBB[0-9]+]] 18; CHECK-NO-ISEL-NEXT: blr 19; CHECK-NO-ISEL-NEXT: [[TRUE]] 20; CHECK-NO-ISEL-NEXT: addi 3, 4, 0 21; CHECK-NO-ISEL-NEXT: blr 22} 23 24define i32 @test2(i1 %a, i32 %c) nounwind { 25 %x = select i1 %a, i32 0, i32 %c 26 ret i32 %x 27 28; CHECK-CRB-LABEL: @test2 29; CHECK-CRB-NOT: li {{[0-9]+}}, 0 30; CHECK-CRB: iselgt 3, 0, 31; CHECK-CRB: blr 32; CHECK-NO-ISEL-LABEL: @test2 33; CHECK-NO-ISEL: bc 12, 1, [[TRUE:.LBB[0-9]+]] 34; CHECK-NO-ISEL: ori 3, 4, 0 35; CHECK-NO-ISEL-NEXT: blr 36; CHECK-NO-ISEL-NEXT: [[TRUE]] 37; CHECK-NO-ISEL-NEXT: li 3, 0 38; CHECK-NO-ISEL-NEXT: blr 39} 40 41