143 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py2; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -passes="print<cost-model>" -cost-kind=throughput 2>&1 -disable-output | FileCheck %s --check-prefix=THROUGHPUT3; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -passes="print<cost-model>" -cost-kind=latency 2>&1 -disable-output | FileCheck %s --check-prefix=LATENCY4; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -passes="print<cost-model>" -cost-kind=code-size 2>&1 -disable-output | FileCheck %s --check-prefix=CODESIZE5 6define i32 @extract_first_i32({i32, i32} %agg) {7; THROUGHPUT-LABEL: 'extract_first_i32'8; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r = extractvalue { i32, i32 } %agg, 09; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 %r10;11; LATENCY-LABEL: 'extract_first_i32'12; LATENCY-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r = extractvalue { i32, i32 } %agg, 013; LATENCY-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i32 %r14;15; CODESIZE-LABEL: 'extract_first_i32'16; CODESIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r = extractvalue { i32, i32 } %agg, 017; CODESIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i32 %r18;19 %r = extractvalue {i32, i32} %agg, 020 ret i32 %r21}22 23define i32 @extract_second_i32({i32, i32} %agg) {24; THROUGHPUT-LABEL: 'extract_second_i32'25; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r = extractvalue { i32, i32 } %agg, 126; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 %r27;28; LATENCY-LABEL: 'extract_second_i32'29; LATENCY-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r = extractvalue { i32, i32 } %agg, 130; LATENCY-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i32 %r31;32; CODESIZE-LABEL: 'extract_second_i32'33; CODESIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r = extractvalue { i32, i32 } %agg, 134; CODESIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i32 %r35;36 %r = extractvalue {i32, i32} %agg, 137 ret i32 %r38}39 40define i32 @extract_i32({i32, i1} %agg) {41; THROUGHPUT-LABEL: 'extract_i32'42; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r = extractvalue { i32, i1 } %agg, 043; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 %r44;45; LATENCY-LABEL: 'extract_i32'46; LATENCY-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r = extractvalue { i32, i1 } %agg, 047; LATENCY-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i32 %r48;49; CODESIZE-LABEL: 'extract_i32'50; CODESIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r = extractvalue { i32, i1 } %agg, 051; CODESIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i32 %r52;53 %r = extractvalue {i32, i1} %agg, 054 ret i32 %r55}56 57define i1 @extract_i1({i32, i1} %agg) {58; THROUGHPUT-LABEL: 'extract_i1'59; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r = extractvalue { i32, i1 } %agg, 160; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i1 %r61;62; LATENCY-LABEL: 'extract_i1'63; LATENCY-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r = extractvalue { i32, i1 } %agg, 164; LATENCY-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i1 %r65;66; CODESIZE-LABEL: 'extract_i1'67; CODESIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r = extractvalue { i32, i1 } %agg, 168; CODESIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i1 %r69;70 %r = extractvalue {i32, i1} %agg, 171 ret i1 %r72}73 74define float @extract_float({i32, float} %agg) {75; THROUGHPUT-LABEL: 'extract_float'76; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r = extractvalue { i32, float } %agg, 177; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret float %r78;79; LATENCY-LABEL: 'extract_float'80; LATENCY-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r = extractvalue { i32, float } %agg, 181; LATENCY-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret float %r82;83; CODESIZE-LABEL: 'extract_float'84; CODESIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r = extractvalue { i32, float } %agg, 185; CODESIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret float %r86;87 %r = extractvalue {i32, float} %agg, 188 ret float %r89}90 91define [42 x i42] @extract_array({i32, [42 x i42]} %agg) {92; THROUGHPUT-LABEL: 'extract_array'93; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r = extractvalue { i32, [42 x i42] } %agg, 194; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret [42 x i42] %r95;96; LATENCY-LABEL: 'extract_array'97; LATENCY-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r = extractvalue { i32, [42 x i42] } %agg, 198; LATENCY-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret [42 x i42] %r99;100; CODESIZE-LABEL: 'extract_array'101; CODESIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r = extractvalue { i32, [42 x i42] } %agg, 1102; CODESIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret [42 x i42] %r103;104 %r = extractvalue {i32, [42 x i42]} %agg, 1105 ret [42 x i42] %r106}107 108define <42 x i42> @extract_vector({i32, <42 x i42>} %agg) {109; THROUGHPUT-LABEL: 'extract_vector'110; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r = extractvalue { i32, <42 x i42> } %agg, 1111; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <42 x i42> %r112;113; LATENCY-LABEL: 'extract_vector'114; LATENCY-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r = extractvalue { i32, <42 x i42> } %agg, 1115; LATENCY-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <42 x i42> %r116;117; CODESIZE-LABEL: 'extract_vector'118; CODESIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r = extractvalue { i32, <42 x i42> } %agg, 1119; CODESIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <42 x i42> %r120;121 %r = extractvalue {i32, <42 x i42>} %agg, 1122 ret <42 x i42> %r123}124 125%T1 = type { i32, float, <4 x i1> }126 127define %T1 @extract_struct({i32, %T1} %agg) {128; THROUGHPUT-LABEL: 'extract_struct'129; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r = extractvalue { i32, %T1 } %agg, 1130; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret %T1 %r131;132; LATENCY-LABEL: 'extract_struct'133; LATENCY-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r = extractvalue { i32, %T1 } %agg, 1134; LATENCY-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret %T1 %r135;136; CODESIZE-LABEL: 'extract_struct'137; CODESIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r = extractvalue { i32, %T1 } %agg, 1138; CODESIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret %T1 %r139;140 %r = extractvalue {i32, %T1} %agg, 1141 ret %T1 %r142}143