File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed
Compiler/tests/PrivateMemoryResolution/MergeAllocas Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -332,6 +332,10 @@ void MergeAllocas::getAnalysisUsage(llvm::AnalysisUsage& AU) const
332332
333333bool MergeAllocas::runOnFunction (Function& F)
334334{
335+ if (F.hasOptNone ()){
336+ return false ;
337+ }
338+
335339 auto ABLA = getAnalysis<AllocationBasedLivenessAnalysis>().getLivenessInfo ();
336340
337341 // we group the allocations by type, then sort them into buckets with nonoverlapping liveranges
Original file line number Diff line number Diff line change 1+ ;=========================== begin_copyright_notice ============================
2+ ;
3+ ; Copyright (C) 2025 Intel Corporation
4+ ;
5+ ; SPDX-License-Identifier: MIT
6+ ;
7+ ;============================ end_copyright_notice =============================
8+ ; RUN: igc_opt --igc-merge-allocas -S %s --platformpvc | FileCheck %s
9+ ; ------------------------------------------------
10+ ; MergeAllocas
11+ ; ------------------------------------------------
12+
13+ ; Check that allocas are not merged if optnone attribute is set
14+ ; Function Attrs: noinline optnone
15+ define spir_kernel void @_ZTS43Kernel_NoReusePrivMem_SameFunc_AlwaysInline () #0 {
16+ ; CHECK-LABEL: _ZTS43Kernel_NoReusePrivMem_SameFunc_AlwaysInline
17+ ; CHECK-NEXT: alloca [128 x float], i32 0, align 4
18+ ; CHECK-NEXT: alloca [128 x float], i32 0, align 4
19+ %1 = alloca [128 x float ], i32 0 , align 4
20+ %2 = alloca [128 x float ], i32 0 , align 4
21+ ret void
22+ }
23+
24+ attributes #0 = { noinline optnone }
You can’t perform that action at this time.
0 commit comments