This is an archive of the discontinued LLVM Phabricator instance.

[CUDA] Don't pass top-level -march down to device cc1 or ptxas.
ClosedPublic

Authored by jlebar on Jun 15 2016, 4:23 PM.

Details

Summary

Previously if you did e.g.

$ clang -march=haswell -x cuda foo.cu

we would pass "-march=haswell -march=sm_20" down to the ptxas tool.
This causes it to assert, and rightly so!

Diff Detail

Repository
rL LLVM

Event Timeline

jlebar updated this revision to Diff 60927.Jun 15 2016, 4:23 PM
jlebar retitled this revision from to [CUDA] Don't pass top-level -march down to device cc1 or ptxas..
jlebar updated this object.
jlebar added a reviewer: tra.
jlebar added subscribers: echristo, cfe-commits.
tra added inline comments.Jun 15 2016, 4:35 PM
test/Driver/cuda-march.cu
15–16 ↗(On Diff #60927)

These look redundant -- we only care whether we eliminate -march on device side. It does not depend on the value of -march or on particular GPU arch. What do I miss?

jlebar updated this revision to Diff 60931.Jun 15 2016, 4:38 PM

Remove redundant test.

jlebar added inline comments.Jun 15 2016, 4:42 PM
test/Driver/cuda-march.cu
15–16 ↗(On Diff #60927)

Removed the last one. I don't think the first two are redundant, because I wanted to check that the *implicit* sm_20 still overrides the explicit -mhaswell.

tra added inline comments.Jun 15 2016, 4:43 PM
test/Driver/cuda-march.cu
22–28 ↗(On Diff #60931)

You don't need SM30 checks these now.
Speaking of checks, you only need one check label now as all runs check for both SM20 and HASWELL.

jlebar updated this revision to Diff 60932.Jun 15 2016, 4:48 PM

Fix tests for real this time.

tra accepted this revision.Jun 15 2016, 4:52 PM
tra edited edge metadata.

LGTM.

This revision is now accepted and ready to land.Jun 15 2016, 4:52 PM
This revision was automatically updated to reflect the committed changes.