1 ; RUN: opt < %s -cost-model -analyze -mtriple=systemz-unknown -mcpu=z13 | FileCheck %s
3 ; Test that an extension of a load does not get an additional cost in cases
4 ; where the load performs the extension.
7 %li8 = load i8, i8* undef
12 %li16 = load i16, i16* undef
16 %li32 = load i32, i32* undef
21 ; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %li8 = load i8, i8* undef
22 ; CHECK: Cost Model: Found an estimated cost of 0 for instruction: %1 = sext i8 %li8 to i16
23 ; CHECK: Cost Model: Found an estimated cost of 0 for instruction: %2 = sext i8 %li8 to i32
24 ; CHECK: Cost Model: Found an estimated cost of 0 for instruction: %3 = sext i8 %li8 to i64
25 ; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %li16 = load i16, i16* undef
26 ; CHECK: Cost Model: Found an estimated cost of 0 for instruction: %4 = sext i16 %li16 to i32
27 ; CHECK: Cost Model: Found an estimated cost of 0 for instruction: %5 = sext i16 %li16 to i64
28 ; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %li32 = load i32, i32* undef
29 ; CHECK: Cost Model: Found an estimated cost of 0 for instruction: %6 = sext i32 %li32 to i64
33 %li8 = load i8, i8* undef
38 %li16 = load i16, i16* undef
42 %li32 = load i32, i32* undef
47 ; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %li8 = load i8, i8* undef
48 ; CHECK: Cost Model: Found an estimated cost of 0 for instruction: %1 = zext i8 %li8 to i16
49 ; CHECK: Cost Model: Found an estimated cost of 0 for instruction: %2 = zext i8 %li8 to i32
50 ; CHECK: Cost Model: Found an estimated cost of 0 for instruction: %3 = zext i8 %li8 to i64
51 ; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %li16 = load i16, i16* undef
52 ; CHECK: Cost Model: Found an estimated cost of 0 for instruction: %4 = zext i16 %li16 to i32
53 ; CHECK: Cost Model: Found an estimated cost of 0 for instruction: %5 = zext i16 %li16 to i64
54 ; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %li32 = load i32, i32* undef
55 ; CHECK: Cost Model: Found an estimated cost of 0 for instruction: %6 = zext i32 %li32 to i64