32 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; RUN: opt -passes=aggressive-instcombine -S < %s | FileCheck %s3 4@ctz1.table = internal constant [32 x i8] c"\00\01\1C\02\1D\0E\18\03\1E\16\14\0F\19\11\04\08\1F\1B\0D\17\15\13\10\07\1A\0C\12\06\0B\05\0A\09", align 15 6define i32 @ctz1(i32 %x) !prof !0 {7; CHECK-LABEL: @ctz1(8; CHECK: !prof [[PROF_0:![0-9]+]] {9; CHECK-NEXT: entry:10; CHECK-NEXT: [[TMP0:%.*]] = call i32 @llvm.cttz.i32(i32 [[X:%.*]], i1 true)11; CHECK-NEXT: [[TMP1:%.*]] = icmp eq i32 [[X]], 012; CHECK-NEXT: [[TMP2:%.*]] = select i1 [[TMP1]], i32 0, i32 [[TMP0]], !prof [[PROF_1:![0-9]+]]13; CHECK-NEXT: [[TMP3:%.*]] = trunc i32 [[TMP2]] to i814; CHECK-NEXT: [[CONV:%.*]] = zext i8 [[TMP3]] to i3215; CHECK-NEXT: ret i32 [[CONV]]16;17entry:18 %sub = sub i32 0, %x19 %and = and i32 %sub, %x20 %mul = mul i32 %and, 12561336121 %shr = lshr i32 %mul, 2722 %idxprom = zext i32 %shr to i6423 %arrayidx = getelementptr inbounds [32 x i8], ptr @ctz1.table, i64 0, i64 %idxprom24 %0 = load i8, ptr %arrayidx, align 125 %conv = zext i8 %0 to i3226 ret i32 %conv27}28 29!0 = !{!"function_entry_count", i64 1000}30; CHECK: [[PROF_0]] = !{!"function_entry_count", i64 1000}31; CHECK: [[PROF_1]] = !{!"branch_weights", i32 1, i32 1048575}32