This is an archive of the discontinued LLVM Phabricator instance.

[clang] Cast the pointer to right type with different address space
Needs ReviewPublic

Authored by cdai2 on Feb 7 2023, 12:37 AM.

Details

Reviewers
Anastasia
Summary

The source type has OpenCL general address space but dest type does
not have address space. Address space cast is needed for this scenario.

Diff Detail

Unit TestsFailed

Event Timeline

cdai2 created this revision.Feb 7 2023, 12:37 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 7 2023, 12:37 AM
cdai2 requested review of this revision.Feb 7 2023, 12:37 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 7 2023, 12:37 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
cdai2 updated this revision to Diff 496033.Feb 8 2023, 11:36 PM

[clang] update test case

cdai2 updated this revision to Diff 496275.Feb 9 2023, 4:16 PM

Update cases to cover both opaque pointer and typed pointer

Anastasia added inline comments.Feb 12 2023, 12:55 PM
clang/lib/CodeGen/CGBuiltin.cpp
12412–12413

I think the semantics of builtin functions is that they accept any address space. So you should preserve the address space from Ops[1].