This is an archive of the discontinued LLVM Phabricator instance.

[Clang] Accept and forward `-fconvergent-functions` in the driver
ClosedPublic

Authored by jhuber6 on Apr 23 2023, 6:50 AM.

Details

Summary

Currently the -fconvergent-functions option is primarily used by GPU
toolchains to enforce convergent operations in line with the semantics.
This option previously was only supported via -Xclang and would show
up as unused if passed to the driver. This patch allows the driver to
forward it. This is mostly useful for users wishing to target GPU
toolchains directly via --target= without an offloading runtime.

Diff Detail

Event Timeline

jhuber6 created this revision.Apr 23 2023, 6:50 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 23 2023, 6:50 AM
jhuber6 requested review of this revision.Apr 23 2023, 6:50 AM

Can't reasonably see the semantic change between all the whitespace reformat, please split those two. E.g. use git-clang-format to only fix formatting in the part you're changing, or commit a clang-format only change first and then rebase this.

Can't reasonably see the semantic change between all the whitespace reformat, please split those two. E.g. use git-clang-format to only fix formatting in the part you're changing, or commit a clang-format only change first and then rebase this.

Sorry that was an accidental format, I'll fix it.

jhuber6 updated this revision to Diff 516167.Apr 23 2023, 7:55 AM

Fix formatting

This revision is now accepted and ready to land.Apr 23 2023, 9:26 AM
MaskRay added inline comments.Apr 23 2023, 10:27 AM
clang/include/clang/Driver/Options.td
972

Only one of the positive and negative options need to be a cc1 option.

clang/lib/Driver/ToolChains/Clang.cpp
5737

Only pass the positive option as cc1 option.

jhuber6 updated this revision to Diff 516188.Apr 23 2023, 10:33 AM

Remove cc1 negative option

MaskRay accepted this revision.Apr 23 2023, 10:35 AM