[apinotes-test] Switch to OptTable (#246760)
Parse the command line with OptTable instead of cl::opt, as part of
removing cl::opt from clang/. Help output uses the OptTable format, and
LLVM's global options (e.g. -debug-only, --version) are no longer
accepted.
LLM-aided
[lldb] Declare darwin-log enable options in TableGen
The --filter option of `plugin structured-data darwin-log enable` took
eArgRawInput, which describes free-form text passed after ' -- ' and so
contradicts how the option works: each --filter takes one rule, which
must be quoted if it contains spaces, and the option may be repeated.
Add eArgTypeLogFilter for a single filter rule and declare the options
of the command in TableGen like the other commands. The multi-line
description of --filter relies on newlines being escaped correctly in
the generated code. eArgRawInput is kept: command help still points at
'help raw-input' to explain the raw-input convention.
The usage line now lists the options in def name order.
Assisted-by: Claude
[lldb] Declare OptionGroupPlatform options in TableGen (NFC)
Add TargetOptions.td for the options of the option groups in
lldbTarget and move the options of RSync/Caching/SSH there.
Assisted-by: Claude
[lldb] Declare darwin-log enable options in TableGen
The --filter option of `plugin structured-data darwin-log enable` took
eArgRawInput, which describes free-form text passed after ' -- ' and so
contradicts how the option works: each --filter takes one rule, which
must be quoted if it contains spaces, and the option may be repeated.
Add eArgTypeLogFilter for a single filter rule and declare the options
of the command in TableGen like the other commands. The multi-line
description of --filter relies on newlines being escaped correctly in
the generated code. eArgRawInput is kept: command help still points at
'help raw-input' to explain the raw-input convention.
The usage line now lists the options in def name order.
Assisted-by: Claude
[lldb] Declare objc class-table dump options in TableGen (NFC)
Move the options of `language objc class-table dump` to a new
AppleObjCRuntimeOptions.td.
Assisted-by: Claude
[lldb] Declare OptionGroupPlatform options in TableGen (NFC)
Add TargetOptions.td for the options of the option groups in
lldbTarget and move the options of RSync/Caching/SSH there.
Assisted-by: Claude
[lldb] Declare OptionGroupPlatformCaching options in TableGen (NFC)
Move the --local-cache-dir option of OptionGroupPlatformCaching to
TargetOptions.td.
Assisted-by: Claude
[lldb] Declare OptionGroupPlatformRSync options in TableGen (NFC)
Add TargetOptions.td for the options of the option groups in
lldbTarget and move the options of OptionGroupPlatformRSync there.
Assisted-by: Claude
[lldb] Declare OptionGroupValueObjectDisplay options in TableGen
The --dynamic-type option is an enum, but it was declared without an
argument type, so `help` printed "-d <none>" and the option was not
described as an enumeration:
```
$ (lldb) help dwim-print
-d <none> ( --dynamic-type <none> )
Show the object as its full dynamic type, not its static
type, if available.
Values: no-dynamic-values | run-target | no-run-target
$ (lldb) help <dynamic-value-type>
error: '<dynamic-value-type>' is not a known command.
```
This is now fixed, as shown in the added test.
Assisted-by: Claude
[BasicAA] Add fast path for constant-offset i8 GEPs (NFC) (#246754)
This patch adds a fast path for two-operand constant-offset i8 GEPs in
DecomposeGEPExpression.
Without this patch, we initialize a GEP type iterator and scale the
index by the element stride even for canonical i8 GEPs. Note that
accumulateConstantOffset already uses a similar fast path.
This reduces CTMark geomean instruction counts by 0.13% at -O3 and
0.19% with ThinLTO. Instruction counts on tramp3d-v4 drop by up to
0.60%.
Assisted-by: Antigravity
[AMDGPU][NFC] Split the GCN tracker path out of getRegisterPressures
With the GCN trackers, getRegisterPressures encoded the banked ArchVGPR
and AGPR numbers into the VGPR_32 and AGPR_32 slots of the pressure-set
vector, so that initCandidate could read them back out. Those slots are
meant to hold generic RegPressureTracker results indexed by pressure set.
Keep getRegisterPressures for the generic tracker only, and add
getGCNTrackerPressure, which returns the GCN trackers' GCNRegPressure.
initCandidate now computes the SGPR, ArchVGPR and AGPR pressure directly
from that GCNRegPressure when the GCN trackers are in use, without going
through the pressure-set vector.
Co-authored-by: Cursor <cursoragent at cursor.com>
[KnownFPClass] Rule out subnormal fmul results for constant scale-ups (#246718)
A finite constant with magnitude at least 1 cannot turn a non-subnormal
input into a subnormal product. Teach `KnownFPClass::fmul` to use this
fact for constant multipliers.
I need this for a NVPTX optimization to prove it is safe to use a ftz
ex2 intrinsic call.
[lldb] Declare darwin-log enable options in TableGen
The --filter option of `plugin structured-data darwin-log enable` took
eArgRawInput, which describes free-form text passed after ' -- ' and so
contradicts how the option works: each --filter takes one rule, which
must be quoted if it contains spaces, and the option may be repeated.
Add eArgTypeLogFilter for a single filter rule and declare the options
of the command in TableGen like the other commands. The multi-line
description of --filter relies on newlines being escaped correctly in
the generated code. eArgRawInput is kept: command help still points at
'help raw-input' to explain the raw-input convention.
The usage line now lists the options in def name order.
Assisted-by: Claude
[lldb] Declare objc class-table dump options in TableGen (NFC)
Move the options of `language objc class-table dump` to a new
AppleObjCRuntimeOptions.td.
Assisted-by: Claude
[lldb] Declare OptionGroupPlatformCaching options in TableGen (NFC)
Move the --local-cache-dir option of OptionGroupPlatformCaching to
TargetOptions.td.
Assisted-by: Claude
[lldb] Declare OptionGroupPlatformRSync options in TableGen (NFC)
Add TargetOptions.td for the options of the option groups in
lldbTarget and move the options of OptionGroupPlatformRSync there.
Assisted-by: Claude
[lldb] Declare OptionGroupValueObjectDisplay options in TableGen
The --dynamic-type option takes its values from g_dynamic_value_types,
but it declared no argument type, so `help` printed "-d <none>" and
the option was not described as an enumeration.
Add eArgTypeDynamicValueType and move the value table to the argument
table, where EnumArg<"DynamicValueType"> can find it, and declare the
options of the group in InterpreterOptions.td. GetDynamicValueTypes()
had no other users and is removed; target.prefer-dynamic-value keeps
using the table directly.
`help dynamic-value-type` now lists the valid values, the usage lines
of the commands that accept -d show <dynamic-value-type> instead of
<none>, and list the options of the group in def name order.
Assisted-by: Claude
[lldb] Declare OptionGroupWatchpoint options in TableGen
Add eArgTypeWatchType to the argument table so that `help watch-type`
can find it and print the valid values.
Assisted-by: Claude
[AMDGPU][NFC] Add a test for the latency tie-break in the initial stages (#246749)
Follow-up to #243116, which made the initial scheduling stages keep a
schedule that ties in register pressure if it has a better latency
metric.
In the test, every value defined in the region is live out of it, so the
pressures before and after scheduling are equal in any order. The ILP
initial stage hides the load latency and keeps the new schedule, which
it reverted before #243116.
Assisted-by: Cursor/Claude Opus
Co-authored-by: Cursor <cursoragent at cursor.com>
[lldb] Declare darwin-log enable options in TableGen
The --filter option of `plugin structured-data darwin-log enable` took
eArgRawInput, which describes free-form text passed after ' -- ' and so
contradicts how the option works: each --filter takes one rule, which
must be quoted if it contains spaces, and the option may be repeated.
Add eArgTypeLogFilter for a single filter rule and declare the options
of the command in TableGen like the other commands. The multi-line
description of --filter relies on newlines being escaped correctly in
the generated code. eArgRawInput is kept: command help still points at
'help raw-input' to explain the raw-input convention.
The usage line now lists the options in def name order.
Assisted-by: Claude
[lldb] Declare objc class-table dump options in TableGen (NFC)
Move the options of `language objc class-table dump` to a new
AppleObjCRuntimeOptions.td.
Assisted-by: Claude
[lldb] Declare OptionGroupPlatformCaching options in TableGen (NFC)
Move the --local-cache-dir option of OptionGroupPlatformCaching to
TargetOptions.td.
Assisted-by: Claude
[lldb] Declare OptionGroupPlatformRSync options in TableGen (NFC)
Add TargetOptions.td for the options of the option groups in
lldbTarget and move the options of OptionGroupPlatformRSync there.
Assisted-by: Claude
[lldb] Declare OptionGroupValueObjectDisplay options in TableGen
The --dynamic-type option takes its values from g_dynamic_value_types,
but it declared no argument type, so `help` printed "-d <none>" and
the option was not described as an enumeration.
Add eArgTypeDynamicValueType and move the value table to the argument
table, where EnumArg<"DynamicValueType"> can find it, and declare the
options of the group in InterpreterOptions.td. GetDynamicValueTypes()
had no other users and is removed; target.prefer-dynamic-value keeps
using the table directly.
`help dynamic-value-type` now lists the valid values, the usage lines
of the commands that accept -d show <dynamic-value-type> instead of
<none>, and list the options of the group in def name order.
Assisted-by: Claude
[lldb] Declare OptionGroupWatchpoint options in TableGen
Move the options of OptionGroupWatchpoint to InterpreterOptions.td.
The watch type enumeration moves to the argument table, where
EnumArg<"WatchType"> looks it up. As a result, `help watch-type` now
lists the valid values.
The usage lines of `watchpoint set variable` and `watchpoint set
expression` list the options in def name order.
Assisted-by: Claude
[lldb] Declare OptionGroupVariable options in TableGen (NFC)
GetDefinitions() omits the four frame-only options by dropping the
leading definitions. Make sure TableGen emits them first by giving
their `def`s appropriate names.
--regex options takes no argument (it is a boolean flag) but was
declared with eArgTypeRegularExpression. It is eArgTypeNone now.
Assisted-by: Claude