- Nov 12, 2021
-
-
Salman Javed authored
Re-apply "Fix lint warning in ClangTidyDiagnosticConsumer.cpp (NFC)" with fixes for the failing ASan tests. This reverts commit 74add1b6.
-
Gabor Marton authored
We no longer need a reference to RangedConstraintManager, we call top level `State->assume` functions. Differential Revision: https://reviews.llvm.org/D113261
-
Gabor Marton authored
D103314 introduced symbol simplification when a new constant constraint is added. Currently, we simplify existing equivalence classes by iterating over all existing members of them and trying to simplify each member symbol with simplifySVal. At the end of such a simplification round we may end up introducing a new constant constraint. Example: ``` if (a + b + c != d) return; if (c + b != 0) return; // Simplification starts here. if (b != 0) return; ``` The `c == 0` constraint is the result of the first simplification iteration. However, we could do another round of simplification to reach the conclusion that `a == d`. Generally, we could do as many new iterations until we reach a fixpoint. We can reach to a fixpoint by recursively calling `State->assume` on the newly simplified symbol. By calling `State->assume` we re-ignite the whole assume machinery (along e.g with adjustment handling). Why should we do this? By reaching a fixpoint in simplification we are capable of discovering infeasible states at the moment of the introduction of the **first** constant constraint. Let's modify the previous example just a bit, and consider what happens without the fixpoint iteration. ``` if (a + b + c != d) return; if (c + b != 0) return; // Adding a new constraint. if (a == d) return; // This brings in a contradiction. if (b != 0) return; clang_analyzer_warnIfReached(); // This produces a warning. // The path is already infeasible... if (c == 0) // ...but we realize that only when we evaluate `c == 0`. return; ``` What happens currently, without the fixpoint iteration? As the inline comments suggest, without the fixpoint iteration we are doomed to realize that we are on an infeasible path only after we are already walking on that. With fixpoint iteration we can detect that before stepping on that. With fixpoint iteration, the `clang_analyzer_warnIfReached` does not warn in the above example b/c during the evaluation of `b == 0` we realize the contradiction. The engine and the checkers do rely on that either `assume(Cond)` or `assume(!Cond)` should be feasible. This is in fact assured by the so called expensive checks (LLVM_ENABLE_EXPENSIVE_CHECKS). The StdLibraryFuncionsChecker is notably one of the checkers that has a very similar assertion. Before this patch, we simply added the simplified symbol to the equivalence class. In this patch, after we have added the simplified symbol, we remove the old (more complex) symbol from the members of the equivalence class (`ClassMembers`). Removing the old symbol is beneficial because during the next iteration of the simplification we don't have to consider again the old symbol. Contrary to how we handle `ClassMembers`, we don't remove the old Sym->Class relation from the `ClassMap`. This is important for two reasons: The constraints of the old symbol can still be found via it's equivalence class that it used to be the member of (1). We can spare one removal and thus one additional tree in the forest of `ClassMap` (2). Performance and complexity: Let us assume that in a State we have N non-trivial equivalence classes and that all constraints and disequality info is related to non-trivial classes. In the worst case, we can simplify only one symbol of one class in each iteration. The number of symbols in one class cannot grow b/c we replace the old symbol with the simplified one. Also, the number of the equivalence classes can decrease only, b/c the algorithm does a merge operation optionally. We need N iterations in this case to reach the fixpoint. Thus, the steps needed to be done in the worst case is proportional to `N*N`. Empirical results (attached) show that there is some hardly noticeable run-time and peak memory discrepancy compared to the baseline. In my opinion, these differences could be the result of measurement error. This worst case scenario can be extended to that cases when we have trivial classes in the constraints and in the disequality map are transforming to such a State where there are only non-trivial classes, b/c the algorithm does merge operations. A merge operation on two trivial classes results in one non-trivial class. Differential Revision: https://reviews.llvm.org/D106823 -
Neubauer, Sebastian authored
Differential Revision: https://reviews.llvm.org/D113672
-
Florian Hahn authored
Suggested in D113577.
-
Kiran Chandramohan authored
Convert fir.int<kind> to their llvm equivalent type This patch is part of the upstreaming effort from fir-dev branch. Reviewed By: clementval, awarzynski Differential Revision: https://reviews.llvm.org/D113660 Co-authored-by:
Eric Schweitz <eschweitz@nvidia.com>
-
Adrian Kuegel authored
This reverts commit 9deab60a. There is a possibly unintended semantic change.
-
Salman Javed authored
This reverts commit d73e27d9.
-
Kiran Chandramohan authored
Convert fir.heap type to its llvm equivalent type (llvm.ptr) This patch is part of the upstreaming effort from fir-dev branch. Reviewed By: clementval Differential Revision: https://reviews.llvm.org/D113670 Co-authored-by:
Eric Schweitz <eschweitz@nvidia.com> Co-authored-by:
Jean Perier <jperier@nvidia.com>
-
Salman Javed authored
Sphinx buildbot failing. This reverts commit 735e4332.
-
Florian Hahn authored
This patch extends the existing out-of-bounds store tests with a case with a bigger object and multiple inbounds stores, followed by an OOB store. The OOB store is not used to remove the inbounds stores in this case at the moment.
-
Salman Javed authored
- Jaro–Winkler and Sørensen–Dice should use en-dashes not regular dashes. In reStructuredText this is typed as `--`. - Letters at the beginning of a sentence should be capitalized.
-
Jean Perier authored
-
Jean Perier authored
The source index should not be compared to zero after applying the shift with the modulo, it must be compared to the lower bound. Otherwise, the extent is not added in case it should and the computed source index may be less than the lower bound, causing invalid results. Differential Revision: https://reviews.llvm.org/D113659
-
Vitaly Buka authored
-
Simon Moll authored
Some compiler-rt tests are inherently incompatible with VE because.. * No consistent denormal support on VE. We skip denormal fp inputs in builtin tests. * `madvise` unsupported on VE. * Instruction alignment requirements. Reviewed By: phosek Differential Revision: https://reviews.llvm.org/D113093
-
Mehdi Amini authored
Differential Revision: https://reviews.llvm.org/D113737
-
Simon Moll authored
TableGen has started warning about unused template parameters in the isel patterns. Remove those. Reviewed By: kaz7 Differential Revision: https://reviews.llvm.org/D113675
-
Markus Lavin authored
Register uses that are MRI->isConstantPhysReg() should not inhibit sinking transformation. Reviewed By: StephenTozer Differential Revision: https://reviews.llvm.org/D111531
-
Stella Laurenzo authored
Per discussion on discord and various feature requests across bindings (Haskell and Rust bindings authors have asked me directly), we should be building a link-ready MLIR-C dylib which exports the C API and can be used without linking to anything else. This patch: * Adds a new MLIR-C aggregate shared library (libMLIR-C.so), which is similar in name and function to libLLVM-C.so. * It is guarded by the new CMake option MLIR_BUILD_MLIR_C_DYLIB, which has a similar purpose/name to the LLVM_BUILD_LLVM_C_DYLIB option. * On all platforms, this will work with both static, BUILD_SHARED_LIBS, and libMLIR builds, if supported: * In static builds: libMLIR-C.so will export the CAPI symbols and statically link all dependencies into itself. * In BUILD_SHARED_LIBS: libMLIR-C.so will export the CAPI symbols and have dynamic dependencies on implementation shared libraries. * In libMLIR.so mode: same as static. libMLIR.so was not finished for actual linking use within the project. An eventua...
-
Kazu Hirata authored
-
David Blaikie authored
Feedback from Richard Smith that the policy should be named closer to the context its used in.
-
Serge Pavlov authored
When compiler converts x87 operations to stack model, it may insert instructions that pop top stack element. To do it the compiler inserts instruction FSTP right after the instruction that calculates value on the stack. It can break the code that uses FPSW set by the last instruction. For example, an instruction FXAM is usually followed by FNSTSW, but FSTP is inserted after FXAM. As FSTP leaves condition code in FPSW undefined, the compiler produces incorrect code. With this change FSTP in inserted after the FPSW consumer if the last instruction sets FPSW. Differential Revision: https://reviews.llvm.org/D113335
-
Kazu Hirata authored
This reverts commit e941fe50. The commit in question causes: lld/MachO/InputFiles.cpp:916:13: error: use of undeclared identifier 'it'
-
Jez Ng authored
Clang seems to emit all functionAddress relocs as section relocs, but `ld -r` can turn those relocs into symbol ones. It turns out that we weren't handling that case correctly when the symbol was a weak def whose definition did not prevail. Reviewed By: #lld-macho, oontvoo Differential Revision: https://reviews.llvm.org/D113702
-
Petr Hosek authored
We don't build libcxxabi and libunwind for Windows so don't set the corresponding variables to avoid configuration errors. Differential Revision: https://reviews.llvm.org/D113729
-
Mogball authored
-
Luís Ferreira authored
This trivial patch runs clang-format on some unformatted files before doing logic changes and prevent hard to review diffs. Differential Revision: https://reviews.llvm.org/D113572
-
Arthur Eubanks authored
Forgot to amend D113537 with these changes before committing.
-
Arthur Eubanks authored
Having a separate counting method runs the risk of a mismatch between the actual reduction method and the counting method. Instead, create an Oracle that always returns true for shouldKeep(), run the reduction, and count how many times shouldKeep() was called. The module should not be modified if shouldKeep() always returns true. Reviewed By: Meinersbur Differential Revision: https://reviews.llvm.org/D113537
-
Arthur Eubanks authored
Metadata operands tend to require special conditions, especially on dbg intrinsics. We also don't have a zero value for metadata. Replacing callee operands is a little weird, since calling undef/null doesn't make sense. It also causes tons of invalid reductions when reducing calls to intrinsics since only arguments to intrinsics can be of the metadata type. Reviewed By: Meinersbur Differential Revision: https://reviews.llvm.org/D113532
-
Arthur Eubanks authored
If a sysroot was specified, it would take precedence over the Android NDK sysroot since it would appear after in the command line. Also only build runtimes for enabled target arches. Many places have copied this around so create and use supported_android_toolchains. Reviewed By: pcc Differential Revision: https://reviews.llvm.org/D113606
-
Mehdi Amini authored
This reverts commit c7be8b75. Build is broken (multiple buildbots)
-
LLVM GN Syncbot authored
-
Michael Kruse authored
Add a new "operands-skip" pass whose goal is to remove instructions in the middle of dependency chains. For instance: ``` %baseptr = alloca i32 %arrayidx = getelementptr i32, i32* %baseptr, i32 %idxprom store i32 42, i32* %arrayidx ``` might be reducible to ``` %baseptr = alloca i32 %arrayidx = getelementptr ... ; now dead, together with the computation of %idxprom store i32 42, i32* %baseptr ``` Other passes would either replace `%baseptr` with undef (operands, instructions) or move it to become a function argument (operands-to-args), both of which might fail the interestingness check. In principle the implementation allows operand replacement with any value or instruction in the function that passes the filter constraints (same type, dominance, "more reduced"), but is limited in this patch to values that are directly or indirectly used to compute the current operand value, motivated by the example above. Additionally, function arguments are added...
-
Stella Laurenzo authored
* Depends on D111504, which provides the boilerplate for building aggregate shared libraries from installed MLIR. * Adds a full-fledged Python example dialect and tests to the Standalone example (need to do a bit of tweaking in the top level CMake and lit tests to adapt better to if not building with Python enabled). * Rips out remnants of custom extension building in favor of `pybind11_add_module` which does the right thing. * Makes python and extension sources installable (outputs to src/python/${name} in the install tree): Both Python and C++ extension sources get installed as downstreams need all of this in order to build a derived version of the API. * Exports sources targets (with our properties that make everything work) by converting them to INTERFACE libraries (which have export support), as recommended for the forseeable future by CMake devs. Renames custom properties to start with lower-case letter, as also recommended/required (groan). * Adds a ROOT_DIR argument to `declare_mlir_python_extension` since now all C++ sources for an extension must be under the same directory (to line up at install time). * Need to validate against a downstream or two and adjust, prior to submitting. Downstreams will need to adapt by: * Remove absolute paths from any SOURCES for `declare_mlir_python_extension` (I believe all downstreams are just using `${CMAKE_CURRENT_SOURCE_DIR}` here, which can just be ommitted). May need to set `ROOT_DIR` if not relative to the current source directory. * To allow further downstreams to install/build, will need to make sure that all C++ extension headers are also listed under SOURCES for `declare_mlir_python_extension`. Reviewed By: stephenneuendorffer, mikeurbach Differential Revision: https://reviews.llvm.org/D111513 -
Mogball authored
-
Phoebe Wang authored
This fixes the crash due to lacking VZEXT_MOVL support with i16. Reviewed By: LuoYuanke, RKSimon Differential Revision: https://reviews.llvm.org/D113661
-
Michael Kruse authored
This reverts commit fa4210a9. It causes compile failures, presumably because conflicting with another patch landed after I checked locally.
-
Matthias Springer authored
The remaining dialects will be decoupled from ComprehensiveBufferize in separate commits. Differential Revision: https://reviews.llvm.org/D113459
-