Skip to content

[InjectTLIMappings] Assert while compiling CheckFunctionExists.cpp with llvm clang when -fveclib=SVML flag is enabled #86627

@Balakrishna7829

Description

@Balakrishna7829

CheckFunctionExists.cpp.txt
CheckFunctionExists.c is used by cmake to find whether the libarary function is supported or not during configuration. When CheckFunctionExists.c is compiled with llvm clang and with -fveclib=SVML flag. Assertion is occurring in InjectTLIMappings pass.

Preprocessed CheckFunctionExists.c:
// code start
char log2(void);
int main(int ac, char* av)
{
log2();
if (ac > 1000) {
return *av[0];
}
return 0;
}
// code end

The issue here is that InjectTLIMappings.cpp is trying to insert vectorized versions of the library function log2 into LLVM IR but vector version of char log2(void) is not present. Is it valid to redeclare a library function like this?

Clang command to reproduce the issue:-
clang -fveclib=SVML -DCHECK_FUNCTION_EXISTS=log2 -c CheckFunctionExists.c

Metadata

Metadata

Assignees

No one assigned

    Labels

    clangClang issues not falling into any other category

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions