summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2025-02-19fix scf.for parserusers/matthias-springer/fix_scf_for_parserMatthias Springer
2025-02-17[mlir][affine] make affine-loop-unroll-jam interface pass (#127402)lonely eagle
Made affine-loop-unroll-jam an interface pass, so it can run on the gpu module.
2025-02-17Reapply "[Analyzer][CFG] Correctly handle rebuilt default arg and default ↵yronglin
init expression" (#127338) This PR reapply https://github.com/llvm/llvm-project/pull/117437. The issue has been fixed by the 2nd commit, we need to ignore parens in CXXDefaultArgExpr when build CFG, because CXXDefaultArgExpr::getExpr stripped off the top level FullExpr and ConstantExpr, ParenExpr may occurres in the top level. --------- Signed-off-by: yronglin <yronglin777@gmail.com>
2025-02-16[X86] Avoid repeated map lookups (NFC) (#127374)Kazu Hirata
2025-02-16[TableGen] Avoid repeated hash lookups (NFC) (#127373)Kazu Hirata
2025-02-16[GlobalISel] Avoid repeated hash lookups (NFC) (#127372)Kazu Hirata
2025-02-16[AMDGPU] Avoid repeated hash lookups (NFC) (#127371)Kazu Hirata
2025-02-16[clang-tidy] Avoid repeated hash lookups (NFC) (#127370)Kazu Hirata
2025-02-16[AST] Avoid repeated map lookups (NFC) (#127369)Kazu Hirata
2025-02-16[analyzer] StackAddrEscapeChecker: also check return for child stack frames ↵Michael Flanders
(#126986) Fixes #123459. This changes checking of the returned expr to also look for memory regions whose stack frame context was a child of the current stack frame context, e.g., for cases like this given in #123459: ``` struct S { int *p; }; S f() { S s; { int a = 1; s.p = &a; } return s; } ```
2025-02-16[Flang] LLVM_ENABLE_RUNTIMES=flang-rt (#110217)Michael Kruse
Extract Flang's runtime library to use the LLVM_ENABLE_RUNTIME mechanism. It will only become active when `LLVM_ENABLE_RUNTIMES=flang-rt` is used, which also changes the `FLANG_INCLUDE_RUNTIME` to `OFF` so the old runtime build rules do not conflict. This also means that unless `LLVM_ENABLE_RUNTIMES=flang-rt` is passed, nothing changes with the current build process. Motivation: * Consistency with LLVM's other runtime libraries (compiler-rt, libc, libcxx, openmp offload, ...) * Allows compiling the runtime for multiple targets at once using the LLVM_RUNTIME_TARGETS configuration options * Installs the runtime into the compiler's per-target resource directory so it can be automatically found even when cross-compiling Also see RFC discussion at https://discourse.llvm.org/t/rfc-use-llvm-enable-runtimes-for-flangs-runtime/80826
2025-02-16[InstCombine] Test foldSelectICmpAnd with cast. (NFC)Andreas Jonson
2025-02-16[ARM] Fix MRC cp10 and cp11 warning (#126407)hstk30-hw
The MRC format is MRC GPRwithAPSR:$Rt, p_imm:$cop, imm0_7:$opc1, c_imm:$CRn, c_imm:$CRm, 0, pred:$p The $cop is the second operand. Patch for https://github.com/llvm/llvm-project/commit/b7d41a11cd31388e8b542b2d881f5c9d7130b95e.
2025-02-16[mlir] add some FP classification ops and their lowering to libdevice (#127322)Oleksandr "Alex" Zinenko
Introduce a subset of floating point classification ops to the Math dialect. These ops mirror functions provided by the C math library and, similarly to the existing `math.copysign`, belong to the math dialect. Add a lowering of those ops to Nvidia libdevice calls when possible as the first mechanism to exercise them.
2025-02-16[Clang][NFCI] Fix a logic issue in TransformDesignatedInitExpr (#127211)GS-GOAT
It was clearly a typo regarding whether the array index expression has changed in its transforming. This doesn't appear to be a functional change in practice, so no test case or release note provided. Fixes #126113
2025-02-16[InstCombine] Test foldSelectICmpAnd with extra uses. (NFC)Andreas Jonson
2025-02-16[flang-rt] Fix aarch64-libcxx build failureMichael Kruse
There seems to be multiple declarations of __libcpp_verbose_abort, some with noexcept and some without. Reverting to the previous forward-declaration (without noexcept) which seemes to have worked before.
2025-02-16ConstRange: test edge-cases of makeAllowedICmpRegion (#127080)Ramkumar Ramachandra
Exhaustively test signed-unsigned min-max edge-cases of makeAllowedICmpRegion.
2025-02-16[AMDGPU] NFC: Fix some details for lit test (#127141)Jeffrey Byrnes
Addressed comments in https://github.com/llvm/llvm-project/pull/126976
2025-02-16[Flang][NFC] Move runtime library files to flang-rt (#110298)Michael Kruse
Mostly mechanical changes in preparation of extracting the Flang-RT "subproject" in #110217. This PR intends to only move pre-existing files to the new folder structure, with no behavioral change. Common files (headers, testing, cmake) shared by Flang-RT and Flang remain in `flang/`. Some cosmetic changes and files paths were necessary: * Relative paths to the new path for the source files and `add_subdirectory`. * Add the new location's include directory to `include_directories` * The unittest/Evaluate directory has unitests for flang-rt and Flang. A new `CMakeLists.txt` was introduced for the flang-rt tests. * Change the `#include` paths relative to the include directive * clang-format on the `#include` directives * Since the paths are part if the copyright header and include guards, a script was used to canonicalize those * `test/Runtime` and runtime tests in `test/Driver` are moved, but the lit.cfg.py mechanism to execute the will only be added in #110217.
2025-02-16[InstCombine] Do not keep samesign when speculatively executing icmps (#127007)Yingwei Zheng
Closes https://github.com/llvm/llvm-project/issues/126974.
2025-02-16[X86] Add missing explicit conversion for AMXAVX512 and SHA (#127385)Phoebe Wang
Address the X86 part of #126491
2025-02-16[clang][bytecode] Fix dynamic array allocation return values (#127387)Timm Baeder
We need to return a pointer to the first element, not the array itself.
2025-02-16[clang][bytecode] Add Descriptor::dumpFull (#127386)Timm Baeder
This is useful to print all (or most) of the valid offsets into a block of the given descriptor.
2025-02-16[InstCombine] Test for trunc to i1 in foldSelectICmpAndBinOp. (NFC)Andreas Jonson
2025-02-16[Clang] [NFC] Remove outdated FIXME (#126978)MagentaTreehouse
2025-02-16[libclc] [cmake] Fix per-target *_convert.cl dependencies (#127315)Michał Górny
Fix `add_libclc_builtin_set` to add an appropriate dependency to either `clspv-generate_convert.cl` or `generate_convert.cl` based on the `ARCH` argument, rather than to both unconditionally. This fixes build failures due to missing dependencies when `clspv*` targets are not enabled. The added check mirrors the one from `libclc/CMakeLists.txt`. Fixes: #127378
2025-02-15[libc++] Fix initialization-order-fiasco with iostream.cpp constructors ↵Vitaly Buka
(#126995) Asan reports it after #124103. It's know case of false positive for Asan. https://github.com/google/sanitizers/wiki/AddressSanitizerInitializationOrderFiasco#false-positives It's can be avoided with `constexpr` constructors. In general order global constructors in different modules is undefined. If global constructor uses external global, they can be not constructed yet. However, implementation may contain workaround for that, or the state of non-constructed global can be still valid. Asan will still falsely report such cases, as it has no machinery to detect correctness of such cases. We need to fix/workaround the issue in libc++, as it will affect many libc++ with Asan users.
2025-02-15[libc] Produce standard-compliant header guard macros in hdrgen (#127356)Roland McGrath
Macros starting with alphabetic characters such as "LLVM" are in the application name space and cannot be defined or used by a conforming implementation's headers. This fixes the headers that are entirely generated, and the __llvm-libc-common.h header to use a conforming macro name for the header guard. That is, it starts with "_LLVM_LIBC_" instead of "LLVM_LIBC_", as identifiers starting with an underscore followed by a capital letter are in the name space reserved for the implementation. The remaining headers either will be fixed implicitly by removal of their custom template files, or will need to be fixed by hand.
2025-02-15[SandboxVec][DAG] Add MemDGNode::MemSuccs (#127253)vporpo
This patch adds Memory successors to the memory nodes of the DAG. This will help maintain the memory dependencies when nodes get removed.
2025-02-15[libc] Fill out generated malloc.h and related stdlib.h extensions (#127293)Roland McGrath
This updates the generated stdlib.h and malloc.h headers to include the subsets of extenion functions declared by glibc that are also supported by Scudo and that use only simple types. Scudo's extensions not declared by glibc are omitted. glibc's extensions not implemented by Scudo are omitted. The mallinfo and mallinfo2 functions are omitted (at least for now) since they need struct definitions for their return types.
2025-02-15[mlir] lower min/maxnum to libdevice calls (#127323)Oleksandr "Alex" Zinenko
Introduce lowering from arith.minnum/maxxnum operations to the corresponding Nvidia libdevice calls. This requires to reorder pattern population methods so that the libdevice-targeting patterns are prioritized over default patterns targeting LLVM IR intrinsics from the Arith dialect. The tests are placed into a separate file as the existing gpu-to-nvvm.mlir files has a mode that forces Arith dialect operations to be preserved as is without using a separate FileCheck tag to differentiate. Co-authored-by: William Moses <gh@wsmoses.com>
2025-02-15[PowerPC] Use getSignedTargetConstant in SelectOptimalAddrMode. (#127305)Craig Topper
Fixes #127298.
2025-02-15[VPlan] Create IR basic block for middle.block in VPlan.Florian Hahn
Create a IR BB directly for the middle.block, instead of creating the IR BB during skeleton creation and then replacing the middle VPBB with a VPIRBB. This moves another part of skeleton creation to VPlan and simplififes the code slightly by removing code to disconnect the middle block and vector preheader + the corresponding DT update. NFC modulo IR block naming and block creation order, which changes the IR names for the blocks.
2025-02-15[AArch64] Add extending reduction costs for addlv and dotDavid Green
This adds some basic getExtendedReductionCost and getMulAccReductionCost to account for add reduction (uaddlv/saddlv) and mla reductions with dotprod.
2025-02-15[NFC] Fix warning in recent commitChris Bieneman
2025-02-15[mlir][vector] Document `ConvertVectorStore` + unify var names (nfc) (#126422)Andrzej Warzyński
1. Documents `ConvertVectorStore`. As the generated output is rather complex, I have refined the comments + variable names in: * "vector-emulate-narrow-type-unaligned-non-atomic.mlir", to serve as reference for this pattern. 2. As a follow-on for #123527, renames `isAlignedEmulation` to `isFullyAligned` and `numSrcElemsPerDest` to `emulatedPerContainerElem`.
2025-02-15[mlir] Improve GreedyPatternRewriteDriver logging (#127314)Andrzej Warzyński
Currently, when `GreedyPatternRewriteDriver` fails, the log output contains nested failure messages: ```bash } -> failure : pattern failed to match } -> failure : pattern failed to match ``` This may seem redundant, but these messages refer to different aspects of the pattern application logic. This patch clarifies the distinction by separately logging: * Success/failure for a specific pattern (e.g., "_this pattern_ failed to match on the Op currently being processed"). * Success/failure for an operation as a whole (e.g., "_all patterns_ failed to match the Op currently being processed"). Before (example with success): ```bash Processing operation : (...) { * Pattern (...) -> ()' { Trying to match "..." ** Match Failure : (...) } -> failure : pattern failed to match * Pattern (...) -> ()' { Trying to match "..." } -> success : pattern applied successfully } -> success : pattern matched ``` After (example with success): ```bash Processing operation : (...) { * Pattern (...) -> ()' { Trying to match "..." ** Match Failure : (...) } -> failure : pattern failed to match * Pattern (...) -> ()' { Trying to match "..." } -> success : pattern applied successfully } -> success : at least one pattern matched ``` This improves log clarity, making it easier to distinguish pattern-level failures from operation-level outcomes.
2025-02-15[Flang] Support overriding `LLVM_LIT_ARGS` in standalone builds (#127340)Michał Górny
Declare `LLVM_LIT_ARGS` as a cache variable in standalone builds to permit overriding it. This mirrors the logic used in Clang.
2025-02-15[HLSL] Implement HLSL intialization list support (#123141)Chris B
This PR implements HLSL's initialization list behvaior as specified in the draft language specifcation under [*Decl.Init.Agg*](https://microsoft.github.io/hlsl-specs/specs/hlsl.html#Decl.Init.Agg). This behavior is a bit unusual for C/C++ because intermediate braces in initializer lists are ignored and a whole array of additional conversions occur unintuitively to how initializaiton works in C. The implementaiton in this PR generates a valid C/C++ initialization list AST for the HLSL initializer so that there are no changes required to Clang's CodeGen to support this. This design will also allow us to use Clang's rewrite to convert HLSL initializers to valid C/C++ initializers that are equivalent. It does have the downside that it will generate often redundant accesses during codegen. The IR optimizer is extremely good at eliminating those so this will have no impact on the final executable performance. There is some opportunity for optimizing the initializer list generation that we could consider in subsequent commits. One notable opportunity would be to identify aggregate objects that occur in the same place in both initializers and do not require converison, those aggregates could be initialized as aggregates rather than fully scalarized. Closes #56067 --------- Co-authored-by: Finn Plummer <50529406+inbelic@users.noreply.github.com> Co-authored-by: Helena Kotas <hekotas@microsoft.com> Co-authored-by: Justin Bogner <mail@justinbogner.com>
2025-02-15[libc++] Fixes (|multi)_set spaceship operator. (#127326)Mark de Wever
The operators did not have a _Compare template arguement. The fix updates the generic container test to use allocators for all types used. No other issues were found. Fixes: #127095
2025-02-15[libc++] Move unused basic_string function definition to the dylib sources ↵Nikolas Klauser
(#126219) `__init(const value_type*, size_type, size_type)` is part of our ABI, but we don't actually use the function anymore in the dylib. THis moves the definition to the `src/` directory to make it clear that the code is unused. This also allows us to remove it entirely in the unstable ABI.
2025-02-15[webkit.UncountedLambdaCapturesChecker] Fix a crash in declProtectsThis ↵Ryosuke Niwa
(#127309) Add a missing nullptr check to declProtectsThis.
2025-02-15[LAA] Replace symbolic strides for translated pointers earlier (NFC).Florian Hahn
Move up replaceSymbolicStrideSCEV before isNoWrap. It needs to be called after hasComputableBounds, as this may create an AddRec via PSE, which replaceSymbolicStrideSCEV will look up. This is in preparation for simplifying isNoWrap.
2025-02-15[flang] Revert MLIR_MAIN_SRC_DIR override (#127337)Michał Górny
This change is no longer necessary after #125842. Thanks to @nikic for letting me know.
2025-02-15ConstRange: factor and introduce splitPosNeg (NFC) (#126528)Ramkumar Ramachandra
Factor out some code that splits a ConstantRange into positive and negative components, introducing ConstantRange::splitPosNeg.
2025-02-15[AArch64] Add patterns for addv(sext) and addv(zext)David Green
This adds patterns for v8i8->i16 vaddlv and v4i16->i32 vaddlv, for both signed and unsigned extends.
2025-02-15[LAA] Use getPointer/setPointer in createCheckForAccess (NFC).Florian Hahn
Use getPointer/setPointer to clarify we are accessing/modifying the rurrent value.
2025-02-15[CodeGen] Remove two dead pass initializer decls. NFCMichael Liao
- After #97727 and #101652, `LowerConstantIntrinsics` and `ExpandVectorPredicationPass` are no longer dedicated passes.
2025-02-15[RISCV] Support Zb*/P Shared Instructions (#127160)realqhc
This enables shared instructions between Zb* and Base-P extension. Documentation: https://jhauser.us/RISCV/ext-P/RVP-baseInstrs-014.pdf https://jhauser.us/RISCV/ext-P/RVP-instrEncodings-014.pdf