This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Do not assume a default GCN target
ClosedPublic

Authored by rampitec on Aug 14 2019, 1:00 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

rampitec created this revision.Aug 14 2019, 1:00 PM
arsenm added inline comments.Aug 14 2019, 1:14 PM
lib/Basic/Targets/AMDGPU.cpp
188–189 ↗(On Diff #215211)

I think this needs to distinguish no specified target from an invalid cpu name

rampitec marked an inline comment as done.Aug 14 2019, 1:29 PM
rampitec added inline comments.
lib/Basic/Targets/AMDGPU.cpp
188–189 ↗(On Diff #215211)

It does. clang then exits with "error: unknown target CPU":

clang -cc1 -triple amdgcn-amd-amdhsa -target-cpu invalid gas.cl
error: unknown target CPU 'invalid'
note: valid target CPU values are: gfx600, tahiti, gfx601, hainan, oland, pitcairn, verde, gfx700, kaveri, gfx701, hawaii, gfx702, gfx703, kabini, mullins, gfx704, bonaire, gfx801, carrizo, gfx802, iceland, tonga, gfx803, fiji, polaris10, polaris11, gfx810, stoney, gfx900, gfx902, gfx904, gfx906, gfx908, gfx909, gfx1010, gfx1011, gfx1012
arsenm accepted this revision.Aug 14 2019, 1:33 PM

LGTM

This revision is now accepted and ready to land.Aug 14 2019, 1:33 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptAug 14 2019, 1:58 PM