brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.1 KiB · 04a9520 Raw
82 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 52; RUN: opt -passes="print<cost-model>" -cost-kind=all 2>&1 -disable-output -mtriple thumbv8.1-m.main -mattr=+dsp  < %s | FileCheck %s3; RUN: opt -passes="print<cost-model>" -cost-kind=all 2>&1 -disable-output -mtriple thumbv8.1-m.main < %s | FileCheck %s --check-prefix=CHECK-NO-DSP4 5define i64 @test(i16 %a, i16 %b) {6; CHECK-LABEL: 'test'7; CHECK-NEXT:  Cost Model: Found costs of 1 for: %as = zext i16 %a to i328; CHECK-NEXT:  Cost Model: Found costs of 1 for: %bs = zext i16 %b to i329; CHECK-NEXT:  Cost Model: Found costs of 0 for: %m = mul i32 %as, %bs10; CHECK-NEXT:  Cost Model: Found costs of 1 for: %ms = zext i32 %m to i6411; CHECK-NEXT:  Cost Model: Found costs of 1 for: ret i64 %ms12;13; CHECK-NO-DSP-LABEL: 'test'14; CHECK-NO-DSP-NEXT:  Cost Model: Found costs of 1 for: %as = zext i16 %a to i3215; CHECK-NO-DSP-NEXT:  Cost Model: Found costs of 1 for: %bs = zext i16 %b to i3216; CHECK-NO-DSP-NEXT:  Cost Model: Found costs of 1 for: %m = mul i32 %as, %bs17; CHECK-NO-DSP-NEXT:  Cost Model: Found costs of 1 for: %ms = zext i32 %m to i6418; CHECK-NO-DSP-NEXT:  Cost Model: Found costs of 1 for: ret i64 %ms19;20    %as = zext i16 %a to i3221    %bs = zext i16 %b to i3222    %m = mul i32 %as, %bs23    %ms = zext i32 %m to i6424    ret i64 %ms25}26 27define i64 @withadd(i16 %a, i16 %b, i64 %c) {28; CHECK-LABEL: 'withadd'29; CHECK-NEXT:  Cost Model: Found costs of 1 for: %as = zext i16 %a to i3230; CHECK-NEXT:  Cost Model: Found costs of 1 for: %bs = zext i16 %b to i3231; CHECK-NEXT:  Cost Model: Found costs of 0 for: %m = mul i32 %as, %bs32; CHECK-NEXT:  Cost Model: Found costs of 1 for: %ms = zext i32 %m to i6433; CHECK-NEXT:  Cost Model: Found costs of 2 for: %r = add i64 %c, %ms34; CHECK-NEXT:  Cost Model: Found costs of 1 for: ret i64 %r35;36; CHECK-NO-DSP-LABEL: 'withadd'37; CHECK-NO-DSP-NEXT:  Cost Model: Found costs of 1 for: %as = zext i16 %a to i3238; CHECK-NO-DSP-NEXT:  Cost Model: Found costs of 1 for: %bs = zext i16 %b to i3239; CHECK-NO-DSP-NEXT:  Cost Model: Found costs of 1 for: %m = mul i32 %as, %bs40; CHECK-NO-DSP-NEXT:  Cost Model: Found costs of 1 for: %ms = zext i32 %m to i6441; CHECK-NO-DSP-NEXT:  Cost Model: Found costs of 2 for: %r = add i64 %c, %ms42; CHECK-NO-DSP-NEXT:  Cost Model: Found costs of 1 for: ret i64 %r43;44    %as = zext i16 %a to i3245    %bs = zext i16 %b to i3246    %m = mul i32 %as, %bs47    %ms = zext i32 %m to i6448    %r = add i64 %c, %ms49    ret i64 %r50}51 52define i64 @withloads(ptr %pa, ptr %pb, i64 %c) {53; CHECK-LABEL: 'withloads'54; CHECK-NEXT:  Cost Model: Found costs of RThru:1 CodeSize:1 Lat:4 SizeLat:1 for: %a = load i16, ptr %pa, align 255; CHECK-NEXT:  Cost Model: Found costs of RThru:1 CodeSize:1 Lat:4 SizeLat:1 for: %b = load i16, ptr %pb, align 256; CHECK-NEXT:  Cost Model: Found costs of 0 for: %as = zext i16 %a to i3257; CHECK-NEXT:  Cost Model: Found costs of 0 for: %bs = zext i16 %b to i3258; CHECK-NEXT:  Cost Model: Found costs of 0 for: %m = mul i32 %as, %bs59; CHECK-NEXT:  Cost Model: Found costs of 1 for: %ms = zext i32 %m to i6460; CHECK-NEXT:  Cost Model: Found costs of 2 for: %r = add i64 %c, %ms61; CHECK-NEXT:  Cost Model: Found costs of 1 for: ret i64 %r62;63; CHECK-NO-DSP-LABEL: 'withloads'64; CHECK-NO-DSP-NEXT:  Cost Model: Found costs of RThru:1 CodeSize:1 Lat:4 SizeLat:1 for: %a = load i16, ptr %pa, align 265; CHECK-NO-DSP-NEXT:  Cost Model: Found costs of RThru:1 CodeSize:1 Lat:4 SizeLat:1 for: %b = load i16, ptr %pb, align 266; CHECK-NO-DSP-NEXT:  Cost Model: Found costs of 0 for: %as = zext i16 %a to i3267; CHECK-NO-DSP-NEXT:  Cost Model: Found costs of 0 for: %bs = zext i16 %b to i3268; CHECK-NO-DSP-NEXT:  Cost Model: Found costs of 1 for: %m = mul i32 %as, %bs69; CHECK-NO-DSP-NEXT:  Cost Model: Found costs of 1 for: %ms = zext i32 %m to i6470; CHECK-NO-DSP-NEXT:  Cost Model: Found costs of 2 for: %r = add i64 %c, %ms71; CHECK-NO-DSP-NEXT:  Cost Model: Found costs of 1 for: ret i64 %r72;73    %a = load i16, ptr %pa74    %b = load i16, ptr %pb75    %as = zext i16 %a to i3276    %bs = zext i16 %b to i3277    %m = mul i32 %as, %bs78    %ms = zext i32 %m to i6479    %r = add i64 %c, %ms80    ret i64 %r81}82