aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2024-03-19Fix formatting issues found by code formatting check in build.myfork/mainDave Pagan3-10/+10
2024-03-19Moved check for whether a 'target teams loop' construct can potentiallyDave Pagan10-85/+101
be considered equivalent to 'target teams distribute parallel for' from CodeGen to Sema.
2024-03-19Compile debug output for 'teams loop' codegen type under NDEBUG.Dave Pagan1-0/+2
2024-03-19A few minor LIT test CHECK updates (auto-generated).Dave Pagan1-1/+1
2024-03-19Fix formatting issues found by code formatting check.Dave Pagan3-11/+9
2024-03-19[OpenMP][CodeGen] Improved codegen for combined loop directivesDave Pagan18-6863/+5840
IR for 'target teams loop' is now dependent on suitability of associated loop-nest. If a loop-nest: - does not contain a function call, or - the -fopenmp-assume-no-nested-parallelism has been specified, - or the call is to an OpenMP API AND - does not contain nested loop bind(parallel) directives then it can be emitted as 'target teams distribute parallel for', which is the current default. Otherwise, it is emitted as 'target teams distribute'. Added debug output indicating how 'target teams loop' was emitted. Flag is -mllvm -debug-only=target-teams-loop-codegen Added LIT tests explicitly verifying 'target teams loop' emitted as a parallel loop and a distribute loop. Updated other 'loop' related tests as needed to reflect change in IR.
2024-03-18[MLIR] Remove unused implicit capture in the lambda (NFC)Mehdi Amini1-1/+1
This lambda does not capture anything, the `&` is just misleading.
2024-03-18[ELF] Improve --pack-dyn-relocs tests for Android and RELRFangrui Song2-129/+118
2024-03-18Add missing includes (to fix the modules build)Adrian Prantl1-0/+4
2024-03-18[lldb][nfc] Factor out repeated code in DWIM Print (#85669)Felipe de Azevedo Piovezan1-21/+17
The code that prints ValueObjects is duplicated across two different cases of the dwim-print command, and a subsequent commit will add a third case. As such, this commit factors out the common code into a lambda. A free function was considered, but there is too much function-local context required in that. We also reword some of the comments so that they stop counting cases, making it easier to add other cases later.
2024-03-18[SystemZ] Don't lower ATOMIC_LOAD/STORE to LOAD/STORE (#75879)Jonas Paulsson22-318/+1293
- Instead of lowering float/double ISD::ATOMIC_LOAD / ISD::ATOMIC_STORE nodes to regular LOAD/STORE nodes, make them legal and select those nodes properly instead. This avoids exposing them to the DAGCombiner. - AtomicExpand pass no longer casts float/double atomic load/stores to integer (FP128 is still casted).
2024-03-18[libc] Remove direct math.h includes (#85324)Michael Jones129-149/+166
Reland of #84991 A downstream overlay mode user ran into issues with the isnan macro not working in our sources with a specific libc configuration. This patch replaces the last direct includes of math.h with our internal math_macros.h, along with the necessary build system changes.
2024-03-18[flang] Fix crash on erroneous program (#85615) (#85659)Peter Klausler1-13/+12
Replace a pointer that should never be null with a reference argument so that it's always defined. Fixes https://github.com/llvm/llvm-project/issues/85615.
2024-03-18[flang] Catch inappropriate attributes for PARAMETERs (#85588)Peter Klausler2-0/+19
There's several symbol attributes that cannot be applied to named constants, but that weren't being checked.
2024-03-18[flang][runtime] Round hex REAL input correctly with excess digits (#85587)Peter Klausler2-29/+50
Excess hexadecimal digits were too significant for rounding purposes, leading to inappropriate rounding away from zero for some modes.
2024-03-18[flang] Fix SCALE() folding with big scale factors (#85576)Peter Klausler2-9/+23
The folding of the SCALE() intrinsic function is implemented via multiplication by a power of two; this simplifies handling of exceptional cases. But sometimes scaling by a power of two requires an exponent larger or smaller than a floating-point format can represent, and two multiplications are required.
2024-03-18[flang] Reduce recursion in common::visit (#85483)Peter Klausler1-22/+16
This patch yields small speed-ups in compiler build and execution times, but more importantly, reduces the stack depth needed in a build environment where tail call optimization does not appear to occur.
2024-03-18[ELF] Change getSymbolIndex to use const reference. NFCFangrui Song4-10/+10
2024-03-18[CodeGen] More uses of LocationSize::beforeOrAfterPointer().David Green3-8/+4
As an extension to #84751, this adds some extra uses of beforeOrAfterPointer() instead of UnknownSize.
2024-03-18[InstSimply] Simplify `(fmul -x, +/-0)` -> `-/+0`Noah Goldstein2-9/+11
We already handle the `+x` case, and noticed it was missing in the bug affecting #82555 Proofs: https://alive2.llvm.org/ce/z/WUSvmV Closes #85345
2024-03-18[InstSimply] Add tests for simplify `(fmul -x, +/-0)`; NFCNoah Goldstein1-0/+47
2024-03-18[CodeExtractor] Terminate callsite blocks to new `noreturn` functions with ↵Noah Goldstein11-39/+45
`unreachable` Since some of the users of `CodeExtractor` like `HotColdSplitting` run late in the pipeline, returns are not cleaned to `unreachable`. So, just emit `unreachable` directly if the function is `noreturn`. Closes #84682
2024-03-18[docs] Prefer --gcc-install-dir= to deprecated GCC_INSTALL_PREFIX (#85458)Fangrui Song2-10/+14
Setting GCC_INSTALL_PREFIX leads to a warning (#77537). Link: https://discourse.llvm.org/t/add-gcc-install-dir-deprecate-gcc-toolchain-and-remove-gcc-install-prefix/65091 Link: https://discourse.llvm.org/t/correct-cmake-parameters-for-building-clang-and-lld-for-riscv/72833
2024-03-18[libc] Remove fileno from GPU entrypointsJoseph Huber1-1/+0
2024-03-18Revert "[RemoveDIs] Enable direct-to-bitcode writing by default"Orlando Cazalet-Hyams1-1/+1
This reverts commit e419084da7a00b269368aeb95698e0d36b24e8ec. Likely cause of buildbot failure: https://lab.llvm.org/buildbot/#/builders/179/builds/9629
2024-03-18[VPlan] Store VPlan directly in VPRecipeBuilder (NFCI).Florian Hahn2-84/+83
Instead of passing VPlan in a number of places, just store it directly in VPRecipeBuilder. A single instance is only used for a single VPlan. This simplifies the code and was suggested by @nikolaypanchenko in https://github.com/llvm/llvm-project/pull/84464.
2024-03-18[OpenMP] Add OpenMP extension API to dump mapping tables (#85381)nicebert8-18/+87
This adds an API call ompx_dump_mapping_tables. This allows users to debug the mapping tables and can be especially useful for unified shared memory applications to check if the code behaves in the way it should. The implementation reuses code already present to dump mapping tables (in a debug setting). --------- Co-authored-by: Joseph Huber <huberjn@outlook.com>
2024-03-18[lld] Fix warningsKazu Hirata1-0/+2
This patch fixes: lld/MachO/ObjC.cpp:633:12: error: unused variable 'expectedListSize' [-Werror,-Wunused-variable] lld/MachO/ObjC.cpp:1034:12: error: unused variable 'newCatDef' [-Werror,-Wunused-variable]
2024-03-18[mlir][nvgpu] Support strided memref when creating TMA descriptor (#85652)Guray Ozen2-24/+173
2024-03-18[LICM] Drop nsw/nuw flags on affected instructions in ↵Craig Topper2-16/+57
hoistMulAddAssociation. (#85486) Since we are introducing new multiplies earlier in the arithmetic, the nsw/nuw flags on later instructions are no longer accurate. Fixes #85457.
2024-03-18[cmake] Disable FatLTO in clang build for Fuchsia (#85677)Paul Kirth1-1/+1
We're seeing an issue on Macs, which shouldn't be using this config, so we will temporarily disable this while we investigate.
2024-03-18[flang][NFC] Fix include style (#85655)Valentin Clement (バレンタイン クレメン)1-1/+1
2024-03-18[RISCV] Add IMinMax sched resources to P600SchedModelMichael Maitland1-0/+2
CI checks were passing in #84962 (c48d8182f172ac24244d5fb038b7ab983f67def4) but that commit caused failures once merged due to ships passing since the PR was not rebased on #85131. This commit fixes this problem by adding sched resources for integer min max instructions from Zbb in P600 model.
2024-03-18[RISCV] Add SiFiveP600Model SchedModel that is used by sifive-p670 (#84962)Michael Maitland3-1/+1024
This PR includes an initial scheduler model shows improvement on multiple workloads over NoSchedModel and SiFive7Model for sifive-p670. We plan on making significant changes to this model in the future so that it is more accurate. This patch would close https://github.com/llvm/llvm-project/pull/80612.
2024-03-18[libc] fix up fileno tests (#85660)Nick Desaulniers5-0/+5
Fixes #85628
2024-03-18[SLP][NFC]Add a test with minbitwidth operand, but not a user.Alexey Bataev1-0/+49
2024-03-18[IR][NFC] Suppress warnings in ternary operatorsFraser Cormack1-11/+15
Just doing this the same way as in AMDGPUPromoteAlloca.cpp
2024-03-18Reland "[compiler-rt] Avoid generating coredumps when piped to a tool"Alex Richardson2-2/+24
Updated the corelimit.cpp test to handle buildbots with RLIMIT_CORE rlim_max already set to zero. Original commit message: I was trying to debug why `ninja check-compiler-rt` was taking so long to run on my system and after some debugging it turned out that most of the time was being spent generating core dumps. On many current Linux systems, coredumps are no longer dumped in the CWD but instead piped to a utility such as systemd-coredumpd that stores them in a deterministic location. This can be done by setting the kernel.core_pattern sysctl to start with a '|'. However, when using such a setup the kernel ignores a coredump limit of 0 (since there is no file being written) and we can end up piping many gigabytes of data to systemd-coredumpd which causes the test suite to freeze for a long time. While most piped coredump handlers do respect the crashing processes' RLIMIT_CORE, this is notable not the case for Debian's systemd-coredump due to a local patch that changes sysctl.d/50-coredump.conf to ignore the specified limit and instead use RLIM_INFINITY (https://salsa.debian.org/systemd-team/systemd/-/commit/64599ffe44f0d). Fortunately there is a workaround: the kernel recognizes the magic value of 1 for RLIMIT_CORE to disable coredumps when piping. One byte is also too small to generate any coredump, so it effectively behaves as if we had set the value to zero. The alternative to using RLIMIT_CORE=1 would be to use prctl() with the PR_SET_DUMPABLE flag, however that also prevents ptrace(), so makes it impossible to attach a debugger. Fixes: https://github.com/llvm/llvm-project/issues/45797 This reverts commit 0b9f19a9880eb786871194af116f223d2ad30c52.
2024-03-18[Clang] Fix preprocessing device only in HIP modeJoseph Huber1-1/+2
Summary: A recent change made the HIP compilation bundle by default. However we don't want to do this for `-E`, which silently broke some handling.
2024-03-18[lld-macho] Implement ObjC category merging (-objc_category_merging) (#82928)alx327-8/+1862
This change adds a flag to lld to enable category merging for MachoO + ObjC. It adds the '-objc_category_merging' flag for enabling this option and uses the existing '-no_objc_category_merging' flag for disabling it. In ld64, this optimization is enabled by default, but in lld, for now, we require explicitly passing the '-objc_category_merging' flag in order to enable it. Behavior: if in the same link unit, multiple categories are extending the same class, then they get merged into a single category. Ex: `Cat1(method1+method2,protocol1) + Cat2(method3+method4,protocol2, property1) = Cat1_2(method1+method2+method3+method4, protocol1+protocol2, property1)` Notes on implementation decisions made in this diff: 1. There is a possibility to further improve the current implementation by directly merging the category data into the base class (if the base class is present in the link unit) - this improvement may be done as a follow-up. This improved functionality is already present in ld64. 2. We do the merging on the raw inputSections - after dead-stripping (categories can't be dead stripped anyway). 3. The changes are mostly self-contained to ObjC.cpp, except for adding a new flag (linkerOptimizeReason) to ConcatInputSection and StringPiece to mark that this data has been optimized away. Another way to do it would have been to just mark the pieces as not 'live' but this would cause the old symbols to show up in the linker map as being dead-stripped - even if dead-stripping is disabled. This flag allows us to match the ld64 behavior. --------- Co-authored-by: Alex B <alexborcan@meta.com>
2024-03-18[AArch64][GlobalISel] Legalize small G_TRUNC (#85625)David Green6-42/+80
This is an alternative to #85610, that moreElement's small G_TRUNC vectors to widen the vectors. It needs to disable one of the existing Unmerge(Trunc(..)) combines, and some of the code is not as optimal as it could be. I believe with some extra optimizations it could look better (I was thinking combining trunc(buildvector) -> buildvector and possibly improving buildvector lowering by generating insert_vector_element earlier).
2024-03-18 [clang][analyzer] Improve BlockInCriticalSectionsChecker (#80029)Endre Fülöp2-146/+510
* Add support for multiple, potentially overlapping critical sections: The checker can now simultaneously handle several mutex's critical sections without confusing them. * Implement the handling of recursive mutexes: By identifying the lock events, recursive mutexes are now supported. A lock event is a pair of a lock expression, and the SVal of the mutex that it locks, so even multiple locks of the same mutex (and even by the same expression) is now supported. * Refine the note tags generated by the checker: The note tags now correctly show just for mutexes that are active at the point of error, and multiple acquisitions of the same mutex are also noted.
2024-03-18[InstCombine] Add tests for selects with same conditions (NFC)zhongyunde 004434071-0/+56
2024-03-18Revert "[MLIR][XeGPU] Adding XeGPU 2d block operators (#84692)" (#85653)Balaji V. Iyer8-767/+12
This reverts commit daebe5c4f27ba140ac8d13abf41e3fe4db72b91a. This commit causes the following asan issue: ``` <snip>/llvm-project/build/bin/mlir-opt <snip>/llvm-project/mlir/test/Dialect/XeGPU/XeGPUOps.mlir | <snip>/llvm-project/build/bin/FileCheck <snip>/llvm-project/mlir/test/Dialect/XeGPU/XeGPUOps.mlir # executed command: <snip>/llvm-project/build/bin/mlir-opt <snip>/llvm-project/mlir/test/Dialect/XeGPU/XeGPUOps.mlir # .---command stderr------------ # | ================================================================= # | ==2772558==ERROR: AddressSanitizer: stack-use-after-return on address 0x7fd2c2c42b90 at pc 0x55e406d54614 bp 0x7ffc810e4070 sp 0x7ffc810e4068 # | READ of size 8 at 0x7fd2c2c42b90 thread T0 # | #0 0x55e406d54613 in operator()<long int const*> /usr/include/c++/13/bits/predefined_ops.h:318 # | #1 0x55e406d54613 in __count_if<long int const*, __gnu_cxx::__ops::_Iter_pred<mlir::verifyListOfOperandsOrIntegers(Operation*, llvm::StringRef, unsigned int, llvm::ArrayRef<long int>, ValueRange)::<lambda(int64_t)> > > /usr/include/c++/13/bits/stl_algobase.h:2125 # | #2 0x55e406d54613 in count_if<long int const*, mlir::verifyListOfOperandsOrIntegers(Operation*, ... ```
2024-03-18[libc] Implement fileno (#85628)Shourya Goel6-0/+66
fixes: #85150
2024-03-18Revert "[libc++][CMake] Removes LIBCXX_ENABLE_CLANG_TIDY. (#85262)"Mark de Wever6-19/+28
This reverts commit 4109b18ee5de1346c2b89a5c89b86bae5c8631d3. It looks like the automatic detection has false positives. This broke the following build https://github.com/llvm/llvm-project/pull/85262
2024-03-18[mlir][OpInterfacesGen][NFC] Add newline after traits declaration (#85633)Andrei Golubev1-1/+1
Slightly improve the readability of the tablegen-generated code. Co-authored-by: Orest Chura <orest.chura@intel.com>
2024-03-18[clang-tidy]bugprone-unused-return-value ignore `++` and `--` operator ↵Congcong Cai2-29/+57
overloading (#84922) Fixes: #84705 Further fix for #84489
2024-03-18[clang-tidy][NFC] Remove unnecessary nullptr check on cast subexpr (#85473)Mike Rice1-2/+1
The value of SubExpr is not null since getSubExpr would assert in that case. Remove the nullptr check. This avoids confusion since SubExpr is used without check later in the function.
2024-03-18[libc] Add `shm_open/shm_unlink` (#84974)Schrodinger ZHU Yifan17-3/+435