This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU/clang: Remove target features from address space test builtins
ClosedPublic

Authored by arsenm on Nov 28 2022, 2:58 PM.

Details

Reviewers
yaxunl
b-sumner
JonChesterfield
Joe_Nash
Group Reviewers
Restricted Project
Summary

It turns out we can codegen these on targets without flat addressing,
although the runtime probably didn't put anything useful there. The
proper diagnostic would be to disallow flat pointer uses or languages
with them, not this one edge case. Allows removing one of the special
cases requiring subtarget support in the device libraries.

Diff Detail

Event Timeline

arsenm created this revision.Nov 28 2022, 2:58 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 28 2022, 2:58 PM
arsenm requested review of this revision.Nov 28 2022, 2:58 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 28 2022, 2:58 PM
arsenm added a reviewer: Restricted Project.Dec 13 2022, 7:16 AM

ping

Joe_Nash added inline comments.
clang/test/CodeGenOpenCL/builtins-amdgcn-flat-address-space.cl
8

What part of the toolchain is responsible for forbiding flat pointers on unsupported targets?

arsenm added inline comments.Dec 29 2022, 12:30 PM
clang/test/CodeGenOpenCL/builtins-amdgcn-flat-address-space.cl
8

The frontend should just error on languages with flat pointers. Really we should just implement software flat pointers, it wouldn’t be difficult and might only require minimal driver cooperation if any

Joe_Nash accepted this revision.Dec 29 2022, 12:38 PM
Joe_Nash added inline comments.
clang/test/CodeGenOpenCL/builtins-amdgcn-flat-address-space.cl
8

Ok, I just want to ask if that is in place or should be in place before this patch lands. So we don't accidentally convert a compile time error into a runtime error. Otherwise LGTM.

This revision is now accepted and ready to land.Dec 29 2022, 12:38 PM
arsenm added inline comments.Dec 29 2022, 1:05 PM
clang/test/CodeGenOpenCL/builtins-amdgcn-flat-address-space.cl
8

In practice you’ll be failing to select all over on regular code long before you see this predicate