libclc: Update erf (#188569)
This was originally ported from rocm device libs in
c374cb76f467f01a3f60740703f995a0e1f7a89a. Merge in more
recent changes. Also enables vectorization.
[AArch64] Sink NOT to be fold into BIC/ORN/EON (#176194)
Undoes a negation being hoisted out of a loop, so that if can be fold
into an inverted bitwise operation in the loop.
Implements #108840 on AArch64
[DA] Fix overflow of calculation in weakCrossingSIVtest
This patch fixes a correctness issue where integer overflow in the
upper bound calculation of weakCrossingSIVtest caused the pass to
incorrectly prove independence.
The previous logic used `SCEV::getMulExpr` to calculate
`2 * ConstCoeff * UpperBound` and compared it to `Delta` using
`isKnownPredicate`. In the presence of overflow, this could yield
unsafe results.
This change replaces the SCEV arithmetic with `ConstantRange` and
its operation (`smul_fast`). If the calculation overflows,
`intersectWith(MLRange).isEmptySet()` would be false, ensures we
conservatively assume a dependence if the bounds cannot be proven
safe.
Signed-off-by: Ruoyu Qiu <cabbaken at outlook.com>
[DA] Hoist division check for early exit in weakCrossingSIVtest (NFC)
This patch moves the check that `Coeff` divides `Delta` earlier in the
function to enable an early exit. Potentially improve performance.
Signed-off-by: Ruoyu Qiu <cabbaken at outlook.com>
[DA] Consolidate the core logic of the Weak Zero SIV tests (NFCI) (#185577)
There have existed two functions `weakZeroSrcSIVtest` and
`weakZeroDstSIVtest`, which are almost identical, except for some minor
differences (e.g., the Direction to be updated). This patch consolidates
the shared core logic into a single function `weakZeroSIVtestImpl` then
calls it from both `weakZeroSrcSIVtest` and `weakZeroDstSIVtest`,
passing the appropriate parameters to handle the differences. This
reduces code duplication and improves maintainability.
[LLVM-Flang] Add support for -fdebug-info-for-profiling option (#188022)
Added support for option "-fdebug-info-for-profiling" in flang.
- When the option `-fdebug-info-for-profiling` option is passed,
compiler sets the `DebugInfoForProfiling` flag and triggers the
`AddDiscriminatorsPass`. This pass inserts additional debug metadata,
specifically discriminator values into the IR to improve the profiling
precision.
- Additionally `-add-debug-info` pass has been updated to emit an extra
field, `debugInfoForProfiling: true` inside the generated DICompileUnit
metadata node.
[lldb] Protect frame provider construction from re-entrant frame access
When a scripted frame provider calls HandleCommand or other
frame-accessing APIs during __init__, GetStackFrameList() re-enters
without the re-entrancy guard, causing infinite recursion. On Windows
(1MB default stack), this results in a stack overflow (0xC00000FD)
before Python's recursion limit can intervene.
The existing PushProviderFrameList/PopProviderFrameList guard only
protected GetFrameAtIndex calls in FetchFramesUpTo. This wraps the
CreateInstance call in LoadScriptedFrameProvider with the same guard
so that provider construction is also protected.
Signed-off-by: Med Ismail Bennani <ismail at bennani.ma>
Fix lld/wasm/SyntheticSections.cpp after SyntheticSections.h #undef
SyntheticSections.cpp uses LLVM_DEBUG but had no #define DEBUG_TYPE,
relying on the leaked "lld" from SyntheticSections.h. Add an
explicit #define DEBUG_TYPE.
Fix lld/wasm/Relocations.cpp after SyntheticSections.h #undef
Relocations.cpp uses LLVM_DEBUG but had no #define DEBUG_TYPE,
relying on the leaked "lld" from SyntheticSections.h. Add an
explicit #define DEBUG_TYPE.
[RISCV] Add TunePreferAscendingLoadStore for SpacemiT X60 LD/ST fusion (#186967)
Add a tune feature that reverses the callee-saved register spill/restore
order so that addresses are ascending, enabling LD/ST fusion on
processors like SpacemiT X60.
Co-authored-by: LiqinWeng <liqin.weng at spacemit.com>
Co-authored-by: Claude Opus 4.6 <noreply at anthropic.com>
AMDGPU: Make VarIndex a WeakVH in AMDGPUPromoteAlloca (#188662)
The VarIndex might come from (like load) another alloca which maybe
promoted before. The value will replaced in this case. WeakVH correctly
handles this.
Fix DebugInfo.cpp and Instructions.cpp after ConstantsContext.h #undef
Both files were relying on DEBUG_TYPE "ir" leaked from
ConstantsContext.h. Add explicit #define DEBUG_TYPE to each file.
Add #undef PASS_NAME to all files that define it
43 source files define a PASS_NAME macro that is never undefined,
which can leak into subsequent translation units in unity builds.
Add #undef PASS_NAME at the end of each file.
[SparseTensor] Add missing #undef REMUI and DIVUI
LoopEmitter.cpp and SparseTensorIterator.cpp define REMUI and DIVUI
macros but the existing #undef block at the end of each file omits
them. This can leak the macros into subsequent translation units in
unity builds.
[SparseTensor] Add #undef FAILURE_IF_FAILED and ERROR_IF
Both DimLvlMapParser.cpp and LvlTypeParser.cpp define FAILURE_IF_FAILED
and ERROR_IF macros that are never undefined, which can leak into
subsequent translation units in unity builds. Add #undef at the end
of each file.
Add #undef RETURN_IF_ERROR to files that define it
Five files define a RETURN_IF_ERROR macro that is never undefined,
which can leak into subsequent translation units in unity builds.
Add #undef RETURN_IF_ERROR at the end of each file.
[StaticAnalyzer] Add #undef REGISTER_CHECKER to files that define it
Eight StaticAnalyzer checker files define a REGISTER_CHECKER macro
that is never undefined, which can leak into subsequent translation
units in unity builds. Add #undef REGISTER_CHECKER at the end of
each file.
[X86] Add #undef PASS_KEY to files that define it
Five X86 source files define a PASS_KEY macro that is never undefined,
which can leak into subsequent translation units in unity builds. Add
#undef PASS_KEY at the end of each file.
[Support] Add #undef GOODFLAGS to regcomp.c and regexec.c
Both files define a GOODFLAGS macro that is never undefined, which
can leak into subsequent translation units in unity builds. Add
#undef GOODFLAGS at the end of each file.
Add missing #undef DEBUG_TYPE to headers that #define it
Several headers define DEBUG_TYPE but never undefine it before the
closing include guard. This means any translation unit that includes
these headers (directly or transitively) gets the header's DEBUG_TYPE
leaked into its scope, which can silently override or conflict with
the file's own DEBUG_TYPE.
Add the missing #undef DEBUG_TYPE before the final #endif in each
affected header, matching the convention used by the majority of
LLVM/Clang/LLD headers that define DEBUG_TYPE.
Affected headers:
- lld/wasm/SyntheticSections.h
- llvm/include/llvm/CodeGen/GlobalISel/LegalizationArtifactCombiner.h
- llvm/lib/ExecutionEngine/JITLink/COFFLinkGraphBuilder.h
- llvm/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldCOFFI386.h
- llvm/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldCOFFThumb.h
- llvm/lib/IR/ConstantsContext.h
[3 lines not shown]