1; RUN: llc < %s | FileCheck %s 2 3target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" 4target triple = "x86_64-apple-macosx10.10.0" 5 6; Function Attrs: nounwind 7declare i32 @printf(i8* nocapture readonly, ...) 8 9; On X86 1 is true and 0 is false, so we can't perform the combine: 10; (and (setgt X, true), (setgt Y, true)) -> (setgt (or X, Y), true) 11; This combine only works if the true value is -1. 12 13 14;CHECK: cmpl 15;CHECK: setg 16;CHECK: cmpl 17;CHECK: setg 18;CHECK: andb 19 20@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 21; Function Attrs: optsize ssp uwtable 22define i32 @foo(i32 %a, i32 %b, i32 * %c) { 23if.else429: 24 %cmp.i1144 = icmp eq i32* %c, null 25 %cmp430 = icmp slt i32 %a, 2 26 %cmp432 = icmp slt i32 %b, 2 27 %or.cond710 = or i1 %cmp430, %cmp432 28 %or.cond710.not = xor i1 %or.cond710, true 29 %brmerge1448 = or i1 %cmp.i1144, %or.cond710.not 30 br i1 %brmerge1448, label %ret1, label %ret2 31 32ret1: 33 ret i32 0 34 35ret2: 36 ret i32 1 37} 38 39define i32 @main(i32 %argc, i8** nocapture readnone %argv) { 40 %res = alloca i32, align 4 41 %t = call i32 @foo(i32 1, i32 2, i32* %res) #3 42 %v = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %t) 43 ret i32 0 44} 45 46 47 48