platform/upstream/llvm.git
2 years agoAdd nounwind for tests. NFC
Phoebe Wang [Fri, 12 Nov 2021 13:05:51 +0000 (21:05 +0800)]
Add nounwind for tests. NFC

2 years ago[clangd] Mark macros from preamble for code completion
Kadir Cetinkaya [Wed, 10 Nov 2021 11:10:33 +0000 (12:10 +0100)]
[clangd] Mark macros from preamble for code completion

If the main file is a header, mark the marcos defined in its preamble
section as code-completion ready.

Fixes https://github.com/clangd/clangd/issues/921.

Differential Revision: https://reviews.llvm.org/D113555

2 years agoRevert "[clang] retain type sugar in auto / template argument deduction"
Adrian Kuegel [Fri, 12 Nov 2021 12:15:51 +0000 (13:15 +0100)]
Revert "[clang] retain type sugar in auto / template argument deduction"

This reverts commit 9b6036deedf28e10d797fc4ca734d57680d18053.
Breaks two libc++ tests.

2 years agoRevert "[lldb] fix test expectation broken by clang fix at D110216"
Adrian Kuegel [Fri, 12 Nov 2021 12:12:02 +0000 (13:12 +0100)]
Revert "[lldb] fix test expectation broken by clang fix at D110216"

This reverts commit 55085952175ed3b029097a0594acc4e34a5df218.
The patch it depends on is reverted.

2 years ago[SCEV] Use APIntOps::umin to select best max BC count (NFC).
Florian Hahn [Fri, 12 Nov 2021 12:20:00 +0000 (12:20 +0000)]
[SCEV] Use APIntOps::umin to select best max BC count (NFC).

Suggested in D102267, but I missed this in the committed version.

2 years ago[SCEV] Add test case where applying zext info pessimizes BTC.
Florian Hahn [Fri, 12 Nov 2021 12:19:35 +0000 (12:19 +0000)]
[SCEV] Add test case where applying zext info pessimizes BTC.

Add an additional test case for D113578.

2 years agotsan: don't start background thread after clone
Dmitry Vyukov [Thu, 11 Nov 2021 19:37:05 +0000 (20:37 +0100)]
tsan: don't start background thread after clone

Start the background thread only after fork, but not after clone.
For fork we did this always and it's known to work (or user code has adopted).
But if we do this for the new clone interceptor some code (sandbox2) fails.
So model we used to do for years and don't start the background thread after clone.

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D113744

2 years ago[mlir][Linalg] Rewrite DownscaleSizeOneWindowed2DConvolution to use rank-reducing...
Nicolas Vasilache [Fri, 12 Nov 2021 09:44:14 +0000 (09:44 +0000)]
[mlir][Linalg] Rewrite DownscaleSizeOneWindowed2DConvolution to use rank-reducing insert/extract slices.

This rewriting enables better bufferization and canonicalizations.

Differential Revision: https://reviews.llvm.org/D113745

2 years agotsan: fix XMM register corruption in hacky call
Dmitry Vyukov [Fri, 12 Nov 2021 09:06:20 +0000 (10:06 +0100)]
tsan: fix XMM register corruption in hacky call

The compiler does not recognize HACKY_CALL as a call
(we intentionally hide it from the compiler so that it can
compile non-leaf functions as leaf functions).
To compensate for that hacky call thunk saves and restores
all caller-saved registers. However, it saves only
general-purposes registers and does not save XMM registers.
This is a latent bug that was masked up until a recent "NFC" commit
d736002e90 ("tsan: move memory access functions to a separate file"),
which allowed more inlining and exposed the 10-year bug.
Save and restore caller-saved XMM registers (all) as well.

Currently the bug manifests as e.g. frexp interceptor messes the
return value and the added test fails with:
  i=8177 y=0.000000 exp=4

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D113742

2 years ago[llvm-nm] Demangle Rust symbols
Tomasz Miąsko [Sat, 16 Oct 2021 12:10:31 +0000 (14:10 +0200)]
[llvm-nm] Demangle Rust symbols

Add support for demangling Rust v0 symbols to llvm-nm by reusing
nonMicrosoftDemangle which supports both Itanium and Rust mangling.

Reviewed By: dblaikie, jhenderson

Differential Revision: https://reviews.llvm.org/D111937

2 years ago[clang] NFC: Use range-based for loop
Jan Svoboda [Fri, 12 Nov 2021 11:11:15 +0000 (12:11 +0100)]
[clang] NFC: Use range-based for loop

2 years ago[clang] NFC: Remove benign condition
Jan Svoboda [Fri, 12 Nov 2021 11:05:02 +0000 (12:05 +0100)]
[clang] NFC: Remove benign condition

2 years ago[clang-tidy] Re-apply 0076957 with fix for failing ASan tests
Salman Javed [Fri, 12 Nov 2021 10:24:19 +0000 (23:24 +1300)]
[clang-tidy] Re-apply 0076957 with fix for failing ASan tests

Re-apply "Fix lint warning in ClangTidyDiagnosticConsumer.cpp (NFC)"
with fixes for the failing ASan tests.

This reverts commit 74add1b6d6d377ab2cdce26699cf798110817e42.

2 years ago[analyzer][solver] Remove reference to RangedConstraintManager
Gabor Marton [Fri, 5 Nov 2021 10:53:29 +0000 (11:53 +0100)]
[analyzer][solver] Remove reference to RangedConstraintManager

We no longer need a reference to RangedConstraintManager, we call top
level `State->assume` functions.

Differential Revision: https://reviews.llvm.org/D113261

2 years ago[analyzer][solver] Iterate to a fixpoint during symbol simplification with constants
Gabor Marton [Mon, 26 Jul 2021 20:55:44 +0000 (22:55 +0200)]
[analyzer][solver] Iterate to a fixpoint during symbol simplification with constants

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

2 years ago[AMDGPU][NFC] Fix typos
Neubauer, Sebastian [Thu, 11 Nov 2021 14:58:42 +0000 (15:58 +0100)]
[AMDGPU][NFC] Fix typos

Differential Revision: https://reviews.llvm.org/D113672

2 years ago[SCEV] Add tests where guards limit both %n and (zext %n).
Florian Hahn [Fri, 12 Nov 2021 10:30:03 +0000 (10:30 +0000)]
[SCEV] Add tests where guards limit both %n and (zext %n).

Suggested in D113577.

2 years ago[Flang] Add type conversion for FIR integer kind
Kiran Chandramohan [Fri, 12 Nov 2021 10:10:18 +0000 (10:10 +0000)]
[Flang] Add type conversion for FIR integer kind

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>
2 years agoRevert "Implement target_clones multiversioning"
Adrian Kuegel [Fri, 12 Nov 2021 10:05:58 +0000 (11:05 +0100)]
Revert "Implement target_clones multiversioning"

This reverts commit 9deab60ae710f8c4cc810cd680edfb64c803f42d.
There is a possibly unintended semantic change.

2 years agoRe-land commit 735e433 after fixing buildbot issue
Salman Javed [Fri, 12 Nov 2021 09:59:33 +0000 (22:59 +1300)]
Re-land commit 735e433 after fixing buildbot issue

This reverts commit d73e27d.

2 years ago[Flang] Add type conversion for FIR heap type
Kiran Chandramohan [Fri, 12 Nov 2021 09:35:03 +0000 (09:35 +0000)]
[Flang] Add type conversion for FIR heap type

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>
2 years agoRevert "Make minor fixes to docs based on post-commit review of commit 5de69e1"
Salman Javed [Fri, 12 Nov 2021 09:42:18 +0000 (22:42 +1300)]
Revert "Make minor fixes to docs based on post-commit review of commit 5de69e1"

Sphinx buildbot failing.
This reverts commit 735e4332e2a63e5f0a04f91472fa2403c7d37fe3.

2 years ago[DSE] Add test case with multiple inbounds stores, followed by OOB.
Florian Hahn [Fri, 12 Nov 2021 09:40:03 +0000 (09:40 +0000)]
[DSE] Add test case with multiple inbounds stores, followed by OOB.

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.

2 years agoMake minor fixes to docs based on post-commit review of commit 5de69e1
Salman Javed [Fri, 12 Nov 2021 09:36:21 +0000 (22:36 +1300)]
Make minor fixes to docs based on post-commit review of commit 5de69e1

- 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.

2 years ago[flang] fix unused variable warning from D113659
Jean Perier [Fri, 12 Nov 2021 08:34:02 +0000 (09:34 +0100)]
[flang] fix unused variable warning from D113659

2 years ago[flang] Fix vector cshift runtime with non zero lower bounds
Jean Perier [Fri, 12 Nov 2021 08:25:22 +0000 (09:25 +0100)]
[flang] Fix vector cshift runtime with non zero lower bounds

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

2 years ago[NFC][lsan] Simplify root_regions initialization
Vitaly Buka [Fri, 12 Nov 2021 07:32:58 +0000 (23:32 -0800)]
[NFC][lsan] Simplify root_regions initialization

2 years ago[VE] Disable incompatible compiler-rt tests
Simon Moll [Fri, 12 Nov 2021 07:23:07 +0000 (08:23 +0100)]
[VE] Disable incompatible compiler-rt tests

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

2 years agoAdd a cppType string in AttrDef to make it possible to use them as parameters in...
Mehdi Amini [Fri, 12 Nov 2021 07:20:33 +0000 (07:20 +0000)]
Add a cppType string in AttrDef to make it possible to use them as parameters in other attributes

Differential Revision: https://reviews.llvm.org/D113737

2 years ago[VE][NFCi] Remove unused tablegen parameters
Simon Moll [Fri, 12 Nov 2021 07:19:36 +0000 (08:19 +0100)]
[VE][NFCi] Remove unused tablegen parameters

TableGen has started warning about unused template parameters in the isel patterns.  Remove those.

Reviewed By: kaz7

Differential Revision: https://reviews.llvm.org/D113675

2 years agoFix minor deficiency in machine-sink.
Markus Lavin [Thu, 11 Nov 2021 14:27:15 +0000 (15:27 +0100)]
Fix minor deficiency in machine-sink.

Register uses that are MRI->isConstantPhysReg() should not inhibit
sinking transformation.

Reviewed By: StephenTozer

Differential Revision: https://reviews.llvm.org/D111531

2 years ago[mlir] Add MLIR-C dylib.
Stella Laurenzo [Fri, 12 Nov 2021 05:18:16 +0000 (21:18 -0800)]
[mlir] Add MLIR-C dylib.

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 eventual relayering so that libMLIR-C.so depends on libMLIR.so is possible but requires first re-engineering the latter to use the aggregate facility.
* On Linux, exported symbols are filtered to only the CAPI. On others (MacOS, Windows), all symbols are exported. A CMake status is printed unless if global visibility is hidden indicating that this has not yet been implemented. The library should still work, but it will be larger and more likely to conflict until fixed. Someone should look at lifting the corresponding support from libLLVM-C.so and adapting. Or, for special uses, just build with `-DCMAKE_CXX_VISIBILITY_PRESET=hidden -DCMAKE_C_VISIBILITY_PRESET=hidden`.
* Includes fixes to execution engine symbol export macros to enable default visibility. Without this, the advice to use hidden visibility would have resulted in test failures and unusable execution engine support libraries.

Differential Revision: https://reviews.llvm.org/D113731

2 years ago[CodeGen, Target] Use MachineRegisterInfo::use_operands (NFC)
Kazu Hirata [Fri, 12 Nov 2021 06:28:55 +0000 (22:28 -0800)]
[CodeGen, Target] Use MachineRegisterInfo::use_operands (NFC)

2 years agoDebugInfo/Printing: Improve name of policy for including types for template arguments
David Blaikie [Fri, 12 Nov 2021 05:47:30 +0000 (21:47 -0800)]
DebugInfo/Printing: Improve name of policy for including types for template arguments

Feedback from Richard Smith that the policy should be named closer to
the context its used in.

2 years ago[X86] Preserve FPSW when popping x87 stack
Serge Pavlov [Wed, 3 Nov 2021 12:34:52 +0000 (19:34 +0700)]
[X86] Preserve FPSW when popping x87 stack

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

2 years agoRevert "[lld-macho] Fix symbol relocs handling for compact unwind's functionAddress"
Kazu Hirata [Fri, 12 Nov 2021 04:29:48 +0000 (20:29 -0800)]
Revert "[lld-macho] Fix symbol relocs handling for compact unwind's functionAddress"

This reverts commit e941fe506114569410ec8c77e600cddd5a77559d.

The commit in question causes:

  lld/MachO/InputFiles.cpp:916:13: error: use of undeclared identifier
  'it'

2 years ago[lld-macho] Fix symbol relocs handling for compact unwind's functionAddress
Jez Ng [Fri, 12 Nov 2021 03:53:35 +0000 (22:53 -0500)]
[lld-macho] Fix symbol relocs handling for compact unwind's functionAddress

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

2 years ago[Fuchsia][CMake] Don't set libcxxabi and libunwind variables on Windows
Petr Hosek [Fri, 12 Nov 2021 03:24:49 +0000 (19:24 -0800)]
[Fuchsia][CMake] Don't set libcxxabi and libunwind variables on Windows

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

2 years ago[mlir][ods] Fix DenseSet ambiguous reference
Mogball [Fri, 12 Nov 2021 03:12:36 +0000 (03:12 +0000)]
[mlir][ods] Fix DenseSet ambiguous reference

2 years ago[DebugInfo] run clang-format on some unformatted files
Luís Ferreira [Thu, 11 Nov 2021 21:39:50 +0000 (13:39 -0800)]
[DebugInfo] run clang-format on some unformatted files

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

2 years ago[llvm-reduce] Fix build after D113537
Arthur Eubanks [Fri, 12 Nov 2021 02:53:34 +0000 (18:53 -0800)]
[llvm-reduce] Fix build after D113537

Forgot to amend D113537 with these changes before committing.

2 years ago[llvm-reduce] Count chunks by running a preliminary reduction
Arthur Eubanks [Fri, 12 Nov 2021 02:45:59 +0000 (18:45 -0800)]
[llvm-reduce] Count chunks by running a preliminary reduction

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

2 years ago[llvm-reduce] Skip replacing metadata and callee operands
Arthur Eubanks [Wed, 10 Nov 2021 01:47:43 +0000 (17:47 -0800)]
[llvm-reduce] Skip replacing metadata and callee operands

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

2 years ago[gn build] Fix Android compiler-rt targets
Arthur Eubanks [Wed, 10 Nov 2021 20:51:51 +0000 (12:51 -0800)]
[gn build] Fix Android compiler-rt targets

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

2 years agoRevert "[mlir] Allow out-of-tree python building from installed MLIR."
Mehdi Amini [Fri, 12 Nov 2021 02:30:53 +0000 (02:30 +0000)]
Revert "[mlir] Allow out-of-tree python building from installed MLIR."

This reverts commit c7be8b75399c727ec9e1ddc3f81510f284c65155.

Build is broken (multiple buildbots)

2 years ago[gn build] Port c15f930e9656
LLVM GN Syncbot [Fri, 12 Nov 2021 02:22:04 +0000 (02:22 +0000)]
[gn build] Port c15f930e9656

2 years ago[llvm-reduce] Introduce operands-skip pass.
Michael Kruse [Fri, 12 Nov 2021 00:23:27 +0000 (18:23 -0600)]
[llvm-reduce] Introduce operands-skip pass.

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 to the candidate set which helps reducing the number of relevant arguments mitigating a concern of too many arguments mentioned in https://reviews.llvm.org/D110274#3025013.

Possible future extensions:
 * Instead of requiring the same type, bitcast/trunc/zext could be automatically inserted for some more flexibility.
 * If undef is added to the candidate set, "operands-skip"is able to produce any reduction that "operands" can do. Additional candidates might be zero and one, where the "reductive power" classification can prefer one over the other. If undefined behaviour should not be introduced, undef can be removed from the candidate set.

Recommit after resolving conflict with D112651 and reusing
shouldReduceOperand from D113532.

Reviewed By: aeubanks

Differential Revision: https://reviews.llvm.org/D111818

2 years ago[mlir] Allow out-of-tree python building from installed MLIR.
Stella Laurenzo [Fri, 12 Nov 2021 01:31:39 +0000 (17:31 -0800)]
[mlir] Allow out-of-tree python building from installed MLIR.

* 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

2 years ago[mlir][ods] Escape attribute summaries
Mogball [Fri, 12 Nov 2021 01:39:15 +0000 (01:39 +0000)]
[mlir][ods] Escape attribute summaries

2 years ago[X86][FP16] Avoid to generate VZEXT_MOVL with i16
Phoebe Wang [Fri, 12 Nov 2021 00:50:07 +0000 (08:50 +0800)]
[X86][FP16] Avoid to generate VZEXT_MOVL with i16

This fixes the crash due to lacking VZEXT_MOVL support with i16.

Reviewed By: LuoYuanke, RKSimon

Differential Revision: https://reviews.llvm.org/D113661

2 years agoRevert "[llvm-reduce] Introduce operands-skip pass."
Michael Kruse [Fri, 12 Nov 2021 01:25:39 +0000 (19:25 -0600)]
Revert "[llvm-reduce] Introduce operands-skip pass."

This reverts commit fa4210a9a0729eba04593b7df7b701e2b243de39.

It causes compile failures, presumably because conflicting with another
patch landed after I checked locally.

2 years ago[mlir][linalg][bufferize] Decouple ComprehensiveBufferize from Linalg
Matthias Springer [Fri, 12 Nov 2021 01:00:43 +0000 (10:00 +0900)]
[mlir][linalg][bufferize] Decouple ComprehensiveBufferize from Linalg

The remaining dialects will be decoupled from ComprehensiveBufferize in separate commits.

Differential Revision: https://reviews.llvm.org/D113459

2 years ago[mlir][ods] Unique attribute, successor, region constraints
Mogball [Thu, 11 Nov 2021 22:08:54 +0000 (22:08 +0000)]
[mlir][ods] Unique attribute, successor, region constraints

With `-Os` turned on, results in 2-5% binary size reduction
(depends on the original binary). Without it, the binary size
is essentially unchanged.

Depends on D113128

Differential Revision: https://reviews.llvm.org/D113331

2 years ago[llvm-reduce] Introduce operands-skip pass.
Michael Kruse [Fri, 12 Nov 2021 00:23:27 +0000 (18:23 -0600)]
[llvm-reduce] Introduce operands-skip pass.

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 to the candidate set which helps reducing the number of relevant arguments mitigating a concern of too many arguments mentioned in https://reviews.llvm.org/D110274#3025013.

Possible future extensions:
 * Instead of requiring the same type, bitcast/trunc/zext could be automatically inserted for some more flexibility.
 * If undef is added to the candidate set, "operands-skip"is able to produce any reduction that "operands" can do. Additional candidates might be zero and one, where the "reductive power" classification can prefer one over the other. If undefined behaviour should not be introduced, undef can be removed from the candidate set.

Reviewed By: aeubanks

Differential Revision: https://reviews.llvm.org/D111818

2 years ago[mlir][linalg][bufferize] Add PostAnalysisStep
Matthias Springer [Fri, 12 Nov 2021 00:50:35 +0000 (09:50 +0900)]
[mlir][linalg][bufferize] Add PostAnalysisStep

This helper struct allows users of ComprehensiveBufferize to inject "post analysis" steps that are implemented after the analysis but before the bufferization.

Differential Revision: https://reviews.llvm.org/D113458

2 years ago[lldb] fix test expectation broken by clang fix at D110216
Matheus Izvekov [Fri, 12 Nov 2021 00:27:27 +0000 (01:27 +0100)]
[lldb] fix test expectation broken by clang fix at D110216

Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>
Differential Revision: https://reviews.llvm.org/D113722

2 years ago[clang] retain type sugar in auto / template argument deduction
Matheus Izvekov [Mon, 13 Sep 2021 13:35:45 +0000 (15:35 +0200)]
[clang] retain type sugar in auto / template argument deduction

This implements the following changes:
* AutoType retains sugared deduced-as-type.
* Template argument deduction machinery analyses the sugared type all the way
down. It would previously lose the sugar on first recursion.
* Undeduced AutoType will be properly canonicalized, including the constraint
template arguments.
* Remove the decltype node created from the decltype(auto) deduction.

As a result, we start seeing sugared types in a lot more test cases,
including some which showed very unfriendly `type-parameter-*-*` types.

Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>
Reviewed By: rsmith

Differential Revision: https://reviews.llvm.org/D110216

2 years ago[lldb][NFC] Delete commented out code in AddressRange
Alex Langford [Thu, 11 Nov 2021 23:41:40 +0000 (15:41 -0800)]
[lldb][NFC] Delete commented out code in AddressRange

2 years ago[libc] Simplify decimalStringToFloat and hexadecimalStringToFloat and improve their...
Tue Ly [Thu, 11 Nov 2021 16:22:52 +0000 (11:22 -0500)]
[libc] Simplify decimalStringToFloat and hexadecimalStringToFloat and improve their performance.

Combine two loops in decimalStringToFloat and hexadecimalStringToFloat that extract the digits and re-arrange them a little bit.  This slightly improves the performance of strtof and strtod:
Running libc_str_to_float_comparison_test parse-number-fxx-test_data/data/* on my machine (Ryzen 1700)
- with glibc: ~1.92 seconds
- with current implementation: ~1.78 seconds
- with this change: ~1.67 seconds

Differential Revision: https://reviews.llvm.org/D113681

2 years ago[Driver] Fix unused variable warning in release builds. NFC.
Benjamin Kramer [Thu, 11 Nov 2021 23:20:21 +0000 (00:20 +0100)]
[Driver] Fix unused variable warning in release builds. NFC.

2 years ago[Driver] Fix ToolChain::getSanitizerArgs
Yaxun (Sam) Liu [Thu, 7 Oct 2021 03:55:26 +0000 (23:55 -0400)]
[Driver] Fix ToolChain::getSanitizerArgs

The driver uses class SanitizerArgs to store parsed sanitizer arguments. It keeps a cached
SanitizerArgs object in ToolChain and uses it for different jobs. This does not work if
the sanitizer options are different for different jobs, which could happen when an
offloading toolchain translates the options for different jobs.

To fix this, SanitizerArgs should be created by using the actual arguments passed
to jobs instead of the original arguments passed to the driver, since the toolchain
may change the original arguments. And the sanitizer arguments should be diagnose
once.

This patch also fixes HIP toolchain for handling -fgpu-sanitize: a warning is emitted
for GPU's not supporting sanitizer and skipped. This is for backward compatibility
with existing -fsanitize options. -fgpu-sanitize is also turned on by default.

Reviewed by: Artem Belevich, Evgenii Stepanov

Differential Revision: https://reviews.llvm.org/D111443

2 years ago[mlir][spirv] Regenerate SPIRVBase.td from recent spec
Butygin [Thu, 11 Nov 2021 21:34:37 +0000 (16:34 -0500)]
[mlir][spirv] Regenerate SPIRVBase.td from recent spec

* Some long names were added and script decided to change whitespaces in a lot of places
* `ImageOperand` was renamed to `ImageOperands` in spec
* Some *NV enums were renamed to *KHR (spec actually maintains both variants with same value, but script pulled only *KHR versions)

Reviewed By: antiagainst

Differential Revision: https://reviews.llvm.org/D113667

2 years ago[flang] Allow exterior branch to outermost WHERE construct statement
Peter Klausler [Wed, 10 Nov 2021 22:36:15 +0000 (14:36 -0800)]
[flang] Allow exterior branch to outermost WHERE construct statement

The labels of WHERE constructs were being created within the scope of
the construct, not the scope of its parent, leading to incorrect error
messages for branches to that label.

Differential Revision: https://reviews.llvm.org/D113696

2 years ago[mlir][VectorToGPU] Support more cases in conversion to MMA ops
Thomas Raoux [Wed, 10 Nov 2021 22:32:15 +0000 (14:32 -0800)]
[mlir][VectorToGPU] Support more cases in conversion to MMA ops

Support load with broadcast, elementwise divf op and remove the
hardcoded restriction on the vector size. Picking the right size should
be enfored by user and will fail conversion to llvm/spirv if it is not
supported.

Differential Revision: https://reviews.llvm.org/D113618

2 years ago[lldb][NFC] Inclusive Language: rename master plan to controlling plan
Quinn Pham [Tue, 2 Nov 2021 13:58:19 +0000 (08:58 -0500)]
[lldb][NFC] Inclusive Language: rename master plan to controlling plan

[NFC] As part of using inclusive language within the llvm project, this patch
renames master plan to controlling plan in lldb.

Reviewed By: jingham

Differential Revision: https://reviews.llvm.org/D113019

2 years agoEmit final macro diagnostics in system headers
Chris Bieneman [Thu, 11 Nov 2021 19:50:49 +0000 (13:50 -0600)]
Emit final macro diagnostics in system headers

Final macro diagnostics should log from system headers.

As planned, final macros are hard-mode. They always log diagnostics.

2 years ago[libcxx][format] Fix how we handle char traits in formatter<string> and formatter...
Daniel McIntosh [Thu, 7 Oct 2021 21:32:09 +0000 (17:32 -0400)]
[libcxx][format] Fix how we handle char traits in formatter<string> and formatter<string_view>

Right now we drop the char_traits template argument, which presumes that
string<_CharT, _Traits> and string<_CharT> are interchangeable.

Reviewed By: Mordante, #libc, Quuxplusone

Differential Revision: https://reviews.llvm.org/D112017

2 years agoFix Sphinx build diagnostics
Aaron Ballman [Thu, 11 Nov 2021 19:38:11 +0000 (14:38 -0500)]
Fix Sphinx build diagnostics

This won't parse as either C or C++ according to Sphinx, so switched to
text to appease Sphinx.

2 years ago[memprof] Make the raw binary format the default.
Snehasish Kumar [Wed, 10 Nov 2021 22:37:15 +0000 (14:37 -0800)]
[memprof] Make the raw binary format the default.

Set the default memprof serialization format as binary. 9 tests are
updated to use print_text=true. Also fixed an issue with concatenation
of default and test specified options (missing separator).

Differential Revision: https://reviews.llvm.org/D113617

2 years ago[memprof] Add a raw binary format to serialize memprof profiles.
Snehasish Kumar [Tue, 12 Oct 2021 18:30:23 +0000 (11:30 -0700)]
[memprof] Add a raw binary format to serialize memprof profiles.

This change implements the raw binary format discussed in
https://lists.llvm.org/pipermail/llvm-dev/2021-September/153007.html

Summary of changes
* Add a new memprof option to choose binary or text (default) format.
* Add a rawprofile library which serializes the MIB map to profile.
* Add a unit test for rawprofile.
* Mark sanitizer procmaps methods as virtual to be able to mock them.
* Extend memprof_profile_dump regression test.

Differential Revision: https://reviews.llvm.org/D113317

2 years ago[memprof] Replace the block cache with a hashmap.
Snehasish Kumar [Mon, 11 Oct 2021 22:03:29 +0000 (15:03 -0700)]
[memprof] Replace the block cache with a hashmap.

The existing implementation uses a cache + eviction based scheme to
record heap profile information. This design was adopted to ensure a
constant memory overhead (due to fixed number of cache entries) along
with incremental write-to-disk for evictions. We find that since the
number to entries to track is O(unique-allocation-contexts) the overhead
of keeping all contexts in memory is not very high. On a clang workload,
the max number of unique allocation contexts was ~35K, median ~11K.
For each context, we (currently) store 64 bytes of data - this amounts
to 5.5MB (max). Given the low overheads for a complex workload, we can
simplify the implementation by using a hashmap without eviction.

Other changes:
* Memory map is dumped at the end rather than startup. The relative
order in the profile dump is unchanged since we no longer have evicted
entries at runtime.
* Added a test to check meminfoblocks are merged.

Differential Revision: https://reviews.llvm.org/D111676

2 years ago[memprof] Move the MemInfoBlock definition to a separate header.
Snehasish Kumar [Fri, 5 Nov 2021 19:51:34 +0000 (12:51 -0700)]
[memprof] Move the MemInfoBlock definition to a separate header.

Move the memprof MemInfoBlock struct to it's own header as requested
during the review of D111676.

Differential Revision: https://reviews.llvm.org/D113315

2 years ago[sanitizer] Add a ForEach callback interface for AddrHashMap.
Snehasish Kumar [Thu, 7 Oct 2021 23:35:11 +0000 (16:35 -0700)]
[sanitizer] Add a ForEach callback interface for AddrHashMap.

This change adds a ForEach method to the AddrHashMap class which can
then be used to iterate over all the key value pairs in the hash map.
I intend to use this in an upcoming change to the memprof runtime.

Added a unit test to cover basic insertion and the ForEach callback.

Differential Revision: https://reviews.llvm.org/D111368

2 years ago[InstCombine] Drop redundant fold for and/or of icmp eq/ne (NFCI)
Nikita Popov [Thu, 11 Nov 2021 18:15:11 +0000 (19:15 +0100)]
[InstCombine] Drop redundant fold for and/or of icmp eq/ne (NFCI)

This handles a special case of foldAndOrOfICmpsUsingRanges()
with two equality predicates.

2 years ago[x86] add tests and RUNs for vector compares; NFC
Sanjay Patel [Thu, 11 Nov 2021 18:31:46 +0000 (13:31 -0500)]
[x86] add tests and RUNs for vector compares; NFC

More coverage for D113603

2 years ago[libc++] Implement file_clock::{to,from}_sys
Louis Dionne [Mon, 8 Nov 2021 20:30:32 +0000 (15:30 -0500)]
[libc++] Implement file_clock::{to,from}_sys

This is part of https://wg21.link/P0355R7. I am adding these methods
to provide an alternative for the {from,to}_time_t methods that were
removed in https://llvm.org/D113027.

Differential Revision: https://reviews.llvm.org/D113430

2 years ago[libc++] Disallow running the libc++ benchmarks in standalone builds
Louis Dionne [Tue, 9 Nov 2021 19:44:19 +0000 (14:44 -0500)]
[libc++] Disallow running the libc++ benchmarks in standalone builds

We are trying to remove duplication of third-party code in
https://reviews.llvm.org/D112012, which will move the Google
Benchmark code outside of the `libcxx/` directory. That breaks
running the benchmarks in the Standalone build. Since we have
deprecated the Standalone build anyway, this patch just removes
support for the benchmark in Standalone mode until we remove that
mode entirely.

Differential Revision: https://reviews.llvm.org/D113503

2 years ago[libc++] Allow running the bootstrapping CI build on Darwin
Louis Dionne [Thu, 11 Nov 2021 16:55:20 +0000 (11:55 -0500)]
[libc++] Allow running the bootstrapping CI build on Darwin

Instead of hard-coding the target for our CI nodes, use the default
compiler triple. Also, allow building compiler-rt for the single
specified triple in case we're running on Darwin (otherwise, the
bootstrapping build complains).

Differential Revision: https://reviews.llvm.org/D113683

2 years ago[OpenMP] Allow building libomp using Microsoft Visual C++ naming scheme
Bran Hagger [Thu, 11 Nov 2021 19:08:25 +0000 (13:08 -0600)]
[OpenMP] Allow building libomp using Microsoft Visual C++ naming scheme

Differential Revision: https://reviews.llvm.org/D110354

2 years agoImplement target_clones multiversioning
Erich Keane [Fri, 5 Nov 2021 13:25:34 +0000 (06:25 -0700)]
Implement target_clones multiversioning

As discussed here: https://lwn.net/Articles/691932/

GCC6.0 adds target_clones multiversioning. This functionality is
an odd cross between the cpu_dispatch and 'target' MV, but is compatible
with neither.

This attribute allows you to list all options, then emits a separately
optimized version of each function per-option (similar to the
cpu_specific attribute). It automatically generates a resolver, just
like the other two.

The mangling however, is... ODD to say the least. The mangling format
is:
<normal_mangling>.<option string>.<option ordinal>.

Differential Revision:https://reviews.llvm.org/D51650

2 years ago[AIX][NFC] Disable clang-repl tests failing due to lack of 64-bit XCOFF support.
Steven Wan [Thu, 11 Nov 2021 19:10:37 +0000 (14:10 -0500)]
[AIX][NFC] Disable clang-repl tests failing due to lack of 64-bit XCOFF support.

The following interpreter tests failed on AIX because 64-bit XCOFF object files are currently not supported on AIX. This patch disables the tests on AIX for the time being.

Reviewed By: Jake-Egan

Differential Revision: https://reviews.llvm.org/D113614

2 years ago[M68k][NFC] Rename 'GlSel' -> 'GISel'
Min-Yih Hsu [Thu, 11 Nov 2021 18:59:00 +0000 (10:59 -0800)]
[M68k][NFC] Rename 'GlSel' -> 'GISel'

AArch64 as well as other targets use the abbrev "GISel" so we'd better
to be consistent with them. NFC.

2 years agoFully qualify `::mlir::IntegerAttr` type in ODS generated code (NFC)
Abhimanyu Goyal [Thu, 11 Nov 2021 18:59:11 +0000 (18:59 +0000)]
Fully qualify `::mlir::IntegerAttr` type in ODS generated code (NFC)

2 years ago[RISCV] Add rv32i/rv64i command lines to some floating point tests. NFC
Craig Topper [Thu, 11 Nov 2021 18:08:51 +0000 (10:08 -0800)]
[RISCV] Add rv32i/rv64i command lines to some floating point tests. NFC

This improves our coverage of soft float libcalls lowering.

Remove most of the test cases from rv64i-single-softfloat.ll. They
were duplicated in the test files that now test softflow. Only
a couple test cases for constrained FP remain. Those should be
removed when we start supporting constrained FP.

This is follow up from D113528.

2 years ago[X86] Move LowerFunnelShift below LowerShift. NFC.
Simon Pilgrim [Thu, 11 Nov 2021 18:45:37 +0000 (18:45 +0000)]
[X86] Move LowerFunnelShift below LowerShift. NFC.

Makes it easier to reuse the various vector shift helpers defined above LowerShift

2 years ago[DAG] reassociateOpsCommutative - test getNode result directly. NFC
Simon Pilgrim [Thu, 11 Nov 2021 14:13:33 +0000 (14:13 +0000)]
[DAG] reassociateOpsCommutative - test getNode result directly. NFC

Matches the clean code style we use directly above

2 years ago[clang-apply-replacements] Correctly handle relative paths
Adrian Vogelsgesang [Thu, 11 Nov 2021 18:19:54 +0000 (18:19 +0000)]
[clang-apply-replacements] Correctly handle relative paths

The fixes from the YAML file can refer to relative paths.
Those relative paths are meant to be resolved relative to the
corresponding `build directory`.
However, `clang-apply-replacements` currently interprets all
paths relative to its own working directory. This causes issues,
e.g., when `clang-apply-replacements` is run from outside of
the original build directory.

This commit adjusts `clang-apply-replacements` to take the build
directory into account when resolving relative file paths.

Reviewed By: ymandel

Differential Revision: https://reviews.llvm.org/D112647

2 years agotsan: enable clone interceptor only on Linux
Dmitry Vyukov [Thu, 11 Nov 2021 18:17:17 +0000 (19:17 +0100)]
tsan: enable clone interceptor only on Linux

Clone does not exist on Mac.
There are chances it will break on other OSes.
Enable it incrementally starting with Linux only,
other OSes can enable it later as needed.

Reviewed By: melver, thakis

Differential Revision: https://reviews.llvm.org/D113693

2 years ago[NFC][InlineAdvisor] Inform advisor when the module is invalidated
Mircea Trofin [Thu, 11 Nov 2021 18:23:40 +0000 (10:23 -0800)]
[NFC][InlineAdvisor] Inform advisor when the module is invalidated

This avoids unnecessary re-calculation of module-wide features in the
MLInlineAdvisor. In cases where function passes don't invalidate
functions (and, thus, don't invalidate the module), but we re-process a
CGSCC, we currently refreshed module features unnecessarily. The
overhead of fetching cached results (albeit they weren't themselves
invalidated) was noticeable in certain modules' compilations.

We don't want to just invalidate the advisor object, though, via the
analysis manager, because we'd then need to re-create expensive state
(like the model evaluator in the ML 'development' mode).

Reviewed By: phosek

Differential Revision: https://reviews.llvm.org/D113644

2 years ago[AArch64] Add some fp16 cast cost-model tests.
Florian Hahn [Thu, 11 Nov 2021 18:21:44 +0000 (18:21 +0000)]
[AArch64] Add some fp16 cast cost-model tests.

This adds initial tests for cost-modeling {u,s}itofp for fp16 vectors.
At the moment, they are under-estimated in a couple of cases.

2 years ago[libc] tweak strtof errno behavior
Michael Jones [Thu, 11 Nov 2021 00:19:29 +0000 (16:19 -0800)]
[libc] tweak strtof errno behavior

When strtof/d/ld return a subnormal number they may set errno to
ERANGE. This change makes this behavior more consistent by making any
decimal number converting to a subnormal set errno to ERANGE. This
brings it in line with hexadecimals, which currently only set errno to
ERANGE if the number is truncated when converting to a subnormal.

Reviewed By: sivachandra, lntue

Differential Revision: https://reviews.llvm.org/D113626

2 years ago[libc] clean up FPUtil long doubles
Michael Jones [Thu, 11 Nov 2021 00:11:18 +0000 (16:11 -0800)]
[libc] clean up FPUtil long doubles

Add quietNaNMask consts to FloatProperties and make LongDoubleBitsX86
clear the extra bits that aren't set when initializing with an 80 bit
long double.

Reviewed By: sivachandra, lntue

Differential Revision: https://reviews.llvm.org/D113625

2 years ago[flang][CodeGen] Transform `IsPresentOpConversion` and `AbsentOpConversion`
Andrzej Warzynski [Mon, 8 Nov 2021 11:35:48 +0000 (11:35 +0000)]
[flang][CodeGen] Transform `IsPresentOpConversion` and `AbsentOpConversion`

This patch extends the `FIRToLLVMLowering` pass in Flang by adding
hooks to transform `fir.is_present` and `fir.absent` to the LLVM dialect
of MLIR.

This is part of the upstreaming effort from the `fir-dev` branch in [1].

[1] https://github.com/flang-compiler/f18-llvm-project

Differential Revision: https://reviews.llvm.org/D113395

Originally written by:
Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
2 years ago[gn build] (manually) port 57c22ade867
Nico Weber [Thu, 11 Nov 2021 18:07:17 +0000 (13:07 -0500)]
[gn build] (manually) port 57c22ade867

2 years ago[InstCombine] Handle undefs in and of icmp eq zero fold
Nikita Popov [Thu, 11 Nov 2021 17:59:03 +0000 (18:59 +0100)]
[InstCombine] Handle undefs in and of icmp eq zero fold

For the scalar/splat case, this fold is subsumed by
foldLogOpOfMaskedICmps(). However, the conjugated fold for "or"
also supports splats with undef. Make both code paths consistent
by using m_ZeroInt() for the "and" implementation as well.

https://alive2.llvm.org/ce/z/tN63cu
https://alive2.llvm.org/ce/z/ufB_Ue

2 years ago[libc++] Implement P2186R2 (Remove Garbage Collection)
Nikolas Klauser [Thu, 11 Nov 2021 17:57:25 +0000 (18:57 +0100)]
[libc++] Implement P2186R2 (Remove Garbage Collection)

Reviewed By: Quuxplusone, #libc, ldionne

Differential Revision: https://reviews.llvm.org/D112869

2 years ago[InstCombine] Add test for and of icmp ne zero with undefs (NFC)
Nikita Popov [Thu, 11 Nov 2021 17:59:07 +0000 (18:59 +0100)]
[InstCombine] Add test for and of icmp ne zero with undefs (NFC)

We handle this in the conjugated "or" fold, but not for "and".

2 years ago[libc++] Use addressof in list.
Mark de Wever [Wed, 27 Oct 2021 16:50:07 +0000 (18:50 +0200)]
[libc++] Use addressof in list.

This addresses the usage of `operator&` in `<list>`.

(Note there are still more headers with the same issue.)

Reviewed By: #libc, Quuxplusone, ldionne

Differential Revision: https://reviews.llvm.org/D112654

2 years agotsan: intercept clone
Dmitry Vyukov [Thu, 11 Nov 2021 15:17:58 +0000 (16:17 +0100)]
tsan: intercept clone

gtest uses clone for death tests and it needs the same
handling as fork to prevent deadlock (take runtime mutexes
before and release them after).

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D113677

2 years ago[mlir][Linalg] Add 1-d depthwise conv with opdsl
Nicolas Vasilache [Thu, 11 Nov 2021 17:33:24 +0000 (17:33 +0000)]
[mlir][Linalg] Add 1-d depthwise conv with opdsl

Differential Revision: https://reviews.llvm.org/D113686