diff --git a/reuse-mlir/src/cxx/Passes/ConvertReuseIRToLLVM.cpp b/reuse-mlir/src/cxx/Passes/ConvertReuseIRToLLVM.cpp index 9075790..e92332b 100644 --- a/reuse-mlir/src/cxx/Passes/ConvertReuseIRToLLVM.cpp +++ b/reuse-mlir/src/cxx/Passes/ConvertReuseIRToLLVM.cpp @@ -87,7 +87,6 @@ class ValueToRefOpLowering mlir::ConversionPatternRewriter &rewriter) const override final { uint64_t alignment = cache.getDataLayout().getTypePreferredAlignment( op.getValue().getType()); - alignment = std::max(cache.getDataLayout().getStackAlignment(), alignment); auto ptrTy = LLVM::LLVMPointerType::get(getContext()); auto alloca = rewriter.create( op->getLoc(), ptrTy, adaptor.getValue().getType(), diff --git a/reuse-mlir/test/integration/lowering/value_to_ref_op_lowering.mlir b/reuse-mlir/test/integration/lowering/value_to_ref_op_lowering.mlir index 766643f..b1acf74 100644 --- a/reuse-mlir/test/integration/lowering/value_to_ref_op_lowering.mlir +++ b/reuse-mlir/test/integration/lowering/value_to_ref_op_lowering.mlir @@ -3,8 +3,8 @@ module @test attributes {dlti.dl_spec = #dlti.dl_spec<#dlti.dl_entry : vector<2xi64>>, #dlti.dl_entry : vector<2xi64>>, #dlti.dl_entry : vector<2xi64>>, #dlti.dl_entry : vector<2xi64>>, #dlti.dl_entry : vector<2xi64>>, #dlti.dl_entry : vector<2xi64>>, #dlti.dl_entry : vector<2xi64>>, #dlti.dl_entry : vector<4xi64>>, #dlti.dl_entry, dense<32> : vector<4xi64>>, #dlti.dl_entry : vector<2xi64>>, #dlti.dl_entry : vector<2xi64>>, #dlti.dl_entry, dense<64> : vector<4xi64>>, #dlti.dl_entry, dense<32> : vector<4xi64>>, #dlti.dl_entry : vector<2xi64>>, #dlti.dl_entry<"dlti.stack_alignment", 128 : i64>, #dlti.dl_entry<"dlti.endianness", "little">>, llvm.data_layout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"} { func.func @borrow_nonfreezing(%0: !test) { // CHECK-ORIGIN: %[[REG0:[a-z0-9]+]] = llvm.mlir.constant(1 : i64) : i64 - // CHECK-ORIGIN: %[[REG1:[a-z0-9]+]] = llvm.alloca %[[REG0]] x !llvm.struct<(struct<(i128, i32, array<12 x i8>)>, i32, array<12 x i8>)> {alignment = 128 : i64} : (i64) -> !llvm.ptr - // CHECK-ORIGIN: llvm.store %{{[a-z0-9]+}}, %[[REG1]] {alignment = 128 : i64} : !llvm.struct<(struct<(i128, i32, array<12 x i8>)>, i32, array<12 x i8>)>, !llvm.ptr + // CHECK-ORIGIN: %[[REG1:[a-z0-9]+]] = llvm.alloca %[[REG0]] x !llvm.struct<(struct<(i128, i32, array<12 x i8>)>, i32, array<12 x i8>)> {alignment = 16 : i64} : (i64) -> !llvm.ptr + // CHECK-ORIGIN: llvm.store %{{[a-z0-9]+}}, %[[REG1]] {alignment = 16 : i64} : !llvm.struct<(struct<(i128, i32, array<12 x i8>)>, i32, array<12 x i8>)>, !llvm.ptr %1 = reuse_ir.val2ref %0 : !test -> !reuse_ir.ref func.call @opaque (%1) : (!reuse_ir.ref) -> () return