llvm-project/mlir/test/Dialect/LLVMIR/call-param.mlir
Bruno Cardoso Lopes 08aedf7201
[MLIR][LLVM] Lift alignstack attribute ptr type restriction (#133195)
Current usage of alignstack is restricted to LLVM pointer types, whereas
when it's used in parameters it's possible to use it for other types,
see examples like `{i8, i8}, [2 x float], etc` in `llvm/test/CodeGen`.
This PR lifts the restriction and add testcases.
2025-03-27 10:28:37 -07:00

24 lines
1.1 KiB
MLIR

// RUN: mlir-opt %s -split-input-file | FileCheck %s
llvm.func local_unnamed_addr @testfn(!llvm.array<2 x f32> {llvm.alignstack = 8 : i64})
llvm.func internal @g(%arg0: !llvm.array<2 x f32>) attributes {dso_local} {
// CHECK-LABEL: @g
// CHECK: llvm.call @testfn(%arg0) : (!llvm.array<2 x f32> {llvm.alignstack = 8 : i64}) -> ()
llvm.call @testfn(%arg0) : (!llvm.array<2 x f32> {llvm.alignstack = 8 : i64}) -> ()
llvm.return
}
llvm.func local_unnamed_addr @testfn2(!llvm.struct<(i8, i8)> {llvm.alignstack = 8 : i64})
llvm.func internal @h(%arg0: !llvm.struct<(i8, i8)>) attributes {dso_local} {
// CHECK-LABEL: @h
// CHECK: llvm.call @testfn2(%arg0) : (!llvm.struct<(i8, i8)> {llvm.alignstack = 8 : i64}) -> ()
llvm.call @testfn2(%arg0) : (!llvm.struct<(i8, i8)> {llvm.alignstack = 8 : i64}) -> ()
llvm.return
}
llvm.func local_unnamed_addr @testfn3(i32 {llvm.alignstack = 8 : i64})
llvm.func internal @i(%arg0: i32) attributes {dso_local} {
// CHECK-LABEL: @i
// CHECK: llvm.call @testfn3(%arg0) : (i32 {llvm.alignstack = 8 : i64}) -> ()
llvm.call @testfn3(%arg0) : (i32 {llvm.alignstack = 8 : i64}) -> ()
llvm.return
}