[PATCH] D36868: [GPGPU] Do not create copy statements when targetting managed memory
Tobias Grosser via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 18 03:49:52 PDT 2017
grosser created this revision.
grosser added a project: Polly.
Herald added subscribers: kbarton, nemanjai.
They are not used and consequently do not even need to be computed. This reduces
the overall compile time for our kernel from 1m33s to 17s.
https://reviews.llvm.org/D36868
Files:
lib/CodeGen/PPCGCodeGeneration.cpp
lib/External/ppcg/gpu.c
lib/External/ppcg/gpu.h
Index: lib/External/ppcg/gpu.h
===================================================================
--- lib/External/ppcg/gpu.h
+++ lib/External/ppcg/gpu.h
@@ -447,7 +447,8 @@
__isl_give isl_schedule *get_schedule(struct gpu_gen *gen);
int has_any_permutable_node(__isl_keep isl_schedule *schedule);
__isl_give isl_schedule *map_to_device(struct gpu_gen *gen,
- __isl_take isl_schedule *schedule);
+ __isl_take isl_schedule *schedule,
+ int to_from_device);
__isl_give isl_ast_node *generate_code(struct gpu_gen *gen,
__isl_take isl_schedule *schedule);
Index: lib/External/ppcg/gpu.c
===================================================================
--- lib/External/ppcg/gpu.c
+++ lib/External/ppcg/gpu.c
@@ -5277,7 +5277,7 @@
* around the entire schedule.
*/
__isl_give isl_schedule *map_to_device(struct gpu_gen *gen,
- __isl_take isl_schedule *schedule)
+ __isl_take isl_schedule *schedule, int to_from_device)
{
isl_schedule_node *node;
isl_set *context;
@@ -5309,7 +5309,12 @@
prefix = isl_union_map_preimage_domain_union_pw_multi_aff(prefix,
contraction);
node = mark_kernels(gen, node);
- node = add_to_from_device(node, domain, prefix, gen->prog);
+ if (to_from_device) {
+ node = add_to_from_device(node, domain, prefix, gen->prog);
+ } else {
+ isl_union_set_free(domain);
+ isl_union_map_free(prefix);
+ }
node = isl_schedule_node_root(node);
node = isl_schedule_node_child(node, 0);
node = isl_schedule_node_child(node, 0);
@@ -5675,7 +5680,7 @@
p = print_cpu(p, scop, options);
isl_schedule_free(schedule);
} else {
- schedule = map_to_device(gen, schedule);
+ schedule = map_to_device(gen, schedule, 1);
gen->tree = generate_code(gen, schedule);
p = ppcg_set_macro_names(p);
p = ppcg_print_exposed_declarations(p, prog->scop);
Index: lib/CodeGen/PPCGCodeGeneration.cpp
===================================================================
--- lib/CodeGen/PPCGCodeGeneration.cpp
+++ lib/CodeGen/PPCGCodeGeneration.cpp
@@ -3140,7 +3140,7 @@
DEBUG(dbgs() << getUniqueScopName(S)
<< " does not have permutable bands. Bailing out\n";);
} else {
- Schedule = map_to_device(PPCGGen, Schedule);
+ Schedule = map_to_device(PPCGGen, Schedule, !PollyManagedMemory);
PPCGGen->tree = generate_code(PPCGGen, isl_schedule_copy(Schedule));
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36868.111650.patch
Type: text/x-patch
Size: 2508 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170818/fe09c0e9/attachment.bin>
More information about the llvm-commits
mailing list