- Apr 29, 2022
-
-
Vitaly Buka authored
We are considering to make -fsanitize-memory-param-retval enabled by default so probably this patch is unnneded. Reviewed By: #libc, EricWF Differential Revision: https://reviews.llvm.org/D123979
-
Duncan P. N. Exon Smith authored
Delete the output streams coming from CompilerInstance::createOutputFile() and friends once writes are finished. Concretely, replacing `OS->flush()` with `OS.reset()` in: - `ExtractAPIAction::EndSourceFileAction()` - `PrecompiledPreambleAction::setEmittedPreamblePCH()` - `cc1_main()'s support for `-ftime-trace` This fixes theoretical bugs related to proxy streams, which may have cleanups to run in their destructor. For example, a proxy that CompilerInstance sometimes uses is `buffer_ostream`, which wraps a `raw_ostream` lacking pwrite support and adds it. `flush()` does not promise that output is complete; `buffer_ostream` needs to wait until the destructor to forward anything so that it can service later calls to `pwrite()`. If the destructor isn't called then the proxied stream hasn't received any content. This also protects against some logic bugs, triggering a null dereference on a later attempt to write to the stream. No test...
-
Artem Dergachev authored
The patch is straightforward except the tiny fix in BugReporterVisitors.cpp that suppresses a default note for "Assuming pointer value is null" when a note tag from the checker is present. This is probably the right thing to do but also definitely not a complete solution to the problem of different sources of path notes being unaware of each other, which is a large and annoying issue that we have to deal with. Note tags really help there because they're nicely introspectable. The problem is demonstrated by the newly added getenv() test. Differential Revision: https://reviews.llvm.org/D122285
-
Yaxun (Sam) Liu authored
MSVC and Itanium mangling use different mangling numbers for function-scope structs, which causes inconsistent mangled kernel names in device and host compilations. This patch uses Itanium mangling number for structs in for mangling device side names in CUDA/HIP host compilation on Windows to fix this issue. A state is added to ASTContext to indicate whether the current name mangling is for device side names in host compilation. Device and host mangling number are encoded/decoded as upper and lower half of 32 bit unsigned integer to fit into the original mangling number field for AST. Diagnostic will be emitted if a manglining number exceeds limit. Reviewed by: Artem Belevich, Reid Kleckner Differential Revision: https://reviews.llvm.org/D122734 Fixes: SWDEV-328515
-
Roman Lebedev authored
[NFC][SCEV] Refactor `createNodeForSelectViaUMinSeq()` out of `createNodeForSelectOrPHIViaUMinSeq()`
-
Roman Lebedev authored
-
wlei authored
This patch is fixing two issues for both CS and non-CS. 1) For external-call-internal, the head samples of the the internal function should be recorded. 2) avoid ignoring LBR after meeting the interrupt branch for CS profile LBR parser is shared between CS and non-CS, we found it's error-prone while dealing with artificial branch inside LBR parser. Since artificial branch is mainly used for CS profile unwinding, this patch tries to simplify LBR parser by decoupling artificial branch code from it, the concept of artificial branch is removed and split into two transitional branches(internal-to-external, external-to-internal). Then we leave all the processing of external branch to unwinder. Specifically for unwinder, remembering that we introduce external frame in https://reviews.llvm.org/D115550. We can just take external address as a regular address and reuse current unwind function(unwindCall, unwindReturn). For a normal case, the external frame will match an external LBR, and it will be filtered out by `unwindLinear` without losing any context. The data also shows that the interrupt or standalone LBR pattern(unpaired case) does exist, we choose to handle it by clearing the call stack and keeping unwinding. Here we leverage checking in `unwindLinear`, because a standalone LBR, no matter its type, since it doesn’t have other part to pair, it will eventually cause a wrong linear range, like [external, internal], [internal, external]. Then set the state to invalid there. Reviewed By: hoy, wenlei Differential Revision: https://reviews.llvm.org/D118177
-
Jonas Devlieghere authored
These tests are timing out on the bots.
-
Argyrios Kyrtzidis authored
[Tooling/DependencyScanning] Make skipping excluded PP ranges during dependency scanning the default This is to improve maintenance a bit and remove need to maintain the additional option and related code-paths. Differential Revision: https://reviews.llvm.org/D124558
-
Mircea Trofin authored
The goal in 75881d8b was just modifying what `Result` is, didn't need to also modify ::run.
-
Jonas Devlieghere authored
This patch fixes a crash when using process launch -t to launch the inferior from a TTY. The issue is that on Darwin, Host.mm is calling ConnectionFileDescriptor::Connect without a socket_id_callback_type. The overload passes nullptr as the function ref, which gets called unconditionally as the socket_id_callback. One potential way to fix this is to change all the lambdas to include a null check, but instead I went with an empty lambda. Differential revision: https://reviews.llvm.org/D124535
-
Since D110065, the 'R' profile support is added to LLVM. It turns the `generic` cpu into the intersection of v8-a and v8-r. However, this makes some backward compatibility problems. The original patch makes the clang driver implicitly pass -march=armv8-a when only the triple is specified. Since it only applies to clang, other tools like llvm-objdump still faces the backward compatibility problem. This patch applies the same idea to MC related tools by enabling '+v8a' feature when nothing is specified (both CPU and FS are empty) for MCSubtargetInfo creation. This patch should fix PR53956. Reviewed by: labrinea Differential Revision: https://reviews.llvm.org/D124319
-
Alexey Moksyakov authored
The relocation value is calculated using the formula S + A - P, the verification of the value is performed by inversely calculating the location address Reviewed By: Amir Differential Revision: https://reviews.llvm.org/D124270
-
Benjamin Kramer authored
-
Yuanfang Chen authored
In case of interrupting, there were None. Fixes PR55176.
-
David Penry authored
This reverts commit 28d09bbb while I investigate a buildbot failure.
-
Simon Pilgrim authored
With BMI2 we have SHRX which is a lot quicker than regular x86 shifts. Fixes #55138
-
Craig Topper authored
Add extra check-prefixes to merge common results.
-
David Penry authored
This patch permits Swing Modulo Scheduling for ARM targets turns it on by default for the Cortex-M7. The t2Bcc instruction is recognized as a loop-ending branch. MachinePipeliner is extended by adding support for "unpipelineable" instructions. These instructions are those which contribute to the loop exit test; in the SMS papers they are removed before creating the dependence graph and then inserted into the final schedule of the kernel and prologues. Support for these instructions was not previously necessary because current targets supporting SMS have only supported it for hardware loop branches, which have no loop-exit-contributing instructions in the loop body. The current structure of the MachinePipeliner makes it difficult to remove/exclude these instructions from the dependence graph. Therefore, this patch leaves them in the graph, but adds a "normalization" method which moves them in the schedule to stage 0, which causes them to appear properly in kernel and prologues. It was also necessary to be more careful about boundary nodes when iterating across successors in the dependence graph because the loop exit branch is now a non-artificial successor to instructions in the graph. In additional, schedules with physical use/def pairs in the same cycle should be treated as creating an invalid schedule because the scheduling logic doesn't respect physical register dependence once scheduled to the same cycle. Reviewed By: dmgreen Differential Revision: https://reviews.llvm.org/D122672
-
River Riddle authored
We weren't properly returning the result of the constraint, which leads to errors when actually trying to use the generated C++. Differential Revision: https://reviews.llvm.org/D124586
-
River Riddle authored
We currently aren't handling this properly, and in the case of a string block just crash. This commit adds proper error handling and detection for eof. Differential Revision: https://reviews.llvm.org/D124585
-
River Riddle authored
SourceMgr generally uses 1-based locations, whereas the LSP is zero based. This commit corrects this conversion and also enhances the conversion from SMLoc to SMRange to support string tokens. Differential Revision: https://reviews.llvm.org/D124584
-
River Riddle authored
We currently emit an error during verification if a pdl.operation with non-inferrable results is used within a rewrite. This allows for catching some errors during compile time, but is slightly broken. For one, the verification at the PDL level assumes that all dialects have been loaded, which is true at run time, but may not be true when the PDL is generated (such as via PDLL). This commit fixes this by not emitting the error if the operation isn't registered, i.e. it uses the `mightHave` variant of trait/interface methods. Secondly, we currently don't verify when a pdl.operation has no explicit results, but the operation being created is known to expect at least one. This commit adds a heuristic error to detect these cases when possible and fail. We can't always capture when the user made an error, but we can capture the most common case where the user expected an operation to infer its result types (when it actually isn't possible). Differential Revision: https://reviews.llvm.org/D124583
-
River Riddle authored
pdl.attribute currently has a syntax ambiguity that leads to the incorrect parsing of pdl.attribute operations with locations that don't also have a constant value. For example: ``` pdl.attribute loc("foo") ``` The above IR is treated as being a pdl.attribute with a constant value containing the location, `loc("foo")`, which is incorrect. This commit changes the syntax to use `= <constant-value>` to clearly distinguish when the constant value is present, as opposed to just trying to parse an attribute. Differential Revision: https://reviews.llvm.org/D124582 -
River Riddle authored
This allows for inferring the result types of operations in certain situations by using the type of an operand. This commit allowed for automatically supporting type inference for many more operations with no additional effort, e.g. nearly all Arithmetic operations now support result type inferrence with no additional changes. Differential Revision: https://reviews.llvm.org/D124581
-
River Riddle authored
This allows for using attribute types in result type inference for use with InferTypeOpInterface. This was a TODO before, but it isn't much additional work to properly support this. After this commit, arith::ConstantOp can now have its InferTypeOpInterface implementation automatically generated. Differential Revision: https://reviews.llvm.org/D124580
-
Peter Klausler authored
This is a common extension, though semantics differ across compilers. I've chosen to interpret the CHARACTER data as if it were an arbitrary-precision integer value and format or read it as such. This matches Intel's compilers and nvfortran. (GNU Fortran can't handle lengths > 1 and XLF seems to get the enddianness wrong.) This patch generalizes the previous implementations of B/O/Z input and output so that they'll work for arbitrary data in memory, and then uses them for all B/O/Z input/output, including (now) CHARACTER. Differential Revision: https://reviews.llvm.org/D124547
-
Mircea Trofin authored
The result is a data bag, this makes sure it's signaled to a user that the data can't be mutated when, for example, doing something like: auto &R = FAM.getResult<FunctionPropertiesAnalysis>(F) ... R.Uses++
-
Simon Pilgrim authored
-
Florian Hahn authored
This reverts commit 43842b88 while I investigate a buildbot failure. It also reverts the follow-up commit 2883de05.
-
Chris Lattner authored
I would ideally like to eliminate 'requiredOperandCount' as a bit of verification that should be in the client side, but it is much more widely used than I expected. Just tidy some pieces up around it given we can't drop it immediately. NFC. Differential Revision: https://reviews.llvm.org/D124629
-
Bill Wendling authored
A record may have more than just FieldDecls in it. If so, then we're likely to drop them if we only randomize the FieldDecls. We need to be careful about anonymous structs/unions. Their fields are made available in the RecordDecl as IndirectFieldDecls, which are listed after the anonymous struct/union. The ordering doesn't appear to be super important, however we place them unrandomized at the end of the RecordDecl just in case. There's also the possiblity of StaticAssertDecls. We also want those at the end. All other non-FieldDecls we place at the top, just in case we get something like: struct foo { enum e { BORK }; enum e a; }; Link: https://github.com/KSPP/linux/issues/185 Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D123958 -
Dominic Chen authored
Set LONG_DOUBLE_IS_DOUBLE, add ifdefs for 128-bit integer types Differential Revision: https://reviews.llvm.org/D124204
-
David Tenty authored
For the AIX linker, under default options, global or weak symbols which have no visibility bits set to zero (i.e. no visibility, similar to ELF default) are only exported if specified on an export list provided to the linker. So AIX has an additional visibility style called "exported" which indicates to the linker that the symbol should be explicitly globally exported. This change maps "dllexport" in the LLVM IR to correspond to XCOFF exported as we feel this best models the intended semantic (discussion on the discourse RFC thread: https://discourse.llvm.org/t/rfc-adding-exported-visibility-style-to-the-ir-to-model-xcoff-exported-visibility/61853) and allows us to enable writing this visibility for the AIX target in the assembly path. Reviewed By: DiggerLin Differential Revision: https://reviews.llvm.org/D123951
-
David Green authored
Given a shuffle feeding a commutative reduction, the lane ordering of the shuffle will not alter the result. This is also true if there are a number of operations between the reduction and the shuffle, providing they only operate lane-wise. This patch searches for cases like that in Vector Combine, allowing us to check the cost of the shuffle vs an in-order identity shuffle and replace the order if possible. This only handles a single shuffle at the moment to keep things simple, and is able to ignore splats that produce results where every result is the same. This is a more powerful version of a combine that already happens in instrcombine, capable of optimizing more cases by looking through more instructions and being able to cost the shuffle. Differential Revision: https://reviews.llvm.org/D123494
-
Jacques Pienaar authored
tree-sitter grammar file that tries to closely matches LangRef (it could use some tweaking and cleanup, but kept fairly basic). Also updated LangRef in places where found some issues while doing the nearly direct transcription. This only adds a grammar file, not all the other parts (npm etc) that accompanies it. Those I'll propose for separate repo like we do for vscode extension. Reviewed By: rriddle Differential Revision: https://reviews.llvm.org/D124352
-
Biplob Mishra authored
InstCombine: Add no-one-use tests and create thwart complexity-based canonicalization for the or-and combine tests
-
Chris Lattner authored
The asm parser had a notional distinction between parsing an operand (like "%foo" or "%4#3") and parsing a region argument (which isn't supposed to allow a result number like #3). Unfortunately the implementation has two problems: 1) It didn't actually check for the result number and reject it. parseRegionArgument and parseOperand were identical. 2) It had a lot of machinery built up around it that paralleled operand parsing. This also was functionally identical, but also had some subtle differences (e.g. the parseOptional stuff had a different result type). I thought about just removing all of this, but decided that the missing error checking was important, so I reimplemented it with a `allowResultNumber` flag on parseOperand. This keeps the codepaths unified and adds the missing error checks. Differential Revision: https://reviews.llvm.org/D124470
-
Yitzhak Mandelbaum authored
This patch changes `Environment::join`, in the case that two values at the same location are not (pointer) equal, to structurally compare indirection values (pointers and references) for equivalence (that is, equivalent pointees) before resorting to merging. This change makes join consistent with equivalence, which also performs structural comparison. It also fixes a bug where the values are `ReferenceValue` but the merge creates a non-reference value. This case arises when the `ReferenceValue`s were created to represent an lvalue, so the "reference-ness" is not reflected in the type. In this case, the pointees will always be equivalent, because lvalues at the same code location point to the location of a fixed declaration, whose location is itself stable across blocks. We were unable to reproduce a unit test for this latter bug, but have verified the fix in the context of a larger piece of code that triggers the bug. Differential Revision: https://reviews.llvm.org/D124540
-