[CodeGen] Remove legacy option spellings that have no in-tree use (#243946)
PR #243746 renamed these options and kept the old spellings as aliases
(convenient to downstream users that might use them). Nothing in the
tree uses the old spellings, so remove them now.
[SampleProfile] Recover indirect targets after iterative inlining
An indirect fallback survives when a target is promoted and inlined. Recording its hottest target on every scan can therefore merge samples from an inline copy into the standalone function. Recording only one target also loses samples for other targets that stay out of line.
Collect recovery candidates from the calls that remain after inlining finishes. Use the existing promotion history to exclude promoted targets from the fallback, and recover promoted direct calls separately if they did not inline. This also handles promotion without a successful inline or another iteration.
[lldb] Fix a crash in SBTypeSynthetic::IsEqualTo (#243932)
Comparing a valid SBTypeSynthetic to an invalid one dereferenced a null
pointer.
Assisted-by: Claude
[SPIR-V] Drop type incompatible attributes after aggregate signature rewrite (#242704)
Retyped functions and calls that kept attributes like nofpclass on i32,
which are rejected by verifier
[CodeGen] Declare command line options of more passes in TableGen (#243746)
Renames, with the old spellings kept as aliases:
* Negative to positive: -no-stack-coloring, -no-stack-slot-sharing,
-disable-phi-elim-edge-splitting and -no-phi-elim-live-out-early-exit
become -stack-coloring, -stack-slot-sharing, -phi-elim-edge-splitting
and -phi-elim-live-out-early-exit.
* Drop enable-: -enable-shrink-wrap, -enable-shrink-wrap-region-split
and -enable-tail-merge become -shrink-wrap, -shrink-wrap-region-split
and -tail-merge, and -enable-spill-copy-elim becomes
-mcp-spill-copy-elim.
* Add the pass prefix: the MachineLICM options gain machine-licm-, and
-aggressive-machine-cse, -csuses-threshold, -dataflow-edge-limit and
-protect-from-escaped-allocas become -machine-cse-aggressive,
-machine-cse-csuses-threshold, -twoaddr-dataflow-edge-limit and
-stackcoloring-protect-from-escaped-allocas.
Other changes:
[6 lines not shown]
[libc++][docs] Make status colors readable in Furo dark mode
The status table cell colors are light pastels. Furo's dark theme uses light
text, so cells such as "Complete" were unreadable. Use darker backgrounds
for the explicit dark theme and for the automatic theme when the browser
prefers a dark color scheme.
LLM-aided
[Propeller] Guard supplemental sample lookup against missing or line-0 debug info (#243715)
Skip supplementing functions without a DISubprogram or with a line-0
DISubprogram, matching SampleProfileLoader and MIRProfileLoader. Also
skip instructions whose leaf debug location has line 0 so artificial or
merged locations do not wrap line offsets mod 65536.
Assisted-by: Antigravity
[libc++][docs] Use Furo theme
Adopt the shared LLVM Furo configuration and wyvern logo, widen the content area on desktop viewports, and remove page-local contents directives that duplicate Furo's navigation.
LLM-aided
[AMDGPU] Split uni/div true16 scalar_to_vector patterns for 16-bit types (#242395)
With real true16, the v2i16/v2f16/v4i16/v4f16 scalar_to_vector patterns
always selected a VGPR REG_SEQUENCE with the source in the lo16 slot. A
uniform 16-bit source is a 32-bit SGPR, so this put a 32-bit register in
a 16-bit subregister slot. After SIFixSGPRCopies, DetectDeadLanes read
the used lanes of that operand as hi16 only and marked the lo16 inputs
undef. The loads feeding them were then deleted as dead.
Split the patterns into divergent (VGPR_16) and uniform (SReg_32)
versions, as is already done for v2bf16.
Assisted-by: AI
[Support] Optimize suffix-tree construction for unique terminators (#233123)
Reduce suffix-tree construction work and memory use by skipping child
lookups for unique terminators and pruning boundary leaves whose parent
paths are shorter than the minimum repeat length of two.
Add an optional `BoundaryStart` lower bound to identify unique
terminators.
MachineOutliner passes the lower bound of its separator symbols.
These optimizations are disabled when no bound is provided.
Pruning uses the path lengths computed during construction by #232720.
Add unit tests for optional boundaries and pruning. Preserve the
existing
check prefixes and emission-order checks, reordering only the two
affected
check blocks.
[26 lines not shown]
[Driver] Use SeparateOrEq for -mllvm and some --long options (#240937)
Merge each Joined `-x=` and Separate `-x` pair into one SeparateOrEq
row for a few options.
-mllvm keeps RenderSeparate so -### and generated cc1 command lines
still use `-mllvm <arg>`. -mllvm= becomes accepted by cc1, cc1as, and
fc1, and --help lists only `-mllvm=<value>`.
Teach the cc1 denormalizers and the option doc emitter about
SeparateOrEq. In clangd's ArgStripper, give `-x=` its own prefix rule so
that stripping --output no longer matches --output-class-directory=.
LLM-aided
[x86] Lower `VECTOR_SHUFFLE_VAR` simplifying x86 custom variable permute lowering (#240632)
x86 already had custom code to make a shuffle out of scalar code
`BUILD_VECTOR`, but didn't get lowered by a generic node that let
optimizations be shared across backends (it had custom lowering with
`createVariablePermute`). Now that we can generically express
`VECTOR_SHUFFLE_VAR`, we should eventually delete `BUILD_VECTOR` and
move it to middle end, but for now, this moves `createVariablePermute`
to be the lowering of `VECTOR_SHUFFLE_VAR` rather than a free standing
function.
[ProfCheck] Annotate/verify memop VP metadata
This patch makes profcheck (optionally) inject/verify memory operation
VP metadata for variable sized memory operations. This is off by default
for now as it causes another ~50 tests to fail under profcheck.
Reviewers: mtrofin, david-xl, snehasish
Pull Request: https://github.com/llvm/llvm-project/pull/243582
[ProfCheck] Annotate/verify indirect call VP metadata
This patch makes prof-inject add VP metadata to indirect calls and makes
prof-verify assert that indirect calls have VP metadata. This is left
off by default for now as it makes ~60 additional tests fail under the
ProfCheck configuration.
Replaces #154657.
Co-Authored-By: Mircea Trofin <mtrofin at google.com>
Reviewers: mtrofin, snehasish, david-xl
Pull Request: https://github.com/llvm/llvm-project/pull/243581
[RISCV] Sort the CPU list returned by fillValid(Tune)CPUArchList (#243708)
This puts vendor tune CPU names with their regular CPU names.
This will also affect the output of #243697
[AllocToken] Infer the allocated type from placement new into the result (#241548)
-fsanitize=alloc-token infers the type of an untyped allocation (malloc,
size-returning new, alloc_size functions) from a sizeof in the size
argument or a cast of the result. The common "allocate raw storage, then
construct in place" idiom has neither:
void *mem = alloc(size);
T *obj = new (mem) T();
and so gets the fallback token, which misplaces the object under a
pointer-split token mode. Add placement new as a third source. The order
is sizeof, then placement new, then cast: a sizeof states what the
allocation was sized for (it may be a header plus elements placed by
pointer arithmetic), while a cast to a raw storage pointer carries less
information than the construction. Only the reserved global placement
form is considered; the storage is matched through parentheses, casts,
and the non-static fields of a by-value result (res.p of a
size-returning allocation). A local variable is used only if it is
[8 lines not shown]
[lldb] Fix a crash in SBEvent::GetBroadcasterClass (#243736)
An event has no broadcaster until it is broadcast. Return "unknown
class" instead of dereferencing null.
Assisted-by: Claude
[LAA] Allow runtime checks between comparable address spaces. (#229588)
If casts between address spaces are no-ops, both address spaces
are integral and they have the same size, the pointers in the address
space should be guaranteed not to overlap. Otherwise the same
address would point to different objects.
In this case, we can compare them and generate runtime checks.
Fixes https://github.com/llvm/llvm-project/issues/229278.
PR: https://github.com/llvm/llvm-project/pull/229588
[AMDGPU] Add missing EXTLOAD/TRUNCSTORE legalization for v{5,6,7}f16 (#243383)
The legalization actions for EXTLOADs of v{5,6,7}f16 to corresponding
f32 types and TRUNCSTOREs from v{5,7}f32 to corresponding f16 types were
never added after those MVTs were introduced in 9b5502292d8e4 ("[CG] Add
VTs for v[567]i1 and v[567]f16").
Add the legalization actions and corresponding tests, also for the
preexisting TRUNCSTORE to v6f16 handling.
Fixes ROCM-33452.
Co-authored-by: Jacob Lambert <jacob.lambert at amd.com>