[BOLT] Make sure IOAddressMap exist before lookup (NFC) (#183184)
`BinaryFunction::translateInputToOutputAddress()` contains fallback
logic in case that querying `IOAddressMap` doesn't yield an output
address. Because this function could be called in scenarios where
`IOAddressMap` won't be set up, we should check if the map actually
exists before lookup.
[BOLT][instr] Disable stderr diagnostic output when targeting Android (#183185)
Disable all stderr diagnostic output on Android since there is typically
no terminal to read diagnostic message. The `noinline`annotation is to
keep same inline decision before and after this change. On AArch64
the `.text` section in instr runtime library is now ~4.8 KB smaller.
[BOLT][instr] Make instrumentation counter reset thread safe (#183186)
Use `GlobalWriteProfileMutex` to synchronize between data reset and
dump. Between static counter reset and increment, we use atomic store
in counter reset - the counter increment sequence inserted within user
code already takes care of thread safety, so we just need to make sure
the counter reset code is also thread safe (no torn write to counter).
[WebKit checkers] Trivial function analysis ignores some nodelete annotation (#183970)
This PR fixes the bug that TrivialFunctionAnalysis can ignore nodelete
annotation set on some but not all function declarations because it does
not check the annotation on prior declarations unlike
alpha.webkit.NoDeleteChecker which checks it on any declaration by
replacing isNoDeleteFunction with NoDeleteChecker's
hasNoDeleteAnnotation.
[clang-tidy] New performance linter: performance-use-std-move (#179467)
This linter suggests calls to ``std::move`` when a costly copy would
happen otherwise. It does not try to suggest ``std::move`` when they are
valid but obviously not profitable (e.g. for trivially movable types)
This is a very simple version that only considers terminating basic
blocks. Further work will extend the approach through the control flow
graph.
It has already been used successfully on llvm/lib to submit bugs
#178174,
#178169, #178176, #178172, #178175, #178180, #178178, #178177, #178179,
#178173 and #178167, and on the firefox codebase to submit most of the
dependencies of bug https://bugzilla.mozilla.org/show_bug.cgi?id=2012658
[clang-format] Allow InheritParentConfig to accept a directory (#182791)
Add support for `BasedOnStyle: InheritParentConfig=<directory-path>` in
config files to redirect inheritance to the `.clang-format` or
`_clang-format` file in the `<directory_path>` directory.
Closes #107808
Update actions/attest-build-provenance action to v4 (#184051)
This PR contains the following updates:
| Package | Type | Update | Change |
|---|---|---|---|
|
[actions/attest-build-provenance](https://redirect.github.com/actions/attest-build-provenance)
| action | major | `v3.1.0` → `v4.1.0` |
---
> [!WARNING]
> Some dependencies could not be looked up. Check the [Dependency
Dashboard](../issues/160328) for more information.
---
### Release Notes
[120 lines not shown]
ValueTracking/AMDGPU: handle mbcnt in computeKnownBitsFromOperator (#183229)
This helps canonicalize some address calculation. This would further
help immediate folding into memory load instructions in the backend.
The order changes to v_mad_u32_u24 is just because
@llvm.amdgcn.mul.u24.i32 was used in codegen prepare after this change.
It does not really change anything important.
[MLIR][Python] Support attribute definitions in Python-defined dialects (#183907)
This PR is quite similiar to
https://github.com/llvm/llvm-project/pull/182805.
We added basic support of attribute definitions in Python-defined
dialects, including:
- IRDL codegen for attribute definitions
- Attr builders like `MyAttr.get(..)` and attr parameter accessors (e.g.
`my_attr.param1`)
- Use Python-defined attrs in Python-defined operations
Assisted by GitHub Copilot.
[libunwind][PAC] Defang ptrauth's PC in valid CFI range abort
It turns out making the CFI check a release mode abort causes many,
if not the majority, of JITs to fail during unwinding as they do not
set up CFI sections for their generated code. As a result any JITs
that do nominally support unwinding (and catching) through their JIT
or assembly frames trip this abort.
rdar://170862047
[clang][Sema] fix crash on __type_pack_element with dependent packs (GH180307) (#180407)
dependent pack expansions in __type_pack_element can result in
single-element template argument lists. When performing semantic
analysis for these builtins, the compiler needs to account for the
dependent expansions and handle them without triggering strict size
assertions. The patch adds this analysis and ensures we either defer
evaluation for dependent cases or report clear out-of-bounds diagnostics
instead of crashing
Ai was used for test generation and CI debugging
fixes #180307
[AMDGPU] Make uniform-work-group-size a valueless attribute (#183925)
The "uniform-work-group-size" function attribute previously took a
string value of "true" or "false". Since presence alone can convey the
"true" semantics and absence can convey "false", the value is
unnecessary.
This patch converts it to a valueless string attribute: presence
indicates true, absence indicates false. For backward compatibility,
auto-upgrade logic is added in both UpgradeAttributes (bitcode) and
UpgradeFunctionAttributes: if the old value is "true", the attribute is
kept without a value; if "false", the attribute is removed.
[libunwind][PAC] Defang ptrauth's PC in valid CFI range abort
It turns out making the CFI check a release mode abort causes many,
if not the majority, of JITs to fail during unwinding as they do not
set up CFI sections for their generated code. As a result any JITs
that do nominally support unwinding (and catching) through their JIT
or assembly frames trip this abort.
rdar://170862047
[AMDGPU] Make uniform-work-group-size a valueless attribute
The "uniform-work-group-size" function attribute previously took a
string value of "true" or "false". Since presence alone can convey
the "true" semantics and absence can convey "false", the value is
unnecessary.
This patch converts it to a valueless string attribute: presence
indicates true, absence indicates false. For backward compatibility,
auto-upgrade logic is added in both UpgradeAttributes (bitcode) and
UpgradeFunctionAttributes: if the old value is "true", the attribute
is kept without a value; if "false", the attribute is removed.
All setters (Clang CodeGen, OMPIRBuilder, AMDGPUAttributor, ROCDL
translation) and readers (AMDGPUAttributor, AMDGPULowerKernelAttributes,
AMDGPUHSAMetadataStreamer) are updated accordingly. The attribute is
also documented in the AMDGPU LLVM IR Attributes table where it was
previously missing.
Revert "[NFC][Clang] Auto generate check lines for `clang/test/CodeGenOpenCL/cl-uniform-wg-size.cl`" (#184035)
Reverts llvm/llvm-project#183926 because of some BB failures.
[SLP]Do not consider condition with multiple uses and negate predicate as a candidate for inversed select
If the select/zext comparison has negate predicate and is used in
several places, it should not be considered as a candidate for inversed
zext/select pattern, it will be replaced by a negate vector predicate,
leading to an incorrect codegen for other uses
[clang-tidy][NFC] Don't call `getLangOpts` in `isLanguageVersionSupported` (#184029)
This is just a little inconsistency I noticed. Basically all checks
inspect the `LangOpts` parameter, but these two ignore the parameter and
call `getLangOpts` instead.