- Apr 26, 2022
-
-
Nathan Sidwell authored
Every non-testcase use of OutputBuffer contains code to allocate an initial buffer (using either 128 or 1024 as initial guesses). There's now no need to do that, given recent changes to the buffer extension heuristics -- it allocates a 1k(ish) buffer on first need. Just pass in a buffer (if any) to the constructor. Thus the OutputBuffer's ownership of the buffer starts at its own lifetime start. We can reduce the lifetime of this object in several cases. That new constructor takes a 'size_t *' for the size argument, as all uses with a non-null buffer are passing through a malloc'd buffer from their own caller in this manner. The buffer reset member function is never used, and is deleted. The original buffer initialization code would return a failure code if that first malloc failed. Existing code either ignored that, called std::terminate with a FIXME, or returned an error code. But that's not foolproof anyway, as a subsequent buffer extension failure ends up calling std::terminate. I am working on addressing that unfortunate failure mode in a manner more consistent with the C++ ABI design. Reviewed By: dblaikie Differential Revision: https://reviews.llvm.org/D122604
-
Alex Zinenko authored
-
Alexey Lapshin authored
-
Martin Storsjö authored
Apply this in add_compiler_rt_runtime instead of manually adding it to the individual projects. This applies the option on more parts of compiler-rt than before, but should ideally not make any difference assuming the other runtimes that lacked the option also were C11 compatible. Not marking this as required, to match the existing behaviour (where `-std=c11` was added only if supported by the compiler). This was suggested during the review of D110005. Differential Revision: https://reviews.llvm.org/D124343
-
LLVM GN Syncbot authored
-
Dmitry Makogon authored
Don't check whether an input of BDV can be pruned if the input is the BDV itself. BDV is present in the states map, so in case the input is the BDV itself, we'd return false. So explicitly check this case. Differential Revision: https://reviews.llvm.org/D123846
-
Alexey Lapshin authored
llvm-gsymutil has an implementation of AddressRange and AddressRanges classes. That implementation might be reused in other parts of llvm. This patch moves AddressRange and AddressRanges classes into llvm/ADT. Differential Revision: https://reviews.llvm.org/D124350
-
Haojian Wu authored
-
Jun Zhang authored
BitstreamCursors are heavy-weight objects that should not be passed by value. Differential Revision: https://reviews.llvm.org/D123436
-
Xiang1 Zhang authored
Reviewed by RKSimon, LuoYuanke Differential Revision: https://reviews.llvm.org/D123652
-
Haojian Wu authored
Differential Revision: https://reviews.llvm.org/D124384
-
Christudasan Devadasan authored
The vector register spills have no dependency with SILowerSGPRSpills pass anymore. The entire handling has been moved to PrologEpilogInserter with D55301.
-
Siva Chandra authored
-
Siva Chandra authored
-
Luo, Yuanke authored
Instead of report fatal error, this patch emit error message and exit when shapes are not pre-defined. This would cause the compiling fail but not crash. Differential Revision: https://reviews.llvm.org/D124342
-
Nikolas Klauser authored
Reviewed By: var-const, #libc, ldionne Spies: #libc_vendors, ldionne, libcxx-commits, miyuki Differential Revision: https://reviews.llvm.org/D124123
-
Balazs Benics authored
In the following example: int va_list_get_int(va_list *va) { return va_arg(*va, int); // FP } The `*va` expression will be something like `Element{SymRegion{va}, 0, va_list}`. We use `ElementRegions` for representing the result of the dereference. In this case, the `IsSymbolic` was set to `false` in the `getVAListAsRegion()`. Hence, before checking if the memregion is a SymRegion, we should take the base of that region. Analogously to the previous example, one can craft other cases: struct MyVaList { va_list l; }; int va_list_get_int(struct MyVaList va) { return va_arg(va.l, int); // FP } But it would also work if the `va_list` would be in the base or derived part of a class. `ObjCIvarRegions` are likely also susceptible. I'm not explicitly demonstrating these cases. PS: Check the `MemRegion::getBaseRegion()` definition. Fixes #55009 Reviewed By: xazax.hun Differential Revision: https://reviews.llvm.org/D124239 -
Serge Pavlov authored
This change introduces a new intrinsic, `llvm.is.fpclass`, which checks if the provided floating-point number belongs to any of the the specified value classes. The intrinsic implements the checks made by C standard library functions `isnan`, `isinf`, `isfinite`, `isnormal`, `issubnormal`, `issignaling` and corresponding IEEE-754 operations. The primary motivation for this intrinsic is the support of strict FP mode. In this mode using compare instructions or other FP operations is not possible, because if the value is a signaling NaN, floating-point exception `Invalid` is raised, but the aforementioned functions must never raise exceptions. Currently there are two solutions for this problem, both are implemented partially. One of them is using integer operations to implement the check. It was implemented in https://reviews.llvm.org/D95948 for `isnan`. It solves the problem of exceptions, but offers one solution for all targets, although some can do the check in more efficient way. The other, implemented in https://reviews.llvm.org/D96568, introduced a hook 'clang::TargetCodeGenInfo::testFPKind', which injects a target specific code into IR to implement `isnan` and some other functions. It is convenient for targets that have dedicated instruction to determine FP data class. However using target-specific intrinsic complicates analysis and can prevent some optimizations. A special intrinsic for value class checks allows representing data class tests with enough flexibility. During IR transformations it represents the check in target-independent way and saves it from undesired transformations. In the instruction selector it allows efficient lowering depending on the used target and mode. This implementation is an extended variant of `llvm.isnan` introduced in https://reviews.llvm.org/D104854. It is limited to minimal intrinsic support. Target-specific treatment will be implemented in separate patches. Differential Revision: https://reviews.llvm.org/D112025
-
Tanya Lattner authored
Provide the complete response and reporting Code of Conduct documentation. Remove the word draft from all documents, add information about the CoC committee expectations and add a place for transparency reports. This patch provides the response and reporting guides for Code of Conduct reports. It also removes the word draft from all the documents, adds information about the CoC committee, and a place to put transparency reports. A post will also be made on Discourse to provide more details about the history of the code of conduct, this patch, and next steps. Please see that post for full details. I will put a link below once I have it. Reviewed By: aaron.ballman, hubert.reinterpretcast Differential Revision: https://reviews.llvm.org/D122937
-
Walter Erquinigo authored
TraceInstructionDumper::DumpInstructions was becoming too big, so I'm refactoring it into smaller functions. I also made some static methods proper instance methods to simplify calls. Other minor improvements are also done. Differential Revision: https://reviews.llvm.org/D124064
-
Lian Wang authored
Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D124144
-
Walter Erquinigo authored
A trace might contain events traced during the target's execution. For example, a thread might be paused for some period of time due to context switches or breakpoints, which actually force a context switch. Not only that, a trace might be paused because the CPU decides to trace only a specific part of the target, like the address filtering provided by intel pt, which will cause pause events. Besides this case, other kinds of events might exist. This patch adds the method `TraceCursor::GetEvents()`` that returns the list of events that happened right before the instruction being pointed at by the cursor. Some refactors were done to make this change simpler. Besides this new API, the instruction dumper now supports the -e flag which shows pause events, like in the following example, where pauses happened due to breakpoints. ``` thread #1: tid = 2717361 a.out`main + 20 at main.cpp:27:20 0: 0x00000000004023d9 leaq -0x1200(%rbp), %rax [paused] 1: 0x00000000004023e0 movq %rax, %rdi [paused] 2: 0x00000000004023e3 callq 0x403a62 ; std::vector<int, std::allocator<int> >::vector at stl_vector.h:391:7 a.out`std::vector<int, std::allocator<int> >::vector() at stl_vector.h:391:7 3: 0x0000000000403a62 pushq %rbp 4: 0x0000000000403a63 movq %rsp, %rbp ``` The `dump info` command has also been updated and now it shows the number of instructions that have associated events. Differential Revision: https://reviews.llvm.org/D123982 -
LLVM GN Syncbot authored
-
Mircea Trofin authored
This is a simple datatype with a few JSON utilities, and is independent of the underlying executor. The main motivation is to allow taking a dependency on it on the AOT side, and allow us build a correctly-sized buffer in the cases when the requested feature isn't supported by the model. This, in turn, allows us to grow the feature set supported by the compiler in a backward-compatible way; and also collect traces exposing the new features, but starting off the older model, and continue training from those new traces. Differential Revision: https://reviews.llvm.org/D124417
-
Jeffrey Tan authored
This is a preparatory patch for https://reviews.llvm.org/D121631. It refactors protected virtual members of SymbolFile into a new SymbolFileCommon class per suggestion in: https://reviews.llvm.org/D121631 This will avoid the friendship declaration in that patch. Differential Revision: https://reviews.llvm.org/D124110
-
Chris Bieneman authored
This resolves -Werror hexigon build failures.
-
YASHASVI KHATAVKAR authored
Don't replace Undef with null value for Constants Differential Revision:https://reviews.llvm.org/D124098
-
Vladimir Vereschaka authored
Use default test configuration file for the libunwind tests.
-
Vladimir Vereschaka authored
These changes allow remote execution for the libunwind library tests. Differential Revision: https://reviews.llvm.org/D123890
-
Nico Weber authored
-
Vitaly Buka authored
runWithAST stores the first parameters as StringRef, so we can't use temporarily std::string from parameter ID.
-
Will Hawkins authored
Update the online help text for breakpoint set to be consistent with respect to the spelling of Objective-C and fix a few space-related typos. Differential revision: https://reviews.llvm.org/D124338
-
Craig Topper authored
-
Eric Schweitz authored
Differential Revision: https://reviews.llvm.org/D124410
-
Chris Bieneman authored
As implemented this patch assumes that Typed pointer support remains in the llvm::PointerType class, however this could be modified to use a different subclass of llvm::Type that could be disallowed from use in other contexts. This does not rely on inserting typed pointers into the Module, it just uses the llvm::PointerType class to track and unique types. Fixes #54918 Reviewed By: kuhar Differential Revision: https://reviews.llvm.org/D122268
-
Jeremy Morse authored
This reverts commit 5db92502. Further to the early revert, the sanitizers have found something wrong with this.
-
Frederik Gossen authored
Differential Revision: https://reviews.llvm.org/D124407
-
Vitaly Buka authored
Detected on many lld tests with -fsanitize-memory-use-after-dtor. Also https://lab.llvm.org/buildbot/#/builders/sanitizer-x86_64-linux-fast after D122869 will report a lot of them. Threads may outlive static variables. Even if ~__thread_specific_ptr() does nothing, lifetime of members ends with ~ and accessing the value is UB https://eel.is/c++draft/basic.life#1 ``` ==9214==WARNING: MemorySanitizer: use-of-uninitialized-value #0 0x557e1cec4539 in __libcpp_tls_set ../include/c++/v1/__threading_support:428:12 #1 0x557e1cec4539 in set_pointer ../include/c++/v1/thread:196:5 #2 0x557e1cec4539 in void* std::__msan::__thread_proxy< std::__msan::tuple<...>, llvm::parallel::detail::(anonymous namespace)::ThreadPoolExecutor::ThreadPoolExecutor(llvm::ThreadPoolStrategy)::'lambda'()::operator()() const::'lambda'()> >(void*) ../include/c++/v1/thread:285:27 Memory was marked as uninitialized #0 0x557e10a0759d in __sanitizer_dtor_callback compiler-rt/lib/msan/msan_interceptors.cpp:940:5 #1 0x557e1d8c478d in std::__msan::__thread_specific_ptr<std::__msan::__thread_struct>::~__thread_specific_ptr() libcxx/include/thread:188:1 #2 0x557e10a07dc0 in MSanCxaAtExitWrapper(void*) compiler-rt/lib/msan/msan_interceptors.cpp:1151:3 ``` The test needs D123979 or -fsanitize-memory-param-retval enabled by default. Reviewed By: ldionne, #libc Differential Revision: https://reviews.llvm.org/D122864
-
Quinn Pham authored
from libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/ [NFC] As part of using inclusive language within the llvm project, this patch rewords comments to remove sanity check. Reviewed By: #libc, philnik Differential Revision: https://reviews.llvm.org/D124391
-