Page MenuHomePhabricator

[AMDGPU] Do not assume a default GCN target
ClosedPublic

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

Diff Detail

Repository
rL LLVM

Event Timeline

rampitec created this revision.Wed, Aug 14, 1:00 PM
arsenm added inline comments.Wed, Aug 14, 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.Wed, Aug 14, 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.Wed, Aug 14, 1:33 PM

LGTM

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