[LLVM][AutoUpgrade] Support default args on undeclared multi-call upgrades (#216246)
When an `.ll` file contains multiple calls to an intrinsic without an explicit
declaration, only the first call is upgraded successfully, and the remaining
subsequent calls fail.
`LLParser` builds one temporary Function per call, so after the first
upgrade occupies the canonical name the later functions are uniquified
(eg. `llvm.foo.1`). The intrinsic ID was previously looked up using `F->getName()`,
which requires an exact name match. So, the uniquified names resolved to `not_intrinsic`,
causing the upgrade to return and the default arguments were not applied.
This patch fixes this issue by using the cached `F->getIntrinsicID()`,
which is set when the temporary function is created from the original name.
It also `rename(F)` before inserting the full declaration, so the temporary
function no longer occupies the canonical name.
---------
Signed-off-by: DharuniRAcharya <dharunira at nvidia.com>
[orc-rt] Add Session::attach for pre-mode ControllerAccesses. (#222227)
Allow clients to attach a session using a pre-constructed
ControllerAccess object. This allows clients to use non-trivial
construction methods (e.g. factories) to build ControllerAccess objects.
[VPlan] Remove VPInstruction::Not. NFC
It can be represented by a canonical `xor x, -1`. The motiviation for this is to help streamline pattern matchers so we can start dispatching combineRecipes based on opcodes.
[lldb] Link API unit tests against LLVMTestingSupport. (#222206)
Changes to lldb have added a dependency on llvm::detail::TakeError, this
fails to link on my desktop without the dependency. Most other unittests
already link to LLVMTestingSupport.
universe.sh: add MK_BEARSSL build
BEARSSL is disabled by default, add this here to make sure it doesn't
break.
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D59516
universe.sh: build with 1.5 * ncpu jobs
Build with 1.5 * ncpu jobs instead of hardcoding 40.
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D59515
[SLP][modularisation][NFC] Move reduction match helpers to SLPReductionUtils (#222052)
Move the following BoUpSLP-independent reduction pattern-match helpers
out of SLPVectorizer.cpp into a new
SLPVectorizer/SLPReductionUtils.{h,cpp}:
getNonPhiOperand
isReductionCandidate
matchRdxBop, used only by these two, moves alongside them and stays
file-local. Behavior is unchanged.
Part of the SLPVectorizer.cpp modularization effort:
https://discourse.llvm.org/t/modularizing-slpvectorizer-cpp/90922
Assisted by AI
[SLP][modularisation][NFC] Move compress load/store helpers to SLPMemoryUtils (#222038)
Move the following BoUpSLP-independent masked-load/store compress
helpers out of SLPVectorizer.cpp into
SLPVectorizer/SLPMemoryUtils.{h,cpp}:
isMaskedLoadCompress (both overloads)
isMaskedStoreCompress
buildCompressMask, used only by isMaskedLoadCompress, moves alongside
them and stays file-local. isMaskedLoadCompress reads the file-local
SLPReVec cl::opt; the option stays static in SLPVectorizer.cpp and the
moved helper takes its value as an explicit bool parameter. Behavior is
unchanged.
Part of the SLPVectorizer.cpp modularization effort:
https://discourse.llvm.org/t/modularizing-slpvectorizer-cpp/90922
Assisted by AI
[VPlan] Append recipes created via builder to worklist
The previous PR appended the top most created recipe to the worklist, and this PR extends it to any other nested recipes that were created, similar to InstCombine.
This removes the header mask in a good few more places on RISC-V as measured on SPEC CPU 2017, e.g. for the following loop:
```c
long f(const int *p, const int *q, long n) {
long a = 0, b = 0;
for (long i = 0;; i++) {
if (p[i] && q[i]) { a += i; b += i; }
if (i + 1 == n) break;
}
return a + b;
}
```
Before:
[49 lines not shown]
[VPlan] Process simplifyRecipes in a worklist
This brings simplifyRecipes further in line with InstCombine, and asides from unlocking more simplifications it also helps avoid spurious test churn whenever passes are moved around simplifyRecipes.
For now just push the new recipe onto the worklist, not its users.
This uses a post order traversal so we maintain the same simplification order as before.
I've gone through and checked every simplification we do is a canonicalisation that converges, and I checked on llvm-test-suite + SPEC CPU 2017 in various configurations that we don't hit any cycles.
Switch to SmallVector with space on stack
SmallVector allows for much larger small sizes than SetVector, so use 256 to match InstructionWorklist.
We don't need to worry about duplicate worklist entries until we add users to the worklist.
[VPlan] Split simplifyRecipes into simplifyRecipes and combineRecipes (#221924)
Bringing it in line with InstSimplify and InstCombine, split up
simplifyRecipe into a function that modifies and creates recipes
(combineRecipe), and one that is analysis-only (simplifyRecipe).
This allows us to avoid adding simplficiation only folds to the worklist
in #213899.
The funclet.ll test no longer erases the constant-folded intrinsic call
because vputils::isDeadRecipe returns false.
textproc/libcyaml: Update to 1.4.2
== v1.4.2 ==
Buildsystem:
- Add explicit shared and static library install targets.
General:
- Small code cleanups.
- Reverted to C89-compatible static assertion macro.
- Fixes build on quirky platforms.
- Rationalised GitHub actions.
- Fixed CI for MacOS.
No changes are required for client applications to upgrade.
== v1.4.1 ==
[30 lines not shown]
[lldb] Add APSInt representation to formatter bytecode (#220665)
Adopt a single representation for integers in the formatter bytecode
interpreter. This simplifies code generation, where the (now deprecated)
distinction of `uint64_t` and `int64_t` types could make conditionals
and other operations more complicated, by having to have code paths for
signed and unsigned.
Depends on https://github.com/llvm/llvm-project/pull/218801
Assisted-by: claude
[Clang] Enable UBSan for AMDGPU device offload
Summary:
This enables the device UBSan runtime for AMDGPU decides. Primarily this
required modifications to the `addSanitizerRuntime` interface so we can
query the compilation's offload status. Also need to forward it through
the linker wrapper interface. Works on all AMDGPU offload, slight hacks
around the other targets as they do not advertise sanitizer
runtimes properly.
This is linked in via a new `-u __ubsan_device_initialize` hook to pull
in the side library. This is standard behavior and keeps the core logic
mostly unchanged and re-used.