Skip to content

[HIPIFY][merge] merge amd-develop into amd-staging#2491

Merged
ranapratap55 merged 4 commits intoamd-stagingfrom
upstream_merge_202604032306
Apr 6, 2026
Merged

[HIPIFY][merge] merge amd-develop into amd-staging#2491
ranapratap55 merged 4 commits intoamd-stagingfrom
upstream_merge_202604032306

Conversation

@z1-cciauto
Copy link
Copy Markdown

No description provided.

emankov and others added 4 commits April 3, 2026 15:53
…t test directives` (#2486)

[Synopsis]
+ The removal of redundant `// CHECK:` lookbehinds from AST transformation regexes exposed LLVM `lit` test directives and standard C/C++ comments (`//`, `/* */`) to unintended hipification.
+ Aggressive global regexes erroneously hipify any multi-line or inline C/C++ comment containing `CUDA` keywords.

[Solution]
+ [Slurp & Regex Tokenization] Leveraged the existing file-slurping architecture (`undef $/;`) to perform global lexical masking across the entire file buffer.
+ [Lexical Masking] Introduced a `maskComments` subroutine to parse string literals `”..”'` and `'...'` and leave them untouched, while extracting C/C++ comments and replacing them with placeholders `__HIPIFY_COMMENT_X__` before any AST transformations.
+ [Global Restoration] Implemented `unmaskComments` to accurately restore the original comments and `lit` directives immediately prior to file output.

[Impact]
+ Guarantees 100% preservation of: LLVM `lit` test validation strings (`RUN`, `CHECK, `CHECK-NEXT`, etc., and any other custom directives) and `C/C++ comments`.
+ Decouples comment preservation from `AST` regex logic, keeping the transformation expressions clean and focused on syntax.

[Testing]
+ `perl -c hipify-perl`
+ Validated against all `hipify-clang` unit tests, ensuring no validation strings or comment blocks are mutated during the hipification process.
…ce` - Part 2 - `Functions` - final (#2487)

+ Updated the regenerated `hipify-perl` and `FFT` `CUDA2HIP` docs accordingly
…E` (#2489)

+ Updated the regenerated `hipify-perl` and `SPARSE` `CUDA2HIP` docs accordingly
@z1-cciauto z1-cciauto requested review from a team, emankov and searlmc1 as code owners April 4, 2026 03:06
@ranapratap55 ranapratap55 changed the title merge amd-develop into amd-staging [HIPIFY][merge] merge amd-develop into amd-staging Apr 6, 2026
@ranapratap55 ranapratap55 self-requested a review April 6, 2026 05:40
@ranapratap55 ranapratap55 added bot bot's change merge labels Apr 6, 2026
Copy link
Copy Markdown
Collaborator

@ranapratap55 ranapratap55 left a comment

Choose a reason for hiding this comment

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

LGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot bot's change merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants