Skip to content
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

[FPGA] [CodeGen][NFC] Enhance Intel FPGA annotation function and optimize code #14577

Merged
merged 9 commits into from
Jul 16, 2024

Conversation

smanna12
Copy link
Contributor

@smanna12 smanna12 commented Jul 16, 2024

This commit makes several improvements to the CodeGenModule::addGlobalIntelFPGAAnnotation method:

  • Updating the comment style to be Doxygen compliant for the addGlobalIntelFPGAAnnotation function.
  • Replaced getAs<RecordType>() with castAs<RecordType>() after confirming that the variable declaration type is guaranteed to be a RecordType. This change removes the need for a null check and streamlines the code.
  • Modified the base class iteration loop to use a reference (const auto &Base) to avoid unnecessary copies of CXXBaseSpecifier objects.

These changes enhance code readability, improve code documentation and potentially increase performance by avoiding unnecessary dynamic type checks and copies.

@smanna12 smanna12 marked this pull request as ready for review July 16, 2024 05:20
@smanna12 smanna12 requested a review from a team as a code owner July 16, 2024 05:20
@smanna12 smanna12 changed the title Fix static analyzr bugs [FPGA] [CodeGen] Enhance Intel FPGA annotation function and optimize code Jul 16, 2024
@smanna12 smanna12 changed the title [FPGA] [CodeGen] Enhance Intel FPGA annotation function and optimize code [FPGA] [CodeGen][NFC] Enhance Intel FPGA annotation function and optimize code Jul 16, 2024
@smanna12
Copy link
Contributor Author

Thank you @elizabethandrews for reviews!

@smanna12
Copy link
Contributor Author

@intel/llvm-gatekeepers, This PR is ready to merge. Thank you

@againull againull merged commit 6d13aef into intel:sycl Jul 16, 2024
15 checks passed
@smanna12 smanna12 deleted the FixStaticAnalyzrBugs branch July 16, 2024 21:31
smanna12 added a commit to smanna12/llvm that referenced this pull request Jul 16, 2024
…mize code (intel#14577)

This commit makes several improvements to the
`CodeGenModule::addGlobalIntelFPGAAnnotation` method:

- Updating the comment style to be Doxygen compliant for the
`addGlobalIntelFPGAAnnotation` function.
- Replaced `getAs<RecordType>()` with `castAs<RecordType>()` after
confirming that the variable declaration type is guaranteed to be a
`RecordType`. This change removes the need for a null check and
streamlines the code.
- Modified the base class iteration loop to use a reference (`const auto
&Base`) to avoid unnecessary copies of `CXXBaseSpecifier` objects.

These changes enhance code readability, improve code documentation and
potentially increase performance by avoiding unnecessary dynamic type
checks and copies.

---------

Signed-off-by: Soumi Manna <soumi.manna@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