Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AArch64][Driver] Better handling of target feature dependencies #78270

Merged
merged 6 commits into from
Jan 17, 2024

Commits on Jan 16, 2024

  1. [AArch64][Driver] Better handling of target feature dependencies

    Currently there are several bits of code in the AArch64 driver which
    attempt to enforce dependencies between optional features in the -march=
    and -mcpu= options. However, these are based on the list of feature
    names being enabled/disabled, so they have a lot of logic to consider
    the order in which features were turned on and off, which doesn't scale
    well as dependency chains get longer.
    
    This patch moves the code handling these dependencies to TargetParser,
    and changes them to use a Bitset of enabled features. This makes it easy
    to check which features are enabled, and is converted back to a list of
    LLVM feature names once all of the command-line options are parsed.
    
    The motivating example for this was the -mcpu=cortex-r82+nofp option.
    Previously, the code handling the dependency between the fp16 and
    fp16fml extensions did not consider the nofp modifier, so it added
    +fullfp16 to the feature list. This should have been disabled by the
    +nofp modifier, and also the backend did follow the dependency between
    fullfp16 and fp, resulting in fp being turned back on in the backend.
    
    Most of the dependencies added to AArch64TargetParser.h weren't known
    about by clang before, I built that list by checking what the backend
    thinks the dependencies between SubtargetFeatures are.
    ostannard committed Jan 16, 2024
    Configuration menu
    Copy the full SHA
    ebd6e9a View commit details
    Browse the repository at this point in the history
  2. clang-format

    ostannard committed Jan 16, 2024
    Configuration menu
    Copy the full SHA
    b52130a View commit details
    Browse the repository at this point in the history
  3. Fix flang test

    ostannard committed Jan 16, 2024
    Configuration menu
    Copy the full SHA
    6096210 View commit details
    Browse the repository at this point in the history

Commits on Jan 17, 2024

  1. Expand comments

    ostannard committed Jan 17, 2024
    Configuration menu
    Copy the full SHA
    ea9b779 View commit details
    Browse the repository at this point in the history
  2. clang-format

    ostannard committed Jan 17, 2024
    Configuration menu
    Copy the full SHA
    f66989f View commit details
    Browse the repository at this point in the history
  3. comments

    ostannard committed Jan 17, 2024
    Configuration menu
    Copy the full SHA
    2e2ffda View commit details
    Browse the repository at this point in the history