|
| 1 | +# This file is licensed under the Apache License v2.0 with LLVM Exceptions. |
| 2 | +# See https://llvm.org/LICENSE.txt for license information. |
| 3 | +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 4 | +# |
| 5 | +# (c) Copyright 2025 Advanced Micro Devices, Inc. or its affiliates |
| 6 | +# RUN: llc -mtriple=aie2p -run-pass=machine-scheduler -debug-only=machine-scheduler -o - %s \ |
| 7 | +# RUN: 2>&1 | FileCheck %s |
| 8 | + |
| 9 | +--- | |
| 10 | + target datalayout = "e-m:e-p:20:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-f32:32:32-i64:32-f64:32-a:0:32-n32" |
| 11 | + target triple = "aie2p" |
| 12 | + |
| 13 | + %struct.params = type <{ i32, i32, i32, i32, i32, i32, i8, i8, i32, i32 }> |
| 14 | + |
| 15 | + ; Function Attrs: mustprogress noinline |
| 16 | + declare dso_local void @anchor(%struct.params) |
| 17 | + |
| 18 | + ; Function Attrs: mustprogress noinline |
| 19 | + define dso_local void @load_and_store_chain(ptr %ifm, ptr %ofm, %struct.params %sm_params.coerce) { |
| 20 | + entry: |
| 21 | + tail call void @anchor(%struct.params %sm_params.coerce) #1 |
| 22 | + ret void |
| 23 | + } |
| 24 | + |
| 25 | +... |
| 26 | + |
| 27 | +# This test is intended to verify memory disambiguation related to stack objects. |
| 28 | +# In this case, we have five fixed stack objects: 0, that is aliasing (same offset) |
| 29 | +# with 2 and 1 that is aliasing with 3. We also have an object 4 that partially alias |
| 30 | +# with 0 and 2. |
| 31 | + |
| 32 | +--- |
| 33 | +name: load_and_store_chain |
| 34 | +alignment: 16 |
| 35 | +exposesReturnsTwice: false |
| 36 | +tracksRegLiveness: true |
| 37 | +frameInfo: |
| 38 | + hasTailCall: true |
| 39 | + |
| 40 | +fixedStack: |
| 41 | + - { id: 0, type: default, offset: -8, size: 4, alignment: 8, stack-id: default, |
| 42 | + isImmutable: false, isAliased: false, callee-saved-register: '', |
| 43 | + callee-saved-restored: true, debug-info-variable: '', debug-info-expression: '', |
| 44 | + debug-info-location: '' } |
| 45 | + - { id: 1, type: default, offset: -4, size: 4, alignment: 4, stack-id: default, |
| 46 | + isImmutable: false, isAliased: false, callee-saved-register: '', |
| 47 | + callee-saved-restored: true, debug-info-variable: '', debug-info-expression: '', |
| 48 | + debug-info-location: '' } |
| 49 | + - { id: 2, type: default, offset: -8, size: 4, alignment: 8, stack-id: default, |
| 50 | + isImmutable: false, isAliased: false, callee-saved-register: '', |
| 51 | + callee-saved-restored: true, debug-info-variable: '', debug-info-expression: '', |
| 52 | + debug-info-location: '' } |
| 53 | + - { id: 3, type: default, offset: -4, size: 4, alignment: 4, stack-id: default, |
| 54 | + isImmutable: false, isAliased: false, callee-saved-register: '', |
| 55 | + callee-saved-restored: true, debug-info-variable: '', debug-info-expression: '', |
| 56 | + debug-info-location: '' } |
| 57 | + - { id: 4, type: default, offset: -10, size: 2, alignment: 2, stack-id: default, |
| 58 | + isImmutable: false, isAliased: false, callee-saved-register: '', |
| 59 | + callee-saved-restored: true, debug-info-variable: '', debug-info-expression: '', |
| 60 | + debug-info-location: '' } |
| 61 | +stack: [] |
| 62 | +entry_values: [] |
| 63 | +callSites: [] |
| 64 | +debugValueSubstitutions: [] |
| 65 | +constants: [] |
| 66 | +machineFunctionInfo: |
| 67 | + varArgsFrameIndex: 0 |
| 68 | +body: | |
| 69 | + bb.0.entry: |
| 70 | + ; CHECK: ********** MI Scheduling ********** |
| 71 | + ; CHECK-LABEL: load_and_store_chain:%bb.0 entry |
| 72 | + ; CHECK: SU(1): %1:er = LDA_dms_lda_idx_imm %0:ep, 0 :: (invariant load (s32) from %fixed-stack.1) |
| 73 | + ; CHECK: Successors: |
| 74 | + ; CHECK: SU(6): Data Latency=7 Reg=%1 |
| 75 | + ; CHECK: SU(10): Ord Latency=0 Memory |
| 76 | + ; CHECK: SU(8): Ord Latency=0 Memory |
| 77 | + ; CHECK: SU(6): Ord Latency=0 Memory |
| 78 | +
|
| 79 | + ; CHECK: SU(3): %3:er = LDA_dms_lda_idx_imm %2:ep, 0 :: (invariant load (s32) from %fixed-stack.2, align 8) |
| 80 | + ; CHECK: Successors: |
| 81 | + ; CHECK: SU(10): Data Latency=7 Reg=%3 |
| 82 | + ; CHECK: SU(8): Data Latency=7 Reg=%3 |
| 83 | + ; CHECK: SU(10): Ord Latency=0 Memory |
| 84 | + ; CHECK: SU(8): Ord Latency=0 Memory |
| 85 | + ; CHECK: SU(6): Ord Latency=0 Memory |
| 86 | +
|
| 87 | + ; CHECK: SU(6): ST_dms_sts_idx_imm %1:er, %4:ep, 0 :: (store (s32) into %fixed-stack.3, align 32) |
| 88 | + ; CHECK: SU(8): ST_dms_sts_idx_imm %3:er, %5:ep, 0 :: (store (s32) into %fixed-stack.4) |
| 89 | + ; CHECK: SU(10): ST_dms_sts_idx_imm %3:er, %6:ep, 0 :: (store (s32) into %fixed-stack.0) |
| 90 | +
|
| 91 | + %14:ep = PseudoFI %fixed-stack.3, implicit $sp |
| 92 | + %10:er = LDA_dms_lda_idx_imm %14, 0 :: (invariant load (s32) from %fixed-stack.3) |
| 93 | + %15:ep = PseudoFI %fixed-stack.2, implicit $sp |
| 94 | + %11:er = LDA_dms_lda_idx_imm %15, 0 :: (invariant load (s32) from %fixed-stack.2, align 8) |
| 95 | + ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp |
| 96 | + %18:ep = PseudoFI %fixed-stack.1, implicit $sp |
| 97 | + ST_dms_sts_idx_imm %10, %18, 0 :: (store (s32) into %fixed-stack.1, align 32) |
| 98 | + %19:ep = PseudoFI %fixed-stack.0, implicit $sp |
| 99 | + ST_dms_sts_idx_imm %11, %19, 0 :: (store (s32) into %fixed-stack.0) |
| 100 | + %20:ep = PseudoFI %fixed-stack.4, implicit $sp |
| 101 | + ST_dms_sts_idx_imm %11, %20, 0 :: (store (s32) into %fixed-stack.4) |
| 102 | + ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp |
| 103 | + PseudoJ_TCO_jump_imm @anchor, csr_aie2p |
| 104 | +
|
| 105 | +... |
0 commit comments