Index: test/CodeGen/X86/cmp-zext-combine.ll =================================================================== --- /dev/null +++ test/CodeGen/X86/cmp-zext-combine.ll @@ -0,0 +1,21 @@ +; RUN: llc -mtriple=x86_64 < %s | FileCheck %s +; RUN: llc -mtriple=i686 < %s | FileCheck %s + +define i32 @f(i64*, i32, i32) { +; CHECK-LABEL: f + %4 = alloca i64*, align 8 + %5 = bitcast i64** %4 to i8* + store i64* %0, i64** %4, align 8 + %6 = call { i32, i32 } asm sideeffect "cmpxchg8b $2", "={ax},={dx},=*m,{bx},{cx},0,1,*m,~{flags},~{dirflag},~{fpsr},~{flags}"(i64** nonnull %4, i32 4, i32 5, i32 0, i32 0, i64** nonnull %4) #5 + %7 = extractvalue { i32, i32 } %6, 0 + %8 = extractvalue { i32, i32 } %6, 1 + %9 = zext i32 %8 to i64 + %10 = shl nuw i64 %9, 32 +; CHECK-DAG: testl %eax, %eax + %11 = icmp ne i32 %7, 0 +; CHECK-DAG: testl %edx, %edx + %12 = icmp ugt i64 %10, 4294967295 + %13 = and i1 %11, %12 + %14 = zext i1 %13 to i32 + ret i32 %14 +}