- Jan 17, 2022
-
-
Sanjay Patel authored
-
Florian Hahn authored
The modified tests didn't have actual users of all inductions, making it trivial to eliminate them. Add users to make sure the inductions are actually used in the vectorized version.
-
Florian Hahn authored
-
David Sherwood authored
When we know the value we're extending is a negative constant then it makes sense to use SIGN_EXTEND because this may improve code quality in some cases, particularly when doing a constant splat of an unpacked vector type. For example, for SVE when splatting the value -1 into all elements of a vector of type <vscale x 2 x i32> the element type will get promoted from i32 -> i64. In this case we want the splat value to sign-extend from (i32 -1) -> (i64 -1), whereas currently it zero-extends from (i32 -1) -> (i64 0xFFFFFFFF). Sign-extending the constant means we can use a single mov immediate instruction. New tests added here: CodeGen/AArch64/sve-vector-splat.ll I believe we see some code quality improvements in these existing tests too: CodeGen/AArch64/reduce-and.ll CodeGen/AArch64/unfold-masked-merge-vector-variablemask.ll The apparent regressions in CodeGen/AArch64/fast-isel-cmp-vec.ll only occur because the test disables codegen prepare and branch folding. Differential Revision: https://reviews.llvm.org/D114357
-
David Green authored
-
Fraser Cormack authored
This patch adds tests for patterns introduced in D117188. Reviewed By: jacquesguan Differential Revision: https://reviews.llvm.org/D117392
-
Nathan James authored
Adds a option `use-dirty-preambles` to enable using unsaved in editor contents when building pre-ambles. This enables a more seamless user experience when switching between header and implementation files and forgetting to save inbetween. It's also in line with the LSP spec that states open files in the editor should be used instead of on the contents on disk - https://microsoft.github.io/language-server-protocol/overviews/lsp/overview/ For now the option is defaulted to off and hidden, Though I have a feeling it should be moved into the `.clangd` config and possibly defaulted to true. Addresses https://github.com/clangd/clangd/issues/488 Reviewed By: sammccall Differential Revision: https://reviews.llvm.org/D95046
-
Lorenzo Chelini authored
In some cases, the result of an initTensorOp may have an attribute. However, the Attribute was not passed to `inferResultType`, failing the verifier. Therefore, propagate the Attribute to `inferResultType`. Reviewed By: ftynse Differential Revision: https://reviews.llvm.org/D117192
-
Haojian Wu authored
The patch was reverted because it caused a crash during PCH build -- we missed to update the RParenLoc in TreeTransform<Derived>::TransformAutoType. This relands 55d96ac3 and 37ec65e1 with a test and fix.
-
Alex Zinenko authored
This reverts commit 970cb57e. Broke the buildbot.
-
Nikita Popov authored
Following the recommendation in https://github.com/llvm/llvm-project/issues/52817#issuecomment-1007635426, this excludes debug instructions when finalizing the bundle. As uses in debug instructions don't have effects, they will no longer be included in the BUNDLE header. Fixes https://github.com/llvm/llvm-project/issues/52817. Differential Revision: https://reviews.llvm.org/D116945
-
Haojian Wu authored
This is a workaround (adding a newline to the eof) in clangd to avoid the code completion crash, see https://github.com/clangd/clangd/issues/332. In principle, this is a clang bug, we should fix it in clang, but it is not trivial. Reviewed By: sammccall Differential Revision: https://reviews.llvm.org/D117456
-
Ralf Grosse-Kunstleve authored
The GIL must be held when calling any Python C API functions. In multithreaded applications that use callbacks this requirement can easily be violated by accident. A general tool to ensure GIL health is not available, but patching Python Py_INCREF to add an assert provides a basic health check: ``` +int PyGILState_Check(void); /* Include/internal/pystate.h */ + #define Py_INCREF(op) ( \ + assert(PyGILState_Check()), \ _Py_INC_REFTOTAL _Py_REF_DEBUG_COMMA \ ((PyObject *)(op))->ob_refcnt++) #define Py_DECREF(op) \ do { \ + assert(PyGILState_Check()); \ PyObject *_py_decref_tmp = (PyObject *)(op); \ if (_Py_DEC_REFTOTAL _Py_REF_DEBUG_COMMA \ --(_py_decref_tmp)->ob_refcnt != 0) \ ``` Adding this assertion causes around 50 test failures in LLDB. Adjusting the scope of things guarded by `py_lock` fixes them. More background: https://docs.python.org/3/glossary.html#term-global-interpreter-lock Patch by Ralf Grosse-Kunstleve Differential Revision: https://reviews.llvm.org/D114722 -
Nikita Popov authored
This function is no longer used since 499f1ca7.
-
Alex Zinenko authored
The constructor function was being defined without indicating its "__init__" name, which made it interpret it as a regular fuction rather than a constructor. When overload resolution failed, Pybind would attempt to print the arguments actually passed to the function, including "self", which is not initialized since the constructor couldn't be called. This would result in "__repr__" being called with "self" referencing an uninitialized MLIR C API object, which in turn would cause undefined behavior when attempting to print in C++. Fix this by specifying the correct name. This in turn uncovers the fact the the mechanism used by PybindAdaptors.h to bind constructors directly as "__init__" functions taking "self" is deprecated by Pybind. The modern method requires using "py::init", which seems to rely on the C++ equivalent of the bound class to be available, which is not the case in PybindAdaptors.h. A deeper inspection shows that the deprecation concerns old-style pybind11 constructors that had to allocate the object using placement new with "self" as memory. The PybindAdaptors.h only provides extension classes and never allocates (the object construction is delegated to the base class), so it does not use the deprecated functionality. Use the implementation detail tag class to convince pybind11 that we are using the modern constructor binding method and suppress the warning. On top of that, the definition of the function was incorrectly indicated as the method on the "None" object instead of being the method of its parent class. This would result in a second problem when Pybind would attempt to print warnings pointing to the parent class since the "None" does not have a "__name__" field or its C API equivalent. Fix this by specifying the correct parent class by looking it up by name in the parent module. Reviewed By: stellaraccident Differential Revision: https://reviews.llvm.org/D117325
-
Lian Wang authored
Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D117290
-
Nikita Popov authored
This was a last-minute addition to D117249, and of course I ended up inverting the condition in a way that caused an uninitialized memory read. I've dropped it entirely, as I don't think we actually care whether the size is zero or not here. The previous code wasn't checking this either.
-
Nikita Popov authored
The malloc to global transform currently determines the type of the global by looking at bitcasts of the malloc. This is limited (the transform fails if there are multiple different types) and incompatible with opaque pointers. My initial approach was to construct an appropriate struct type based on usage in loads/stores. What this patch does instead is to always create an [i8 x AllocSize] global, without trying to guess types at all. This does mean that other transforms that require a certain global type may break. I fixed two of these in D117034 and D117223, which I believe should be sufficient to avoid regressions. In particular, the global SRA change should end up splitting the global into naturally-typed sub-globals, at which point all other optimizations should work. Differential Revision: https://reviews.llvm.org/D117092
-
Sam McCall authored
- prefer `arguments` over `command`, and add example - clarify that there's no shell-unescaping of `arguments` Fixes https://github.com/llvm/llvm-project/issues/53143 Differential Revision: https://reviews.llvm.org/D117428
-
Fangrui Song authored
strTabOffset stabilizes llvm::sort. My x86-64 executable is 5+KiB smaller.
-
Nikita Popov authored
Currently global SRA uses the GEP structure to determine how to split the global. This patch instead analyses the loads and stores that are performed on the global, and collects which types are used at which offset, and then splits the global according to those. This is both more general, and works fine with opaque pointers. This is also closer to how ordinary SROA is performed. Differential Revision: https://reviews.llvm.org/D117223
-
Haojian Wu authored
The newline-eof fix was rendered as "insert '...'", this patch special-case it. Reviewed By: sammccall Differential Revision: https://reviews.llvm.org/D117294
-
Nikita Popov authored
canSkipDef() currently skips inaccessiblememonly calls, but not if they are allocation functions. This check was added in D103009, but actually seems to be a leftover from a previous implementation in D101440. canSkipDef() is not used on the storeIsNoop() path, where the relevant transform ended up being implemented. Differential Revision: https://reviews.llvm.org/D117005
-
Carl Ritson authored
-
Fangrui Song authored
-
Cameron Mulhern authored
This style is similar to AlwaysBreak, but places closing brackets on new lines. For example, if you have a multiline parameter list, clang-format currently only supports breaking per-parameter, but places the closing bracket on the line of the last parameter. Function( param1, param2, param3); A style supported by other code styling tools (e.g. rustfmt) is to allow the closing brackets to be placed on their own line, aiding the user in being able to quickly infer the bounds of the block of code. Function( param1, param2, param3 ); For prior work on a similar feature, see: https://reviews.llvm.org/D33029. Note: This currently only supports block indentation for closing parentheses. Differential Revision: https://reviews.llvm.org/D109557 -
Fangrui Song authored
-
Fangrui Song authored
-
Kito Cheng authored
Those two TTI hooks are used during vectorization for calculating register pressure, the default implementation isn't consider for LMUL, and that's also definitly wrong value for register number (all register class are 8 registers). So in this patch we tried to: 1. Calculate right register usage for vector type and scalar type. 2. Return right number of register for general purpose register and vector register. Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D116890
-
Qiu Chaofan authored
Targets with VSX feature but without native float128 instructions can also use that type with supplementary libcalls. We don't enable it by default now because Glibc assumes long double and float128 can be implicitly converted in between, which is not available under default 'ibmlongdouble' semantics in clang. This commit partly relands cbd93cee.
-
Fangrui Song authored
After the D33630 fallout was properly fixed by a4c5db30. Tested by D37462/D44986 tests, the new --no-rosegment test in build-id.s, and a few --rosegment/--no-rosegment programs.
-
Fangrui Song authored
The new tests in build-id.s would catch problems if we made a mistake here.
-
Fangrui Song authored
-
Fangrui Song authored
-
https://reviews.llvm.org/D113825esmeyi authored
-
Fangrui Song authored
-
Fangrui Song authored
5~6% speedup when linking clang and chrome.
-
Fangrui Song authored
Similar to D116843 for Gnu.cpp Reviewed By: dim Differential Revision: https://reviews.llvm.org/D117388
-
John Ericson authored
I am breaking apart D99484 so the cause of build failures is easier to understand. Differential Revision: https://reviews.llvm.org/D117420
-
eopXD authored
Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D117404
-