Skip to content

Conversation

@mahmood82
Copy link
Collaborator

Update CIRGenBuilder to propagate the source pointer address space when bitcasting to a different pointee type. This avoids dropping or recomputing address spaces during pointer re-typing and matches LLVM IR behavior.

Update CIRGenBuilder to propagate the source pointer address space when
bitcasting to a different pointee type. This avoids dropping or
recomputing address spaces during pointer re-typing and matches LLVM
IR behavior.
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.

LGTM after nit


auto ptrTy = getPointerTo(destType);
return Address(createBitcast(loc, addr.getPointer(), ptrTy), destType,
auto ptrTy = mlir::dyn_cast<cir::PointerType>(addr.getPointer().getType());
Copy link
Member

Choose a reason for hiding this comment

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

If you are 100% sure this is a PointerType just use cast instead of dyn_cast

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.

2 participants