This is an archive of the discontinued LLVM Phabricator instance.

[clang] Cache OpenCL types
ClosedPublic

Authored by aeubanks on Feb 4 2022, 9:24 AM.

Details

Summary

If we call CGOpenCLRuntime::convertOpenCLSpecificType() multiple times
we should get the same type back.

Diff Detail

Event Timeline

aeubanks created this revision.Feb 4 2022, 9:24 AM
aeubanks requested review of this revision.Feb 4 2022, 9:24 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 4 2022, 9:24 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript

Just to understand the intent - is this a performance optimization or functionality fix?

Also is there any way to test this?

clang/lib/CodeGen/CGOpenCLRuntime.h
42

Maybe it can be named CachedTys?

55

getType -> getPointerType ?

aeubanks updated this revision to Diff 406024.Feb 4 2022, 10:02 AM

address comments

Just to understand the intent - is this a performance optimization or functionality fix?

This is a functionality fix.

Also is there any way to test this?

I came across this while working on another patch. This should be NFC with ToT clang, but was required my other patch. Since this part was easily split apart I wanted to do that.
Separately I think this makes sense in general.

svenvh accepted this revision.Feb 7 2022, 2:28 AM

LGTM, thanks!

This revision is now accepted and ready to land.Feb 7 2022, 2:28 AM
This revision was landed with ongoing or failed builds.Feb 7 2022, 9:23 AM
This revision was automatically updated to reflect the committed changes.