SuccessChanges

Changes from Git (git http://labmaster3.local/git/llvm-project.git)

Summary

  1. [libFuzzer] Do not link pthreads on Android. (details)
  2. [mlir][nfc] Rename `promoteMemRefDescriptors` to `promoteOperands`. (details)
  3. [flang][NFC] Unify OpenMP and OpenACC structure checker (details)
  4. [clang-format] fix BreakBeforeBraces.MultiLine with for each macros (details)
  5. [InstSimplify] add vector tests for icmp with mul nuw; NFC (details)
  6. [InstSimplify] fold icmp with mul nuw and constant operands (details)
  7. [lldb/test] Use realpath consistently for test root file paths. (details)
  8. [InstSimplify] fold icmp with mul nsw and constant operands (details)
  9. AMDGPU: Fix verifier error with undef source producing s_bitset* (details)
  10. AMDGPU: Remove leftover test (details)
  11. [spirv] Fix bitwidth emulation for Workgroup storage class (details)
  12. AMDGPU: Refactor buffer atomic intrinsic lowering (details)
  13. [NFC][InstCombine] Add tests for negation of old-style [n]abs, select-of-op-vs-negation-of-op (details)
  14. [InstCombine] Negator: -(cond ? x : -x)  -->  cond ? -x : x (details)
  15. [mlir][StandardToSPIRV] Use spv.UMod for index re-calculation (details)
  16. [clangd] Disable define out-of-line code action on templates (details)
  17. Revert "Add libFuzzer shared object build output" (details)
Commit 2918727588bbf38ac844fff70c6aa3d2dafbec1c by mascasa
[libFuzzer] Do not link pthreads on Android.

Android has pthreads included in bionic and doesn't recognize -lpthread.
The file was modifiedcompiler-rt/lib/fuzzer/CMakeLists.txt
Commit 9fdd0df9497e5b74a3739e651d218c1251b8ef78 by pifon
[mlir][nfc] Rename `promoteMemRefDescriptors` to `promoteOperands`.

`promoteMemRefDescriptors` also converts types of every operand, not only
memref-typed ones. I think `promoteMemRefDescriptors` name does not imply that.

Differential Revision: https://reviews.llvm.org/D85325
The file was modifiedmlir/include/mlir/Conversion/StandardToLLVM/ConvertStandardToLLVM.h
The file was modifiedmlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp
Commit 40626184cf95a08f8c62192fa19cd8a71a476206 by clementval
[flang][NFC] Unify OpenMP and OpenACC structure checker

This patch remove duplicated code between the check-omp-structure and the check-acc-structure
and unify it into a check-directive-structure templated class.

Reviewed By: kiranchandramohan, sscalpone, ichoyjx

Differential Revision: https://reviews.llvm.org/D85104
The file was addedflang/lib/Semantics/check-directive-structure.h
The file was modifiedflang/test/Semantics/omp-clause-validity01.f90
The file was modifiedflang/lib/Semantics/check-omp-structure.cpp
The file was modifiedflang/lib/Semantics/check-omp-structure.h
The file was modifiedflang/test/Semantics/acc-clause-validity.f90
The file was modifiedflang/test/Semantics/omp-declarative-directive.f90
The file was modifiedflang/lib/Semantics/check-acc-structure.cpp
The file was modifiedflang/lib/Semantics/check-acc-structure.h
The file was modifiedllvm/test/TableGen/directive2.td
The file was modifiedllvm/test/TableGen/directive1.td
The file was modifiedllvm/utils/TableGen/DirectiveEmitter.cpp
Commit 7ad60f6452ff483912776ef6eda4e28c60d9da6e by mitchell
[clang-format] fix BreakBeforeBraces.MultiLine with for each macros
Summary:
The MultiLine option in BreakBeforeBraces was only handling standard
control statement, leading to invalid indentation with for each macros:

Previous behavior:

/* invalid: brace should be on the same line */
Q_FOREACH(int a; list)
{
    foo();
}

/* valid */
Q_FOREACH(int longVariable;
          list)
{
    foo();
}

To fix this, simply add the TT_ForEachMacro kind in the list of
recognized control statements for the multiline option.

This is a fix for https://bugs.llvm.org/show_bug.cgi?id=44632

Reviewers: MyDeveloperDay, mitchell-stellar

Reviewed by: mitchell-stellar

Contributed by: vthib

Subscribers: cfe-commits

Tags: #clang, #clang-format, #clang-tools-extra

Differential Revision: https://reviews.llvm.org/D85304
The file was modifiedclang/lib/Format/UnwrappedLineFormatter.cpp
The file was modifiedclang/unittests/Format/FormatTest.cpp
Commit a569a0af0d96512e1d914f2e966453391f4b9561 by spatel
[InstSimplify] add vector tests for icmp with mul nuw; NFC

Also, the naming was off on a couple of tests.
The file was modifiedllvm/test/Transforms/InstSimplify/icmp-constant.ll
Commit f879c9b796210d0b2407d022e216cc4d907818a3 by spatel
[InstSimplify] fold icmp with mul nuw and constant operands

https://rise4fun.com/Alive/pZEr

  Name: mul nuw with icmp eq
  Pre: (C2 %u C1) != 0
  %a = mul nuw i8 %x, C1
  %r = icmp eq i8 %a, C2
    =>
  %r = false

  Name: mul nuw with icmp ne
  Pre: (C2 %u C1) != 0
  %a = mul nuw i8 %x, C1
  %r = icmp ne i8 %a, C2
    =>
  %r = true

There are potentially several other transforms we need to add based on:
D51625
...but it doesn't look like there was follow-up to that patch.
The file was modifiedllvm/test/Transforms/InstCombine/icmp-mul.ll
The file was modifiedllvm/test/Transforms/InstSimplify/icmp-constant.ll
The file was modifiedllvm/lib/Analysis/InstructionSimplify.cpp
Commit fcb0d8163a4f3090cb85d77b459887cf1f84cc7e by rupprecht
[lldb/test] Use realpath consistently for test root file paths.

LLDB tests assume that tests are in the test tree (the `LLDB_TEST_SRC` env variable, configured by `dotest.py`).
If this assertion doesn't hold, tests fail in strange ways. An early place this goes wrong is in `compute_mydir` which does a simple length-based substring to get the relative path. Later, we use that path to chdir to. If the test file and test tree don't agree in realpath-ness (and therefore length), this will be a cryptic error of chdir-ing to a directory that does not exist.

The actual discrepency is that the places we look for `use_lldb_suite.py` don't use a realpath, but `dotest.py` does (see initialization of `configuration.testdirs`).

It doesn't particularly matter whether we use realpath or abspath to canonicalize things, but many places end up with implicit dependencies on the canonicalized pwd being a realpath, so make them realpath consistently. Also, in the `compute_mydir` method mentioned, raise an error if the path types don't agree.

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D85258
The file was modifiedlldb/packages/Python/lldbsuite/__init__.py
The file was modifiedlldb/test/API/use_lldb_suite.py
The file was modifiedlldb/packages/Python/lldbsuite/test/lldbtest.py
Commit e8760bb9a8a3a22fe22302ffe1932c13c3fcff8e by spatel
[InstSimplify] fold icmp with mul nsw and constant operands

https://rise4fun.com/Alive/slvl

  Name: mul nsw with icmp eq
  Pre: (C2 % C1) != 0
  %a = mul nsw i8 %x, C1
  %r = icmp eq i8 %a, C2
    =>
  %r = false

  Name: mul nsw with icmp ne
  Pre: (C2 % C1) != 0
  %a = mul nsw i8 %x, C1
  %r = icmp ne i8 %a, C2
    =>
  %r = true

Follow-up to the 'nuw' variation added with:
rGf879c9b79621
The file was modifiedllvm/test/Transforms/InstSimplify/icmp-constant.ll
The file was modifiedllvm/lib/Analysis/InstructionSimplify.cpp
The file was modifiedllvm/test/Transforms/InstCombine/icmp-mul.ll
Commit 3e52667433881f42ff95ac6775b1ef1a3edd68cd by Matthew.Arsenault
AMDGPU: Fix verifier error with undef source producing s_bitset*

This needs to preserve the undef flag.
The file was addedllvm/test/CodeGen/AMDGPU/shrink-insts-scalar-bit-ops.mir
The file was addedllvm/test/CodeGen/AMDGPU/shrink-insts-undef-reg-verifier-error.ll
The file was modifiedllvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp
The file was modifiedllvm/test/CodeGen/AMDGPU/andorbitset.ll
Commit b1dac0cfcd3630c9a89bd31f9010eb8e8f099f6c by Matthew.Arsenault
AMDGPU: Remove leftover test
The file was removedllvm/test/CodeGen/AMDGPU/shrink-insts-undef-reg-verifier-error.ll
Commit 48378a32af54af6ae656a3db14dc7c0d975d0f48 by antiagainst
[spirv] Fix bitwidth emulation for Workgroup storage class

If Int16 is not available, 16-bit integers inside Workgroup storage
class should be emulated via 32-bit integers. This was previously
broken because the capability querying logic was incorrectly
intercepting all storage classes where it meant to only handle
interface storage classes. Adjusted where we return to fix this.

Differential Revision: https://reviews.llvm.org/D85308
The file was modifiedmlir/test/Conversion/StandardToSPIRV/alloc.mlir
The file was modifiedmlir/lib/Dialect/SPIRV/SPIRVTypes.cpp
Commit 43c0c9252a3151660f8549e0e54e788b922b7d98 by Matthew.Arsenault
AMDGPU: Refactor buffer atomic intrinsic lowering

Move raw/struct buffer atomic lowering to separate functions. This
avoids a long nested switch, and simplifies a future patch.
The file was modifiedllvm/lib/Target/AMDGPU/SIISelLowering.cpp
The file was modifiedllvm/lib/Target/AMDGPU/SIISelLowering.h
Commit 1d25d0734a15d03f1356735719e04a517a1a8a96 by lebedev.ri
[NFC][InstCombine] Add tests for negation of old-style [n]abs, select-of-op-vs-negation-of-op
The file was modifiedllvm/test/Transforms/InstCombine/sub-of-negatible.ll
Commit f3056dcc02d5dcde1669f61084a940e1ded3dfda by lebedev.ri
[InstCombine] Negator: -(cond ? x : -x)  -->  cond ? -x : x

We were errneously only doing that for old-style abs/nabs,
but we have no such legality check on the condition of the select.

https://rise4fun.com/Alive/xBHS
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineNegator.cpp
The file was modifiedllvm/test/Transforms/InstCombine/sub-of-negatible.ll
Commit 0d03b3901d38484683cd9d6d0d6382967599e92b by antiagainst
[mlir][StandardToSPIRV] Use spv.UMod for index re-calculation

Per Vulkan's SPIR-V environment spec: "While the OpSRem and OpSMod
instructions are supported by the Vulkan environment, they require
non-negative values and thus do not enable additional functionality
beyond what OpUMod provides."

The `getOffsetForBitwidth` function is used for lowering std.load
and std.store, whose indices are of `index` type and cannot be
negative. So we should be okay to use spv.UMod directly here to
be exact. Also made the comment explicit about the assumption.

Differential Revision: https://reviews.llvm.org/D83714
The file was modifiedmlir/lib/Conversion/StandardToSPIRV/ConvertStandardToSPIRV.cpp
The file was modifiedmlir/test/Conversion/StandardToSPIRV/std-ops-to-spirv.mlir
Commit d3ac30188666b182daa87d23533543543b789e97 by kadircet
[clangd] Disable define out-of-line code action on templates

Differential Revision: https://reviews.llvm.org/D85310
The file was modifiedclang-tools-extra/clangd/unittests/TweakTests.cpp
The file was modifiedclang-tools-extra/clangd/refactor/tweaks/DefineOutline.cpp
Commit b0c50ef759d368b33731d0261cae78117c3accdd by mascasa
Revert "Add libFuzzer shared object build output"

This reverts commit 98d91aecb26a51225242332e73ed454c0f6cac5e since it
breaks on platforms without libstdc++.
The file was modifiedllvm/docs/LibFuzzer.rst
The file was modifiedcompiler-rt/lib/fuzzer/CMakeLists.txt