summaryrefslogtreecommitdiffstats
path: root/polly/lib/CodeGen/PPCGCodeGeneration.cpp
diff options
context:
space:
mode:
authorPhilip Pfaffe <philip.pfaffe@gmail.com>2017-10-29 21:36:34 +0000
committerPhilip Pfaffe <philip.pfaffe@gmail.com>2017-10-29 21:36:34 +0000
commit53c803871ef355d7caee38d9ef2c913b51215a89 (patch)
treeda32069c33c151df23a115fa04c6a43ec5970cef /polly/lib/CodeGen/PPCGCodeGeneration.cpp
parentaa65159b0ada2a0dec15fa1136f547b2c22d7d41 (diff)
downloadbcm5719-llvm-53c803871ef355d7caee38d9ef2c913b51215a89.tar.gz
bcm5719-llvm-53c803871ef355d7caee38d9ef2c913b51215a89.zip
[Acc] Do not statically dispatch into IslNodeBuilder's createFor
Summary: When GPUNodeBuilder creates loops inside the kernel, it dispatches to IslNodeBuilder. This however is surprisingly dangerous, since it accesses the AST Node's user through the wrong type. This patch fixes this problem by overriding createFor correctly. This fixes PR35010. Reviewers: grosser, bollu, Meinersbur Reviewed By: Meinersbur Subscribers: Meinersbur, nemanjai, pollydev, llvm-commits, kbarton Differential Revision: https://reviews.llvm.org/D39364 llvm-svn: 316872
Diffstat (limited to 'polly/lib/CodeGen/PPCGCodeGeneration.cpp')
-rw-r--r--polly/lib/CodeGen/PPCGCodeGeneration.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/polly/lib/CodeGen/PPCGCodeGeneration.cpp b/polly/lib/CodeGen/PPCGCodeGeneration.cpp
index ed45e0738ff..720e2564d3e 100644
--- a/polly/lib/CodeGen/PPCGCodeGeneration.cpp
+++ b/polly/lib/CodeGen/PPCGCodeGeneration.cpp
@@ -415,6 +415,8 @@ private:
/// @param UserStmt The ast node to generate code for.
virtual void createUser(__isl_take isl_ast_node *UserStmt);
+ virtual void createFor(__isl_take isl_ast_node *Node);
+
enum DataDirection { HOST_TO_DEVICE, DEVICE_TO_HOST };
/// Create code for a data transfer statement
@@ -1286,6 +1288,11 @@ void GPUNodeBuilder::createUser(__isl_take isl_ast_node *UserStmt) {
isl_ast_node_free(UserStmt);
return;
}
+
+void GPUNodeBuilder::createFor(__isl_take isl_ast_node *Node) {
+ createForSequential(Node, false);
+}
+
void GPUNodeBuilder::createKernelCopy(ppcg_kernel_stmt *KernelStmt) {
isl_ast_expr *LocalIndex = isl_ast_expr_copy(KernelStmt->u.c.local_index);
LocalIndex = isl_ast_expr_address_of(LocalIndex);
OpenPOWER on IntegriCloud