SuccessChanges

Summary

  1. sanitizer_common/symbolizer: fix crashes during exit (details)
  2. [LV] Return both fixed and scalable Max VF from computeMaxVF. (details)
  3. [RDA] Fix printing of regs / reg units. NFC (details)
  4. [NFC][scudo] Reduce test region size on MIPS32 (details)
  5. [lldb][NFC] Remove all uses of StringRef::withNullAsEmpty in LLDB (details)
  6. [ASTimporter] Remove decl from lookup only if it has decl context (details)
  7. [mlir][docs] Fix broken link to Toy example (details)
  8. [VPlan] Add VPUserID to distinguish between recipes and others. (details)
  9. [RISCV] Fix operand order in fixed-length VM(OR|AND)NOT patterns (details)
  10. [lldb][NFC] Cleanup IRForTarget member initializers (details)
  11. Update MSVC version number in preprocessor check (details)
  12. [CodeGen] Avoid unused variable warning in Release builds. NFCI. (details)
  13. [AMDGPU] Fix typo in comment (details)
  14. [mlir] Add folder for complex.ReOp and complex.ImOp. (details)
Commit 00a1007545ba8ad2105876a41364b35235749e2a by dvyukov
sanitizer_common/symbolizer: fix crashes during exit

Override __cxa_atexit and ignore callbacks.
This prevents crashes in a configuration when the symbolizer
is built into sanitizer runtime and consequently into the test process.
LLVM libraries have some global objects destroyed during exit,
so if the test process triggers any bugs after that, the symbolizer crashes.
An example stack trace of such crash:

For the standalone llvm-symbolizer this does not hurt,
we just don't destroy few global objects on exit.

Reviewed By: kda

Differential Revision: https://reviews.llvm.org/D102470
The file was modifiedcompiler-rt/lib/sanitizer_common/symbolizer/sanitizer_symbolize.cpp
The file was addedcompiler-rt/test/tsan/atexit4.cpp
Commit 81fdc73e5dc74bfe7cda1e16f01f23836406d709 by sander.desmalen
[LV] Return both fixed and scalable Max VF from computeMaxVF.

This patch introduces a new class, MaxVFCandidates, that holds the
maximum vectorization factors that have been computed for both scalable
and fixed-width vectors.

This patch is intended to be NFC for fixed-width vectors, although
considering a scalable max VF (which is disabled by default) pessimises
tail-loop elimination, since it can no longer determine if any chosen VF
(less than fixed/scalable MaxVFs) is guaranteed to handle all vector
iterations if the trip-count is known. This issue will be addressed in
a future patch.

Reviewed By: fhahn, david-arm

Differential Revision: https://reviews.llvm.org/D98721
The file was modifiedllvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h
The file was addedllvm/test/Transforms/LoopVectorize/AArch64/eliminate-tail-predication.ll
The file was modifiedllvm/lib/Transforms/Vectorize/LoopVectorize.cpp
Commit b3d38327b2bfcc92b5e34d0d2f2fa52a1ba063a0 by david.green
[RDA] Fix printing of regs / reg units. NFC

It was printing RegUnits as Regs, leading to much confusion in the debug
logs.
The file was modifiedllvm/lib/CodeGen/ReachingDefAnalysis.cpp
Commit 2e92f1a9bcd5550761be936ac9c0848e6d9fcb40 by Vitaly Buka
[NFC][scudo] Reduce test region size on MIPS32
The file was modifiedcompiler-rt/lib/scudo/standalone/tests/primary_test.cpp
Commit bbea361039c11dc2e6e281c80fa8aa569f1c7c2d by Raphael Isemann
[lldb][NFC] Remove all uses of StringRef::withNullAsEmpty in LLDB

A long time ago LLDB wanted to start using StringRef instead of
C-Strings/ConstString but was blocked by the fact that the StringRef constructor
that takes a C-string was asserting that the C-string isn't a nullptr. To
workaround this, D24697 introduced a special function called `withNullAsEmpty`
and that's what LLDB (and only LLDB) started to use to build StringRefs from
C-strings.

A bit later it seems that `withNullAsEmpty` was declared too awkward to use and
instead the assert in the StringRef constructor got removed (see D24904). The
rest of LLDB was then converted to StringRef by just calling the now perfectly
usable implicit constructor.

However, all the calls to `withNullAsEmpty` just remained and are now just
strange artefacts in the code base that just look out of place. It's also
curiously a LLDB-exclusive function and no other project ever called it since
it's introduction half a decade ago.

This patch removes all uses of `withNullAsEmpty`. The follow up will be to
remove the function from StringRef.

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D102597
The file was modifiedlldb/source/Commands/CommandObjectFrame.cpp
The file was modifiedlldb/source/Target/ThreadPlanStepInRange.cpp
The file was modifiedlldb/source/Interpreter/CommandInterpreter.cpp
The file was modifiedlldb/include/lldb/Interpreter/OptionValueString.h
The file was modifiedlldb/source/API/SBTypeCategory.cpp
The file was modifiedlldb/source/API/SBLanguageRuntime.cpp
The file was modifiedlldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
The file was modifiedlldb/source/Interpreter/OptionValue.cpp
The file was modifiedlldb/source/API/SBDebugger.cpp
The file was modifiedlldb/source/Commands/CommandObjectType.cpp
The file was modifiedlldb/source/API/SBPlatform.cpp
The file was modifiedlldb/source/Commands/CommandObjectTarget.cpp
The file was modifiedlldb/source/Breakpoint/BreakpointResolverName.cpp
The file was modifiedlldb/include/lldb/Interpreter/OptionValueRegex.h
Commit 88ee91cd87794813f4394f82d2c693c8d766e1d2 by balazs.benics
[ASTimporter] Remove decl from lookup only if it has decl context

In the case of TypedefDecls we set the DeclContext after we imported it.
It turns out, it could lead to null pointer dereferences during the
cleanup part of a failed import.

This patch demonstrates this issue and fixes it by checking if the
DeclContext is available or not.

Reviewed By: shafik

Differential Revision: https://reviews.llvm.org/D102640
The file was modifiedclang/lib/AST/ASTImporter.cpp
The file was modifiedclang/unittests/AST/ASTImporterTest.cpp
Commit dfd929d26174108ccfe84de33abf23d660e1373d by marius.brehler
[mlir][docs] Fix broken link to Toy example
The file was modifiedmlir/docs/LangRef.md
Commit cc1a6361d34e270b407f91a6e2e76c7fb324ee2d by flo
[VPlan] Add VPUserID to distinguish between recipes and others.

This allows cast/dyn_cast'ing from VPUser to recipes. This is needed
because there are VPUsers that are not recipes.

Reviewed By: gilr, a.elovikov

Differential Revision: https://reviews.llvm.org/D100257
The file was modifiedllvm/lib/Transforms/Vectorize/VPlan.h
The file was modifiedllvm/lib/Transforms/Vectorize/VPlan.cpp
The file was modifiedllvm/lib/Transforms/Vectorize/VPlanValue.h
Commit 175bdf127d5bb09c81fbd3dc1e766e4ef26793d0 by fraser
[RISCV] Fix operand order in fixed-length VM(OR|AND)NOT patterns

Where the RVV specification writes `vs2, vs1`, our TableGen patterns use
`rs1, rs2`. These differences can easily cause confusion. The VMANDNOT
instruction performs `LHS && !RHS`, and similarly for VMORNOT.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D102606
The file was modifiedllvm/test/CodeGen/RISCV/rvv/fixed-vectors-mask-logic.ll
The file was modifiedllvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td
The file was modifiedllvm/test/CodeGen/RISCV/rvv/fixed-vectors-select-int.ll
Commit d017d12f126ee9045f58f9300078d805e3bcc763 by Raphael Isemann
[lldb][NFC] Cleanup IRForTarget member initializers

Note that the FunctionCallee members aren't pointer, so the nullptr was just
an alternative way to call the default constructor.
The file was modifiedlldb/source/Plugins/ExpressionParser/Clang/IRForTarget.h
The file was modifiedlldb/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp
Commit e89b60fcfc7ff776e93a94a54421850cc104a6df by david.spickett
Update MSVC version number in preprocessor check

Passing template parameter packs to std::map doesn't work in VS 2017/2019, so this updates the preprocessor version check to use an alternate version in VS2019, as well.

Reviewed By: DavidSpickett

Differential Revision: https://reviews.llvm.org/D102260
The file was modifiedllvm/lib/Target/Hexagon/HexagonVectorCombine.cpp
Commit 3f3642a7631e28e44c248a46703e381d389958a1 by benny.kra
[CodeGen] Avoid unused variable warning in Release builds. NFCI.
The file was modifiedclang/lib/CodeGen/CGCleanup.cpp
Commit 092a3ce5699e5e2ddeb7b640bab0a70db73040d8 by jay.foad
[AMDGPU] Fix typo in comment
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPUUnifyDivergentExitNodes.cpp
Commit fa765a09440253fd16e92376b4cf132873afe84e by akuegel
[mlir] Add folder for complex.ReOp and complex.ImOp.

Now that complex constants are supported, we can also fold.

Differential Revision: https://reviews.llvm.org/D102616
The file was modifiedmlir/include/mlir/Dialect/Complex/IR/ComplexOps.td
The file was addedmlir/test/Dialect/Complex/canonicalize.mlir
The file was modifiedmlir/lib/Dialect/Complex/IR/ComplexOps.cpp