- Feb 13, 2024
-
-
Craig Topper authored
This reverts commit 7ff5dfba. Causing crashes on Mac build bots.
-
Cyndy Ishida authored
Create a helper method for this operation, so it can be reused in multiple places. Additonally move FileType enum into its own header to avoid include cycles.
-
jkorous-apple authored
Array subscript on a const size array is not bounds-checked. The idiomatic replacement is std::array which is bounds-safe in hardened mode of libc++. This commit extends the fixit-producing machine to consider std::array as a transformation target type and teaches it to handle the array subscript on const size arrays with a trivial (empty) fixit.
-
michaelrj-google authored
Downstream there's a user that intercepts these functions and overlays them. This causes symbol conflicts if neither function is marked weak. In future the intent is to move to this to being a downstream configuration option.
-
michaelrj-google authored
Downstream there's a user that intercepts these functions and overlays them. This causes symbol conflicts if neither function is marked weak. In future the intent is to move to this to being a downstream configuration option.
-
jimingham authored
I get a small but fairly steady stream of crash reports which I can only explain by ValueObjectPrinter trying to access its m_valobj field, and finding it NULL. I have never been able to reproduce any of these, and the reports show a state too long after the fact to know what went wrong. I've read through this section of lldb a bunch of times trying to figure out how this could happen, but haven't ever found anything actually wrong that could cause this. OTOH, ValueObjectPrinter is somewhat sloppy about how it handles the ValueObject it is printing. a) lldb allows you to make a ValueObjectPrinter with a Null incoming ValueObject. However, there's no affordance to set the ValueObject in the Printer after the fact, and it doesn't really make sense to do that. So I change the ValueObjectPrinter API's to take a ValueObject reference, rather than a pointer. All the places that make ValueObjectPrinters already check the non-null status of their ValueObject's before making the ValueObjectPrinter, so sadly, I didn't find the bug, but this will enforce the intent. b) The next step in printing the ValueObject is deciding which of the associated DynamicValue/SyntheticValue we are actually printing (based on the use_dynamic and use_synthetic settings in the original ValueObject. This was put in a pointer by GetMostSpecializedValue, but most of the printer code just accessed the pointer, and it was hard to reason out whether we were guaranteed to always call this before using m_valobj. So far as I could see we always do (sigh, didn't find the bug there either) but this was way too hard to reason about. In fact, we figure out once which ValueObject we're going to print and don't change that through the life of the printer. So I changed this to both set the "most specialized value" in the constructor, and then to always access it through GetMostSpecializedValue(). That makes it easier to reason about the use of this ValueObject as well. This is an NFC change, all it does is make the code easier to reason about.
-
Ryosuke Niwa authored
This PR aligns the evaluation of default arguments with other kinds of arguments by extracting the expressions within them as argument values to be evaluated.
-
Ryosuke Niwa authored
The bug was caused by isRefCountable erroneously returning false for a class with both ref() and deref() functions defined because we were not resetting the base paths results between looking for "ref()" and "deref()"
-
Fangrui Song authored
Similar to d39b4ce3 Using "eabi" or "gnueabi" for aarch64 targets is a common mistake and warned by Clang Driver. We want to avoid them elsewhere as well. Just use the common "aarch64" without other triple components.
-
Ryosuke Niwa authored
This accessor returns a pointer from Ref type and is therefore safe.
-
Craig Topper authored
The reassociation this is trying to repair can happen for integer types too. This patch adds support for integer mul/add to hoistFPAssociation. The function has been renamed to hoistMulAddAssociation. I've used separate statistics and limits for integer to allow tuning flexibility.
-
Ryosuke Niwa authored
-
Amir Ayupov authored
Make core BOLT functionality more friendly to being used as a library instead of in our standalone driver llvm-bolt. To accomplish this, we augment BinaryContext with journaling streams that are to be used by most BOLT code whenever something needs to be logged to the screen. Users of the library can decide if logs should be printed to a file, no file or to the screen, as before. To illustrate this, this patch adds a new option `--log-file` that allows the user to redirect BOLT logging to a file on disk or completely hide it by using `--log-file=/dev/null`. Future BOLT code should now use `BinaryContext::outs()` for printing important messages instead of `llvm::outs()`. A new test log.test enforces this by verifying that no strings are print to screen once the `--log-file` option is used. In previous patches we also added a new BOLTError class to report common and fatal errors, so code shouldn't call exit(1) now. To easily handle problem...
-
Arthur Eubanks authored
The performance of cold functions shouldn't matter too much, so if we care about binary sizes, add an option to mark cold functions as optsize/minsize for binary size, or optnone for compile times [1]. Clang patch will be in a future patch. This is intended to replace `shouldOptimizeForSize(Function&, ...)`. We've seen multiple cases where calls to this expensive function, if not careful, can blow up compile times. I will clean up users of that function in a followup patch. Initial version: https://reviews.llvm.org/D149800 [1] https://discourse.llvm.org/t/rfc-new-feature-proposal-de-optimizing-cold-functions-using-pgo-info/56388
-
Amir Ayupov authored
As part of the effort to refactor old error handling code that would directly call exit(1), in this patch continue the migration on libCore, libRewrite and libPasses to use the new BOLTError class whenever a failure occurs. Test Plan: NFC Co-authored-by:Rafael Auler <rafaelauler@fb.com>
-
Amir Ayupov authored
As part of the effort to refactor old error handling code that would directly call exit(1), in this patch we add a new class BOLTError and auxiliary functions `createFatalBOLTError()` and `createNonFatalBOLTError()` that allow BOLT code to bubble up the problem to the caller by using the Error class as a return type (or Expected). Also changes passes to use these. Co-authored-by:Rafael Auler <rafaelauler@fb.com> Test Plan: NFC
-
Amir Ayupov authored
As part of the effort to refactor old error handling code that would directly call exit(1), in this patch we change the interface to `BinaryFunctionPass` to return an Error on `runOnFunctions()`. This gives passes the ability to report a serious problem to the caller (RewriteInstance class), so the caller may decide how to best handle the exceptional situation. Co-authored-by:Rafael Auler <rafaelauler@fb.com> Test Plan: NFC
-
Karthika Devi C authored
Existing reduction detection algorithm does two types of memory checks before marking a load store pair as reduction. Second check is to verify there is no other memory access in ScopStmt overlapping with the memory of load and store that forms the reduction. Existing check misses cases where there could be probable overlap such as A[V] += A[P]; In the above case there is chance of overlap between A[V] and A[P] which is missed. This commit addresses this by removing the parameter from space before checking for compatible space. Part 1 of this patch : [75297](https://github.com/llvm/llvm-project/pull/75297)
-
Konstantin Zhuravlyov authored
- AMDGPU/NFC: Purge SOPK_ZEXT from TSFlags - Moved to helper function in SIInstInfo - AMDGPU/NFC: Purge VOPAsmPrefer32Bit from TSFlags - This flag did not make sense / remnants of something else I think
-
Arthur Eubanks authored
PR #71709 broke the Linux PIE build with `undefined symbol: alloca` errors. With the newly included `clang/Basic/Builtins.h` in that PR, it surfaces an issue with a combination of two previous patches. 26670dcb added `#undef alloca` so clang builtins handling of alloca would work under MSVC (unsure if this is still necessary). 194b6a3b added code that calls `alloca` to workaround a Linux kernel < 4.1 bug. Given that Linux 4.1 was EOL in 2018, it should be ok to remove this workaround.
-
Mehdi Amini authored
-
Mehdi Amini authored
-
Mehdi Amini authored
-
Mehdi Amini authored
Apply clang-tidy fixes for performance-unnecessary-value-param in BufferizableOpInterfaceImpl.cpp (NFC)
-
Mehdi Amini authored
-
Artem Belevich authored
-
Rishi Surendran authored
Add support for attribute nvvm.grid_constant on LLVM function arguments. The attribute can be attached only to arguments of type llvm.ptr that have llvm.byval attribute. Generate LLVM metadata for functions with nvvm.grid_constant arguments. The metadata node is a list of integers, where each integer n denotes that the nth parameter has the grid_constant annotation (numbering from 1). The generated metadata node will be handled by NVVM compiler. See https://docs.nvidia.com/cuda/nvvm-ir-spec/index.html#supported-properties for documentation on grid_constant property. This patch also adds convertParameterAttr to LLVMTranslationDialectInterface for supporting the translation of derived dialect attributes on function parameters
-
Artem Belevich authored
The replacement should've had BFE() as the arguments for the comparison, not the source register. While at that, tighten the patterns a bit, and expand them to cover variants with immediate arguments. Also change the default lowering of bfe() to use unsigned variant, so the value of the upper bits is predictable.
-
Andy Kaylor authored
This refactors the fast-math handling in the clang driver, moving the settings into a lambda that is shared by the -ffp-model=fast and -ffast-math code. Previously the -ffp-model=fast handler changed the local option variable and fell through to the -ffast-math handler. This refactoring is intended to prepare the way for decoupling the -ffp-model=fast settings from the -ffast-math settings and possibly introduce a less aggressive fp-model.
-
Jordan Rupprecht authored
-
Ben Langmuir authored
Switch the primary implementation of EPC lookupSymbols to be async, keeping a synchronous wrapper for compatibility. Use the new async implementation inside EPCDynamicLibrarySearchGenerator to work working towards a fully async search generator. Provide an asynchronous lookup API for EPCGenericDylibManager and adopt that from the SimpleRemoteEPC. This enables an end-to-end async EPCDynamicLibrarySearchGenerator. Note: currently we keep the current per-dlhandle lookup model, but a future improvement could do a single async call for a given lookup operation.
-
srcarroll authored
This refactored pattern rewrite is intended to be reused by any `LinalgOp`'s canonicalization pattern for removing identity ops. Additionally, this canonicalization has been applied to `BroadCastOp`.
-
Mariusz Borsa authored
Turns out this arch is needed by the ABI impls rdar://121963634 Co-authored-by:
Mariusz Borsa <m_borsa@apple.com>
-
Jonas Hahnfeld authored
As noted in issues #68594 and #73935, `JITLink/RISCV/ELF_ehframe.s` fails with libstdc++'s expensive checks because `getRISCVPCRelHi20` calls `std::equal_range` on the edges which may not be ordered by their offset. Instead let `ELFJITLinker_riscv` build a hashmap of all edges with type `R_RISCV_PCREL_HI20` that can be looked up in constant time. Closes #73935
-
Florian Hahn authored
Row and column arguments for matrix_transpose indicate the shape of the operand. When hoisting the transpose to the result of the add, the add operates on the original operand's shape, and so does the hoisted transpose. This patch also adds an assert that the shape for the original add and the transpose match, as well as the shape of the new add matches the cached shape for it. The assert could potentially be moved to updateShapeAndReplaceAllUsesWith.
-
Konstantin Zhuravlyov authored
-
Vlad Serebrennikov authored
Covers CWG issues [124](https://cplusplus.github.io/CWG/issues/124.html) [185](https://cplusplus.github.io/CWG/issues/185.html), [193](https://cplusplus.github.io/CWG/issues/193.html), [199](https://cplusplus.github.io/CWG/issues/199.html). I also looked at [190](https://cplusplus.github.io/CWG/issues/190.html), but concluded that we should try to test it via C++20 `std::is_layout_compatible` first. I tried to group tests under `dr1xx-codegen.cpp`, but found out that CodeGen can arbitrarily reorder function definitions in LLVM module. In particular, interleaving between regular function definitions and destructor definitions present in the source might not be preserved, which messes up FileCheck directives. `CHECK-DAG` can help with that, but its interaction with `CHECK-LABEL` (lack of thereof) would require me to relax tests too much.
-
Alexey Bataev authored
The mask for the reshuffling/resizing might be calculated incorrectly, fixed.
-
Fangrui Song authored
-
Mirko Brkušanin authored
-