This is an archive of the discontinued LLVM Phabricator instance.

[OpenCL] Fix bug in mergeTypes which causes equivalent types treated as different.
ClosedPublic

Authored by yaxunl on Apr 28 2016, 8:01 AM.

Details

Summary

When comparing unqualified types, canonical types should be used, otherwise equivalent types may be treated as different type.

For example,

typedef int int_t;
generic int* a;
global int_t* b;

0 ? a : b should have type generic int*. However due to this bug, int_t and int are treated as different types, which causes the type of 0 ? a : b to have type generic void*.

This patch fixes it.

Diff Detail

Repository
rL LLVM

Event Timeline

yaxunl updated this revision to Diff 55417.Apr 28 2016, 8:01 AM
yaxunl retitled this revision from to [OpenCL] Fix bug in mergeTypes which causes equivalent types treated as different..
yaxunl updated this object.
yaxunl added a reviewer: Anastasia.
yaxunl added subscribers: cfe-commits, tstellarAMD.
Anastasia added inline comments.Apr 28 2016, 9:39 AM
test/CodeGenOpenCL/address-spaces-conversions.cl
52 ↗(On Diff #55417)

Inserting a whitespace here?

yaxunl updated this revision to Diff 55438.Apr 28 2016, 10:24 AM

Removed accidentally inserted blanks.

Anastasia accepted this revision.Apr 28 2016, 10:31 AM
Anastasia edited edge metadata.

LGTM!

This revision is now accepted and ready to land.Apr 28 2016, 10:31 AM
This revision was automatically updated to reflect the committed changes.