brintos

brintos / llvm-project-archived public Read only

0
0
Text · 7.8 KiB · aa905dc Raw
249 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py2; RUN: opt < %s -passes="print<cost-model>" -cost-kind=code-size 2>&1 -disable-output -mtriple=x86_64-- | FileCheck %s3 4define i8 @trunc_i64_i8(i64 %x) {5; CHECK-LABEL: 'trunc_i64_i8'6; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %r = trunc i64 %x to i87; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i8 %r8;9  %r = trunc i64 %x to i810  ret i8 %r11}12 13define i64 @sext_i8_i64(i8 %x) {14; CHECK-LABEL: 'sext_i8_i64'15; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %r = sext i8 %x to i6416; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i64 %r17;18  %r = sext i8 %x to i6419  ret i64 %r20}21 22define i64 @zext_i8_i64(i8 %x) {23; CHECK-LABEL: 'zext_i8_i64'24; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %r = zext i8 %x to i6425; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i64 %r26;27  %r = zext i8 %x to i6428  ret i64 %r29}30 31define i64 @bitcast_f64_i64(double %x) {32; CHECK-LABEL: 'bitcast_f64_i64'33; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %r = bitcast double %x to i6434; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i64 %r35;36  %r = bitcast double %x to i6437  ret i64 %r38}39 40define double @bitcast_i64_f64(i64 %x) {41; CHECK-LABEL: 'bitcast_i64_f64'42; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %r = bitcast i64 %x to double43; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret double %r44;45  %r = bitcast i64 %x to double46  ret double %r47}48 49define ptr @inttoptr_i64_p64(i64 %x) {50; CHECK-LABEL: 'inttoptr_i64_p64'51; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %r = inttoptr i64 %x to ptr52; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret ptr %r53;54  %r = inttoptr i64 %x to ptr55  ret ptr %r56}57 58define i64 @ptrtoint_p64_i64(ptr %x) {59; CHECK-LABEL: 'ptrtoint_p64_i64'60; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %r = ptrtoint ptr %x to i6461; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i64 %r62;63  %r = ptrtoint ptr %x to i6464  ret i64 %r65}66 67define i64 @add_i64(i64 %x, i64 %y) {68; CHECK-LABEL: 'add_i64'69; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %r = add i64 %x, %y70; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i64 %r71;72  %r = add i64 %x, %y73  ret i64 %r74}75 76define i64 @sub_i64(i64 %x, i64 %y) {77; CHECK-LABEL: 'sub_i64'78; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %r = sub i64 %x, %y79; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i64 %r80;81  %r = sub i64 %x, %y82  ret i64 %r83}84 85define i64 @mul_i64(i64 %x, i64 %y) {86; CHECK-LABEL: 'mul_i64'87; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %r = mul i64 %x, %y88; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i64 %r89;90  %r = mul i64 %x, %y91  ret i64 %r92}93 94; FIXME: idiv is 1 instruction.95 96define i64 @sdiv_i64(i64 %x, i64 %y) {97; CHECK-LABEL: 'sdiv_i64'98; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %r = sdiv i64 %x, %y99; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i64 %r100;101  %r = sdiv i64 %x, %y102  ret i64 %r103}104 105; FIXME: div is 1 instruction.106 107define i64 @udiv_i64(i64 %x, i64 %y) {108; CHECK-LABEL: 'udiv_i64'109; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %r = udiv i64 %x, %y110; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i64 %r111;112  %r = udiv i64 %x, %y113  ret i64 %r114}115 116; FIXME: idiv is 1 instruction.117 118define i64 @srem_i64(i64 %x, i64 %y) {119; CHECK-LABEL: 'srem_i64'120; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %r = srem i64 %x, %y121; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i64 %r122;123  %r = srem i64 %x, %y124  ret i64 %r125}126 127; FIXME: div is 1 instruction.128 129define i64 @urem_i64(i64 %x, i64 %y) {130; CHECK-LABEL: 'urem_i64'131; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %r = urem i64 %x, %y132; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i64 %r133;134  %r = urem i64 %x, %y135  ret i64 %r136}137 138define i64 @ashr_i64(i64 %x, i64 %y) {139; CHECK-LABEL: 'ashr_i64'140; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %r = ashr i64 %x, %y141; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i64 %r142;143  %r = ashr i64 %x, %y144  ret i64 %r145}146 147define i64 @lshr_i64(i64 %x, i64 %y) {148; CHECK-LABEL: 'lshr_i64'149; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %r = lshr i64 %x, %y150; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i64 %r151;152  %r = lshr i64 %x, %y153  ret i64 %r154}155 156define i64 @shl_i64(i64 %x, i64 %y) {157; CHECK-LABEL: 'shl_i64'158; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %r = shl i64 %x, %y159; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i64 %r160;161  %r = shl i64 %x, %y162  ret i64 %r163}164 165define i64 @and_i64(i64 %x, i64 %y) {166; CHECK-LABEL: 'and_i64'167; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %r = and i64 %x, %y168; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i64 %r169;170  %r = and i64 %x, %y171  ret i64 %r172}173 174define i64 @or_i64(i64 %x, i64 %y) {175; CHECK-LABEL: 'or_i64'176; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %r = or i64 %x, %y177; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i64 %r178;179  %r = or i64 %x, %y180  ret i64 %r181}182 183define i64 @xor_i64(i64 %x, i64 %y) {184; CHECK-LABEL: 'xor_i64'185; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %r = xor i64 %x, %y186; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i64 %r187;188  %r = xor i64 %x, %y189  ret i64 %r190}191 192define double @fadd_f64(double %x, double %y) {193; CHECK-LABEL: 'fadd_f64'194; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %r = fadd double %x, %y195; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret double %r196;197  %r = fadd double %x, %y198  ret double %r199}200 201define double @fsub_f64(double %x, double %y) {202; CHECK-LABEL: 'fsub_f64'203; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %r = fsub double %x, %y204; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret double %r205;206  %r = fsub double %x, %y207  ret double %r208}209 210define double @fmul_f64(double %x, double %y) {211; CHECK-LABEL: 'fmul_f64'212; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %r = fmul double %x, %y213; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret double %r214;215  %r = fmul double %x, %y216  ret double %r217}218 219; divsd is 1 instruction.220 221define double @fdiv_f64(double %x, double %y) {222; CHECK-LABEL: 'fdiv_f64'223; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %r = fdiv double %x, %y224; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret double %r225;226  %r = fdiv double %x, %y227  ret double %r228}229 230; TODO: How does this lower?231 232define double @frem_f64(double %x, double %y) {233; CHECK-LABEL: 'frem_f64'234; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %r = frem double %x, %y235; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret double %r236;237  %r = frem double %x, %y238  ret double %r239}240 241define double @fneg_f64(double %x) {242; CHECK-LABEL: 'fneg_f64'243; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %r = fneg double %x244; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret double %r245;246  %r = fneg double %x247  ret double %r248}249