32 lines · plain
1// RUN: mlir-opt -inline --split-input-file %s | FileCheck %s2 3// CHECK-LABEL: @byval_2_000_000_0004llvm.func @byval_2_000_000_000(%ptr : !llvm.ptr) {5 // CHECK: %[[SIZE:.+]] = llvm.mlir.constant(2000000000 : i64)6 // CHECK: "llvm.intr.memcpy"(%{{.*}}, %{{.*}}, %[[SIZE]]7 8 llvm.call @with_byval_arg(%ptr) : (!llvm.ptr) -> ()9 llvm.return10}11 12llvm.func @with_byval_arg(%ptr : !llvm.ptr { llvm.byval = !llvm.array<1000 x array<1000 x array <500 x i32>>> }) {13 llvm.return14}15 16// -----17 18// This exceeds representational capacity of 32-bit unsigned value.19 20// CHECK-LABEL: @byval_8_000_000_00021llvm.func @byval_8_000_000_000(%ptr : !llvm.ptr) {22 // CHECK: %[[SIZE:.+]] = llvm.mlir.constant(8000000000 : i64)23 // CHECK: "llvm.intr.memcpy"(%{{.*}}, %{{.*}}, %[[SIZE]]24 25 llvm.call @with_byval_arg(%ptr) : (!llvm.ptr) -> ()26 llvm.return27}28 29llvm.func @with_byval_arg(%ptr : !llvm.ptr { llvm.byval = !llvm.array<2000 x array<2000 x array <500 x i32>>> }) {30 llvm.return31}32