Skip to content

Commit bc36585

Browse files
authored
[SYCL][NFC] Move instead of copy. (#18438)
Adding `std::move` to variables that can be moved to prevent copies.
1 parent 006c896 commit bc36585

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

llvm/lib/SYCLPostLink/ModuleSplitter.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,8 @@ ModuleDesc extractCallGraph(
397397
collectFunctionsAndGlobalVariablesToExtract(
398398
GVs, MD.getModule(), ModuleEntryPoints, CG, IncludeFunctionPredicate);
399399

400-
ModuleDesc SplitM = extractSubModule(MD, GVs, std::move(ModuleEntryPoints));
400+
ModuleDesc SplitM =
401+
extractSubModule(MD, std::move(GVs), std::move(ModuleEntryPoints));
401402
// TODO: cleanup pass is now called for each output module at the end of
402403
// sycl-post-link. This call is redundant. However, we subsequently run
403404
// GenXSPIRVWriterAdaptor pass that relies on this cleanup. This cleanup call
@@ -425,7 +426,8 @@ ModuleDesc extractESIMDSubModule(
425426
collectFunctionsAndGlobalVariablesToExtract(
426427
GVs, MD.getModule(), ModuleEntryPoints, CG, IncludeFunctionPredicate);
427428

428-
ModuleDesc SplitM = extractSubModule(MD, GVs, std::move(ModuleEntryPoints));
429+
ModuleDesc SplitM =
430+
extractSubModule(MD, std::move(GVs), std::move(ModuleEntryPoints));
429431
// TODO: cleanup pass is now called for each output module at the end of
430432
// sycl-post-link. This call is redundant. However, we subsequently run
431433
// GenXSPIRVWriterAdaptor pass that relies on this cleanup. This cleanup call

0 commit comments

Comments
 (0)