1 ; RUN: llc < %s | FileCheck %s
3 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
4 target triple = "x86_64-apple-macosx10.10.0"
6 ; Function Attrs: nounwind
7 declare i32 @printf(ptr nocapture readonly, ...)
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.
21 @.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
22 ; Function Attrs: optsize ssp uwtable
23 define i32 @foo(i32 %a, i32 %b, ptr %c) {
25 %cmp.i1144 = icmp eq ptr %c, null
26 %cmp430 = icmp slt i32 %a, 2
27 %cmp432 = icmp slt i32 %b, 2
28 %or.cond710 = or i1 %cmp430, %cmp432
29 %or.cond710.not = xor i1 %or.cond710, true
30 %brmerge1448 = or i1 %cmp.i1144, %or.cond710.not
31 br i1 %brmerge1448, label %ret1, label %ret2
40 define i32 @main(i32 %argc, ptr nocapture readnone %argv) {
41 %res = alloca i32, align 4
42 %t = call i32 @foo(i32 1, i32 2, ptr %res) #3
43 %v = call i32 (ptr, ...) @printf(ptr @.str, i32 %t)