Skip to content

SWDEV-102314 "[OCL-LC-ROCm] AMD lower kernel calls" #35

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

Merged
merged 2 commits into from
Dec 2, 2016

Conversation

dfukalov
Copy link

@dfukalov dfukalov commented Dec 2, 2016

Ported lower kernels calls pre-link pass from hsail compiler

@dfukalov dfukalov changed the title Ported lower kernels calls pre-link pass from hsail compiler SWDEV-102314 "[OCL-LC-ROCm] AMD lower kernel calls" Dec 2, 2016
F.empty() ? copyDeclaration(F) : CloneFunction(&F, ignored, false);
F.getParent()->getOrInsertFunction(NewF->getName(), NewF->getFunctionType(),
NewF->getAttributes());
NewF->setCallingConv(CallingConv::C);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just getOrInsertFunction with the new name from setNameForBody?

@vpykhtin
Copy link

vpykhtin commented Dec 2, 2016

LGTM.

@vpykhtin vpykhtin merged commit 4acced1 into amd-common Dec 2, 2016
@tstellarAMD
Copy link

Are you sure this is necessary? I thought the compiler already did this.

@tstellarAMD
Copy link

There is code in AMDGPUAlwaysInlinePass, which is meant to do this. If that code isn't working, I would prefer to fix that rather than add a new pass.

@dfukalov
Copy link
Author

dfukalov commented Dec 2, 2016

There is and ability in OpenCL to call kernel function from other kernel or function. The pass finds such calls, create clones for callees (with mangled name and removed amdgpu_kernel calling convention) and patches calls to such functions.
As I understand, it's a bit different from cloning part of AMDGPUAlwaysInline pass. Are you sure processing of kernel functions calls functionality should be introduced to the inliner?

@tstellarAMD
Copy link

Ok, I forgot we would need this for when function calls were supported. Did you test this with the OCL conformance tests?

@dfukalov dfukalov deleted the LowerKernelCalls branch December 9, 2016 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants