Skip to content

Commit fba7ec4

Browse files
committed
[mlir] Add tests for the array deep-copy lowering
Fix array::push to deep-copy reference-type elements instead of emitting a plain StoreOp.
1 parent 87acaa7 commit fba7ec4

File tree

13 files changed

+3903
-101
lines changed

13 files changed

+3903
-101
lines changed

libsolidity/codegen/mlir/SolidityToMLIR.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1873,14 +1873,14 @@ SolidityToMLIRPass::genExprs(FunctionCall const &call) {
18731873
auto newAddr =
18741874
b.create<mlir::sol::PushOp>(loc, genRValExpr(memberAcc->expression()));
18751875
if (!astArgs.empty())
1876-
b.create<mlir::sol::StoreOp>(loc, genRValExpr(*astArgs[0]), newAddr);
1876+
genAssign(newAddr, genRValExpr(*astArgs[0]), loc);
18771877
resVals.push_back(newAddr);
18781878
return resVals;
18791879
}
18801880

18811881
case FunctionType::Kind::BytesConcat:
18821882
case FunctionType::Kind::StringConcat: {
1883-
std::vector<mlir::Value> args;
1883+
llvm::SmallVector<mlir::Value, 4> args;
18841884
for (const auto &arg : astArgs)
18851885
args.push_back(genRValExpr(*arg));
18861886

0 commit comments

Comments
 (0)