Changes

Summary

  1. [clang-cl] Add parsing support for a bunch of new flags (details)
  2. Thread safety analysis: Replace flags in FactEntry by SourceKind (NFC) (details)
  3. Thread safety analysis: Fix false negative on break (details)
  4. [clang] Spell correct variable (details)
  5. [InstCombine] improve demanded bits analysis of left-shifted operand (details)
  6. [SystemZ][z/OS] Add the functions needed for handling EBCDIC I/O (details)
  7. [gn build] Port 1527a5e4b483 (details)
  8. [LV] Iterate over recipes in VPlan to fix PHI (NFC). (details)
  9. AMDGPU: XFAIL LLVM::note-amd-valid-v2.test for big endian (details)
  10. [SLP]Allow masked gathers only if allowed by target. (details)
  11. Revert "[SLP]Allow masked gathers only if allowed by target." (details)
  12. [Matrix] Remove bitcast when casting between matrices of the same size (details)
Commit 876bf516e7d4bba615da6cf791372fb36fc8f947 by hans
[clang-cl] Add parsing support for a bunch of new flags

MSVC has added some new flags. Although they're not supported, this adds
parsing support for them so clang-cl doesn't treat them as filenames.

Except for /fsanitize=address which we do support. (clang-cl already
exposes the -fsanitize= option, but this allows using the
MSVC-spelling with a slash.)

Differential revision: https://reviews.llvm.org/D101439
The file was modifiedclang/include/clang/Driver/Options.td
The file was modifiedclang/test/Driver/cl-options.c
Commit 530e074faafe995a560e80815f5af8306670ea7b by aaron.puchert
Thread safety analysis: Replace flags in FactEntry by SourceKind (NFC)

The motivation here is to make it available in the base class whether a
fact is managed or not. That would have meant three flags on the base
class, so I had a look whether we really have 8 possible combinations.

It turns out we don't: asserted and declared are obviously mutually
exclusive. Managed facts are only created when we acquire a capability
through a scoped capability. Adopting an asserted or declared lock will
not (in fact can not, because Facts are immutable) make them managed.

We probably don't want to allow adopting an asserted lock (because then
the function should probably have a release attribute, and then the
assertion is pointless), but we might at some point decide to replace a
declared fact on adoption.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D100801
The file was modifiedclang/lib/Analysis/ThreadSafety.cpp
Commit daca6edb31efae048a420595fae9750aaa91c733 by aaron.puchert
Thread safety analysis: Fix false negative on break

We weren't modifying the lock set when intersecting with one coming
from a break-terminated block. This is inconsistent, since break isn't a
back edge, and it leads to false negatives with scoped locks. We usually
don't warn for those when joining locksets aren't the same, we just
silently remove locks that are not in the intersection. But not warning
and not removing them isn't right.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D101202
The file was modifiedclang/lib/Analysis/ThreadSafety.cpp
The file was modifiedclang/test/PCH/thread-safety-attrs.cpp
The file was modifiedclang/test/SemaCXX/warn-thread-safety-analysis.cpp
Commit ab7316f1c64c3530a6eca2e449c2dd734e83498e by nathan
[clang] Spell correct variable

fix Trailling -> Trailing (two ll-> one l)

Differential Revision: https://reviews.llvm.org/D101753
The file was modifiedclang/include/clang/AST/DeclCXX.h
The file was modifiedclang/lib/AST/DeclCXX.cpp
The file was modifiedclang/test/SemaCXX/cxx2a-explicit-bool.cpp
The file was modifiedclang/lib/Serialization/ASTWriterDecl.cpp
Commit 1b24f35f843cd58ea22ec3968d0d2589c5bdc2c9 by spatel
[InstCombine] improve demanded bits analysis of left-shifted operand

If we don't demand high bits, then we also don't care about those
high bits of a left-shift operand regardless of shift amount.
I noticed the sext/trunc pattern in a motivating example.
It seems like there should be a low-bits with right-shift sibling,
but I haven't looked at that yet.

https://alive2.llvm.org/ce/z/JuS6jc
https://rise4fun.com/Alive/Trm (not sure how to use 'width' with Alive1)
https://alive2.llvm.org/ce/z/gRadbF

Differential Revision: https://reviews.llvm.org/D101489
The file was modifiedllvm/test/Transforms/InstCombine/rotate.ll
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
The file was modifiedllvm/test/Transforms/InstCombine/shl-demand.ll
Commit 1527a5e4b4834e65678f9c30f786a2f4c17932bf by Abhina.Sreeskantharajan
[SystemZ][z/OS] Add the functions needed for handling EBCDIC I/O

This patch adds the basic functions needed for controlling auto conversion on z/OS.
Auto conversion is enabled on untagged input file to ASCII by making the assumption that all untagged files are EBCDIC encoded. Output files are auto converted to EBCDIC IBM-1047.
This change also enables conversion for stdin/stdout/stderr.

For more information on how fcntl controls codepage https://www.ibm.com/docs/en/zos/2.4.0?topic=descriptions-fcntl-bpx1fct-bpx4fct-control-open-file-descriptors

Reviewed By: anirudhp

Differential Revision: https://reviews.llvm.org/D100483
The file was modifiedllvm/lib/Support/Unix/Path.inc
The file was addedllvm/include/llvm/Support/AutoConvert.h
The file was addedllvm/lib/Support/AutoConvert.cpp
The file was modifiedllvm/lib/Support/CMakeLists.txt
The file was modifiedllvm/lib/Support/MemoryBuffer.cpp
The file was addedllvm/test/Support/encoding.ll
Commit 895ba21401f675d3449a325a82ebc053e8561690 by llvmgnsyncbot
[gn build] Port 1527a5e4b483
The file was modifiedllvm/utils/gn/secondary/llvm/lib/Support/BUILD.gn
Commit 2b7fa7f7442ba342c4098556a962c1d8ffedc1f4 by flo
[LV] Iterate over recipes in VPlan to fix PHI (NFC).

As we gradually move more elements of LV to VPlan, we are trying to
reduce the number of places that still has to check IR of the original
loop.

This patch adjusts the code to fix cross iteration phis to get the PHIs
to fix directly from the VPlan that is executed. We still need the
original PHI to check for first-order recurrences, but we can get rid of
that once we model that explicitly in VPlan as well.

Reviewed By: Ayal

Differential Revision: https://reviews.llvm.org/D99293
The file was modifiedllvm/lib/Transforms/Vectorize/LoopVectorize.cpp
The file was modifiedllvm/lib/Transforms/Vectorize/VPlan.h
Commit 2055cc8ef4b961bbac1bf44aa879be6465e1fc36 by kzhuravl_dev
AMDGPU: XFAIL LLVM::note-amd-valid-v2.test for big endian
The file was modifiedllvm/test/tools/llvm-readobj/ELF/note-amd-valid-v2.test
Commit b5f64768cfeecca16c7c9c53cbd97ac7289c43aa by a.bataev
[SLP]Allow masked gathers only if allowed by target.

Need to check if target allows/supports masked gathers before trying to
estimate its cost, otherwise we may fail to vectorize some of the
patterns because of too pessimistic cost model.

Part of D57059.

Differential Revision: https://reviews.llvm.org/D101297
The file was modifiedllvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
The file was modifiedllvm/test/Transforms/SLPVectorizer/X86/pr47629-inseltpoison.ll
The file was modifiedllvm/test/Transforms/SLPVectorizer/X86/pr47629.ll
The file was modifiedllvm/test/Transforms/SLPVectorizer/X86/tiny-tree.ll
Commit 2e4cc9a7256b8a23421727522059ec5c67500cf3 by a.bataev
Revert "[SLP]Allow masked gathers only if allowed by target."

This reverts commit b5f64768cfeecca16c7c9c53cbd97ac7289c43aa to fix
a compiler crash revealed by buildbots.
The file was modifiedllvm/test/Transforms/SLPVectorizer/X86/pr47629.ll
The file was modifiedllvm/test/Transforms/SLPVectorizer/X86/tiny-tree.ll
The file was modifiedllvm/test/Transforms/SLPVectorizer/X86/pr47629-inseltpoison.ll
The file was modifiedllvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
Commit 696becbd139e4bbbe304ce2231de0fb50f307b68 by flo
[Matrix] Remove bitcast when casting between matrices of the same size

In matrix type casts, we were doing bitcast when the matrices had the same size. This was incorrect and this patch fixes that.
Also added some new CodeGen tests for signed <-> usigned conversions

Reviewed By: fhahn

Differential Revision: https://reviews.llvm.org/D101754
The file was modifiedclang/lib/CodeGen/CGExprScalar.cpp
The file was modifiedclang/test/CodeGen/matrix-cast.c