Skip to content

[SYCL][FPGA] Changing the attribute max_private_copies to private_copes #994

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

Closed
wants to merge 1 commit into from

Conversation

mohammadfawaz
Copy link
Contributor

The IR coming out of this does not change. This allows the llvm-spirv
translator to not be affected. This should probably be fixed in the future
(in the SPIRV spec) for consistency.

@MrSidims
Copy link
Contributor

MrSidims commented Jan 9, 2020

LGTM max_ here is really looking redundant.

Please sign-off your commit.

…ies.

The IR coming out of this does not change. This allows the llvm-spirv
translator to be affected. This should probably be fixed in the future
(in the SPIRV spec) for consistency.

Signed-off-by: Mohammad Fawaz <[email protected]>
llvm::APSInt MCAInt = MCA->getValue()->EvaluateKnownConstInt(getContext());
Out << '{' << MCA->getSpelling() << ':' << MCAInt << '}';
Out << "{max_private_copies:" << MCAInt << '}';
Copy link
Contributor

Choose a reason for hiding this comment

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

If this change is required, then:

Suggested change
Out << "{max_private_copies:" << MCAInt << '}';
Out << "{private_copies:" << MCAInt << '}';

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, I got it. In that way we don't want to change LLVM IR output. It's looking hacky, isn't it? :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Exactly.. As you mentioned, the "max" here is redundant, and is in fact misleading to customers. That's why we're getting rid of it. However, I'm keeping the IR the same for now because otherwise, we would have to change the llvm-spirv translator and the SPIRV spec to do things the right way. I should open a JIRA to track that effort, but this does not affect the customer flow.

Copy link
Contributor

@AGindinson AGindinson Jan 13, 2020

Choose a reason for hiding this comment

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

However, I'm keeping the IR the same for now because otherwise, we would have to change the llvm-spirv translator and the SPIRV spec to do things the right way.

I'd argue that no changes would have to be made to the SPIR-V specification, as it doesn't specify the LLVM IR layout. Would it be better to accompany this patch with a correspondent adjustment to the translator? I believe the fix would be trivial.

Copy link
Contributor

Choose a reason for hiding this comment

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

@mohammadfawaz please address @AGindinson comment. I'm OK to go either way.

Copy link
Contributor Author

@mohammadfawaz mohammadfawaz Jan 16, 2020

Choose a reason for hiding this comment

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

@MrSidims @AGindinson I will address the translator changes asap!

@intel intel deleted a comment from mohammadfawaz Jan 17, 2020
vladimirlaz pushed a commit to vladimirlaz/llvm that referenced this pull request Apr 19, 2021
…#994)

According to https://llvm.org/docs/LangRef.html aliasing metadata
must have following layout:
List { MD Node Scope1, (other scopes) ... }
Scope1 { MD Node Scope1, MD Node Domain1, (optional MD String) }
... (other scopes)
Domain1 { MD Node Domain1, (optional MD String) }
... (other domains)

and this pattern is actually being checked in LLVM's
ScopedNoAliasAA.cpp.

But in a harsh reality LLVM opt have bugs, which can result in this
pattern violation. So lets be more tolerant to the input IR module.

Signed-off-by: Dmitry Sidorov <[email protected]>

Original commit:
KhronosGroup/SPIRV-LLVM-Translator@2c61561
alexbatashev pushed a commit to alexbatashev/llvm that referenced this pull request Apr 20, 2021
* sycl: (625 commits)
  [SYCL] Fix post-commit build failure (intel#3578)
  [SYCL] Add support for set(get)_specialization_constant (intel#3501)
  [SYCL] Do not allow template instantiation to create null attributes. (intel#3575)
  [SYCL][PI][L0] Close and submit batch immediately when Queue is empty. (intel#3552)
  [SYCL] Raise bit_cast to SYCL namespace (intel#3524)
  [ESIMD] Always preserve -vc-codegen option for ESIMD kernels (intel#3547)
  [SYCL] Fix warnings on clang-based build (intel#3570)
  Revert "Align tests with the codegen changes"
  Disable SPV_INTEL_memory_access_aliasing extension
  Fix build issues after applying translator patches
  [PassManager][PhaseOrdering] lower expects before running simplifyCFG
  Exclude spirv.hpp for clang-format
  Fix llvm-spirv crash when count of Fortran metadata variables is an array
  Fix transTypeComposite bug (intel#964)
  Fix incorrect translation of FPGA decoration on arrays (intel#983)
  Tolerate more inputs during alias.scope/noalias MD translation (intel#994)
  Update for LLVM iterator change
  Fix crash at translation of Entity of DebugImportedEntity (intel#951)
  Add HandleLLVMOptions to main CMakeLists.txt to propagate configuration flags. In particular, this enables Multi-threaded option in MSVC (instead of Multi-threaded DLL)
  Fix uninitialized variables warnings These warnings come into place when HandleLLVMOptions is imported
  ...
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