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

[HIPIFY][clang] Add a callback in clang to decide on hipify-clang's side whether to exclude the particular false conditional block or not #1

Open
emankov opened this issue Mar 3, 2020 · 1 comment
Assignees
Labels
clang clang compiler related issue or change feature Feature request or implementation

Comments

@emankov
Copy link
Collaborator

emankov commented Mar 3, 2020

With the change ROCm/HIP#1372, all the blocks are not excluded from AST when -skip-excluded-preprocessor-conditional-blocks option is set. The corresponding change in clang: https://reviews.llvm.org/D66597.

The main idea is: if there is nothing to hipify in a particular false conditional block, then such block might be excluded from AST.

Such a callback in clang's preprocessor will be useful for the following main cases:

  • conditional branches with multiplatform code;
  • variables redefinition in conditional branches;
  • other cases, which may lead to syntactical errors.
@emankov emankov self-assigned this Mar 3, 2020
@emankov emankov transferred this issue from ROCm/HIP Apr 2, 2020
@emankov emankov added feature Feature request or implementation clang clang compiler related issue or change labels Apr 2, 2020
@emankov
Copy link
Collaborator Author

emankov commented Apr 27, 2020

The following example should be successfully hipified after implementing the feature in clang:
deviceQuery.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang clang compiler related issue or change feature Feature request or implementation
Projects
None yet
Development

No branches or pull requests

1 participant