added addrspace(4)/constant memory for const uniform declarations

This commit is contained in:
Evghenii
2014-01-08 13:27:24 +01:00
parent f011b3cb22
commit de4d66c56f
6 changed files with 139 additions and 88 deletions

View File

@@ -2353,25 +2353,25 @@ Module::CompileAndOutput(const char *srcFile,
m = new Module(srcFile);
if (m->CompileFile() == 0) {
/* NVPTX:
* for PTX target replace '.' with '_' in all global variables
* a PTX identifier name must match [a-zA-Z$_][a-zA-Z$_0-9]*
*/
if (g->target->getISA() == Target::NVPTX)
{
llvm::Module::global_iterator
I = m->module->global_begin(),
E = m->module->global_end();
for (; I != E; I++)
/* NVPTX:
* for PTX target replace '.' with '_' in all global variables
* a PTX identifier name must match [a-zA-Z$_][a-zA-Z$_0-9]*
*/
if (g->target->getISA() == Target::NVPTX)
{
std::string name = I->getName();
for (int i = 0; i < name.length(); i++)
if (name[i] == '.')
name[i] = '_';
I->setName(name);
llvm::Module::global_iterator
I = m->module->global_begin(),
E = m->module->global_end();
for (; I != E; I++)
{
std::string name = I->getName();
for (int i = 0; i < name.length(); i++)
if (name[i] == '.')
name[i] = '_';
I->setName(name);
}
}
}
if (outputType == CXX) {
if (target == NULL || strncmp(target, "generic-", 8) != 0) {
Error(SourcePos(), "When generating C++ output, one of the \"generic-*\" "