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

Update AnnotationToMetadataPass to handle pointer casts in llvm.global.annotations #1335

Merged
merged 1 commit into from
Apr 19, 2024

Conversation

ben-clayton
Copy link
Contributor

A recent change to LLVM introduces pointer address space casts on the function pointer.
Use stripPointerCasts() on the operand to make the dyn_cast work.

…al.annotations`

A recent change to LLVM introduces pointer address space casts on the function pointer. Use `stripPointerCasts()` on the operand to make the `dyn_cast` work.
@rjodinchr
Copy link
Collaborator

Should we also update LLVM to make sure that all the tests are passing with this new version of LLVM and that fix?

@ben-clayton
Copy link
Contributor Author

Updating LLVM might be a good idea, but please can we do this as a followup?
I've been testing internally at Google with this, as a recent LLVM roll broke everything clspv related. There's some urgency in getting a fix landed.

I believe this fix to be backwards-compatible.

@rjodinchr
Copy link
Collaborator

Updating LLVM might be a good idea, but please can we do this as a followup?

Sure, I'll merge it once the checks are complete.
I'll update LLVM after it.

@ben-clayton
Copy link
Contributor Author

Updating LLVM might be a good idea, but please can we do this as a followup?

Sure, I'll merge it once the checks are complete. I'll update LLVM after it.

Thank you!

@ben-clayton
Copy link
Contributor Author

CI-clvk-ubuntu-clang-debug failure seems unrelated:

/tmpfs/src/github/clvk/external/SPIRV-LLVM-Translator/lib/SPIRV/SPIRVToLLVMDbgTran.cpp:1568:13: error: variable 'DbgDeclare' with type 'auto *' has incompatible initializer of type 'llvm::DbgInstPtr' (aka 'PointerUnion')
      auto *DbgDeclare = getDIBuilder(DebugInst).insertDeclare(
            ^            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmpfs/src/github/clvk/external/SPIRV-LLVM-Translator/lib/SPIRV/SPIRVToLLVMDbgTran.cpp:1574:12: error: no viable conversion from returned value of type 'llvm::DbgInstPtr' (aka 'PointerUnion') to function return type 'llvm::Instruction *'
    return getDIBuilder(DebugInst).insertDeclare(
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmpfs/src/github/clvk/external/SPIRV-LLVM-Translator/lib/SPIRV/SPIRVToLLVMDbgTran.cpp:1583:11: error: variable 'DbgValIntr' with type 'auto *' has incompatible initializer of type 'llvm::DbgInstPtr' (aka 'PointerUnion')
    auto *DbgValIntr = getDIBuilder(DebugInst).insertDbgValueIntrinsic(
          ^            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 errors generated.

@rjodinchr
Copy link
Collaborator

CI-clvk-ubuntu-clang-debug is expected to fail at the moment, CI-amber-ubuntu-gcc-release as well.

@rjodinchr rjodinchr merged commit 8cb89a7 into google:main Apr 19, 2024
10 of 12 checks passed
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.

None yet

2 participants