summaryrefslogtreecommitdiffstats
path: root/polly/lib/CodeGen/LoopGenerators.cpp
diff options
context:
space:
mode:
authorTobias Grosser <tobias@grosser.es>2015-09-08 06:22:17 +0000
committerTobias Grosser <tobias@grosser.es>2015-09-08 06:22:17 +0000
commita89dc57b41186c45aa3f7d641bab0ddb02ebd4cf (patch)
treeb8395740651ed7509bdf983bc317a514073067ad /polly/lib/CodeGen/LoopGenerators.cpp
parent2f9aa579279ba7ba2daa262ef271f6ee27456bdc (diff)
downloadbcm5719-llvm-a89dc57b41186c45aa3f7d641bab0ddb02ebd4cf.tar.gz
bcm5719-llvm-a89dc57b41186c45aa3f7d641bab0ddb02ebd4cf.zip
Do not use '.' in subfunction names
Certain backends, e.g. NVPTX, do not support '.' in function names. Hence, we ensure all '.' are replaced by '_' when generating function names for subfunctions. For the current OpenMP code generation, this is not strictly necessary, but future uses cases (e.g. GPU offloading) need this issue to be fixed. llvm-svn: 246980
Diffstat (limited to 'polly/lib/CodeGen/LoopGenerators.cpp')
-rw-r--r--polly/lib/CodeGen/LoopGenerators.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/polly/lib/CodeGen/LoopGenerators.cpp b/polly/lib/CodeGen/LoopGenerators.cpp
index beded43eee0..16964b32d0c 100644
--- a/polly/lib/CodeGen/LoopGenerators.cpp
+++ b/polly/lib/CodeGen/LoopGenerators.cpp
@@ -259,7 +259,13 @@ Function *ParallelLoopGenerator::createSubFnDefinition() {
std::vector<Type *> Arguments(1, Builder.getInt8PtrTy());
FunctionType *FT = FunctionType::get(Builder.getVoidTy(), Arguments, false);
Function *SubFn = Function::Create(FT, Function::InternalLinkage,
- F->getName() + ".polly.subfn", M);
+ F->getName() + "_polly_subfn", M);
+
+ // Certain backends (e.g., NVPTX) do not support '.'s in function names.
+ // Hence, we ensure that all '.'s are replaced by '_'s.
+ std::string FunctionName = SubFn->getName();
+ std::replace(FunctionName.begin(), FunctionName.end(), '.', '_');
+ SubFn->setName(FunctionName);
// Do not run any polly pass on the new function.
SubFn->addFnAttr(PollySkipFnAttr);
OpenPOWER on IntegriCloud