From f050e3ff3041f366e5539e6cf20be49f9b8b0301 Mon Sep 17 00:00:00 2001 From: Ivan Radanov Ivanov Date: Wed, 9 Mar 2022 09:50:14 +0900 Subject: [PATCH] Transform MemcpyToSymbol call ops --- lib/polygeist/Passes/ParallelLower.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/polygeist/Passes/ParallelLower.cpp b/lib/polygeist/Passes/ParallelLower.cpp index b90d1c383675..d3810fd2aff3 100644 --- a/lib/polygeist/Passes/ParallelLower.cpp +++ b/lib/polygeist/Passes/ParallelLower.cpp @@ -518,6 +518,19 @@ void ParallelLower::runOnOperation() { Value vals[] = {retv}; call.replaceAllUsesWith(ArrayRef(vals)); call.erase(); + } else if (call.getCallee() == "cudaMemcpyToSymbol") { + OpBuilder bz(call); + auto falsev = bz.create(call.getLoc(), false, 1); + bz.create( + call.getLoc(), + bz.create(call.getLoc(), call.getOperand(0).getType(), + call.getOperand(0), + std::vector({call.getOperand(3)})), + call.getOperand(1), call.getOperand(2), + /*isVolatile*/ falsev); + call.replaceAllUsesWith( + bz.create(call.getLoc(), 0, call.getType(0))); + call.erase(); } });