Skip to content

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

Closed
z1-cciauto wants to merge 4 commits intoamd-stagingfrom
upstream_merge_202604051943
Closed

[HIPIFY][merge] merge amd-develop into amd-staging#2499
z1-cciauto wants to merge 4 commits intoamd-stagingfrom
upstream_merge_202604051943

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 5, 2026 23:43
@ranapratap55 ranapratap55 changed the title merge amd-develop into amd-staging [HIPIFY][merge] merge amd-develop into amd-staging Apr 6, 2026
@ranapratap55
Copy link
Copy Markdown
Collaborator

Duplicate of #2491

@ranapratap55 ranapratap55 marked this as a duplicate of #2491 Apr 6, 2026
@ranapratap55 ranapratap55 added duplicate This issue or pull request already exists bot bot's change merge labels Apr 6, 2026
@ranapratap55 ranapratap55 self-requested a review April 6, 2026 05:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot bot's change duplicate This issue or pull request already exists merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants