- Jun 13, 2024
-
-
Florian Mayer authored
Created using spr 1.3.4
-
Florian Mayer authored
Created using spr 1.3.4
-
Florian Mayer authored
Created using spr 1.3.4
-
Florian Mayer authored
Created using spr 1.3.4
-
Florian Mayer authored
Created using spr 1.3.4
-
Vitaly Buka authored
Revert "
✨ [Sema, Lex, Parse] Preprocessor embed in C and C++ (and Obj-C and Obj-C++ by-proxy)" (#95299) Reverts llvm/llvm-project#68620 Introduce or expose a memory leak and UB, see llvm/llvm-project#68620 -
Paul Kirth authored
…f weights" #95136 Reverts #95060, and relands #86609, with the unintended code generation changes addressed. This patch implements the changes to LLVM IR discussed in https://discourse.llvm.org/t/rfc-update-branch-weights-metadata-to-allow-tracking-branch-weight-origins/75032 In this patch, we add an optional field to MD_prof meatdata nodes for branch weights, which can be used to distinguish weights added from llvm.expect* intrinsics from those added via other methods, e.g. from profiles or inserted by the compiler. One of the major motivations, is for use with MisExpect diagnostics, which need to know if branch_weight metadata originates from an llvm.expect intrinsic. Without that information, we end up checking branch weights multiple times in the case if ThinLTO + SampleProfiling, leading to some inaccuracy in how we report MisExpect related diagnostics to users. Since we change the format of MD_prof metadata in a fundamental way, we need to update code handling branch weights in a number of places. We also update the lang ref for branch weights to reflect the change.
-
Louis Dionne authored
They were always intended to be in that namespace but I was trying to keep changes orthogonal.
-
Jay Foad authored
Implement MVT::getVectorElementType and MVT::getVectorMinNumElements with table lookup instead of switch. This speeds up "check-llvm-codegen-amdgpu" by about 7% in my Release build.
-
Simon Pilgrim authored
As we allow these nodes to be created pre-legalization, we can't rely on them having a simple VT Fixes #95278
-
Simon Pilgrim authored
-
Kazu Hirata authored
This patch changes the type of ValueData to std::vector<InstrProfValueData> so that, in a follow-up patch, we can teach getValueForSite to return ArrayRef<InstrProfValueData>. Currently, a typical traversal over the value data looks like: uint32_t NV = Func.getNumValueDataForSite(VK, I); std::unique_ptr<InstrProfValueData[]> VD = Func.getValueForSite(VK, I); for (uint32_t V = 0; V < NV; V++) Do something with VD[V].Value and/or VD[V].Count; Note that we need to call getNumValueDataForSite and getValueForSite separately. If getValueForSite returns ArrayRef<InstrProfValueData> in the future, then we'll be able to do something like: for (const auto &V : Func.getValueForSite(VK, I)) Do something with V.Value and/or V.Count; If ArrayRef<InstrProfValueData> directly points to ValueData, then getValueForSite won't need to allocate memory with std::make_unique. Now, switching to std::vector requires us to update several places: - sortByTargetValues switches to llvm::sort because we don't need to worry about sort stability. - sortByCount retains sort stability because std::list::sort also performs stable sort. - merge builds another array and move it back to ValueData to avoid a potential quadratic behavior with std::vector::insert into the middle of a vector. -
Pierre d'Herbemont authored
Support `guarded_by` attribute and related attributes inside C structs and support late parsing them (#94216) This fixes #20777. Previously the `guarded_by`, `pt_guarded_by`, `acquired_after`, and `acquired_before` attributes were only supported inside C++ classes or top level C/C++ declaration. This patch allows these attributes to be added to struct members in C. These attributes have also now support experimental late parsing. This is off by default but can be enabled by passing `-fexperimental-late-parse-attributes`. This is useful for referring to a struct member after the annotated member. E.g. ``` struct Example { int a_value_defined_before __attribute__ ((guarded_by(a_mutex))); struct Mutex *a_mutex; }; ``` Patch by Pierre d'Herbemont (@pdherbemont) -
Iman Hosseini authored
* Add reductionOperands and reductionAttrs to cuf's KernelOp. * Parsing is already working and the tree has the info: here I make the Bridge emit the updated KernelOp with reduction information added. * Check |reductionAttrs| = |reductionOperands| in verifier * Add a test @clementval @vzakhari --------- Co-authored-by:
Iman Hosseini <imanh@nvidia.com> Co-authored-by:
Valentin Clement (バレンタイン クレメン) <clementval@gmail.com>
-
Simon Pilgrim authored
Fixes #95271
-
Peiming Liu authored
**DO NOT MERGE** until https://github.com/llvm/llvm-project/pull/89003
-
Craig Topper authored
-
LLVM GN Syncbot authored
-
Kazu Hirata authored
getValueForSite computes the total count -- the total number of times a given value site is visited. The problem is that, excluding tests, annotateValueSite is the only place that needs the total count. This patch moves the total count computation to annotateValueSite.
-
Simon Pilgrim authored
Now we have promotion support we should be able to remove the next-power-of-2 code entirely, but this is good enough for now.
-
Simon Pilgrim authored
-
Peter Klausler authored
…e produced by keyword macro replacement When later initial keyword macro replacement will yield a line that is not Fortran source, don't interpret "&" as a Fortran source line continuation marker during tokenization of the line. Fixes https://github.com/llvm/llvm-project/issues/82579.
-
Ramkumar Ramachandra authored
Change: remove guards on debug-printing, to allow Release builds without LLVM_ENABLE_DUMP to pass. MPInt is an arbitrary-precision integer library that builds on top of APInt, and has a fast-path when the number fits within 64 bits. It was originally written for the Presburger library in MLIR, but seems useful to the LLVM project in general, independently of the Presburger library or MLIR. Hence, move it into LLVM/ADT under the name DynamicAPInt. This patch is part of a project to move the Presburger library into LLVM.
-
Mark de Wever authored
The feature has been implemented in LLVM 18 as an experimental feature. This marks the paper as complete and sets the feature-test macro. Implements - P2465R3 Standard Library Modules std and std.compat Fixes: https://github.com/llvm/llvm-project/issues/89579
-
Mark de Wever authored
The paper P0768R1 Library Support for the Spaceship (Comparison) Operator did not add a feature-test macro. This omission has been corrected in P1353R0 Missing Feature Test Macros This enables the FTM for P0768R1 Fixes: https://github.com/llvm/llvm-project/issues/73953 --------- Co-authored-by:
S. B. Tam <cpplearner@outlook.com>
-
Michael Jones authored
In #94685 I discussed my ideas for cleaner baremetal output writing. This patch is not that. This patch just uses `write_to_stderr` for outputting from putchar and printf on baremetal. I'm still planning to create a proper design for writing to stdout and stderr on various platforms, but that will be a followup patch.
-
LLVM GN Syncbot authored
-
Felipe de Azevedo Piovezan authored
This is a fixup to https://github.com/llvm/llvm-project/pull/93808, which used LDFLAGS instead of the correct LD_EXTRAS
-
Louis Dionne authored
-
Louis Dionne authored
-
Louis Dionne authored
The experimental PSTL's current dispatching mechanism was designed with flexibility in mind. However, while reviewing the in-progress OpenMP backend, I realized that the dispatching mechanism based on ADL and default definitions in the frontend had several downsides. To name a few: 1. The dispatching of an algorithm to the back-end and its default implementation is bundled together via `_LIBCPP_PSTL_CUSTOMIZATION_POINT`. This makes the dispatching really confusing and leads to annoyances such as variable shadowing and weird lambda captures in the front-end. 2. The distinction between back-end functions and front-end algorithms is not as clear as it could be, which led us to call one where we meant the other in a few cases. This is bad due to the exception requirements of the PSTL: calling a front-end algorithm inside the implementation of a back-end is incorrect for exception-safety. 3. There are two levels of back-end dispatching in the PSTL, which treat CPU backends as a special case. This was confusing and not as flexible as we'd like. For example, there was no straightforward way to dispatch all uses of `unseq` to a specific back-end from the OpenMP backend, or for CPU backends to fall back on each other. This patch rewrites the backend dispatching mechanism to solve these problems, but doesn't touch any of the actual implementation of algorithms. Specifically, this rewrite has the following characteristics: - There is a single level of backend dispatching, however partial backends can be stacked to provide a full implementation of the PSTL. The two-level dispatching that was used for CPU-based backends is handled by providing CPU-based basis operations as simple helpers that can easily be reused when defining any PSTL backend. - The default definitions for algorithms are separated from their dispatching logic. - The front-end is thus simplified a whole lot and made very consistent for all algorithms, which makes it easier to audit the front-end for things like exception-correctness, appropriate forwarding, etc. Fixes #70718
-
Rodrigo Salazar authored
3 error_code related cleanups/corrections in the std::filesystem operations functions. 1. In `__copy`, the `ec->clear()` is unnecessary as `ErrorHandler` at the start of each function clears the error_code as part of its initialization. 2. In `__copy`, in the recursive codepath we are not checking the error_code result of `it.increment(m_ec2)` immediately after use in the for loop condition (and we aren't checking it after the final increment when we don't enter the loop). 3. In `__weakly_canonical`, it makes calls to `__canonical` (which internally uses OS APIs implementing POSIX `realpath`) and we are not checking the error code result from the `__canonical` call. Both `weakly_canonical` and `canonical` are supposed to set the error_code when underlying OS APIs result in an error (https://eel.is/c++draft/fs.err.report#3.1). With this change we propagate up the error_code from `__canonical` caused by any underlying OS API failure up to the `__weakly_canonical`. Essentially, if `__canonical` thinks an error code should be set, then `__weakly_canonical` must as well. Before this change it would be throwing an exception in the non-error_code form of the function when `__canonical` fails, while not setting the error code in the error_code form of the function (an inconsistency). Added a little coverage in weakly_canonical.pass.cpp for the error_code forms of the API that was missing. Though I am lacking utilities in libcxx testing to add granular testing of the failure scenarios (like forcing realpath to fail for a given path, as it could if you had something like a flaky remote filesystem).
-
Martin Storsjö authored
Pick the latest version available in Chocolatey (18.1.6) and llvm-mingw (20240606, which includes LLVM 18.1.7). Also add the flag "--allow-downgrade" when installing a specific version of LLVM. If the preinstalled version is higher than the requested one, Chocolatey would otherwise error out when requesting installing a lower version. This will avoid errors in the future, if the runner image comes preinstalled with a newer version of LLVM. (This currently seems to happen with a recent version of the GitHub Actions runner image, version 20240610.1.0 has LLVM 18.1.6 already preinstalled, and will error out when trying to install the 17.0.6 version that we previously requested.)
-
Simon Pilgrim authored
-
- Jun 12, 2024
-
-
Jay Foad authored
These tests do not require bash. Skip them because they use features not available on Windows. This is a follow up to #94595.
-
Akira Hatanaka authored
Prior to 84780af4, the class didn't have any information about whether the saved value was volatile. This is NFC as far as I can tell.
-
Simon Pilgrim authored
-
Simon Pilgrim authored
-
Martin Storsjö authored
Nothing uses wget - only curl is used, and that's available out of the box.
-
Andrzej Warzyński authored
Restrict `DropInnerMostUnitDimsTransferRead` so that it fails when one of the indices to be dropped could be != 0, e.g. ```mlir func.func @negative_example(%A: memref<16x1xf32>, %i:index, %j:index) -> (vector<8x1xf32>) { %f0 = arith.constant 0.0 : f32 %1 = vector.transfer_read %A[%i, %j], %f0 : memref<16x1xf32>, vector<8x1xf32> return %1 : vector<8x1xf32> } ``` This is an edge case that could represent an out-of-bounds access, though that will depend on the actual value of `%j`. Importantly, _without this change_ it would be transformed as follows: ```mlir func.func @negative_example(%arg0: memref<16x1xf32>, %arg1: index, %arg2: index) -> vector<8x1xf32> { %cst = arith.constant 0.000000e+00 : f32 %subview = memref.subview %arg0[0, 0] [16, 1] [1, 1] : memref<16x1xf32> to memref<16xf32, strided<[1]>> %0 = vector.transfer_read %subview[%arg1], %cst : memref<16xf32, strided<[1]>>, vector<8xf32> %1 = vector.shape_cast %0 : vector<8xf32> to vector<8x1xf32> return %1 : vector<8x1xf32> } ``` This is incorrect - `%arg2` is ignored. Hence the extra restriction to avoid such cases. NOTE: This PR is limited to tests for `vector.transfer_read`.
-