-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[libclc] only check filename part of the source for avoiding duplication #135710
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[libclc] only check filename part of the source for avoiding duplication #135710
Conversation
llvm-diff shows this PR has no changes to amdgcn--amdhsa.bc. Motivation is that in our downstream the same category of target built-ins, e.g. math, are organized in several different folders. For example, in target SOURCES we have math-common/cos.cl, while in generic SOURCES it is math/cos.cl. Based on current check rule that compares both folder name and base filename, target math-common/cos.cl won't override math/cos.cl when collecting source files from SOURCES files in cmake function libclc_configure_lib_source. With this PR, we allow folder name to be different in the process. A notable change of this PR is that two entries in SOURCES with the same base filename must not implements the same built-in.
@frasercrmck please help to review? thanks. |
I don't mind this. Given the current naming scheme, files are named after specific builtins so you're unlikely to want to include two I would like to further investigate weak linkage as another means of overriding specific builtins down to a finer granularity. That approach might warrant another method of file discovery. |
Yes. To enable overriding generic implementation of
It would bring unnecessary builds and may increase build time. Filename overriding should be better. |
Yes, however when a target only wants to override one type such as fp16, with the current approach the target has to override the whole of The idea using weak linkage wouldn't remove file overriding (as you say, it's a good approach for coarse-grained overriding), but would have to compliment it. We actually do it already for a couple of builtins (such as ldexp), but it's a bit hacky. |
…ion (llvm#135710) llvm-diff shows this PR has no changes to amdgcn--amdhsa.bc. Motivation is that in our downstream the same category of target built-ins, e.g. math, are organized in several different folders. For example, in target SOURCES we have math-common/cos.cl, while in generic SOURCES it is math/cos.cl. Based on current check rule that compares both folder name and base filename, target math-common/cos.cl won't override math/cos.cl when collecting source files from SOURCES files in cmake function libclc_configure_lib_source. With this PR, we allow folder name to be different in the process. A notable change of this PR is that two entries in SOURCES with the same base filename must not implements the same built-in.
…ion (llvm#135710) llvm-diff shows this PR has no changes to amdgcn--amdhsa.bc. Motivation is that in our downstream the same category of target built-ins, e.g. math, are organized in several different folders. For example, in target SOURCES we have math-common/cos.cl, while in generic SOURCES it is math/cos.cl. Based on current check rule that compares both folder name and base filename, target math-common/cos.cl won't override math/cos.cl when collecting source files from SOURCES files in cmake function libclc_configure_lib_source. With this PR, we allow folder name to be different in the process. A notable change of this PR is that two entries in SOURCES with the same base filename must not implements the same built-in.
…ion (llvm#135710) llvm-diff shows this PR has no changes to amdgcn--amdhsa.bc. Motivation is that in our downstream the same category of target built-ins, e.g. math, are organized in several different folders. For example, in target SOURCES we have math-common/cos.cl, while in generic SOURCES it is math/cos.cl. Based on current check rule that compares both folder name and base filename, target math-common/cos.cl won't override math/cos.cl when collecting source files from SOURCES files in cmake function libclc_configure_lib_source. With this PR, we allow folder name to be different in the process. A notable change of this PR is that two entries in SOURCES with the same base filename must not implements the same built-in.
…ion (llvm#135710) llvm-diff shows this PR has no changes to amdgcn--amdhsa.bc. Motivation is that in our downstream the same category of target built-ins, e.g. math, are organized in several different folders. For example, in target SOURCES we have math-common/cos.cl, while in generic SOURCES it is math/cos.cl. Based on current check rule that compares both folder name and base filename, target math-common/cos.cl won't override math/cos.cl when collecting source files from SOURCES files in cmake function libclc_configure_lib_source. With this PR, we allow folder name to be different in the process. A notable change of this PR is that two entries in SOURCES with the same base filename must not implements the same built-in.
llvm-diff shows this PR has no changes to amdgcn--amdhsa.bc.
Motivation is that in our downstream the same category of target built-ins, e.g. math, are organized in several different folders. For example, in target SOURCES we have math-common/cos.cl, while in generic SOURCES it is math/cos.cl. Based on current check rule that compares both folder name and base filename, target math-common/cos.cl won't override math/cos.cl when collecting source files from SOURCES files in cmake function libclc_configure_lib_source.
With this PR, we allow folder name to be different in the process.
A notable change of this PR is that two entries in SOURCES with the same base filename must not implements the same built-in.