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

[CIR][CIRGen][LowerToLLVM] Support address space casting #652

Merged
merged 14 commits into from
Jun 6, 2024

Conversation

seven-mile
Copy link
Collaborator

  • New CastKind::addrspace_cast for cir.cast
  • TargetCIRGenInfo::performAddrSpaceCast helper for non-constant values only
  • CIRGen for address space casting of pointers and references
  • Lowering to LLVM

@seven-mile
Copy link
Collaborator Author

seven-mile commented Jun 2, 2024

Note that other versions of TargetCIRGenInfo::performAddrSpaceCast should include GlobalOp and ConstOp, which are unified as llvm::Constant in LLVM IR. Should track it by another issue.

clang/lib/CIR/CodeGen/CIRGenExprScalar.cpp Show resolved Hide resolved
clang/lib/CIR/CodeGen/CIRGenExprScalar.cpp Show resolved Hide resolved
clang/lib/CIR/CodeGen/CIRGenExpr.cpp Outdated Show resolved Hide resolved
clang/lib/CIR/Dialect/IR/CIRDialect.cpp Outdated Show resolved Hide resolved
Copy link
Member

@bcardosolopes bcardosolopes left a comment

Choose a reason for hiding this comment

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

Overall looks good, more inline comments!

clang/include/clang/CIR/Dialect/IR/CIROps.td Outdated Show resolved Hide resolved
clang/test/CIR/IR/cast.cir Outdated Show resolved Hide resolved
clang/lib/CIR/CodeGen/CIRGenExprScalar.cpp Show resolved Hide resolved
clang/lib/CIR/CodeGen/CIRGenExprScalar.cpp Show resolved Hide resolved
clang/lib/CIR/Dialect/IR/CIRDialect.cpp Outdated Show resolved Hide resolved
@seven-mile
Copy link
Collaborator Author

Rebased. Updated except ABI-related nullptr representation.

@seven-mile
Copy link
Collaborator Author

Updated as suggested.

Copy link
Member

@bcardosolopes bcardosolopes left a comment

Choose a reason for hiding this comment

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

Awesome, LGTM

@bcardosolopes bcardosolopes merged commit 5b44dd7 into llvm:main Jun 6, 2024
6 checks passed
bcardosolopes pushed a commit that referenced this pull request Jun 12, 2024
Continue the work of #652 . Test the branch of null pointer expressions
with side effects.
bruteforceboy pushed a commit to bruteforceboy/clangir that referenced this pull request Oct 2, 2024
* New `CastKind::addrspace_cast` for `cir.cast`
* `TargetCIRGenInfo::performAddrSpaceCast` helper for non-constant
values only
* CIRGen for address space casting of pointers and references
* Lowering to LLVM
bruteforceboy pushed a commit to bruteforceboy/clangir that referenced this pull request Oct 2, 2024
Continue the work of llvm#652 . Test the branch of null pointer expressions
with side effects.
Hugobros3 pushed a commit to shady-gang/clangir that referenced this pull request Oct 2, 2024
* New `CastKind::addrspace_cast` for `cir.cast`
* `TargetCIRGenInfo::performAddrSpaceCast` helper for non-constant
values only
* CIRGen for address space casting of pointers and references
* Lowering to LLVM
Hugobros3 pushed a commit to shady-gang/clangir that referenced this pull request Oct 2, 2024
Continue the work of llvm#652 . Test the branch of null pointer expressions
with side effects.
smeenai pushed a commit to smeenai/clangir that referenced this pull request Oct 9, 2024
* New `CastKind::addrspace_cast` for `cir.cast`
* `TargetCIRGenInfo::performAddrSpaceCast` helper for non-constant
values only
* CIRGen for address space casting of pointers and references
* Lowering to LLVM
smeenai pushed a commit to smeenai/clangir that referenced this pull request Oct 9, 2024
Continue the work of llvm#652 . Test the branch of null pointer expressions
with side effects.
keryell pushed a commit to keryell/clangir that referenced this pull request Oct 19, 2024
* New `CastKind::addrspace_cast` for `cir.cast`
* `TargetCIRGenInfo::performAddrSpaceCast` helper for non-constant
values only
* CIRGen for address space casting of pointers and references
* Lowering to LLVM
keryell pushed a commit to keryell/clangir that referenced this pull request Oct 19, 2024
Continue the work of llvm#652 . Test the branch of null pointer expressions
with side effects.
lanza pushed a commit that referenced this pull request Nov 5, 2024
* New `CastKind::addrspace_cast` for `cir.cast`
* `TargetCIRGenInfo::performAddrSpaceCast` helper for non-constant
values only
* CIRGen for address space casting of pointers and references
* Lowering to LLVM
lanza pushed a commit that referenced this pull request Nov 5, 2024
Continue the work of #652 . Test the branch of null pointer expressions
with side effects.
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.

4 participants