xref: /llvm-project/llvm/test/Analysis/CostModel/SystemZ/struct-cost-crash.ll (revision 85e4ee15d32ae0344755d11d4ca90a15a6e005cd)
1; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 2
2; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output < %s | FileCheck %s
3;
4; Check that SystemZTTIImpl::getMemoryOpCost doesn't try to legalize structs,
5; which was failing llvm_unreachable in MVT::getVT.
6
7target datalayout = "E-m:e-i1:8:16-i8:8:16-i64:64-f128:64-v128:64-a:8:16-n32:64"
8target triple = "s390x-unknown-linux-gnu"
9
10declare { i64, i32 } @bar()
11
12define i8 @foo() {
13; CHECK-LABEL: 'foo'
14; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: br label %1
15; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %2 = call { i64, i32 } @bar()
16; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: store { i64, i32 } %2, ptr inttoptr (i64 16 to ptr), align 16
17; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: br label %1
18;
19  br label %1
20
211:                                                ; preds = %1, %0
22  %2 = call { i64, i32 } @bar()
23  store { i64, i32 } %2, ptr inttoptr (i64 16 to ptr), align 16
24  br label %1
25}
26