brintos

brintos / llvm-project-archived public Read only

0
0
Text · 908 B · d6643ef Raw
32 lines · plain
1; RUN: opt < %s -passes="print<cost-model>" 2>&1 -disable-output | FileCheck %s2 3; The cost model does not have any target information so it just makes boring4; assumptions.5 6; -- No triple in this module --7 8; CHECK-LABEL: function 'no_info'9; CHECK: cost of 1 {{.*}} add10; CHECK: cost of 1 {{.*}} ret11define i32 @no_info(i32 %arg) {12  %e = add i32 %arg, %arg13  ret i32 %e14}15 16define 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 {{.*}} getelementptr20  %v = load i8, ptr %p21  ret i8 %v22}23 24; CHECK-LABEL: function 'addressing_mode_scaled_reg'25define i32 @addressing_mode_scaled_reg(ptr %a, i32 %b) {26  ; NoTTI rejects reg+scale*reg addressing.27  %p = getelementptr i32, ptr %a, i32 %b28; CHECK: cost of 1 {{.*}} getelementptr29  %v = load i32, ptr %p30  ret i32 %v31}32