Add Objective-C support to include-cleaner's AST walker. (#211119)
Extend WalkAST to recognize and report references in Objective-C
constructs, including interfaces, protocols, message expressions,
properties, categories, compatible aliases, and instance variables. Also
update the test helper to support custom compiler arguments and add
corresponding unit tests.
[PowerPC][AIX] Mark LowerCommentStringPass as RequiredPassInfoMixin
Directly using isRequired is deprecated and PassInfoMixin will soon be
moved to a detail namespace.
Reviewers: tonykuttai, w2yehia, hubert-reinterpretcast
Pull Request: https://github.com/llvm/llvm-project/pull/212018
[clang][Tooling] Fix main header matching for headers with special characters. (#211934)
In Clang Tooling, escape HeaderStem before constructing MainIncludeRegex
to prevent special characters (such as '+') from being interpreted as
regex operators. Useful for Objective-C where "Foo+Bar.h" headers are
very common for categories.
[lldb][docs] Add hardware feature considerations to target doc (#211213)
As requested on #207166, this change adds information about hardware
features that can help or hinder porting LLDB.
I decided not to add an explicit "help" or "hinder" tag to them because
the descriptions are pretty general and I'd rather people took them as
starting points to think for themselves.
Debugging is a pile of things working together, so it's hard to say that
lack of one thing is "bad" without seeing it in context. Hopefully by
thinking about all these items for their target, developers will be able
to do that.
[HashRecognize] Fix compiler crash on missing latch compare instruction (#211895)
It is never checked whether a candidate loop `L` is latched by a compare
instruction, yet `L.getLatchCmpInst()` is added to the `Roots` for
`containsUnreachable`. If a loop is predicated on anything other than a
compare instruction, `getLatchCmpInst()` returns `nullptr`, causing
`containsUnreachable` to crash when calling `isa<PHINode>`. To fix,
consider loops where `L.getLatchCmpInst()` is null to be not in
canonical form, and reject them.
- Crash: https://godbolt.org/z/Tboo4jo5Y
Assisted-by: Claude Opus 5
[MLIR][LLVM] Preserve unknown function metadata on import
Import non-debug function metadata without a kind-specific dialect conversion into LLVMFuncOp function_metadata. Preserve repeated metadata kinds through the generic carrier so LLVM IR import and export can round-trip those attachments.
[MLIR][LLVM] Translate LLVMFuncOp function metadata
Materialize LLVMFuncOp function_metadata through ModuleTranslation metadata conversion. Attach function metadata after module-level symbols are mapped so metadata references to functions, globals, aliases, and ifuncs can be resolved.
[MLIR][LLVM] Add function metadata to LLVMFuncOp
Add a generic LLVM dialect carrier for LLVM IR function metadata on LLVMFuncOp.
Represent attachments as an ordered list so repeated metadata kinds, such as
multiple type metadata attachments, can be preserved while keeping metadata names
language-agnostic.
[MLIR][LLVM] Preserve global value metadata operands on import
Import global value references inside LLVM metadata operands as LLVM dialect metadata symbol-reference attributes. Add llvm.read_register import coverage for function, global, alias, and nameless-global metadata operands.
[AMDGPU][True16] Apply v2s copies to non-def operand 0 (#212261)
`legalizeOperandsVALUt16` iterates over all operands except for the
zeroth one, as the zeroth one is typically a definition. However, if the
zeroth operand is an input (e.g., for a `V_CMP`), then this causes the
compiler to generate illegal machine code.
This patch extends `legalizeOperandsVALUt16` to apply also to the zeroth
operand, guarding for when this operand is a definition.
[lldb][DIL] Fix size check when assigning a signed value with DIL (#207404)
The DIL assignment path (`frame variable 'lhs = rhs'`) routes through
`ValueObject::SetValueFromInteger`, which verifies that the new value
fits
in the destination type before writing it. That size check compared the
source `APInt`'s raw 64-bit word, treated as an unsigned value, against
the
destination type's unsigned maximum:
```
uint64_t u_max = (1 << (byte_size * CHAR_BIT)) - 1;
if (*(value.getRawData()) > u_max)
return llvm::createStringError("Illegal argument: new value is too big");
```
This is wrong in both directions:
* Small negative values that fit are rejected. A literal such as `-2`
[41 lines not shown]
[scudo] Add unmap and eviction stats to Secondary
Track and print stats on the number of memory unmaps and cache evictions
in the MapAllocator. These statistics track total unmaps, as well as
unmaps triggered by exceeding the maximum cache entry size or the
maximum number of entries in the cache.
[NFC][ELF][PPC64] Pass address not offset to writePPC64LoadAndBranch (#212275)
Every caller currently subtracts the TOC base in its argument, so move
that into common code inside writePPC64LoadAndBranch. This will also
allow a different computation to be used in some cases in a future
commit.
Note that offset is now unsigned not signed; even previously, all
arguments were uint64_t, and all uses are unsigned, so making it signed
doesn't make much sense.
[NFC][ELF] Use hasPhdrsCommands() wrapper instead of direct access (#212273)
This is the only place outside of LinkerScript/ScriptParser that
directly accesses the phdrsCommands member, introduced in 5a58e98c2018
("[ELF] Align the end of PT_GNU_RELRO associated PT_LOAD to a
common-page-size boundary (#66042)").
[MLIR][LLVM] Preserve unknown function metadata on import
Import non-debug function metadata without a kind-specific dialect conversion into LLVMFuncOp function_metadata. Preserve repeated metadata kinds through the generic carrier so LLVM IR import and export can round-trip those attachments.
[MLIR][LLVM] Translate LLVMFuncOp function metadata
Materialize LLVMFuncOp function_metadata through ModuleTranslation metadata conversion. Attach function metadata after module-level symbols are mapped so metadata references to functions, globals, aliases, and ifuncs can be resolved.
[MLIR][LLVM] Add function metadata to LLVMFuncOp
Add a generic LLVM dialect carrier for LLVM IR function metadata on LLVMFuncOp.
Represent attachments as an ordered list so repeated metadata kinds, such as
multiple type metadata attachments, can be preserved while keeping metadata names
language-agnostic.
[MLIR][LLVM] Preserve global value metadata operands on import
Import global value references inside LLVM metadata operands as LLVM dialect metadata symbol-reference attributes. Add llvm.read_register import coverage for function, global, alias, and nameless-global metadata operands.
[MLIR][LLVM] Rename MDValueAttr to MDGlobalValueAttr
Name the metadata carrier after the symbol-backed global values it can represent. Update the assembly mnemonic and the C, C++, and Python APIs consistently.
[VPlan] Use llvm.mask.beforefirst for computing early exit mask
This makes the cost more accurate and improves codegen for RISC-V. The codegen for an early exit loop with side effects then goes from:
.LBB0_3: # %vector.body
# =>This Inner Loop Header: Depth=1
vl1r.v v16, (a3)
vsetvli zero, zero, e8, m1, ta, ma
vmseq.vi v16, v16, 0
vfirst.m a7, v16
srli t0, a7, 63
czero.nez a7, a7, t0
czero.eqz t0, a1, t0
or a7, t0, a7
vsetvli zero, zero, e64, m8, ta, ma
vmsltu.vx v0, v8, a7
vle8.v v17, (a5), v0.t
vcpop.m t1, v16
vsetvli zero, zero, e8, m1, ta, ma
[20 lines not shown]
[ThinLTO] Mark AssignGUIDPass as RequiredPassInfoMixin
PassInfoMixin is going away, so switch to RequiredPassInfoMixin and
remove the explicit isRequired implementation.
Reviewers: mtrofin, orodley
Pull Request: https://github.com/llvm/llvm-project/pull/211987
[AArch64] Rename SVEShuffleOpts to AArch64SVEShuffleOpts
To be more consistent with other AArch64 passes and other CodeGen passes
in general which are almost always prefixed with the name of the target
(and ideally will be once we finish the NewPM transition).
Reviewers: davemgreen, huntergr-arm, paulwalker-arm
Pull Request: https://github.com/llvm/llvm-project/pull/211876