Changes

Summary

  1. [PowerPC] Add scalar vector test (details)
  2. [PowerPC] Remove accidently left checks (details)
  3. [AMDGPU] Improve v2i32/v2f32 insertelt patterns (details)
  4. [AArch64][GlobalISel] Widen extloads before clamping during legalization (details)
  5. Mark getc_unlocked as unavailable by default (details)
  6. [LLDB][GUI] Refactor form drawing using subsurfaces (details)
  7. [llvm-profgen] Fix bug of loop scope mismatch (details)
  8. [GlobalISel][KnownBits] Implement G_CTPOP (details)
  9. [GlobalISel] Allow the ArtifactValueFinder to return the best available register on failure. (details)
  10. Revert "[GlobalISel][KnownBits] Implement G_CTPOP" (details)
  11. [PowerPC][AIX] Create multiple constant sections. (details)
  12. [AArch64][GlobalISel] Widen G_IMPLICIT_DEF and G_FREEZE before clamping (details)
  13. [AArch64][GlobalISel] Overhaul G_INSERT legalization (details)
  14. [mlir] Cleanup: Fix warnings in MLIR (details)
  15. [AVR][clang] Pass '-fno-use-init-array' to cc1 as default (details)
  16. Revert "[LLDB][GUI] Refactor form drawing using subsurfaces" (details)
Commit 41aaf82911252c7cd4958b16131b7b1bf1f0e39f by Jinsong Ji
[PowerPC] Add scalar vector test
The file was addedllvm/test/CodeGen/PowerPC/scalar_vector_test_5.ll
Commit b4fe4358905d2739283bb04570d60b970869db2b by Jinsong Ji
[PowerPC] Remove accidently left checks
The file was modifiedllvm/test/CodeGen/PowerPC/scalar_vector_test_5.ll
Commit d71924fbfef2efd343388d189309bfb1e38e8021 by Stanislav.Mekhanoshin
[AMDGPU] Improve v2i32/v2f32 insertelt patterns

Using REG_SEQUENCE produces better code than INSERT_SUBREG,
we can omit one move instruction in many cases.

Fixes: SWDEV-298028

Differential Revision: https://reviews.llvm.org/D107602
The file was modifiedllvm/test/CodeGen/AMDGPU/insert_vector_elt.ll
The file was modifiedllvm/lib/Target/AMDGPU/SIInstructions.td
Commit 8a557d8311593627efd08d03178889971d5ae02b by Jessica Paquette
[AArch64][GlobalISel] Widen extloads before clamping during legalization

Allows us to avoid awkward type breakdowns on types like s88, like the other
commits.

Differential Revision: https://reviews.llvm.org/D107587
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/legalize-extload.mir
The file was modifiedllvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp
Commit 623cf3dfdf3e202b99e4d0529c37eb7ef2474860 by rprichard
Mark getc_unlocked as unavailable by default

Before D45736, getc_unlocked was available by default, but turned off
for non-Cygwin/non-MinGW Windows. D45736 then added 9 more unlocked
functions, which were unavailable by default, but it also:
* left getc_unlocked enabled by default,
* removed the disabling line for Windows, and
* added code to enable getc_unlocked for GNU, Android, and OSX.

For consistency, make getc_unlocked unavailable by default. Maybe this
was the intent of D45736 anyway.

Reviewed By: MaskRay, efriedma

Differential Revision: https://reviews.llvm.org/D107527
The file was modifiedllvm/lib/Analysis/TargetLibraryInfo.cpp
The file was modifiedllvm/test/Transforms/InferFunctionAttrs/annotate.ll
Commit 2b89f40a411cb9717232df61371b24d73ae84cb8 by gclayton
[LLDB][GUI] Refactor form drawing using subsurfaces

This patch adds a new method SubSurface to the Surface class. The method
returns another surface that is a subset of this surface. This is
important to further abstract away drawing from the ncurses objects. For
instance, fields could previously be drawn on subpads only but can now
be drawn on any surface. This is needed to create the file search
dialogs and similar functionalities.

There is an opportunity to refactor window drawing in general using
surfaces, but we shall consider this separately later.

Reviewed By: clayborg

Differential Revision: https://reviews.llvm.org/D107182
The file was modifiedlldb/source/Core/IOHandlerCursesGUI.cpp
Commit a8a38ef3d99ce2b180f9c5ff968e5b930a99b10b by wlei
[llvm-profgen] Fix bug of loop scope mismatch

One performance issue happened in profile generation and it turned out the line 525 loop is the bottleneck.
Moving the code outside of loop scope can fix this issue. The run time is improved from 30+mins to ~30s.

Reviewed By: hoy, wenlei

Differential Revision: https://reviews.llvm.org/D107529
The file was modifiedllvm/tools/llvm-profgen/ProfileGenerator.cpp
Commit ce6eb4f15a159e652bdccf92a9d3da8a972d1596 by Jon Roelofs
[GlobalISel][KnownBits] Implement G_CTPOP

Implementation copied almost verbatim from ValueTracking.

Differential revision: https://reviews.llvm.org/D107606
The file was modifiedllvm/lib/CodeGen/GlobalISel/GISelKnownBits.cpp
The file was modifiedllvm/unittests/CodeGen/GlobalISel/KnownBitsTest.cpp
Commit 1577c41090a0606432688a9a9cd1744cddcccbda by Amara Emerson
[GlobalISel] Allow the ArtifactValueFinder to return the best available register on failure.

In some cases, like with inserts, we may have a matching size register already,
but still decide to try to look further. This change adds a CurrentBest
register to the value finder state, and any time a method fails to make progress,
returns that register (which may just be an empty Register).

To facilitate this, add a new entry point to the findValueFromDef() function
which initializes this state.

Also fix the build vector finder to return the current build_vector if all
sources are being requested.

Differential Revision: https://reviews.llvm.org/D107017
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/legalize-inserts.mir
The file was modifiedllvm/include/llvm/CodeGen/GlobalISel/LegalizationArtifactCombiner.h
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/bug-legalization-artifact-combiner-dead-def.mir
Commit 5fc7b1a260f2d33a70cf5202ce9f780f1fbf5f2c by Jon Roelofs
Revert "[GlobalISel][KnownBits] Implement G_CTPOP"

This reverts commit ce6eb4f15a159e652bdccf92a9d3da8a972d1596.

It's broken on the windows bots: https://reviews.llvm.org/D107606#2930121
The file was modifiedllvm/lib/CodeGen/GlobalISel/GISelKnownBits.cpp
The file was modifiedllvm/unittests/CodeGen/GlobalISel/KnownBitsTest.cpp
Commit 23651c5ae02a209ff214e4283dddb5ab65d1003a by sd.fertile
[PowerPC][AIX] Create multiple constant sections.

Fixes issue where late materialized constants can be more strictly
aligned then their containing csect.

Differential Revision: https://reviews.llvm.org/D103103
The file was modifiedllvm/test/CodeGen/PowerPC/aix-space.ll
The file was modifiedllvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
The file was modifiedllvm/lib/MC/MCObjectFileInfo.cpp
The file was addedllvm/test/CodeGen/PowerPC/aix-constant-align.ll
The file was modifiedllvm/include/llvm/MC/MCObjectFileInfo.h
The file was addedllvm/test/CodeGen/PowerPC/aix-rodata-align.ll
Commit 562c8e14d9f19220fe0a9a35dafa0bcf2485bc0f by Jessica Paquette
[AArch64][GlobalISel] Widen G_IMPLICIT_DEF and G_FREEZE before clamping

Similar to other cleanup commits which widen instructions before clamping
during legalization. Purpose of this is to avoid weird type breakdowns.

In terms of G_IMPLICIT_DEF, this simplifies legalization for other instructions.
The legalizer has to emit G_IMPLICIT_DEF to legalize certain instructions, so
this can help with emitting merges elsewhere.

Differential Revision: https://reviews.llvm.org/D107604
The file was modifiedllvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/legalize-cmp.mir
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/legalize-extracts.mir
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/legalize-undef.mir
Commit e6a3944ea9dee8ffaa318c347287027480311552 by Jessica Paquette
[AArch64][GlobalISel] Overhaul G_INSERT legalization

Similar cleanup to G_EXTRACT (51bd4e874fa51412e7399fe7f863169b4f4829bc).

Also swap the order of clamp/widen to avoid unnecessary complex merges.

Add a bunch of missing testcases to legalize-inserts while we're at it.

Differential Revision: https://reviews.llvm.org/D107601
The file was modifiedllvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/legalize-inserts.mir
Commit 66b1e629d89543cb7542c184f7dfb32deee732e1 by springerm
[mlir] Cleanup: Fix warnings in MLIR

Tested with gcc-10. Other compilers may generate additional warnings. This does not fix all warnings. There are a few extra ones in LLVMCore and MLIR.

* `OpEmitter::getAttrNameIndex`: -Wunused-function (function is private and not used anywhere)
* `PrintOpPass` copy constructor: -Wextra ("Base class should be explicitly initialized in the copy constructor")
* `LegalizeForLLVMExport.cpp`: -Woverflow (overflow is expected, silence warning by making the cast explicit)

Differential Revision: https://reviews.llvm.org/D107525
The file was modifiedmlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
The file was modifiedmlir/lib/Dialect/X86Vector/Transforms/LegalizeForLLVMExport.cpp
The file was modifiedmlir/lib/Transforms/ViewOpGraph.cpp
Commit dae7adda949993bd96aa50c551dc64ddebba7923 by powerman1st
[AVR][clang] Pass '-fno-use-init-array' to cc1 as default

On AVR, '.ctors' is used, not '.init_array'. Make this the default
unless specifically overridden by driver argument.

This matches gcc, and it matches the behavior in (e.g.) the NetBSD
driver (for certain OS variants).

Reviewed by: MaskRay

Differential Revision: https://reviews.llvm.org/D107610
The file was modifiedclang/test/Driver/avr-toolchain.c
The file was modifiedclang/lib/Driver/ToolChains/AVR.h
The file was modifiedclang/lib/Driver/ToolChains/AVR.cpp
Commit 4d3d182c1dcb99ddcce7d077060d87111cb8dbfa by Jason Molenda
Revert "[LLDB][GUI] Refactor form drawing using subsurfaces"

Temporarily revert this patch to unbreak the bots/builds
until we can understand what was intended; is_pad() call
isn't defined.

This reverts commit 2b89f40a411cb9717232df61371b24d73ae84cb8.
The file was modifiedlldb/source/Core/IOHandlerCursesGUI.cpp