SuccessChanges

Summary

  1. [lldb/testsuite] Change get_debugserver_exe to support Rosetta (details)
  2. [HIP] Ignore invalid ar linker options (details)
  3. [NewPM][LoopUnswitch] Pin loop-unswitch to legacy PM or use simple-loop-unswitch (details)
  4. GlobalISel: Implement fewerElementsVector for G_EXTRACT_VECTOR_ELT (details)
  5. [AMDGPU][CostModel] Add f16, f64 and contract cases to fused costs estimation. (details)
  6. [clangd] Fix crash in bugprone-bad-signal-to-kill-thread clang-tidy check. (details)
  7. [lldb] Use target.GetLaunchInfo() instead of creating an empty one. (details)
  8. [mlir][SPIR-V] Fix wrongly placed Rationale section. (details)
  9. Add freeze keyword to IR emacs mode (details)
  10. Fix CFI issues in <future> (details)
  11. [SLP] Fix order of `insertelement`/`insertvalue` seed operands (details)
  12. [libc] Add tolower, toupper implementation. (details)
  13. Correctly detect legacy iOS simulator Mach-O objectfiles (details)
  14. [VectorCombine] add tests for load+insert; NFC (details)
  15. clang: Use byref for aggregate kernel arguments (details)
Commit 99298c7fc540c74c89c92f0e5d617e00cb87cf19 by Fred Riss
[lldb/testsuite] Change get_debugserver_exe to support Rosetta

In order to be able to run the debugserver tests against the Rosetta
debugserver, detect the Rosetta run configuration and return the
system Rosetta debugserver.
The file was modifiedlldb/packages/Python/lldbsuite/test/tools/lldb-server/lldbgdbserverutils.py
Commit 96c2d5e99e32340be1379959977f2d6247788db6 by enye.shi
[HIP] Ignore invalid ar linker options

Instead of accepting the same arguments as regular linker,
the static linker will only accept input files.

Reviewed By: yaxunl

Differential Revision: https://reviews.llvm.org/D85442
The file was modifiedclang/lib/Driver/ToolChains/Gnu.cpp
The file was modifiedclang/test/Driver/hip-link-static-library.hip
Commit d0acd97c68eceada71a96173bdff745dd4307038 by aeubanks
[NewPM][LoopUnswitch] Pin loop-unswitch to legacy PM or use simple-loop-unswitch

As mentioned in
http://lists.llvm.org/pipermail/llvm-dev/2020-July/143395.html,
loop-unswitch has not been ported to the NPM. Instead people are using
simple-loop-unswitch.

Pin all tests in Transforms/LoopUnswitch to legacy PM and replace all
other uses of loop-unswitch with simple-loop-unswitch.

One test that didn't fit into the above was
2014-06-21-congruent-constant.ll which seems to only pass with
loop-unswitch. That is also pinned to legacy PM.

Now all tests containing "-loop-unswitch" anywhere in the test succeed with
NPM turned on by default.

Reviewed By: ychen

Differential Revision: https://reviews.llvm.org/D85360
The file was modifiedllvm/test/Transforms/LoopUnswitch/2012-04-30-LoopUnswitch-LPad-Crash.ll
The file was modifiedllvm/test/Transforms/LoopUnswitch/2007-08-01-LCSSA.ll
The file was modifiedllvm/test/Analysis/Dominators/2007-07-12-SplitBlock.ll
The file was modifiedllvm/test/Transforms/LoopUnswitch/2011-09-26-EHCrash.ll
The file was modifiedllvm/test/Transforms/LoopUnswitch/basictest.ll
The file was modifiedllvm/test/Transforms/LoopUnswitch/trivial-unswitch.ll
The file was modifiedllvm/test/Transforms/LCSSA/2007-07-12-LICM-3.ll
The file was modifiedllvm/test/Transforms/LoopUnswitch/2008-11-03-Invariant.ll
The file was modifiedllvm/test/Transforms/LoopUnswitch/elseif-non-exponential-behavior.ll
The file was modifiedllvm/test/Transforms/LoopDeletion/2008-05-06-Phi.ll
The file was modifiedllvm/test/Transforms/LoopUnswitch/2015-06-17-Metadata.ll
The file was modifiedllvm/test/Transforms/LoopUnswitch/2010-11-18-LCSSA.ll
The file was modifiedllvm/test/Analysis/MemorySSA/loop-unswitch.ll
The file was modifiedllvm/test/Analysis/Dominators/2007-07-11-SplitBlock.ll
The file was modifiedllvm/test/Transforms/LoopUnswitch/exponential-behavior.ll
The file was modifiedllvm/test/Transforms/LoopUnswitch/2006-06-27-DeadSwitchCase.ll
The file was modifiedllvm/test/Transforms/LICM/2007-07-30-AliasSet.ll
The file was modifiedllvm/test/Transforms/LoopUnswitch/2012-04-02-IndirectBr.ll
The file was modifiedllvm/test/Transforms/LoopUnswitch/pr32818.ll
The file was modifiedllvm/test/Analysis/MemorySSA/pr40749_2.ll
The file was modifiedllvm/test/Transforms/IndVarSimplify/2014-06-21-congruent-constant.ll
The file was modifiedllvm/test/Transforms/LoopUnswitch/unswitch-select.ll
The file was modifiedllvm/test/Other/2007-09-10-PassManager.ll
The file was modifiedllvm/test/Transforms/LoopUnswitch/2008-06-02-DomInfo.ll
The file was modifiedllvm/test/Transforms/LoopUnswitch/2007-05-09-tl.ll
The file was modifiedllvm/test/Transforms/LoopUnswitch/guards.ll
The file was modifiedllvm/test/Transforms/LoopUnswitch/preserve-analyses.ll
The file was modifiedllvm/test/Transforms/LCSSA/2007-07-12-LICM.ll
The file was modifiedllvm/test/Transforms/LoopUnswitch/2011-11-18-TwoSwitches.ll
The file was modifiedllvm/test/Transforms/LoopUnswitch/2011-11-18-SimpleSwitch.ll
The file was modifiedllvm/test/Transforms/LoopUnswitch/unswitch-equality-undef.ll
The file was modifiedllvm/test/Transforms/LoopUnswitch/copy-metadata.ll
The file was modifiedllvm/test/Transforms/LoopUnswitch/2007-07-13-DomInfo.ll
The file was modifiedllvm/test/Transforms/LoopUnswitch/2007-07-12-ExitDomInfo.ll
The file was modifiedllvm/test/Transforms/LICM/Preserve-LCSSA.ll
The file was modifiedllvm/test/Transforms/LoopUnswitch/2012-05-20-Phi.ll
The file was modifiedllvm/test/Transforms/LoopUnswitch/callbr.ll
The file was modifiedllvm/test/Transforms/LoopUnswitch/invalidate-scev.ll
The file was modifiedllvm/test/Transforms/LoopUnswitch/2006-06-13-SingleEntryPHI.ll
The file was modifiedllvm/test/Analysis/AliasSet/unknown-inst-tracking.ll
The file was modifiedllvm/test/Transforms/LoopUnswitch/LIV-loop-condtion.ll
The file was modifiedllvm/test/Transforms/LoopUnswitch/2011-06-02-CritSwitch.ll
The file was modifiedllvm/test/Transforms/LICM/pr32129.ll
The file was modifiedllvm/test/Transforms/LoopUnswitch/msan.ll
The file was modifiedllvm/test/Transforms/LoopUnswitch/cleanuppad.ll
The file was modifiedllvm/test/Transforms/LoopUnswitch/2007-07-18-DomInfo.ll
The file was modifiedllvm/test/Transforms/LoopUnswitch/2008-06-17-DomFrontier.ll
The file was modifiedllvm/test/Transforms/LCSSA/2007-07-12-LICM-2.ll
The file was modifiedllvm/test/Transforms/LoopUnswitch/2011-11-18-TwoSwitches-Threshold.ll
The file was modifiedllvm/test/Transforms/LoopUnswitch/2007-08-01-Dom.ll
The file was modifiedllvm/test/Analysis/MemorySSA/pr39197.ll
The file was modifiedllvm/test/Transforms/LoopUnswitch/crash.ll
The file was modifiedllvm/test/Transforms/LoopUnswitch/simplify-with-nonvalness.ll
The file was modifiedllvm/test/Transforms/LoopUnswitch/2007-05-09-Unreachable.ll
The file was modifiedllvm/test/Transforms/LoopUnswitch/2015-09-18-Addrspace.ll
The file was modifiedllvm/test/Transforms/LoopUnswitch/infinite-loop.ll
Commit e00201539f9c5c540a037add790eb31032aaea8f by Matthew.Arsenault
GlobalISel: Implement fewerElementsVector for G_EXTRACT_VECTOR_ELT

Use the same basic strategy as LegalizeVectorTypes. Try to index into
smaller pieces if there's a constant index, and otherwise fall back to
a stack temporary.
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/legalize-extract-vector-elt.mir
The file was modifiedllvm/include/llvm/CodeGen/GlobalISel/LegalizerHelper.h
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/extractelement.ll
The file was modifiedllvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
The file was addedllvm/test/CodeGen/AMDGPU/GlobalISel/extractelement-stack-lower.ll
Commit 4ccc38813eb76c7984f2700df527c643abeb9a58 by dfukalov
[AMDGPU][CostModel] Add f16, f64 and contract cases to fused costs estimation.

Add cases of fused fmul+fadd/fsub with f16 and f64 operands to cost model.
Also added operations with contract attribute.

Fixed line endings in test.

Reviewed By: rampitec

Differential Revision: https://reviews.llvm.org/D84995
The file was modifiedllvm/test/Analysis/CostModel/AMDGPU/fused_costs.ll
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.h
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
Commit 9f24148b212698aca220ac923d215c2073e443ce by platonov.aleksandr
[clangd] Fix crash in bugprone-bad-signal-to-kill-thread clang-tidy check.

Inside clangd, clang-tidy checks don't see preprocessor events in the preamble.
This leads to `Token::PtrData == nullptr` for tokens that the macro is defined to.
E.g. `#define SIGTERM 15`:
- Token::Kind == tok::numeric_constant (Token::isLiteral() == true)
- Token::UintData == 2
- Token::PtrData == nullptr

As the result of this, bugprone-bad-signal-to-kill-thread check crashes at null-dereference inside clangd.

Reviewed By: hokein

Differential Revision: https://reviews.llvm.org/D85417
The file was modifiedclang-tools-extra/clangd/unittests/DiagnosticsTests.cpp
The file was modifiedclang-tools-extra/clang-tidy/bugprone/BadSignalToKillThreadCheck.cpp
Commit 86aa8e6363c7e00f211de62ccb3236556e9841df by Jonas Devlieghere
[lldb] Use target.GetLaunchInfo() instead of creating an empty one.

Update tests that were creating an empty LaunchInfo instead of using the
one coming from the target. This ensures target properties are honored.
The file was modifiedlldb/test/API/commands/frame/language/TestGuessLanguage.py
The file was modifiedlldb/test/API/commands/disassemble/basic/TestFrameDisassemble.py
The file was modifiedlldb/test/API/python_api/process/io/TestProcessIO.py
The file was modifiedlldb/test/API/functionalities/tail_call_frames/thread_step_out_or_return/TestSteppingOutWithArtificialFrames.py
The file was modifiedlldb/test/API/python_api/process/TestProcessAPI.py
The file was modifiedlldb/test/API/functionalities/signal/TestSendSignal.py
The file was modifiedlldb/test/API/functionalities/breakpoint/address_breakpoints/TestAddressBreakpoints.py
The file was modifiedlldb/test/API/macosx/thread-names/TestInterruptThreadNames.py
The file was modifiedlldb/test/API/commands/frame/var/TestFrameVar.py
The file was modifiedlldb/test/API/commands/target/auto-install-main-executable/TestAutoInstallMainExecutable.py
The file was modifiedlldb/test/API/functionalities/breakpoint/auto_continue/TestBreakpointAutoContinue.py
The file was modifiedlldb/test/API/functionalities/tail_call_frames/sbapi_support/TestTailCallFrameSBAPI.py
Commit 25e8668e88bb1fa7bfa359b56ba7c663ebec5d3b by ravishankarm
[mlir][SPIR-V] Fix wrongly placed Rationale section.

Differential Revision: https://reviews.llvm.org/D85461
The file was modifiedmlir/docs/Dialects/SPIR-V.md
Commit 87ce06e3155775f63ce8b6693282c130e7dff21d by Matthew.Arsenault
Add freeze keyword to IR emacs mode
The file was modifiedllvm/utils/emacs/llvm-mode.el
Commit 189ba3db8653eaefc191599dd60d9aa6b0127c44 by eugenis
Fix CFI issues in <future>

This change fixes errors reported by Control Flow Integrity (CFI) checking when using `std::packaged_task`.  The errors mostly stem from casting the underlying storage (`__buf_`) to `__base*`, even if it is uninitialized.  The solution is to wrap `__base*` access to `__buf_` behind a getter marked with _LIBCPP_NO_CFI.

Differential Revision: https://reviews.llvm.org/D82627
The file was modifiedlibcxx/include/future
Commit a7478fab6ce82532c1545614362a3688e8a4ed36 by anton.a.afanasyev
[SLP] Fix order of `insertelement`/`insertvalue` seed operands

Summary:
This patch takes the indices operands of `insertelement`/`insertvalue`
into account while generation of seed elements for `findBuildAggregate()`.
This function has kept the original order of `insert`s before.
Also this patch optimizes `findBuildAggregate()` preventing it from
redundant temporary vector allocations and its multiple reversing.

Fixes llvm.org/pr44067

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D83779
The file was modifiedllvm/test/Transforms/SLPVectorizer/X86/insert-element-build-vector.ll
The file was modifiedllvm/test/Transforms/SLPVectorizer/X86/pr44067.ll
The file was modifiedllvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
The file was modifiedllvm/test/Transforms/PhaseOrdering/X86/horiz-math.ll
The file was modifiedllvm/test/Transforms/SLPVectorizer/X86/pr42022.ll
Commit 128bf458ab8c5bdbb02e5b13769a618b357d5ae2 by gyurgyikcp
[libc] Add tolower, toupper implementation.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D85326
The file was modifiedlibc/test/src/ctype/CMakeLists.txt
The file was addedlibc/test/src/ctype/tolower_test.cpp
The file was modifiedlibc/src/ctype/isupper.cpp
The file was addedlibc/src/ctype/toupper.h
The file was modifiedlibc/src/ctype/ctype_utils.h
The file was addedlibc/test/src/ctype/toupper_test.cpp
The file was modifiedlibc/config/linux/api.td
The file was modifiedlibc/src/ctype/islower.cpp
The file was addedlibc/src/ctype/toupper.cpp
The file was modifiedlibc/config/linux/x86_64/entrypoints.txt
The file was modifiedlibc/src/ctype/CMakeLists.txt
The file was modifiedlibc/config/linux/aarch64/entrypoints.txt
The file was addedlibc/src/ctype/tolower.h
The file was modifiedlibc/spec/stdc.td
The file was addedlibc/src/ctype/tolower.cpp
Commit 05df9cc70367a60cb34bee773389ab2522984f8b by Adrian Prantl
Correctly detect legacy iOS simulator Mach-O objectfiles

The code in ObjectFileMachO didn't disambiguate between ios and
ios-simulator object files for Mach-O objects using the legacy
ambiguous LC_VERSION_MIN load commands. This used to not matter before
taught ArchSpec that ios and ios-simulator are no longer compatible.

rdar://problem/66545307

Differential Revision: https://reviews.llvm.org/D85358
The file was modifiedlldb/unittests/Utility/ArchSpecTest.cpp
The file was modifiedlldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
The file was modifiedlldb/source/Utility/ArchSpec.cpp
The file was modifiedlldb/test/API/macosx/simulator/TestSimulatorPlatform.py
Commit c9bcc237a284af16d25ae89e5e3178ed210a840f by spatel
[VectorCombine] add tests for load+insert; NFC
The file was modifiedllvm/test/Transforms/VectorCombine/X86/load.ll
Commit 30eeb742f1d11d7a7036e3b8a3bffc1dfd252082 by Matthew.Arsenault
clang: Use byref for aggregate kernel arguments

Add address space to indirect abi info and use it for kernels.

Previously, indirect arguments assumed assumed a stack passed object
in the alloca address space using byval. A stack pointer is unsuitable
for kernel arguments, which are passed in a separate, constant buffer
with a different address space.

Start using the new byref for aggregate kernel arguments. Previously
these were emitted as raw struct arguments, and turned into loads in
the backend. These will lower identically, although with byref you now
have the option of applying an explicit alignment. In the future, a
reasonable implementation would use byref for all kernel arguments
(this would be a practical problem at the moment due to losing things
like noalias on pointer arguments).

This is mostly to avoid fighting the optimizer's treatment of
aggregate load/store. SROA and instcombine both turn aggregate loads
and stores into a long sequence of element loads and stores, rather
than the optimizable memcpy I would expect in this situation. Now an
explicit memcpy will be introduced up-front which is better understood
and helps eliminate the alloca in more situations.

This skips using byref in the case where HIP kernel pointer arguments
in structs are promoted to global pointers. At minimum an additional
patch is needed to allow coercion with indirect arguments. This also
skips using it for OpenCL due to the current workaround used to
support kernels calling kernels. Distinct function bodies would need
to be generated up front instead of emitting an illegal call.
The file was modifiedclang/test/CodeGenCUDA/kernel-args.cu
The file was modifiedclang/lib/CodeGen/TargetInfo.cpp
The file was modifiedclang/test/CodeGenOpenCL/amdgpu-abi-struct-coerce.cl
The file was modifiedclang/lib/CodeGen/CGCall.cpp
The file was modifiedclang/include/clang/CodeGen/CGFunctionInfo.h