SuccessChanges

Summary

  1. BPF: permit .maps section variables with typedef type (details)
  2. [LV] Fixing versioning-for-unit-stide of loops with small trip count (details)
  3. [clang-format] PR46609 clang-format does not obey `PointerAlignment: Right` for ellipsis in declarator for pack (details)
  4. [X86] Fix two places that appear to misuse peekThroughOneUseBitcasts (details)
  5. [X86] Consistently use 128 as the PSHUFB/VPPERM index for zero (details)
  6. [polly] NFC clang-format change following D83564 (details)
  7. [Matrix] Tighten LangRef definitions and Verifier checks. (details)
  8. Revert "[Matrix] Tighten LangRef definitions and Verifier checks." (details)
  9. [InstCombine] fold mul of zext/sext bools to 'and' (details)
  10. [X86] Add CPU name strings to getIntelProcessorTypeAndSubtype and getAMDProcessorTypeAndSubtype in compiler-rt. (details)
  11. [X86] Add CPU string output to getIntelProcessorTypeAndSubtype/getAMDProcessorTypeAndSubtype in Host.cpp (details)
  12. [X86] Remove model number based detection for 'pentiumpro', 'pentium2', 'pentium3', 'pentium-m', and 'yonah' from getHostCPUName. (details)
  13. [mlir][ODS] Add support for specifying the namespace of an interface. (details)
  14. Revert "[TRE] allow TRE for non-capturing calls." (details)
  15. Bump the default target CPU for i386-freebsd to i686 (details)
  16. [Attributor] Add AAValueSimplifyCallSiteArgument::manifest (details)
  17. [clang] Add -Wsuggest-override (details)
Commit 152a9fef1b3b44f2c224cb8096b3d649279f2578 by yhs
BPF: permit .maps section variables with typedef type

Currently, llvm when see a global variable in .maps section,
it ensures its type must be a struct type. Then pointee
will be further evaluated for the structure members.
In normal cases, the pointee type will be skipped.

Although this is what current all bpf programs are doing,
but it is a little bit restrictive. For example, it is legitimate
for users to have:
typedef struct { int key_size; int value_size; } __map_t;
__map_t map __attribute__((section(".maps")));

This patch lifts this restriction and typedef of
a struct type is also allowed for .maps section variables.
To avoid create unnecessary fixup entries when traversal
started with typedef/struct type, the new implementation
first traverse all map struct members and then traverse
the typedef/struct type. This way, in internal BTFDebug
implementation, no fixup entries are generated.

Two new unit tests are added for typedef and const
struct in .maps section. Also tested with kernel bpf selftests.

Differential Revision: https://reviews.llvm.org/D83638
The file was modifiedllvm/lib/Target/BPF/BTFDebug.cpp
The file was addedllvm/test/CodeGen/BPF/BTF/map-def-2.ll
The file was addedllvm/test/CodeGen/BPF/BTF/map-def-3.ll
The file was modifiedllvm/test/CodeGen/BPF/BTF/map-def.ll
Commit 82a5157ff1650e3366f7a9c619269766ad1d5e93 by ayal.zaks
[LV] Fixing versioning-for-unit-stide of loops with small trip count

This patch fixes D81345 and PR46652.

If a loop with a small trip count is compiled w/o -Os/-Oz, Loop Access Analysis
still generates runtime checks for unit strides that will version the loop.

In such cases, the loop vectorizer should either re-run the analysis or bail-out
from vectorizing the loop, as done prior to D81345. The latter is applied for
now as the former requires refactoring.

Differential Revision: https://reviews.llvm.org/D83470
The file was modifiedllvm/test/Transforms/LoopVectorize/optsize.ll
The file was modifiedllvm/lib/Transforms/Vectorize/LoopVectorize.cpp
Commit 65dc97b79eb1979c54e7e17c411ea5f58f8dcc9c by mydeveloperday
[clang-format] PR46609 clang-format does not obey `PointerAlignment: Right` for ellipsis in declarator for pack

Summary:
https://bugs.llvm.org/show_bug.cgi?id=46609

Ensure `*...` obey they left/middle/right rules of Pointer alignment

Reviewed By: curdeius

Differential Revision: https://reviews.llvm.org/D83564
The file was modifiedclang/unittests/Format/FormatTest.cpp
The file was modifiedclang/lib/Format/TokenAnnotator.cpp
Commit 04013a07ac3b67eb176ddfd1ddaeda41415c038f by craig.topper
[X86] Fix two places that appear to misuse peekThroughOneUseBitcasts

peekThroughOneUseBitcasts checks the use count of the operand of the bitcast. Not the bitcast itself. So I think that means we need to do any outside haseOneUse checks before calling the function not after.

I was working on another patch where I misused the function and did a very quick audit to see if I there were other similar mistakes.

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D83598
The file was modifiedllvm/lib/Target/X86/X86ISelLowering.cpp
Commit f8f007e378e1ed84fadf281f05166a4463a79316 by craig.topper
[X86] Consistently use 128 as the PSHUFB/VPPERM index for zero

Bit 7 of the index controls zeroing, the other bits are ignored when bit 7 is set. Shuffle lowering was using 128 and shuffle combining was using 255. Seems like we should be consistent.

This patch changes shuffle combining to use 128 to match lowering.

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D83587
The file was modifiedllvm/test/CodeGen/X86/vector-trunc.ll
The file was modifiedllvm/lib/Target/X86/X86ISelLowering.cpp
Commit 7a1bcf9f9a95fca9dcf8e42f8eb845db3643fffb by mydeveloperday
[polly] NFC clang-format change following D83564
The file was modifiedpolly/lib/Analysis/ScopDetection.cpp
Commit f4d29d6e8c43cfd924d9d7cc1ac0c269b2788e75 by sjoerd.meijer
[Matrix] Tighten LangRef definitions and Verifier checks.

This tightens the matrix intrinsic definitions in LLVM LangRef and adds
correspondings checks to the IR Verifier.

Differential Revision: https://reviews.llvm.org/D83477
The file was modifiedllvm/docs/LangRef.rst
The file was modifiedllvm/lib/IR/Verifier.cpp
The file was modifiedllvm/test/Verifier/matrix-intrinsics.ll
Commit 4ff7ed33108d9039fd960a4979b2e1503888582c by sjoerd.meijer
Revert "[Matrix] Tighten LangRef definitions and Verifier checks."

This reverts commit f4d29d6e8c43cfd924d9d7cc1ac0c269b2788e75.

Hm, some build bot failures, reverting it while I investigate that.
The file was modifiedllvm/test/Verifier/matrix-intrinsics.ll
The file was modifiedllvm/lib/IR/Verifier.cpp
The file was modifiedllvm/docs/LangRef.rst
Commit 445897334741c53e98f8044f5f33ab1e888b3818 by spatel
[InstCombine] fold mul of zext/sext bools to 'and'

Similar to rG40fcc42:
The base case only worked because we were relying on a
poison-unsafe select transform; if that is fixed, we
would regress on patterns like this.

The extra use tests show that the select transform can't
be applied consistently. So it may be a regression to have
an extra instruction on 1 test, but that result was not
created safely and does not happen reliably.
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
The file was modifiedllvm/test/Transforms/InstCombine/mul.ll
Commit b92c2bb6a2058611d727c4e2ce3a928f0a3e647d by craig.topper
[X86] Add CPU name strings to getIntelProcessorTypeAndSubtype and getAMDProcessorTypeAndSubtype in compiler-rt.

These aren't used in compiler-rt, but I plan to make a similar
change to the equivalent code in Host.cpp where the mapping from
type/subtype is an unnecessary complication. Having the CPU strings
here will help keep the code somewhat synchronized.
The file was modifiedcompiler-rt/lib/builtins/cpu_model.c
Commit ea84dc9500df383b4fe07199134033f358411e59 by craig.topper
[X86] Add CPU string output to getIntelProcessorTypeAndSubtype/getAMDProcessorTypeAndSubtype in Host.cpp

Rather than converting type/subtype into strings, just directly
select the string as part of family/model decoding. This avoids
the need for creating fake Type/SubTypes for CPUs not supported
by compiler-rtl. I've left the Type/SubType in place where it matches
compiler-rt so that the code can be diffed, but the Type/SubType
is no longer used by Host.cpp.

compiler-rt was already updated to select strings that aren't used
so the code will look similar.
The file was modifiedllvm/include/llvm/Support/X86TargetParser.def
The file was modifiedllvm/lib/Support/Host.cpp
Commit 90c577a113e97212e02d5956d6db45e701e3552f by craig.topper
[X86] Remove model number based detection for 'pentiumpro', 'pentium2', 'pentium3', 'pentium-m', and 'yonah' from getHostCPUName.

For model 6 CPUs, we have a fallback detection method based on
available features. That mechanism should be enough to detect
these early family 6 CPUs as they only differ in the features
used by the detection anyway.
The file was modifiedllvm/lib/Support/Host.cpp
Commit 572c2905aeaef00a6fedfc4c54f21856ba4cc34e by riddleriver
[mlir][ODS] Add support for specifying the namespace of an interface.

The namespace can be specified using the `cppNamespace` field. This matches the functionality already present on dialects, enums, etc. This fixes problems with using interfaces on operations in a different namespace than the interface was defined in.

Differential Revision: https://reviews.llvm.org/D83604
The file was modifiedmlir/include/mlir/Interfaces/SideEffectInterfaces.td
The file was modifiedmlir/include/mlir/Interfaces/LoopLikeInterface.h
The file was modifiedmlir/lib/TableGen/Operator.cpp
The file was modifiedmlir/include/mlir/Interfaces/ControlFlowInterfaces.h
The file was modifiedmlir/include/mlir/Interfaces/CopyOpInterface.h
The file was modifiedmlir/include/mlir/IR/SymbolInterfaces.td
The file was modifiedmlir/include/mlir/Interfaces/SideEffectInterfaces.h
The file was modifiedmlir/include/mlir/Interfaces/CopyOpInterface.td
The file was modifiedmlir/include/mlir/Interfaces/CallInterfaces.h
The file was modifiedmlir/include/mlir/Interfaces/InferTypeOpInterface.h
The file was modifiedmlir/include/mlir/IR/OpImplementation.h
The file was modifiedmlir/include/mlir/IR/SymbolTable.h
The file was modifiedmlir/include/mlir/Interfaces/DerivedAttributeOpInterface.h
The file was modifiedmlir/include/mlir/TableGen/Interfaces.h
The file was modifiedmlir/include/mlir/Interfaces/InferTypeOpInterface.td
The file was modifiedmlir/include/mlir/TableGen/OpTrait.h
The file was modifiedmlir/include/mlir/Interfaces/DerivedAttributeOpInterface.td
The file was modifiedmlir/lib/TableGen/OpTrait.cpp
The file was modifiedmlir/include/mlir/Interfaces/ControlFlowInterfaces.td
The file was modifiedmlir/include/mlir/Interfaces/VectorUnrollInterface.td
The file was modifiedmlir/include/mlir/Interfaces/ViewLikeInterface.h
The file was modifiedmlir/include/mlir/Interfaces/LoopLikeInterface.td
The file was modifiedmlir/lib/TableGen/SideEffects.cpp
The file was modifiedmlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
The file was modifiedmlir/include/mlir/IR/OpBase.td
The file was modifiedmlir/include/mlir/Interfaces/CallInterfaces.td
The file was modifiedmlir/include/mlir/IR/OpAsmInterface.td
The file was modifiedmlir/include/mlir/Interfaces/VectorUnrollInterface.h
The file was modifiedmlir/include/mlir/TableGen/SideEffects.h
The file was modifiedmlir/lib/TableGen/Interfaces.cpp
The file was modifiedmlir/tools/mlir-tblgen/OpInterfacesGen.cpp
The file was modifiedmlir/include/mlir/Interfaces/ViewLikeInterface.td
Commit 0a01fc96e24b7c7de2141a2ea07593500ea34732 by a.v.lapshin
Revert "[TRE] allow TRE for non-capturing calls."

This reverts commit f7907e9d223d8484f9afd457ba614c2db2ae4743.

That commit caused error on multi-stage build.
The file was modifiedllvm/lib/Transforms/Scalar/TailRecursionElimination.cpp
The file was removedllvm/test/Transforms/TailCallElim/tre-noncapturing-alloca-calls.ll
The file was removedllvm/test/Transforms/TailCallElim/tre-multiple-exits.ll
The file was modifiedllvm/test/Transforms/TailCallElim/basic.ll
Commit 02cfa7530d9e7cfd8ea940dab4173afb7938b831 by dimitry
Bump the default target CPU for i386-freebsd to i686

Summary:
Similar to what we have done downstream, some time ago:
https://svnweb.freebsd.org/changeset/base/353936

This followed some discussions on the freebsd-arch mailing lists, and
most people agreed that it was a better default, and also it worked
around several issues where clang generated libcalls to 64 bit atomic
primitives, instead of using cmpxchg8b.

Reviewers: emaste, brooks, rsmith

Reviewed By: emaste

Subscribers: arichardson, krytarowski, jfb, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D83645
The file was modifiedclang/lib/Driver/ToolChains/Arch/X86.cpp
Commit c73f425f84ad18e4b610dff7d21a5844fb0da5d7 by okuraofvegetable
[Attributor] Add AAValueSimplifyCallSiteArgument::manifest

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D82861
The file was modifiedllvm/test/Transforms/Attributor/range.ll
The file was modifiedllvm/lib/Transforms/IPO/AttributorAttributes.cpp
Commit 111167895d47558989f9f3a593a82527b016c7e7 by dblaikie
[clang] Add -Wsuggest-override

This patch adds `-Wsuggest-override`, which allows for more aggressive enforcement of modern C++ best practices, as well as better compatibility with gcc, which has had its own `-Wsuggest-override` since version 5.1.

Clang already has `-Winconsistent-missing-override`, which only warns in the case where there is at least one function already marked `override` in a class. This warning strengthens that warning by suggesting the `override` keyword regardless of whether it is already present anywhere.

The text between suggest-override and inconsistent-missing-override is now shared, using `TextSubstitution` for the entire diagnostic text.

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D82728
The file was addedclang/test/SemaCXX/warn-suggest-destructor-override
The file was modifiedclang/include/clang/Basic/DiagnosticSemaKinds.td
The file was modifiedclang/include/clang/Sema/Sema.h
The file was modifiedclang/include/clang/Basic/DiagnosticGroups.td
The file was modifiedclang/lib/Sema/SemaDeclCXX.cpp
The file was addedclang/test/SemaCXX/warn-suggest-override