SuccessChanges

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

Summary

  1. [SVE] Fix invalid uses of VectorType::getNumElements() in ValueTracking (details)
  2. [Sema] Allow function attribute patchable_function_entry on aarch64_be (details)
  3. [InstCombine] limit bitcast+insertelement transform to x86 MMX type (details)
  4. [X86] getShuffleScalarElt - consistently use SDValue. NFC. (details)
  5. [X86] getShuffleScalarElt - add CONCAT_VECTORS/INSERT_VECTOR_ELT support. (details)
  6. Fix ShapeBase.td (details)
  7. [libc] Fix how math results are compared with MPFR results. (details)
  8. Mark values as trivially dead when their only use is a start or end lifetime intrinsic. (details)
  9. Revert "Mark values as trivially dead when their only use is a start or end lifetime intrinsic." (details)
  10. [X86][AVX] Add PR45808 test case for badly promoted comparison mask arithmetic (details)
  11. [amdgpu] Fix check of VCC. (details)
  12. [x86] add test of shift+cast+concat for PR45794; NFC (details)
  13. [mlir] OperationFolder: fix crash in creation of single-result-ops with in-place folds (details)
  14. [flang] Handle EQUIVALENCE and COMMON in size and offset computations (details)
  15. [MLIR][NFC] Rename op trait PolyhedralScope -> AffineScope (details)
  16. [SelectionDAG] Fix assertion failure with big shift amounts (details)
  17. clang-format: Add ControlStatementsExceptForEachMacros option to SpaceBeforeParens (details)
  18. [SystemZ] Fix/optimize vec_load_len and related intrinsics (details)
  19. [flang][NFC] Add accessors to equivalence and common blocks (details)
  20. [LLD][COFF] Move debug info for thread-local variables into PDB global stream (details)
  21. Revert "[Debug][CodeView] Emit fully qualified names for globals" (details)
Commit 782231ac799fd9c58d317c7ba168495510995df8 by ctetreau
[SVE] Fix invalid uses of VectorType::getNumElements() in ValueTracking

Summary:
Any function in this module that make use of DemandedElts laregely does
not work with scalable vectors. DemandedElts is used to define which
elements of the vector to look at. At best, for scalable vectors, we can
express the first N elements of the vector. However, in practice, most
code that uses these functions expect to be able to talk about the
entire vector. In principle, this module should be able to be extended
to work with scalable vectors. However, before we can do that, we should
ensure that it does not cause code with scalable vectors to miscompile.
All functions that use a DemandedElts will bail out if the vector is
scalable. Usages of getNumElements() are updated to go through
FixedVectorType pointers.

Reviewers: rengolin, efriedma, sdesmalen, c-rhodes, spatel

Reviewed By: efriedma

Subscribers: david-arm, tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D79053
The file was modifiedllvm/lib/Analysis/ValueTracking.cpp
Commit 57a1c1be53aeea521747dd2f4b0097831341bea5 by maskray
[Sema] Allow function attribute patchable_function_entry on aarch64_be

Reviewed By: nickdesaulniers

Differential Revision: https://reviews.llvm.org/D79495
The file was modifiedclang/test/Sema/patchable-function-entry-attr.cpp
The file was modifiedclang/include/clang/Basic/Attr.td
Commit 2058c98715f6baf59fae1e1d617958cea39236b4 by spatel
[InstCombine] limit bitcast+insertelement transform to x86 MMX type

This is unusual for the general case because we are replacing
1 instruction with 2.

Splitting from a potential conflicting transform in D79171
The file was modifiedllvm/test/Transforms/InstCombine/bitcast-vec-canon.ll
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
Commit 8c71c2291e81b1348fdedbda7e7600c5c2eeed7c by llvm-dev
[X86] getShuffleScalarElt - consistently use SDValue. NFC.

We never need to call this from anything but ISD::SHUFFLE_VECTOR or target shuffles so shouldn't need to address SDNode directly.
The file was modifiedllvm/lib/Target/X86/X86ISelLowering.cpp
Commit 8817334ce3c71bf4c087adde60e11c7fe0aaceba by llvm-dev
[X86] getShuffleScalarElt - add CONCAT_VECTORS/INSERT_VECTOR_ELT support.

This helped fix some i686 vXi64 broadcast folds that were becoming v2Xi32 broadcasts because we didn't match the broadcast until after SimplifyDemandedBits worked out we only used the bottom 32-bits in PMUL(U)DQ and type legalization had split the original i64 load.

A couple of regressions occurred which required some fixups - adding concat_vectors(broadcast_load,broadcast_load) splat support and recognising (unnecessary) unary shuffles of already broadcasted vectors.

This came about as part of the work investigating vector load combining from shuffles for PR42550.
The file was modifiedllvm/test/CodeGen/X86/avx512-intrinsics-upgrade.ll
The file was modifiedllvm/test/CodeGen/X86/avx512vl-intrinsics-upgrade.ll
The file was modifiedllvm/lib/Target/X86/X86ISelLowering.cpp
Commit e382b3770ed721d63c0c039ff1ceee1b67802b05 by silvasean
Fix ShapeBase.td

Summary:
- Add license header.
- Remove TODO about extracting ShapeBase.td

Differential Revision: https://reviews.llvm.org/D79506
The file was modifiedmlir/include/mlir/Dialect/Shape/IR/ShapeBase.td
Commit a7e11496996269fc589322da7bedbe4b1adcb13f by sivachandra
[libc] Fix how math results are compared with MPFR results.

Summary:
Math results are compared with MPFR results by checking if they are
within a tolerance level of the MPFR result. The tolerance level is set
using additional bits of precision of the fractional part of a floating
point value. Hence, the actual value of the tolerance depends on not
only the additional bits, but also on the exponent part of the floating
point number.

Previously, the exponent part was not considered in evaluating the
tolerance value. While it was OK for small values less than 1 (hence
sinf, cosf, sincosf tests were OK), it breaks for large values which
functions like exp and friends produce. This change uses the exponent
value also to evaluate the tolerance value. LLVM libc produced results
can now be compared with MPFR produced results for large values also.

Reviewers: abrachet

Differential Revision: https://reviews.llvm.org/D79278
The file was modifiedlibc/utils/MPFRWrapper/MPFRUtils.cpp
Commit 95aa28cc8fcbcb43a047779814a5be0abe54863b by zoecarver
Mark values as trivially dead when their only use is a start or end lifetime intrinsic.

Summary:
If the only use of a value is a start or end lifetime intrinsic then mark the intrinsic as trivially dead. This should allow for that value to then be removed as well.

Currently, this only works for allocas, globals, and arguments.

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D79355
The file was modifiedllvm/test/Transforms/DeadStoreElimination/lifetime.ll
The file was modifiedllvm/test/Transforms/Attributor/memory_locations.ll
The file was modifiedllvm/test/Transforms/InstCombine/vararg.ll
The file was modifiedllvm/lib/Transforms/Utils/Local.cpp
The file was modifiedllvm/test/Transforms/DCE/basic.ll
Commit 1998e796e9dc1cbe3bc3059aeade0dad81c33a71 by zoecarver
Revert "Mark values as trivially dead when their only use is a start or end lifetime intrinsic."

This reverts commit 95aa28cc8fcbcb43a047779814a5be0abe54863b.
The file was modifiedllvm/test/Transforms/DCE/basic.ll
The file was modifiedllvm/test/Transforms/DeadStoreElimination/lifetime.ll
The file was modifiedllvm/test/Transforms/Attributor/memory_locations.ll
The file was modifiedllvm/test/Transforms/InstCombine/vararg.ll
The file was modifiedllvm/lib/Transforms/Utils/Local.cpp
Commit fe6f5ba0bffd042a8e667908096403046314ea66 by llvm-dev
[X86][AVX] Add PR45808 test case for badly promoted comparison mask arithmetic
The file was addedllvm/test/CodeGen/X86/promote-cmp.ll
Commit 4ee5a04187aadfb646e49d1d002a7c3da07ff254 by michael.hliao
[amdgpu] Fix check of VCC.

Summary: - Need to include checking on the new 16-bit subregs.

Reviewers: rampitec

Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D79498
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
The file was addedllvm/test/CodeGen/AMDGPU/asm-printer-check-vcc.mir
Commit 1b678ee8a6cc7510801b7c5be2bcde08ff8bbd6e by spatel
[x86] add test of shift+cast+concat for PR45794; NFC

Depends on D79360 / rG2f1fe1864d25 for the transform.
The file was modifiedllvm/test/CodeGen/X86/concat-cast.ll
Commit 26f93d9f373a1e638b621391ef7ba9bdf7b79044 by zinenko
[mlir] OperationFolder: fix crash in creation of single-result-ops with in-place folds

When the folding is performed in place, the `::fold` function does not populate
its `results` argument to indicate that. (In the folding hook for single-result
operations, the result of the original operation is expected to be returned,
but it is then ignored by the wrapper.) `OperationFolder::create` would
erronously rely on the _operation_ having zero results instead of on the
_folding_ producing zero new results to populate the list of results with those
of the original operation. This would lead to a crash for single-result ops
with in-place folds where the first result is accessed uncondtionally because
the list of results was not properly populated. Use the list of values produced
by the folding instead.

Differential Revision: https://reviews.llvm.org/D79497
The file was modifiedmlir/include/mlir/Transforms/FoldUtils.h
The file was modifiedmlir/test/lib/Dialect/Test/TestPatterns.cpp
The file was modifiedmlir/test/lib/Dialect/Test/TestOps.td
The file was modifiedmlir/test/lib/Dialect/Test/TestDialect.cpp
Commit 237d0e3c0416abf9919406bcc92874cfd15f5e0c by tkeith
[flang] Handle EQUIVALENCE and COMMON in size and offset computations

Objects in common blocks have offsets relative to the start of the
common block, independent of the enclosing scope, so they are processed
first. Add alignment to CommonBlockDetails to record the required
alignment of the common block.

For equivalence sets, each object depends on the one that is forced to
occur first in memory. The rest are recorded in the dependents_ map and
have offsets assigned after the other symbols are done.

Differential Revision: https://reviews.llvm.org/D79347
The file was modifiedflang/lib/Semantics/symbol.cpp
The file was modifiedflang/include/flang/Semantics/symbol.h
The file was modifiedflang/lib/Semantics/compute-offsets.cpp
The file was addedflang/test/Semantics/offsets03.f90
Commit 57d361bd2f3668eefa7028ad4a2d616317ed437c by uday
[MLIR][NFC] Rename op trait PolyhedralScope -> AffineScope

Rename op trait PolyhedralScope -> AffineScope for consistency.

Differential Revision: https://reviews.llvm.org/D79503
The file was modifiedmlir/include/mlir/IR/Module.h
The file was modifiedmlir/include/mlir/IR/OpBase.td
The file was modifiedmlir/docs/Traits.md
The file was modifiedmlir/test/lib/Dialect/Test/TestOps.td
The file was modifiedmlir/docs/Dialects/Affine.md
The file was modifiedmlir/lib/Dialect/Affine/IR/AffineOps.cpp
The file was modifiedmlir/include/mlir/Dialect/Affine/IR/AffineOps.h
The file was modifiedmlir/include/mlir/IR/Function.h
The file was modifiedmlir/include/mlir/Dialect/Affine/IR/AffineOps.td
The file was modifiedmlir/include/mlir/IR/OpDefinition.h
The file was modifiedmlir/test/lib/Dialect/Test/TestDialect.cpp
The file was modifiedmlir/test/Dialect/Affine/ops.mlir
Commit 7fa5abd3437e94e0983a3baf323cac574d92fc03 by craig.topper
[SelectionDAG] Fix assertion failure with big shift amounts

Calling getShiftAmountTy with LegalTypes set may return a type that's too narrow to hold the shift amount for integer type it's applied to.

Fixes the regression introduced by D79096

Differential Revision: https://reviews.llvm.org/D79405
The file was modifiedllvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
The file was addedllvm/test/CodeGen/X86/load-local-v3i129.ll
Commit f21c704553a8af7012eaf1ab777e2aa1a55cc86d by daan.j.demeyer
clang-format: Add ControlStatementsExceptForEachMacros option to SpaceBeforeParens

Summary: systemd recently added a clang-format file. One issue I
encountered in using clang-format on systemd is that systemd does
not add a space before the parens of their foreach macros but
clang-format always adds a space. This does not seem to be
configurable in clang-format. This revision adds the
ControlStatementsExceptForEachMacros option to SpaceBeforeParens
which puts a space before all control statement parens except
ForEach macros. This drastically reduces the amount of changes
when running clang-format on systemd's source code.

Reviewers: MyDeveloperDay, krasimir, mitchell-stellar

Reviewed By: MyDeveloperDay

Subscribers: cfe-commits

Tags: #clang-format, #clang

Differential Revision: https://reviews.llvm.org/D78869
The file was modifiedclang/lib/Format/TokenAnnotator.cpp
The file was modifiedclang/docs/ClangFormatStyleOptions.rst
The file was modifiedclang/lib/Format/Format.cpp
The file was modifiedclang/include/clang/Format/Format.h
The file was modifiedclang/unittests/Format/FormatTest.cpp
Commit 947f78ac27f4ea52a443ba9d5983cfe3eaf51148 by ulrich.weigand
[SystemZ] Fix/optimize vec_load_len and related intrinsics

When using vec_load/store_len_r with an immediate length operand
of 16 or larger, LLVM will currently emit an VLRL/VSTRL instruction
with that immediate.  This creates a valid encoding (which should be
supported by the assembler), but always traps at runtime.  This patch
fixes this by not creating VLRL/VSTRL in those cases.

This would result in loading the length into a register and
calling VLRLR/VSTRLR instead.  However, these operations with
a length of 15 or larger are in fact simply equivalent to a
full vector load or store.  And in fact the same holds true for
vec_load/store_len as well.

Therefore, add a DAGCombine rule to replace those operations with
plain vector loads or stores if the length is known at compile
time and equal or larger to 15.
The file was modifiedllvm/test/CodeGen/SystemZ/vec-intrinsics-02.ll
The file was modifiedllvm/lib/Target/SystemZ/SystemZISelLowering.h
The file was modifiedllvm/lib/Target/SystemZ/SystemZISelLowering.cpp
The file was modifiedllvm/lib/Target/SystemZ/SystemZInstrVector.td
The file was modifiedllvm/test/CodeGen/SystemZ/vec-intrinsics-01.ll
Commit d5c05ced82ff698fad3da0537cf9b7cdb38dce85 by tkeith
[flang][NFC] Add accessors to equivalence and common blocks

Add a way to get mutable equivalence sets to Scope so that they can
have sizes and offsets assigned to them.

Change CommonBlockDetails to have mutable symbols so that they can have
sizes and offets assigned to them. This also allows the removal of some
`const_cast`s.

Add MutableSymbolRef and MutableSymbolVector as mutable analogs to
SymbolRef and SymbolVector. Replace uses of equivalent types with those
names.

Differential Revision: https://reviews.llvm.org/D79346
The file was modifiedflang/lib/Semantics/resolve-names.cpp
The file was modifiedflang/include/flang/Semantics/scope.h
The file was modifiedflang/include/flang/Semantics/symbol.h
The file was modifiedflang/lib/Semantics/mod-file.cpp
The file was modifiedflang/lib/Semantics/symbol.cpp
The file was modifiedflang/lib/Semantics/scope.cpp
Commit 6adc45d3fd67cdfc0b653e584ee04232309453fb by alexandre.ganea
[LLD][COFF] Move debug info for thread-local variables into PDB global stream

Before this patch, the debug record S_GTHREAD32 which represents global thread_local symbols, was emitted by LLD into the respective module stream. This makes Visual Studio unable to display thread_local symbols in the debugger.

After this patch, S_GTHREAD32 is moved into the globals stream. This matches MSVC behavior.

Differential Revision: https://reviews.llvm.org/D79005
The file was modifiedlld/test/COFF/Inputs/pdb-globals.yaml
The file was modifiedlld/test/COFF/pdb-globals.test
The file was modifiedlld/COFF/PDB.cpp
Commit f78b674de4531c9092ab1c0c7e4c00196f24e06c by alexandre.ganea
Revert "[Debug][CodeView] Emit fully qualified names for globals"

This reverts commit 06591b6d191ad3582d21a801cbaf56b36714cae7.
The file was modifiedllvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
The file was modifiedllvm/test/DebugInfo/COFF/types-array-unsized.ll
The file was modifiedllvm/test/DebugInfo/COFF/global_visibility.ll
The file was modifiedllvm/test/DebugInfo/COFF/global-constants.ll
The file was modifiedllvm/test/DebugInfo/COFF/globals.ll