Skip to content

[llvm-spirv] Cherry pick Khronos changes to expand collection of entry point interfaces (PR #1334) #10623

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
Aug 2, 2023

Conversation

asudarsa
Copy link
Contributor

@asudarsa asudarsa commented Jul 29, 2023

This PR pulls in the following PR from upstream Khronos SPIRV-LLVM-Translator repo:
KhronosGroup/SPIRV-LLVM-Translator#1334

This is a patch to expand the collection of entry point interfaces. In SPIR-V 1.4 and later OpEntryPoint must list all global variables in the interface.
In addition, a couple of minor changes have been added to sync with latest code.
This patch addresses #9958

Updated the following tests to sync with upstream as well:
llvm-spirv/test/extensions/INTEL/SPV_INTEL_inline_assembly/inline_asm_clobbers.cl
llvm-spirv/test/extensions/INTEL/SPV_INTEL_inline_assembly/inline_asm_constraints.cl

Thanks

Signed-off-by: Arvind Sudarsanam <arvind.sudarsanam@intel.com>
@asudarsa asudarsa requested a review from a team as a code owner July 29, 2023 19:27
if (isKernel(F))
BM->addEntryPoint(ExecutionModelKernel, BF->getId());
else if (F->getLinkage() != GlobalValue::InternalLinkage)
if (!isKernel(F) && F->getLinkage() != GlobalValue::InternalLinkage)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We no longer add entry point for function decls.

SPIRVWord ModuleVersion = static_cast<SPIRVWord>(BM->getSPIRVVersion());
if (AS != SPIRAS_Input && AS != SPIRAS_Output &&
ModuleVersion < static_cast<SPIRVWord>(VersionNumber::SPIRV_1_4))
BM->setMinSPIRVVersion(VersionNumber::SPIRV_1_4);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We now pass Version number directly without converting to SPIRVWord

@@ -248,6 +248,8 @@ class LLVMToSPIRVBase : protected BuiltinCallHelper {
const Function *FS,
const std::unordered_set<const Function *> Funcs) const;
void collectInputOutputVariables(SPIRVFunction *SF, Function *F);
std::vector<SPIRVId> collectEntryPointInterfaces(SPIRVFunction *BF,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This function declaration was missing in the original patch.

@asudarsa asudarsa temporarily deployed to aws July 29, 2023 19:45 — with GitHub Actions Inactive
@asudarsa asudarsa temporarily deployed to aws July 29, 2023 20:25 — with GitHub Actions Inactive
Signed-off-by: Arvind Sudarsanam <arvind.sudarsanam@intel.com>
@asudarsa asudarsa requested a review from sarnex July 30, 2023 07:23
@asudarsa asudarsa temporarily deployed to aws July 30, 2023 07:39 — with GitHub Actions Inactive
@asudarsa asudarsa temporarily deployed to aws July 30, 2023 08:17 — with GitHub Actions Inactive
@AlexeySachkov
Copy link
Contributor

Just curious, why can't we get this patch with a regular pulldown?

@asudarsa
Copy link
Contributor Author

Just curious, why can't we get this patch with a regular pulldown?

This was part of an earlier pulldown and was removed due to issues in CI testing. We are trying to reintroduce it.

Thanks

Copy link
Contributor

@sarnex sarnex left a comment

Choose a reason for hiding this comment

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

lgtm from a high level, i did not review the change in depth

@asudarsa asudarsa closed this Aug 1, 2023
@asudarsa asudarsa reopened this Aug 1, 2023
@asudarsa
Copy link
Contributor Author

asudarsa commented Aug 1, 2023

Sorry. I pushed the wrong button which caused close/reopen.

@asudarsa asudarsa temporarily deployed to aws August 1, 2023 01:43 — with GitHub Actions Inactive
@asudarsa asudarsa temporarily deployed to aws August 1, 2023 02:23 — with GitHub Actions Inactive
@asudarsa
Copy link
Contributor Author

asudarsa commented Aug 1, 2023

Hi @AlexeySachkov

I think this is ready to land. Can you please help with merging when convenient?

Thanks

@AlexeySachkov AlexeySachkov merged commit 5d28c93 into intel:sycl Aug 2, 2023
mdtoguchi pushed a commit to mdtoguchi/llvm that referenced this pull request Oct 18, 2023
…y point interfaces (PR intel#1334) (intel#10623)

This PR pulls in the following PR from upstream Khronos
SPIRV-LLVM-Translator repo:
KhronosGroup/SPIRV-LLVM-Translator#1334

`
This is a patch to expand the collection of entry point interfaces.
In SPIR-V 1.4 and later OpEntryPoint must list all global variables in
the
interface.
`
In addition, a couple of minor changes have been added to sync with
latest code.
This patch addresses intel#9958

Updated the following tests to sync with upstream as well:

llvm-spirv/test/extensions/INTEL/SPV_INTEL_inline_assembly/inline_asm_clobbers.cl

llvm-spirv/test/extensions/INTEL/SPV_INTEL_inline_assembly/inline_asm_constraints.cl

Thanks

---------

Signed-off-by: Arvind Sudarsanam <arvind.sudarsanam@intel.com>
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