From a89dc57b41186c45aa3f7d641bab0ddb02ebd4cf Mon Sep 17 00:00:00 2001 From: Tobias Grosser Date: Tue, 8 Sep 2015 06:22:17 +0000 Subject: 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 --- polly/lib/CodeGen/LoopGenerators.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'polly/lib/CodeGen/LoopGenerators.cpp') 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 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); -- cgit v1.2.3