Skip to content

Conversation

@mahmood82
Copy link
Collaborator

No description provided.

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.

You also need to add a testcase

@bcardosolopes
Copy link
Member

Still needs a testcase

@mahmood82
Copy link
Collaborator Author

Still needs a testcase

Hi, It's reproducible on my local project, I need to make a unit test for incubator. I'll provide it ASAP.

@mahmood82
Copy link
Collaborator Author

Unfortunately I can't add a proper test for this change. The behavior depends on Clang's handling of OpenCL built-ins.
Reproducing the scenario would require adding a private. The issue only manifests with my local specific setup, so a standard test can't capture it.

// emitting an addrspacecast for address-space mismatches only.
static mlir::Value getCorrectedPtr(mlir::Value argValue, mlir::Type expectedTy,
CIRGenBuilderTy &builder) {
mlir::Type argType = argValue.getType();
Copy link
Member

Choose a reason for hiding this comment

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

Because this doesn't exist in OG, let's just add a few asserts to clean this up:

auto ptrType = mlir::dyn_cast<cir::PointerType>(argType);
assert(ptrType && "expected pointer type");
assert(ptrType.getPointee() != expectedPtrType.getPointee() && "types should not match");

@bcardosolopes
Copy link
Member

The behavior depends on Clang's handling of OpenCL built-ins

This is something that should be added at some point right? Can you perhaps just add a commented testcase to one of the testcases so that when you get to it we can enable it?

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.

3 participants