Skip to content

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

Merged
emankov merged 3 commits intoamd-stagingfrom
upstream_merge_202604031506
Apr 4, 2026
Merged

[HIPIFY][merge] merge amd-develop into amd-staging#2490
emankov merged 3 commits intoamd-stagingfrom
upstream_merge_202604031506

Conversation

@z1-cciauto
Copy link
Copy Markdown

No description provided.

emankov and others added 3 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
@emankov emankov changed the title merge amd-develop into amd-staging [HIPIFY][merge] merge amd-develop into amd-staging Apr 4, 2026
@emankov emankov added merge bot bot's change labels Apr 4, 2026
@emankov emankov self-requested a review April 4, 2026 00:21
Copy link
Copy Markdown
Collaborator

@emankov emankov left a comment

Choose a reason for hiding this comment

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

LGTM, despite the fact that "Files changed 0".

@emankov emankov merged commit a9045ad into amd-staging Apr 4, 2026
25 of 27 checks passed
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.

2 participants