- Nov 22, 2022
-
-
KAWASHIMA Takahiro authored
Sphinx has the `option` directive. Most option descriptions in `clang/docs/UsersManual.rst` used it but some didn't. This commit changes the remaining option descriptions to use the `option` directive. This makes a consistent view in HTML. The `option` directive automatically creates a cross-reference target. So labeling by `.. _opt_XXX:` is almost unnecessary. However, options with and without `no-` (e.g. `-fno-show-column`/`-fshow-column`) cannot be distinguish for the cross-reference. So some required `.. _opt_XXX:` directives are kept unremoved. Differential Revision: https://reviews.llvm.org/D138088
-
Vitaly Buka authored
-
Peiming Liu authored
Reviewed By: aartbik Differential Revision: https://reviews.llvm.org/D138169
-
Christopher Di Bella authored
This makes it possible for programmers to run IWYU and get more accurate standard library inclusions. Prior to this commit, the following program would be transformed thusly: ```cpp // Before #include <algorithm> #include <vector> void f() { auto v = std::vector{0, 1}; std::find(std::ranges::begin(v), std::ranges::end(v), 0); } ``` ```cpp // After #include <__algorithm/find.h> #include <__ranges/access.h> #include <vector> ... ``` There are two ways to fix this issue: to use [comment pragmas](https://github.com/include-what-you-use/include-what-you-use/blob/master/docs/IWYUPragmas.md) on every private include, or to write a canonical [mapping file](https://github.com/include-what-you-use/include-what-you-use/blob/master/docs/IWYUMappings.md) that provides the tool with a manual on how libc++ is laid out. Due to the complexity of libc++, this commit opts for the latter, to maximise correctness and minimise developer burden. To mimimise developer updates to the file, it makes use of wildcards that match everything within listed subdirectories. A script has also been added to ensure that the mapping is always fresh in CI, and makes the process a single step. Finally, documentation has been added to inform users that IWYU is supported, and what they need to do in order to leverage the mapping file. Closes #56937. Differential Revision: https://reviews.llvm.org/D138189 -
Kazu Hirata authored
The last use of emitCalleeSavedFrameMoves was removed on March 24, 2022 in commit 50a97aac. Differential Revision: https://reviews.llvm.org/D138388
-
Evgenii Stepanov authored
Mysterious failures on the x86_64-linux-qemu, to be debugged. This reverts commit 1dd54691.
-
Aart Bik authored
Reviewed By: Peiming Differential Revision: https://reviews.llvm.org/D138343
-
Nico Weber authored
Adds build files for libraries, tools, and tests -- everything except the runtime. Doesn't hook up bolt in the main BUILD.gn file yet -- I want to verify that it builds on Linux, macOS, Windows before doing that. (I've only checked on macOS so far.) `ninja check-bolt` passes on macOS with this. (I locally bumped the deployment target to macOS 10.12 for that. bolt/ uses std::mutex quite a bit, which requires 10.12.) Differential Revision: https://reviews.llvm.org/D138355
-
Advenam Tacet authored
This revision is a part of a series of patches extending AddressSanitizer C++ container overflow detection capabilities by adding annotations, similar to those existing in std::vector, to std::string and std::deque collections. These changes allow ASan to detect cases when the instrumented program accesses memory which is internally allocated by the collection but is still not in-use (accesses before or after the stored elements for std::deque, or between the size and capacity bounds for std::string). The motivation for the research and those changes was a bug, found by Trail of Bits, in a real code where an out-of-bounds read could happen as two strings were compared via a std::equals function that took iter1_begin, iter1_end, iter2_begin iterators (with a custom comparison function). When object iter1 was longer than iter2, read out-of-bounds on iter2 could happen. Container sanitization would detect it. This revision adds a new compiler-rt ASan sanitization API function sanitizer_annotate_double_ended_contiguous_container necessary to sanitize/annotate double ended contiguous containers. Note that that function annotates a single contiguous memory buffer (for example the std::deque's internal chunk). Such containers have the beginning of allocated memory block, beginning of the container in-use data, end of the container's in-use data and the end of the allocated memory block. This also adds a new API function to verify if a double ended contiguous container is correctly annotated (__sanitizer_verify_double_ended_contiguous_container). Since we do not modify the ASan's shadow memory encoding values, the capability of sanitizing/annotating a prefix of the internal contiguous memory buffer is limited – up to SHADOW_GRANULARITY-1 bytes may not be poisoned before the container's in-use data. This can cause false negatives (situations when ASan will not detect memory corruption in those areas). On the other hand, API function interfaces are designed to work even if this caveat would not exist. Therefore implementations using those functions will poison every byte correctly, if only ASan (and compiler-rt) is extended to support it. In other words, if ASan was modified to support annotating/poisoning of objects lying on addresses unaligned to SHADOW_GRANULARITY (so e.g. prefixes of those blocks), which would require changing its shadow memory encoding, this would not require any changes in the libcxx std::string/deque code which is added in further commits of this patch series. If you have any questions, please email: advenam.tacet@trailofbits.com disconnect3d@trailofbits.com Differential Revision: https://reviews.llvm.org/D132090
-
Vitaly Buka authored
-
Vitaly Buka authored
-
Nico Weber authored
This has the following advantages: - std::shared_timed_mutex is macOS 10.12+ only. llvm::sys::RWMutex automatically switches to a different implementation internally when targeting older macOS versions. - bolt only needs std::shared_mutex, not std::shared_timed_mutex. llvm::sys::RWMutex automatically uses std::shared_mutex internally where available. std::shared_mutex and RWMutex have the same API, so no code changes other than types and includes are needed. Differential Revision: https://reviews.llvm.org/D138423
-
Aart Bik authored
This brings back previous SIMD functionality, but in a separate pass. The idea is to improve this new pass incrementally, going beyond for-loops to while-loops for co-iteration as welll (masking), while introducing new abstractions to make the lowering more progressive. The separation of sparsification and vectorization is a very good first step on this journey. Also brings back ArmSVE support Still to be fine-tuned: + use of "index" in SIMD loop (viz. a[i] = i) + check that all ops really have SIMD support + check all forms of reductions + chain reduction SIMD values Reviewed By: dcaballe Differential Revision: https://reviews.llvm.org/D138236
-
David Blaikie authored
-
Kai Nacke authored
Extends the global isel implementation to support G_ADD and G_SUB. Reviewed By: arsenm, amyk Differential Revision: https://reviews.llvm.org/D128106
-
Louis Dionne authored
Differential Revision: https://reviews.llvm.org/D138435
-
Quentin Colombet authored
This pass has outgrown its original goal and is now going to be used to expand certain memref operations before lowering. Reflect that in the name. The pass is now called expand-strided-metadata. NFC Differential Revision: https://reviews.llvm.org/D138448
-
Saleem Abdulrasool authored
We would previously reject valid input where GNU attributes preceded the standard attributes on top-level declarations. A previous attribute handling change had begun rejecting this whilst GCC does honour this layout. In practice, this breaks use of `extern "C"` attributed functions which use both standard and GNU attributes as experienced by the Swift runtime. Objective-C deserves an honourable mention for requiring some additional special casing. Because attributes on declarations and definitions differ in semantics, we need to replicate some of the logic for detecting attributes to declarations to which they appertain cannot be attributed. This should match the existing case for the application of GNU attributes to interfaces, protocols, and implementations. Take the opportunity to split out the tooling tests into two cases: ones which process macros and ones which do not. Special thanks to Aaron Ballman for the many hints and extensive rubber ducking that was involved in identifying the various places where we accidentally dropped attributes. Differential Revision: https://reviews.llvm.org/D137979 Fixes: #58229 Reviewed By: aaron.ballman, arphaman
-
John Baldwin authored
GCC expands the pointer type in this conditional expression even for template types _Up that are not arrays. This raises an error when std::decay<> is used with reference types (as is done in LLVM's sources). Using add_pointer<> causes GCC to only instantiate a pointer type for array types. Reviewed By: #libc, philnik, ldionne Differential Revision: https://reviews.llvm.org/D135469
-
Heejin Ahn authored
This disables `RegisterCoalescer` pass at -O1, which currently runs for all levels except for -O0, as a part of common optimization pipeline. `RegisterCoalescer` pass degrades Wasm debug info quality by a significant margin. When I use `LiveDebugValue` analysis, disabling this increases the average PC ranges covered by 15% on Emscripten core benchmarks (52% -> 66.8%). (Our code is currently not using `LiveDebugValues` analysis at the moment, and the experiment was done on a local setting that enabled it. I'm planning to upstream it soon.) In Emscripten core benchmarks, disabling this at -O1 causes +4.5% in code size and +1% in the number of locals. The number of globals stays the same. I believe this tradeoff is acceptable given that -O1 is not usually used in production builds and is often used for debugging when the application size is very large. The plan is to investigate and fix what's causing the degradation in that pass, but for now disabling it seems like a low-hanging quick fix. Reviewed By: dschuff Differential Revision: https://reviews.llvm.org/D138455
-
Florian Hahn authored
At the moment, getRangeRef may overflow the stack for very deeply nested expressions. This patch introduces a new getRangeRefIter function, which first builds a worklist of N-ary expressions and phi nodes, followed by their operands iteratively. getRangeRef has been extended to also take a Depth argument and it switches to use getRangeRefIter once the depth reaches a certain threshold. This ensures compile-time is not impacted in general. Note that the iterative algorithm may lead to a slightly different evaluation order, which could result in slightly worse ranges for cyclic phis. https://llvm-compile-time-tracker.com/compare.php?from=23c3eb7cdf3478c9db86f6cb5115821a8f0f5f40&to=e0e09fa338e77e53242bfc846e1484350ad79773&stat=instructions Fixes #49579. Reviewed By: mkazantsev Differential Revision: https://reviews.llvm.org/D130728
-
Nikolas Klauser authored
This is just to make to follow-up diffs simpler Reviewed By: ldionne, #libc, EricWF Spies: EricWF, libcxx-commits Differential Revision: https://reviews.llvm.org/D137498
-
Benjamin Kramer authored
[PowerPC] Move PPCGenRegisterBankInfo.def into the directory where it would be if it was autogenerated
-
Ji, Jinsong authored
The vim Formatonsave integration is not working if we create a new file directly using vim. eg: vi -V9t.log t.cpp It will not able to format the buffer. > Traceback (most recent call last): > File "<string>", line 1, in <module> > File "...clang/tools/clang-format/clang-format.py", line 156, in <module> > main() > File "...clang/tools/clang-format/clang-format.py", line 80, in main > with open(vim.current.buffer.name, 'r') as f: > FileNotFoundError: [Errno 2] No such file or directory: '...t.cpp' This patch check the file before we try to open it. Reviewed By: owenpan Differential Revision: https://reviews.llvm.org/D138234
-
Louis Dionne authored
Differential Revision: https://reviews.llvm.org/D138438
-
Christian Kandeler authored
... in semantic highlighting. These specifiers cannot be identified by simple lexing (since e.g. variables with these names can legally be declared), which means they should be semantic tokens. Reviewed By: sammccall Differential Revision: https://reviews.llvm.org/D137943
-
Fangrui Song authored
Restore global descriptor demangling after D138095 "[asan] Keep Itanium mangled names in global metadata" This amends commit 00be3578 to demangle symbol names in global descriptors. We keep the mangled name for the `__odr_gen_asan_*` variables and the runtime __cxa_demangle call site change (which fixed possible leaks for other scenarios: non-fatal diagnostics). compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cpp uses an undefined weak `__cxa_demangle` which does not pull in an archive definition. A -static-libstdc++ executable link does not get demangled names. Unfortunately this means we cannot rely on runtime demangling. See compiler-rt/test/asan/TestCases/global-demangle.cpp
-
Dave Lee authored
Update `fullpath` asserts in TestMiniDump.py. This reverts commit 682fcc95f4149f00e9da961817fe2f5832e4b301.
-
Thomas Lively authored
Including builtin and intrinsic names. These should be the final names for the proposal. https://github.com/WebAssembly/relaxed-simd/blob/main/proposals/relaxed-simd/Overview.md Reviewed By: aheejin, maratyszcza Differential Revision: https://reviews.llvm.org/D138249
-
Owen Pan authored
Fixes #59089. Differential Revision: https://reviews.llvm.org/D138371
-
Kazu Hirata authored
This patch replaces None with a custom base class in FormatVariadicTest.cpp. As part of the migration from llvm::Optional to std::optional, I'd like to define None as std::nullopt, but FormatVariadicTest.cpp blocks that. When you specialize indexed_accessor_range with the base class being None, the template instantiation eventually generates code to compare two instances of None. That's not guaranteed with std::nullopt. Replacing None with a custom base class allows me to define None as std::nullopt. This is part of an effort to migrate from llvm::Optional to std::optional: https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716 Differential Revision: https://reviews.llvm.org/D138381
-
Dave Lee authored
Reimplement `SBFileSpec.fullpath` to (indirectly) use `FileSpec::GetPath`. Instead of hardcoding a `/` separator, use `GetPath`. This makes use of the `FileSpec`'s internal style, which for example allows for backslash on Windows where required. It's not obvious from looking at the source, but the `fullpath` property is implemented with `str`, which calls `GetDescription`, which finally calls `GetPath`. Differential Revision: https://reviews.llvm.org/D138348
-
Kai Nacke authored
Adds some more code to GlobalISel to enable instruction selection for and/or/xor. - Makes G_IMPLICIT_DEF, G_CONSTANT, G_AND, G_OR, G_XOR legal for 64bit register size. - Implement lowerReturn in CallLowering - Provides mapping of the operands to register banks. - Adds register info to G_COPY operands. The utility functions are all only implemented so far to support this use case. Especially the functions in PPCGenRegisterBankInfo.def are too simple for general use. Reviewed By: nemanjai, shchenz, amyk Differential Revision: https://reviews.llvm.org/D127530
-
Florian Hahn authored
Extra test coverage for D130728.
-
Jordan Rupprecht authored
This test copies main.c to main-copy.c and modifies main-copy.c while debugging, but main.c may have come from a readonly location, which means writing to main-copy.c will fail because permissions are preserved. Run the equivalent of "chmod u+w" before attempting to modify it. This effect can be seen by attempting to run this test after running `chmod u-w lldb/test/API/source-manager/main.c`
-
Nikolas Klauser authored
We currently call a lot of functions with the same list of types. To avoid forgetting any of them, this patch adds type_lists and utilities for it. Specifically, it adds - `type_list` - This is just a list of types - `concatenate` - This allows concatenating type_lists - `for_each` - Iterate over a type_list Reviewed By: ldionne, #libc Spies: jloser, EricWF, libcxx-commits Differential Revision: https://reviews.llvm.org/D137476
-
Maryam Moghadas authored
This patch adds 8 news load and store with length instructions including lxvrl, lxvrll, stxvrl, stxvrll, lxvprl, lxvprll, stxvprl, stxvprll. Reviewed By: stefanp, amyk, saghir Differential Revision: https://reviews.llvm.org/D136992
-
Nathan Sidwell authored
Replace old-style, brittle, grep with new-fangled FileCheck technology. Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D137941
-
Sanjay Patel authored
An early run of VectorCombine was added with D102496 specifically to deal with unnecessary vector ops produced with the C matrix extension. This patch is proposing to try those folds in general and add a pair of load folds to the menu. The load transform will partly solve (see PhaseOrdering diffs) a longstanding vectorization perf bug by removing redundant loads via GVN: issue #17113 The main reason for not enabling the extra pass generally in the initial patch was compile-time cost. The cost of VectorCombine was significantly (surprisingly) improved with: 87debdad https://llvm-compile-time-tracker.com/compare.php?from=ffe05b8f57d97bc4340f791cb386c8d00e0739f2&to=87debdadaf18f8a5c7e5d563889e10731dc3554d&stat=instructions:u ...so the extra run is going to cost very little now - the total cost of the 2 runs should be less than the 1 run before that micro-optimization: https://llvm-compile-time-tracker.com/compare.php?from=5e8c2026d10e8e2c93c038c776853bed0e7c8fc1&to=2c4b68eab5ae969811f422714e0eba44c5f7eefb&stat=instructions:u It may be possible to reduce the cost slightly more with a few more earlier-exits like that, but it's probably in the noise based on timing experiments. Differential Revision: https://reviews.llvm.org/D138353
-