1 ; RUN: opt < %s -cost-model -analyze | 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(i8* %a, i32 %b) {
17 ; CHECK-LABEL: function 'addressing_mode_reg_reg'
18 %p = getelementptr i8, i8* %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(i32* %a, i32 %b) {
26 ; NoTTI rejects reg+scale*reg addressing.
27 %p = getelementptr i32, i32* %a, i32 %b
28 ; CHECK: cost of 1 {{.*}} getelementptr
29 %v = load i32, i32* %p