- Sep 24, 2020
-
-
Sam McCall authored
Translating between JSON objects and C++ strutctures is common. From experience in clangd, fromJSON/ObjectMapper work well and save a lot of code, but aren't adopted elsewhere at least partly due to total lack of error reporting beyond "ok"/"bad". The recently-added error model should be rich enough for most applications. It requires tracking the path within the root object and reporting local errors at appropriate places. To do this, we exploit the fact that the call graph of recursive parse functions mirror the structure of the JSON itself. The current path is represented as a linked list of segments, each of which is on the stack as a parameter. Concretely, fromJSON now looks like: bool fromJSON(const Value&, T&, Path); Beyond the signature change, this is reasonably unobtrusive: building the path segments is mostly handled by ObjectMapper and the vector<T> fromJSON. However the root caller of fromJSON must now create a Root object to store the errors, which is a little clunky. I've added high-level parse<T>(StringRef) -> Expected<T>, but it's not general enough to be the primary interface I think (at least, not usable in clangd). All existing users (mostly just clangd) are updated in this patch, making this change backwards-compatible is a bit hairy. Differential Revision: https://reviews.llvm.org/D88103
-
Ryan Prichard authored
Currently, findUnwindSectionsByPhdr is slightly micro-optimized for the case where the first callback has the target address, and is otherwise very inefficient -- it decodes .eh_frame_hdr even when no PT_LOAD matches the PC. (If the FrameHeaderCache is enabled, then the micro-optimization only helps the first time unwind info is looked up.) Instead, it makes more sense to optimize for the case where the callback *doesn't* find the target address, so search for a PT_LOAD segment first, and only look for the unwind info section if a matching PT_LOAD is found. This change helps on an Android benchmark with 100 shared objects, where the DSO at the end of the dl_iterate_phdr list throws 10000 exceptions. Assuming the frame cache is disabled, this change cuts about 30-40% off the benchmark's runtime. Reviewed By: compnerd, saugustine, #libunwind Differential Revision: https://reviews.llvm.org/D87881
-
Ryan Prichard authored
dl_iterate_phdr is used to search for unwind info provided by either PT_GNU_EH_FRAME or PT_ARM_EXIDX. Most of the code between the two is the same, so combine them, and factor out what's different into checkForUnwindInfoSegment. Details: - The FrameHeaderCache can now be enabled for ARM EHABI. - findUnwindSectionsByPhdr now finds the last PT_ARM_EXIDX rather than the first. There should only be one segment. - The dso_base and text_segment_length fields of UnwindInfoSections are now needed for dl_iterate_phdr when using EHABI, to hold the low and high PC values for a cache entry. Reviewed By: compnerd, danielkiss, #libunwind, saugustine Differential Revision: https://reviews.llvm.org/D87880
-
Sam McCall authored
When an error occurs processing a JSON object, seeing the actual surrounding data helps. Dumping just the node where the problem was identified can be too much or too little information. printErrorContext() shows the error message in its context, as a comment. JSON values along the path to the broken place are shown in some detail, the rest of the document is elided. For example: ``` { "credentials": [ { "username": /* error: expected string */ 42, "password": "secret" }, { ... } ] "backups": { ... } } ``` Differential Revision: https://reviews.llvm.org/D88103 -
Arthur Eubanks authored
This is in preparation for supporting -debugify-each, which adds a debug info pass before and after each pass. Switch VerifyEach to use this. Reviewed By: ychen Differential Revision: https://reviews.llvm.org/D88107
-
Arthur Eubanks authored
This seems to fit the CGSCC updates model better than calling addNewFunctionInto{Ref,}SCC() on newly created/outlined functions. Now addNewFunctionInto{Ref,}SCC() are no longer necessary. However, this doesn't work on newly outlined functions that aren't referenced by the original function. e.g. if a() was outlined into b() and c(), but c() is only referenced by b() and not by a(), this will trigger an assert. This also fixes an issue I was seeing with newly created functions not having passes run on them. Ran check-llvm with expensive checks. Reviewed By: asbirlea Differential Revision: https://reviews.llvm.org/D87798 -
Arthur Eubanks authored
Reviewed By: asbirlea Differential Revision: https://reviews.llvm.org/D88128
-
Sam McCall authored
This error model should be rich enough for most applications. It comprises: - a name for the root object, so the user knows what we're parsing - a path from the root object to the JSON node most associated with the error - a local error message This can be presented as an llvm::Error e.g. "expected string at ConfigFile.credentials[0].username" It's designed to be cheap: Paths are a linked list of lightweight objects on the stack. No heap allocations unless errors are encountered. A subsequent commit will make use of this in the JSON-to-object translation facilities: fromJSON and ObjectMapper. However it's independent of these and can be used for e.g. validation alone. Another subsequent commit will support showing the error in its context within the parsed value. Differential Revision: https://reviews.llvm.org/D88103
-
Greg McGary authored
Differential Revision: https://reviews.llvm.org/D88054
-
Craig Topper authored
[X86] Add a memory clobber to the bittest intrinsic inline asm. Get default clobbers from the target I believe the inline asm emitted here should have a memory clobber since it writes to memory. It was also missing the dirflag clobber that we use by default along with flags and fpsr. To avoid missing defaults in the future, get the default list from the target Differential Revision: https://reviews.llvm.org/D88121
-
Greg McGary authored
Remove all spurious `HelpHidden` flags from `lld/MachO/Options.td`. Add test for `HelpHidden` to `warnIfUnimplementedOption()` so that the empty `// handled elsewhere` case is unnecessary. Reviewed By: #lld-macho, int3, smeenai Differential Revision: https://reviews.llvm.org/D88160
-
Sam McCall authored
This isn't standard JSON, but is a popular extension. It will be used to show errors in context, rendering pseudo-json for humans. Differential Revision: https://reviews.llvm.org/D88103
-
Eli Friedman authored
Previously, if a floating-point type was legal, but FNEG wasn't legal, we would use FSUB. Instead, we should use integer ops, to preserve the semantics. (Alternatively, there's a compiler-rt call we could use, but there isn't much reason to use that.) It turns out we actually are still using this obscure codepath in a few cases: on some targets, we have "legal" floating-point types that don't actually support any floating-point operations. In particular, ARM and AArch64 are using this path. The implementation for SelectionDAG is pretty simple because we can reuse the infrastructure from FCOPYSIGN. See also 9a3dc3e6, the corresponding change to type legalization. Also includes a "bonus" change to STRICT_FSUB legalization, so we can lower a STRICT_FSUB to a float libcall. Includes the changes to both LegalizeDAG and GlobalISel so we don't have inconsistent results in the future. Fixes https://bugs.llvm.org/show_bug.cgi?id=46792 . Differential Revision: https://reviews.llvm.org/D84287
-
Cameron McInally authored
With the exception of VECREDUCE_ADD, there are no NEON instructions to support vector of i64 reductions. This patch removes the Custom lowerings for those and adds some test coverage to confirm. Differential Revision: https://reviews.llvm.org/D88161
-
Yaxun (Sam) Liu authored
This recommits 829d14ee. The patch was reverted due to a regression in some CUDA app which was thought to be caused by this patch. However, investigation showed that the regression was due to some other issues, therefore recommit this patch.
-
Amy Kwan authored
This patch implements the vec_[all|any]_[eq | ne | lt | gt | le | ge] builtins for vector signed/unsigned __int128. Differential Revision: https://reviews.llvm.org/D87910
-
Albion Fung authored
This patch implements Vector signed/unsigned __int128 overloads for the comparison builtins. Differential Revision: https://reviews.llvm.org/D87804
-
Krzysztof Parzyszek authored
-
Stefanos Baziotis authored
-
Joseph Tremoulet authored
The minidump-sysroot test I added in commit 20f84257 compares two paths using a string comparison. This causes the Windows buildbot to fail because of mismatched forward slashes and backslashes. Use os.path.normcase to normalize before comparing.
-
Aaron Ballman authored
This also adds some bare-bones documentation for the attribute rather than leaving it undocumented.
-
Muhammad Asif Manzoor authored
Add the functionality to lower frecpx for passthru variant Reviewed By: paulwalker-arm Differential Revision: https://reviews.llvm.org/D88032
-
Nikita Popov authored
This reverts commit 0caad9fe. This reverts commit c96d0cce. Causes linker errors which were not fixed by the subsequent commit either: /home/nikic/llvm-project/compiler-rt/lib/asan/asan_rtl.cpp:503: error: undefined reference to '__asan::InstallAtExitCheckLeaks()'
-
Kostya Kortchinsky authored
Fix a potential UB in `appendSignedDecimal` (with -INT64_MIN) by making it a special case. Fix the terrible test cases for `isOwned`: I was pretty sloppy on those and used some stack & static variables, but since `isOwned` accesses memory prior to the pointer to check for the validity of the Scudo header, it ended up being detected as some global and stack buffer out of bounds accesses. So not I am using buffers with enough room so that the test will not access memory prior to the variables. With those fixes, the tests pass on the ASan+UBSan Fuchsia build. Thanks to Roland for pointing those out! Differential Revision: https://reviews.llvm.org/D88170
-
Roland McGrath authored
The `if (0)` isn't necessarily optimized out so as not to create a link-time reference to LSan runtime functions that might not exist. So use explicit conditional compilation instead. Reviewed By: phosek Differential Revision: https://reviews.llvm.org/D88173
-
Victor Huang authored
This patch is the initial support for the Local Dynamic Thread Local Storage model to produce code sequence and relocation correct to the ABI for the model when using PC relative memory operations. Differential Revision: https://reviews.llvm.org/D87721
-
Andrew Litteken authored
The IRSimilarityCandidate is a container to hold a region of IRInstructions and offer interfaces for the starting instruction, ending instruction, parent function, length. It also assigns a global value number for each unique instance of a value in the region. It also contains an interface to compare two IRSimilarity as to whether they have the same sequence of similar instructions. Tests for whether the instructions are similar are found in unittests/Analysis/IRSimilarityIdentifierTest.cpp. Recommit of: 4944bb19 Differential Revision: https://reviews.llvm.org/D86970
-
Stanislav Mekhanoshin authored
Differential Revision: https://reviews.llvm.org/D87947
-
Jim Ingham authored
Differential Revision: https://reviews.llvm.org/D88129
-
Eli Friedman authored
If d8 is saved, the fp is not actually adjacent to the SVE spills/allocations. Fix the offset calculation to account for this. Differential Revision: https://reviews.llvm.org/D88117
-
Mike Urbach authored
This tweaks the generated code for parsing attributes with a custom directive to call `addAttribute` on the `OperationState` directly, and adds a newline after this call. Previously, the generated code would call `addAttribute` on the `OperationState` field `attributes`, which has no such method and fails to compile. Furthermore, the lack of newline would generate code with incorrectly formatted single line `if` statements. Added tests for parsing and printing attributes with a custom directive. Reviewed By: mehdi_amini Differential Revision: https://reviews.llvm.org/D87860
-
Arthur Eubanks authored
Reviewed By: thakis Differential Revision: https://reviews.llvm.org/D88056
-
Roland McGrath authored
Fuchsia's system libraries are instrumented and use the lsan allocator for internal purposes. So leak checking needs to run after all atexit hooks and after the system libraries' internal exit-time hooks. The <zircon/sanitizer.h> hook API calls the __sanitizer_process_exit_hook function at exactly the right time. Reviewed By: vitalybuka, phosek Differential Revision: https://reviews.llvm.org/D86171
-
Mehdi Amini authored
-
Mehdi Amini authored
-
Eric Astor authored
This reverts commit 5dd1b6d6.
-
Craig Topper authored
All of the callers already have an Instruction *. Many of them from a dyn_cast. Also update the OperationData constructor to use a Instruction& to remove a dyn_cast and make it clear that the pointer is non-null. Differential Revision: https://reviews.llvm.org/D88132
-
Craig Topper authored
If the control is constant we can figure out exactly which bits of the input are demanded. Differential Revision: https://reviews.llvm.org/D88072
-
Eric Astor authored
-
Sanjay Patel authored
I'm not sure what this means, but the order in which we try the matches makes a difference on at least 1 regression test...
-