1 ; RUN: llc -march=x86-64 < %s | FileCheck %s
3 declare i64 @llvm.ctpop.i64(i64) nounwind readnone
5 define i32 @test1(i64 %x) nounwind readnone {
6 %count = tail call i64 @llvm.ctpop.i64(i64 %x)
7 %cast = trunc i64 %count to i32
8 %cmp = icmp ugt i32 %cast, 1
9 %conv = zext i1 %cmp to i32
12 ; CHECK: leaq -1(%rdi)
19 define i32 @test2(i64 %x) nounwind readnone {
20 %count = tail call i64 @llvm.ctpop.i64(i64 %x)
21 %cast = trunc i64 %count to i32
22 %cmp = icmp ult i32 %cast, 2
23 %conv = zext i1 %cmp to i32
26 ; CHECK: leaq -1(%rdi)