1 ; RUN: opt < %s -passes="print<cost-model>" 2>&1 -disable-output | FileCheck %s
3 ; The cost model does not have any target information so it just makes boring
6 ; -- No triple in this module --
8 ; CHECK-LABEL: function 'no_info'
9 ; CHECK: cost of 1 {{.*}} add
10 ; CHECK: cost of 1 {{.*}} ret
11 define i32 @no_info(i32 %arg) {
12 %e = add i32 %arg, %arg
16 define i8 @addressing_mode_reg_reg(ptr %a, i32 %b) {
17 ; CHECK-LABEL: function 'addressing_mode_reg_reg'
18 %p = getelementptr i8, ptr %a, i32 %b ; NoTTI accepts reg+reg addressing.
19 ; CHECK: cost of 0 {{.*}} getelementptr
24 ; CHECK-LABEL: function 'addressing_mode_scaled_reg'
25 define i32 @addressing_mode_scaled_reg(ptr %a, i32 %b) {
26 ; NoTTI rejects reg+scale*reg addressing.
27 %p = getelementptr i32, ptr %a, i32 %b
28 ; CHECK: cost of 1 {{.*}} getelementptr