This is an archive of the discontinued LLVM Phabricator instance.

Allow target to handle required features for TARGET_BUILTINs.
AbandonedPublic

Authored by tra on Mar 29 2018, 1:40 PM.

Details

Reviewers
echristo
jlebar
Summary

In some cases figuring out whether particular target builtin
should be enabled is a bit more complicated than current
implementation allow. This patch allows the target to override
what it considers for required feature to be enabled/disabled.

This will be used in the upcoming patch which needs to have some
NVPTX builtins enabled for a range of GPUs depending on detected
CUDA version.

Event Timeline

tra created this revision.Mar 29 2018, 1:40 PM
jlebar accepted this revision.Mar 29 2018, 4:26 PM
jlebar added inline comments.
clang/include/clang/Basic/TargetInfo.h
933

It's not totally obvious to me, can we explain why it's a tristate?

This revision is now accepted and ready to land.Mar 29 2018, 4:26 PM
tra updated this revision to Diff 140371.Mar 29 2018, 5:14 PM

Updated description of hasRequiredFeature.
Set FirstMissing if target returns 'false' so diags still work.

tra marked an inline comment as done.Mar 29 2018, 5:15 PM
tra added inline comments.
clang/include/clang/Basic/TargetInfo.h
933

We need to distinguish between "target does not need to do anything special about the feature" (no value) and "target does have an opinion, which may be true or false.". I'll update the comment.

tra abandoned this revision.Apr 10 2018, 5:21 PM
tra marked an inline comment as done.

I've figured out a manageable way to enforce constraints without this change.