Changes

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

Summary

  1. [mlir] Fix build on Windows on Arm (details)
  2. [clang][tooling] NFC: Refactor command-line diagnostic tests (details)
  3. [X86][FP16] Combine the FADD(A, FMA(B, C, 0)) to FMA(B, C, A) (details)
  4. Wrap xar/xar.h include in extern "C" block (details)
  5. [NFC] Wrap MLIR addAffineForOpDomain warning with LLVM_DEBUG (details)
  6. [clangd] Ensure lambda init-capture gets semantic token (details)
  7. [ModuleInlinerWrapperPass] Do some naive printing of wrapped pipeline with -print-pipeline-passes (details)
  8. [DAGCombiner] Rename isAlias as mayAlias. NFC (details)
  9. [TII] Remove the MFI argument to convertToThreeAddress. NFC. (details)
  10. [Driver] Correctly handle static C++ standard library (details)
  11. Revert "[Driver] Correctly handle static C++ standard library" (details)
  12. [libc] Add optimized memset for AArch64 (details)
  13. [InstSimplify] Don't lose inbounds when simplifying a GEP (details)
  14. tsan: remove unnecessary enum values (NFC) (details)
  15. tsan: remove DontDumpShadow from Go build (details)
  16. tsan: add another deep stack test (details)
  17. tsan: use RawShadow instead of u64 more (details)
  18. tsan: move shadow declaration into a separate header file (NFC) (details)
  19. [fir][NFC] inline trival isa_<type> functions (details)
  20. [RISCV][VP] Add support for VP_REDUCE_* operations (details)
  21. [lldb] Fix DomainSocket::GetSocketName for unnamed sockets (details)
  22. [BasicBlockUtils] Fixup of an assumed typo in MergeBlockIntoPredecessor (details)
  23. [CodeGen] RegisterCoalescer::buildVRegToDbgValueMap - use const-ref value in for-range loop. NFCI. (details)
  24. [CodeGen] ProcessSDDbgValues - use const-ref value in for-range loop. NFCI. (details)
  25. [RISCV] Add missing op type OPERAND_UIMM2, OPERAND_UIMM3 and OPERAND_UIMM7 for verifyInstruction (details)
  26. [DSE] Track earliest escape, use for loads in isReadClobber. (details)
  27. tsan: remove expected race leftover (details)
  28. [libc++] Remove uses of _LIBCPP_HAS_NO_VARIABLE_TEMPLATES (details)
  29. [CodeGen] update test file to not run the entire LLVM optimizer; NFC (details)
  30. [gn build] (semi-manually) port 702cb7afe9de (details)
  31. [gn build] (manually) port ac191bcc99e2f (details)
  32. [gn build] Port f4abdb0c074b (details)
  33. [InstCombine] fold cast of right-shift if high bits are not demanded (2nd try) (details)
  34. [CostModel][X86] Increase i64 mul cost from 1 to 2 (details)
  35. clangd: Do not report inline overrides twice (details)
  36. [ORC][examples] Fix segfault in LLJITWithTargetProcessControl (details)
  37. [Sema] Fix a null pointer reference crash. (details)
  38. [AMDGPU] Avoid processing functions in amdgpu-propagate-attributes pass for shaders (details)
  39. Pass some DataLayout arguments by const-ref (details)
  40. Fix buildbot error. (details)
  41. Support: Fix missing whitespace in comment for inconvertibleErrorCode(), NFC (details)
  42. [x86] add AVX run to tests of fcmp logic; NFC (details)
  43. [lldb] [gdb-remote] Refactor getting remote regs to use local vector (details)
  44. [lldb] [gdb-remote] Use local regnos for value_regs/invalidate_regs (details)
  45. [clang] Use portable "#!/usr/bin/env bash" shebang for tools and utils. (details)
  46. [RegAlloc] Cast uint8_t to unsigned before printing it. (details)
  47. [SampleFDO] Remove redundant declarations (NFC) (details)
  48. [PowerPC] Add range checks for P10 Vector Builtins (details)
  49. [libc++] Use CMake interface targets to setup benchmark flags (details)
  50. [LiveIntervals] Fix repairOldRegInRange for simple def cases (details)
  51. Revert "[lldb] [gdb-remote] Use local regnos for value_regs/invalidate_regs" (details)
  52. Revert "[lldb] [gdb-remote] Refactor getting remote regs to use local vector" (details)
  53. Resolve {GlobalValue,GloalIndirectSymol}::getBaseObject confusion (details)
  54. [JumpThreading] Ignore free instructions (details)
  55. [fir][NFC] rename canBePointerOrHeapElementType to cannotBePointerOrHeapElementType (details)
  56. Revert "[LiveIntervals] Fix repairOldRegInRange for simple def cases" (details)
  57. [fir][NFC] Remove fir.cmpf replaced by mlir.cmpf (details)
  58. [ARM] Extra tests for unpredicated qr MVE intrinsics. (details)
  59. [libc++] Remove unused macro in __config (details)
  60. [flang] Implement READ(SIZE=) and INQUIRE(IOLENGTH=) in runtime (details)
  61. [compiler-rt][profile] Add padding after binary IDs (details)
  62. [lldb] Add a C language REPL to test LLDB's REPL infrastructure (details)
Commit b7050c791d8951c0a099bf162f9ab3a696611b7d by diana.picus
[mlir] Fix build on Windows on Arm

clang-cl errors out while handling the templated version of tgfmt. This
patch works around the issue by explicitly choosing the non-templated
version of tgfmt, which takes an ArrayRef<std::string>.

More details in this thread:
https://lists.llvm.org/pipermail/cfe-dev/2021-September/068936.html

Thanks @Mehdi Amini for suggesting the fix :)

Differential Revision: https://reviews.llvm.org/D110223
The file was modifiedmlir/tools/mlir-tblgen/RewriterGen.cpp
Commit 352a2e67162541efe79a1e144b40a054751e7d5c by Jan Svoboda
[clang][tooling] NFC: Refactor command-line diagnostic tests

This patch uses a different command-line arguments to test `clang::tooling::ToolInvocation` that are not specific to Darwin.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D110160
The file was modifiedclang/unittests/Tooling/ToolingTest.cpp
Commit 76656ec8ec535bd17afc998112a83c7c55ad7719 by chen3.liu
[X86][FP16] Combine the FADD(A, FMA(B, C, 0)) to FMA(B, C, A)

This patch is to support transform something like
_mm512_add_ph(acc, _mm512_fmadd_pch(a, b, _mm512_setzero_ph()))
to _mm512_fmadd_pch(a, b, acc).

Differential Revision: https://reviews.llvm.org/D109953
The file was modifiedllvm/lib/Target/X86/X86ISelLowering.cpp
The file was addedllvm/test/CodeGen/X86/avx512fp16-combine-vfmac-fadd.ll
Commit 08ef24f6abdfaee038c47e3fe0b61b40e8fd9053 by sylvestre
Wrap xar/xar.h include in extern "C" block

Without such wrapping, linking lld fails with missing symbols because of
C++ symbol mangling with older versions of the MacOSX SDK, in which
xar.h doesn't have an extern "C" block itself.

Reviewed By: #lld-macho, thakis

Differential Revision: https://reviews.llvm.org/D110224
The file was modifiedlld/MachO/SyntheticSections.cpp
Commit 1f3f144446d1766b6bd63ac02a064450c4fa5e55 by shivam98.tkg
[NFC] Wrap MLIR addAffineForOpDomain warning with LLVM_DEBUG

Current warning message in method `addAffineForOpDomain` of mlir/lib/Analysis/AffineStructures.cpp is being printed to the stdout/stderr.
This patch redirects the warning with LLVM_DEBUG following standard llvm practice.

Reviewed By: bondhugula

Differential Revision: https://reviews.llvm.org/D108340
The file was modifiedmlir/lib/Analysis/AffineStructures.cpp
Commit 4223195de3eaaa9c221d1f178899f221be6264c5 by zeratul976
[clangd] Ensure lambda init-capture gets semantic token

Prior to this patch, CollectExtraHighlightings would incorrectly produce
a token for the init-capture's type which overlapped the name and
resulted in both being dropped.

Fixes https://github.com/clangd/clangd/issues/868

Differential Revision: https://reviews.llvm.org/D110130
The file was modifiedclang-tools-extra/clangd/unittests/SemanticHighlightingTests.cpp
The file was modifiedclang-tools-extra/clangd/SemanticHighlighting.cpp
Commit c5e0313e4489cb3130f441685fd4207eeee6aa48 by bjorn.a.pettersson
[ModuleInlinerWrapperPass] Do some naive printing of wrapped pipeline with -print-pipeline-passes

Bisecting and reducing opt pipelines that includes the
ModuleInlinerWrapperPass has turned out to be a bit problematic.
This is far from perfect (it still lacks information about inline
advisor params etc.), but it should give some kind of hint to what
the wrapped pipeline looks like when using -print-pipeline-passes.

Reviewed By: aeubanks, mtrofin

Differential Revision: https://reviews.llvm.org/D109878
The file was modifiedllvm/test/Other/new-pm-print-pipeline.ll
The file was modifiedllvm/include/llvm/Transforms/IPO/Inliner.h
The file was modifiedllvm/lib/Transforms/IPO/Inliner.cpp
Commit c3ae8ecb520e6565594272d12e447e295ce09c9b by bjorn.a.pettersson
[DAGCombiner] Rename isAlias as mayAlias. NFC

Differential Revision: https://reviews.llvm.org/D110062
The file was modifiedllvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Commit 6cef28ed2df19c197790ca777423fc1c2572c138 by jay.foad
[TII] Remove the MFI argument to convertToThreeAddress. NFC.

This simplifies the API and addresses a FIXME in
TwoAddressInstructionPass::convertInstTo3Addr.

Differential Revision: https://reviews.llvm.org/D110229
The file was modifiedllvm/lib/Target/AMDGPU/SIInstrInfo.cpp
The file was modifiedllvm/lib/Target/RISCV/RISCVInstrInfo.cpp
The file was modifiedllvm/lib/Target/SystemZ/SystemZInstrInfo.cpp
The file was modifiedllvm/lib/Target/X86/X86FixupLEAs.cpp
The file was modifiedllvm/include/llvm/CodeGen/TargetInstrInfo.h
The file was modifiedllvm/lib/Target/ARM/ARMBaseInstrInfo.h
The file was modifiedllvm/lib/Target/SystemZ/SystemZInstrInfo.h
The file was modifiedllvm/lib/Target/X86/X86InstrInfo.h
The file was modifiedllvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
The file was modifiedllvm/lib/Target/AMDGPU/SIInstrInfo.h
The file was modifiedllvm/lib/CodeGen/TwoAddressInstructionPass.cpp
The file was modifiedllvm/lib/Target/RISCV/RISCVInstrInfo.h
The file was modifiedllvm/lib/Target/AMDGPU/SIFoldOperands.cpp
The file was modifiedllvm/lib/Target/X86/X86InstrInfo.cpp
Commit 5e28c892d06f95600f8b6290ad4de38bfe142637 by phosek
[Driver] Correctly handle static C++ standard library

When statically linking C++ standard library, we shouldn't add -Bdynamic
after including the library on the link line because that might override
user settings like -static and -static-pie. Rather, we should surround
the library with --push-state/--pop-state to make sure that -Bstatic
only applies to C++ standard library and nothing else. This has been
supported since GNU ld 2.25 (2014) so backwards compatibility should
no longer be a concern.

Differential Revision: https://reviews.llvm.org/D110128
The file was modifiedclang/lib/Driver/ToolChains/Fuchsia.cpp
The file was modifiedclang/test/Driver/fuchsia.cpp
The file was modifiedclang/test/Driver/linux-ld.c
The file was modifiedclang/lib/Driver/ToolChains/Gnu.cpp
Commit 904ca7d2ed97bf114fd11373c722acd1e54bfaa3 by phosek
Revert "[Driver] Correctly handle static C++ standard library"

This reverts commit 5e28c892d06f95600f8b6290ad4de38bfe142637 as
the linker on the clang-ppc64le-rhel bot doesn't seem to support
--push-state/--pop-state.
The file was modifiedclang/test/Driver/linux-ld.c
The file was modifiedclang/test/Driver/fuchsia.cpp
The file was modifiedclang/lib/Driver/ToolChains/Fuchsia.cpp
The file was modifiedclang/lib/Driver/ToolChains/Gnu.cpp
Commit 8b87c3d5736730cda1d8856098621029b759f3d1 by andre.simoesdiasvieira
[libc] Add optimized memset for AArch64

Differential Revision: https://reviews.llvm.org/D107848
The file was modifiedlibc/src/string/CMakeLists.txt
The file was modifiedlibc/src/string/memory_utils/elements_aarch64.h
The file was addedlibc/src/string/aarch64/memset.cpp
Commit 05663dc14644d12d688155d55ba267e7b7e69817 by Alexander.Richardson
[InstSimplify] Don't lose inbounds when simplifying a GEP

I noticed this while working on a (ptrtoint (gep null, x)) -> x fold.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D110168
The file was modifiedllvm/lib/Analysis/PHITransAddr.cpp
The file was modifiedllvm/include/llvm/Analysis/InstructionSimplify.h
The file was modifiedllvm/test/Transforms/InstSimplify/simplify-nested-bitcast.ll
The file was modifiedllvm/lib/Transforms/Scalar/NewGVN.cpp
The file was modifiedllvm/lib/Analysis/InstructionSimplify.cpp
The file was modifiedllvm/lib/Transforms/InstCombine/InstructionCombining.cpp
Commit af8b14c278c2cb5309562b6e3fa55333c2889d86 by dvyukov
tsan: remove unnecessary enum values (NFC)

Remove unnecessary enum values in the memory profiler.
There is no point in spelling them, it can only lead to bugs
and larger diffs when values are added/removed.

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D110263
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_platform_linux.cpp
Commit 356ecd9bd1c5c10ff776dced80f353839fafb354 by dvyukov
tsan: remove DontDumpShadow from Go build

DontDumpShadow is used only in InitializeShadowMemory which is Go-only.

Depends on D110263.

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D110264
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_platform_posix.cpp
Commit dcc6db22d8508a85ecd2b8bdcc5ae5646968c083 by dvyukov
tsan: add another deep stack test

Add a test for a trace corner case that lead to a bug
in experimental runtime replacement.
Since it passes with the current runtime it makes sense
to submit it on its own.

Depends on D110264.

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D110265
The file was addedcompiler-rt/test/tsan/deep_stack2.cpp
Commit 20d3e518010a2a4fa1f4cdc9b7b885f13966a19c by dvyukov
tsan: use RawShadow instead of u64 more

Fix few remaining cases where we use u64 instead of the new RawShadow type.

Depends on D110265.

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D110266
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_platform_linux.cpp
Commit 702cb7afe9de21b9a86d012cdd0b283496e619af by dvyukov
tsan: move shadow declaration into a separate header file (NFC)

tsan_rtl.h is very huge and contains too many things.
Move FastState and Shadow types into a new tsan_shadow.h file.
This also allows to use FastState/Shadow in other header files
without creating circular dependencies (which most likely will
happen today).

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D110272
The file was modifiedcompiler-rt/lib/tsan/CMakeLists.txt
The file was addedcompiler-rt/lib/tsan/rtl/tsan_shadow.h
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_rtl.h
Commit ce59ccd04023cab3a837da14079ca2dcbfebb70c by clementval
[fir][NFC] inline trival isa_<type> functions

This patch is part of the upstreaming effort from fir-dev branch and sync changes. Inline trival `isa_<type>` functions.

Co-authored-by: schweitzpgi

Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D110233
The file was modifiedflang/lib/Optimizer/Dialect/FIRType.cpp
The file was modifiedflang/include/flang/Optimizer/Dialect/FIRType.h
Commit e7c879a69d6b61f35969936a9efd46bcfbf80ca0 by fraser
[RISCV][VP] Add support for VP_REDUCE_* operations

This patch adds codegen support for lowering the vector-predicated
reduction intrinsics to RVV instructions. The process is similar to that
of the other reduction intrinsics, save for the fact that every VP
reduction has a start value. We reuse the existing custom "VL" nodes,
adding extra patterns where required to handle non-true masks.

To support these nodes, the `RISCVISD::VECREDUCE_*_VL` nodes have been
given an explicit "merge" operand. This is to faciliate the VP
reductions, where we must be careful to ensure that even if no operation
is performed (when VL=0) we still produce the start value. The RVV
reductions don't update the destination register under these conditions,
so we tie the splatted start value to the output register.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D107657
The file was addedllvm/test/CodeGen/RISCV/rvv/vreductions-fp-vp.ll
The file was modifiedllvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h
The file was modifiedllvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
The file was modifiedllvm/lib/Target/RISCV/RISCVISelLowering.cpp
The file was addedllvm/test/CodeGen/RISCV/rvv/fixed-vectors-reduction-mask-vp.ll
The file was modifiedllvm/lib/Target/RISCV/RISCVISelLowering.h
The file was addedllvm/test/CodeGen/RISCV/rvv/vreductions-int-vp.ll
The file was addedllvm/test/CodeGen/RISCV/rvv/fixed-vectors-reduction-int-vp.ll
The file was modifiedllvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td
The file was modifiedllvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
The file was addedllvm/test/CodeGen/RISCV/rvv/fixed-vectors-reduction-fp-vp.ll
The file was addedllvm/test/CodeGen/RISCV/rvv/vreductions-mask-vp.ll
Commit 5685eb950da7c6901c8b264a3c93e8ea63b34d3d by pavel
[lldb] Fix DomainSocket::GetSocketName for unnamed sockets

getpeername will return addrlen = 2 (sizeof sa_family_t) for unnamed
sockets (those not assigned a name with bind(2)). This is typically true
for client sockets as well as those created by socketpair(2).

This GetSocketName used to crash for sockets which were connected to
these kinds of sockets. Now it returns an empty string.
The file was modifiedlldb/unittests/Host/SocketTest.cpp
The file was modifiedlldb/source/Host/posix/DomainSocket.cpp
Commit 85a586501bcc5b556d34a566b9d256d56d6fc5ba by bjorn.a.pettersson
[BasicBlockUtils] Fixup of an assumed typo in MergeBlockIntoPredecessor

The NFC commit e5692a564a73ef63b7b changed the logic for
DomTreeUpdates to use the range [succ_begin, succ_begin) when
looking for SuccsOfPredBB rather than using [succ_begin, succ_end).

As the commit was NFC this is identified as a typo (it has been
discussed briefly in phabricator).

The typo was found when inspecting the code, so I've got no idea if
changing back to the old range has any significant impact (such as
solving any PR:s or causing some new problems). But at least this
restores the code to the originally indented behavior.
The file was modifiedllvm/lib/Transforms/Utils/BasicBlockUtils.cpp
Commit 5cabe4d9d3226bfd0856ac031b63ab641acc08f5 by llvm-dev
[CodeGen] RegisterCoalescer::buildVRegToDbgValueMap - use const-ref value in for-range loop. NFCI.

Avoid unnecessary copies, reported by MSVC static analyzer.
The file was modifiedllvm/lib/CodeGen/RegisterCoalescer.cpp
Commit 2a5936faf0f3da9f55109ac1ed3b7b45436e3ced by llvm-dev
[CodeGen] ProcessSDDbgValues - use const-ref value in for-range loop. NFCI.

Avoid unnecessary copies, reported by MSVC static analyzer.
The file was modifiedllvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp
Commit fbacf5ad385c63c73060369ac11dd535e44a37ce by jim
[RISCV] Add missing op type OPERAND_UIMM2, OPERAND_UIMM3 and OPERAND_UIMM7 for verifyInstruction

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D110307
The file was modifiedllvm/lib/Target/RISCV/RISCVInstrInfo.cpp
Commit 5ce89279c0986d0bcbe526dce52f91dd0c16427c by flo
[DSE] Track earliest escape, use for loads in isReadClobber.

At the moment, DSE only considers whether a pointer may be captured at
all in a function. This leads to cases where we fail to remove stores to
local objects because we do not check if they escape before potential
read-clobbers or after.

Doing context-sensitive escape queries in isReadClobber has been removed
a while ago in d1a1cce5b130 to save compile-time. See PR50220 for more
context.

This patch introduces a new capture tracker, which keeps track of the
'earliest' capture. An instruction A is considered earlier than instruction
B, if A dominates B. If 2 escapes do not dominate each other, the
terminator of the common dominator is chosen. If not all uses cannot be
analyzed, the earliest escape is set to the first instruction in the
function entry block.

If the query instruction dominates the earliest escape and is not in a
cycle, then pointer does not escape before the query instruction.

This patch uses this information when checking if a load of a loaded
underlying object may alias a write to a stack object. If the stack
object does not escape before the load, they do not alias.

I will share a follow-up patch to also use the information for call
instructions to fix PR50220.

In terms of compile-time, the impact is low in general,
    NewPM-O3: +0.05%
    NewPM-ReleaseThinLTO: +0.05%
    NewPM-ReleaseLTO-g: +0.03

with the largest change being tramp3d-v4 (+0.30%)
http://llvm-compile-time-tracker.com/compare.php?from=1a3b3301d7aa9ab25a8bdf045c77298b087e3930&to=bc6c6899cae757c3480f4ad4874a76fc1eafb0be&stat=instructions

Compared to always computing the capture information on demand, we get
the following benefits from the caching:
NewPM-O3: -0.03%
NewPM-ReleaseThinLTO: -0.08%
NewPM-ReleaseLTO-g: -0.04%

The biggest speedup is tramp3d-v4 (-0.21%).
http://llvm-compile-time-tracker.com/compare.php?from=0b0c99177d1511469c633282ef67f20c851f58b1&to=bc6c6899cae757c3480f4ad4874a76fc1eafb0be&stat=instructions

Overall there is a small, but noticeable benefit from caching. I am not
entirely sure if the speedups warrant the extra complexity of caching.
The way the caching works also means that we might miss a few cases, as
it is less precise. Also, there may be a better way to cache things.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D109844
The file was modifiedllvm/lib/Analysis/CaptureTracking.cpp
The file was modifiedllvm/test/Transforms/DeadStoreElimination/captures-before-load.ll
The file was modifiedllvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
The file was modifiedllvm/include/llvm/Analysis/CaptureTracking.h
Commit 7faf1285f2c416494aacf7ee13e70e330b2f0540 by dvyukov
tsan: remove expected race leftover

Remove nmissed_expected variable.
It's a leftover from removed "expected race" feature and is never incremented.

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D110321
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_rtl.cpp
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_rtl.h
Commit 1711a6ec650980764d97b3be148745e2813a3707 by Louis Dionne
[libc++] Remove uses of _LIBCPP_HAS_NO_VARIABLE_TEMPLATES

All supported compilers provide support for variable templates now.

Differential Revision: https://reviews.llvm.org/D110284
The file was modifiedlibcxx/test/support/test_macros.h
The file was modifiedlibcxx/include/chrono
The file was modifiedlibcxx/include/type_traits
The file was modifiedlibcxx/include/__config
The file was modifiedlibcxx/test/libcxx/selftest/test_macros.pass.cpp
The file was modifiedlibcxx/include/ratio
Commit c75c5c5f8f3740716c9a1c4fb1d8f7e753af2cf6 by spatel
[CodeGen] update test file to not run the entire LLVM optimizer; NFC

Clang regression tests should not break when changes are made to
the LLVM optimizer. This file broke on the 1st attempt at D110170,
so I'm trying to prevent that on another try.

Similar to other files in this directory, we make a compromise and
run -mem2reg to reduce noise by about 1000 lines out of 5000+ CHECK lines.
The file was modifiedclang/test/CodeGen/aapcs-bitfield.c
Commit cef0280a95dd969f18a5cd3c2238a60a25ef4cce by thakis
[gn build] (semi-manually) port 702cb7afe9de
The file was modifiedllvm/utils/gn/secondary/compiler-rt/lib/tsan/BUILD.gn
Commit 64f623d4c37c686e74fae6f1a3e33dd4f39e1423 by thakis
[gn build] (manually) port ac191bcc99e2f
The file was modifiedllvm/utils/gn/secondary/compiler-rt/test/BUILD.gn
Commit ac889a5262f230eaccfbe60ad2c1d1ae60280623 by llvmgnsyncbot
[gn build] Port f4abdb0c074b
The file was modifiedllvm/utils/gn/secondary/libcxx/include/BUILD.gn
Commit bb9333c3504a4a02b982526ad8264d14c6ec1ad4 by spatel
[InstCombine] fold cast of right-shift if high bits are not demanded (2nd try)

The 1st try at this was reverted because it caused an infinite loop in instcombine.
That should be fixed after:
1cd6b44f267b

(masked) trunc (lshr X, C) --> (masked) lshr (trunc X), C

Narrowing the shift should be better for analysis and can lead
to follow-on transforms as shown.

Attempt at a general proof in Alive2:
https://alive2.llvm.org/ce/z/tRnnSF

Here are a couple of the specific tests:
https://alive2.llvm.org/ce/z/bCnTp-
https://alive2.llvm.org/ce/z/TfaHnb

Differential Revision: https://reviews.llvm.org/D110170
The file was modifiedllvm/test/Transforms/InstCombine/trunc-demand.ll
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
Commit c931d35216a320465947a5a46b158cf71024458d by llvm-dev
[CostModel][X86] Increase i64 mul cost from 1 to 2

Only the most recent cpus support really 1cy 64-bit multiplies, and the X64 cost table represents a realistic worst case. The 1cy value was also discouraging vectorization when most vXi64 PMULDQ expansions aren't actually slower than scalarization.

Noticed while investigating PR51436.
The file was modifiedllvm/test/Analysis/CostModel/X86/rem.ll
The file was modifiedllvm/lib/Target/X86/X86TargetTransformInfo.cpp
The file was modifiedllvm/test/Analysis/CostModel/X86/arith-fix.ll
The file was modifiedllvm/test/Analysis/CostModel/X86/arith.ll
The file was modifiedllvm/test/Analysis/CostModel/X86/slm-arith-costs.ll
The file was modifiedllvm/test/Transforms/SLPVectorizer/X86/arith-fix.ll
The file was modifiedllvm/test/Analysis/CostModel/X86/arith-overflow.ll
The file was modifiedllvm/test/Transforms/IndVarSimplify/X86/loop-invariant-conditions.ll
The file was modifiedllvm/test/Transforms/SLPVectorizer/X86/arith-mul.ll
Commit eb209c13cce99b1ad8d8e619bf2006f4376ed1ef by sam.mccall
clangd: Do not report inline overrides twice

... in textDocument/references.

Reviewed By: sammccall

Differential Revision: https://reviews.llvm.org/D110324
The file was modifiedclang-tools-extra/clangd/XRefs.cpp
The file was modifiedclang-tools-extra/clangd/unittests/XRefsTests.cpp
Commit 828422747d65ab6f0e3cdd75ed9a35f0afedf589 by Stefan Gränitz
[ORC][examples] Fix segfault in LLJITWithTargetProcessControl

Issue reported during review D110260
The file was modifiedllvm/examples/OrcV2Examples/LLJITWithTargetProcessControl/LLJITWithTargetProcessControl.cpp
Commit 3778c1cd6ef5a3286d5d49e842a2c65fffb8f3a6 by hokein.wu
[Sema] Fix a null pointer reference crash.

Differential Revision: https://reviews.llvm.org/D110315
The file was modifiedclang/lib/Sema/SemaDecl.cpp
The file was addedclang/test/SemaCXX/rounding-math-crash.cpp
Commit 2ac53fffaeda809df34e3fb2c442b0fd85d4b0ff by Piotr Sobczak
[AMDGPU] Avoid processing functions in amdgpu-propagate-attributes pass for shaders

The pass amdgpu-propagate-attributes ("Early/Late propagate attributes
from kernels to functions") is currently run also for shaders, where
it does nothing. Modify the check so the pass only processes functions
for kernels.

Differential Revision: https://reviews.llvm.org/D109961
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPUPropagateAttributes.cpp
Commit 5f2c53bdf4c58a488c098ed42c26dfcd369dd15e by llvm-dev
Pass some DataLayout arguments by const-ref

Avoid unnecessary copies, reported by MSVC static analyzer.
The file was modifiedllvm/lib/Transforms/Coroutines/CoroFrame.cpp
The file was modifiedllvm/tools/llvm-exegesis/lib/Assembler.cpp
The file was modifiedllvm/lib/Transforms/Utils/AssumeBundleBuilder.cpp
Commit 8ecf3660f2de3b88d10db0fd52d0bc80bda33dcc by hokein.wu
Fix buildbot error.

-frounding-math is not available for all targets.
The file was modifiedclang/test/SemaCXX/rounding-math-crash.cpp
Commit 87689657e28cd78faf2e07e859fb5b96f7a1f8fc by Duncan P. N. Exon Smith
Support: Fix missing whitespace in comment for inconvertibleErrorCode(), NFC
The file was modifiedllvm/include/llvm/Support/Error.h
Commit b240a2980b6e3777d6659d993f3ba60a3ca84bcb by spatel
[x86] add AVX run to tests of fcmp logic; NFC

The ISA before AVX has predicate gaps for both fcmp
codegen alternatives, so that requires a more
complicated fix to get ideal asm in all cases.
The file was modifiedllvm/test/CodeGen/X86/fcmp-logic.ll
Commit b03e701c145365ba339657ead54a2e0cc5c02776 by mgorny
[lldb] [gdb-remote] Refactor getting remote regs to use local vector

Refactor remote register getters to collect them into a local
std::vector rather than adding them straight into DynamicRegisterInfo.
The purpose of this change is to lay groundwork for switching value_regs
and invalidate_regs to use local LLDB register numbers rather than
remote numbers.

Differential Revision: https://reviews.llvm.org/D110025
The file was modifiedlldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
The file was modifiedlldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
Commit 6fbed33d4a7de2229c40e6318f223092d3a23848 by mgorny
[lldb] [gdb-remote] Use local regnos for value_regs/invalidate_regs

Switch the gdb-remote client logic to use local (LLDB) register numbers
in value_regs/invalidate_regs rather than remote regnos. This involves
translating regnos received from lldb-server.

Differential Revision: https://reviews.llvm.org/D110027
The file was modifiedlldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
The file was modifiedlldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
The file was modifiedlldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
Commit 7f5ca8cc2158debe66663f09eb19b4613e75e124 by shivam98.tkg
[clang] Use portable "#!/usr/bin/env bash" shebang for tools and utils.

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D110041
The file was modifiedclang/utils/make-ast-dump-check.sh
The file was modifiedclang/tools/diag-build/diag-build.sh
Commit d5c67bba62d3abc96ac501f45cabc33a100b00e8 by craig.topper
[RegAlloc] Cast uint8_t to unsigned before printing it.

raw_ostream interprets uint8_t as wanting to print a character
with that ASCII value. In this case the uint8_t is an integer
that we want to print.
The file was modifiedllvm/lib/CodeGen/RegAllocGreedy.cpp
Commit a95061691e43fd9a4216e60917715bdc58660d17 by kazu
[SampleFDO] Remove redundant declarations (NFC)

Note that these are declared in SampleProfileLoaderBaseUtil.h, which
SampleProfileLoaderBaseImpl.h includes.
The file was modifiedllvm/include/llvm/Transforms/Utils/SampleProfileLoaderBaseImpl.h
Commit f9912fe4eac91f27965c22d015b3109c5158d050 by quinn.pham
[PowerPC] Add range checks for P10 Vector Builtins

This patch adds range checking for some Power10 altivec builtins and
changes the signature of a builtin to match documentation. For `vec_cntm`,
range checking is done via SemaChecking. For `vec_splati_ins`, the second
argument is masked to extract the 0th bit so that we always receive either a `0`
or a `1`.

Reviewed By: lei, amyk

Differential Revision: https://reviews.llvm.org/D109710
The file was addedclang/test/CodeGen/builtins-ppc-p10vector-error.c
The file was modifiedclang/lib/Sema/SemaChecking.cpp
The file was modifiedclang/test/CodeGen/builtins-ppc-p10vector.c
The file was modifiedclang/lib/Headers/altivec.h
Commit fd04fd9ac92d705f7d144b77109b8bcec950c04f by Louis Dionne
[libc++] Use CMake interface targets to setup benchmark flags

This is a re-application of da0592e4c8df which was reverted in
1454018dc1d9 because it was incompatible with older CMakes.
Instead, disable the benchmarks when CMake is too old to
support those idioms.

Differential Revision: https://reviews.llvm.org/D110285
The file was modifiedlibcxx/benchmarks/CMakeLists.txt
Commit 8229cb74125322ff337cfe316ab35c6ebf412bde by jay.foad
[LiveIntervals] Fix repairOldRegInRange for simple def cases

The fix applied in D23303 "LiveIntervalAnalysis: fix a crash in repairOldRegInRange"
was over-zealous. It would bail out when the end of the range to be
repaired was in the middle of the first segment of the live range of
Reg, which was always the case when the range contained a single def of
Reg.

This patch fixes it as suggested by Matthias Braun in post-commit review
on the original patch, and tests it by adding -early-live-intervals to
a selection of existing lit tests that now pass.

(Note that D23303 was originally applied to fix a crash in
SILoadStoreOptimizer, but that is now moot since D23814 updated
SILoadStoreOptimizer to run before scheduling so it no longer has to
update live intervals.)

Differential Revision: https://reviews.llvm.org/D110238
The file was modifiedllvm/test/CodeGen/ARM/signext-inreg.ll
The file was modifiedllvm/lib/CodeGen/LiveIntervals.cpp
The file was addedllvm/test/CodeGen/AMDGPU/twoaddr-regsequence.mir
The file was modifiedllvm/test/CodeGen/AMDGPU/extract-load-i1.ll
The file was modifiedllvm/test/CodeGen/X86/mul-shift-reassoc.ll
Commit 12504f50729a338fb37c1c1863e7125b607e11d7 by mgorny
Revert "[lldb] [gdb-remote] Use local regnos for value_regs/invalidate_regs"

This reverts commit 6fbed33d4a7de2229c40e6318f223092d3a23848.
The prerequisite commit is causing regressions.
The file was modifiedlldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
The file was modifiedlldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
The file was modifiedlldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
Commit bcb6b97cde84b6acd67d5551302683234c09337c by mgorny
Revert "[lldb] [gdb-remote] Refactor getting remote regs to use local vector"

This reverts commit b03e701c145365ba339657ead54a2e0cc5c02776.  This is
causing regressions when XML support is disabled.
The file was modifiedlldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
The file was modifiedlldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
Commit 1a6e1ee42a6af255d45e3fd2fe87021dd31f79bb by i
Resolve {GlobalValue,GloalIndirectSymol}::getBaseObject confusion

While both GlobalAlias and GlobalIFunc are GlobalIndirectSymbol, their
`getIndirectSymbol()` usage is quite different (GlobalIFunc's resolver
is an entity different from GlobalIFunc itself).

As discussed on https://lists.llvm.org/pipermail/llvm-dev/2020-September/144904.html
("[IR] Modelling of GlobalIFunc"), the name `getBaseObject` is confusing when
used with GlobalIFunc.

To resolve the confusion:

* Move GloalIndirectSymol::getBaseObject to GlobalAlias:: (GlobalIFunc should use `getResolver` instead)
* Change GlobalValue::getBaseObject not to inspect GlobalIFunc. Note: the function has 7 references.
* Add GlobalIFunc::getResolverFunction to peel off potential ConstantExpr indirection
  (`strlen` in `test/LTO/Resolution/X86/ifunc.ll`)

Note: GlobalIFunc::getResolver (like GlobalAlias::getAliasee which does not peel
off ConstantExpr indirection) is kept to be used by ValueEnumerator.

Reviewed By: ibookstein

Differential Revision: https://reviews.llvm.org/D109792
The file was modifiedllvm/include/llvm/IR/GlobalIFunc.h
The file was modifiedllvm/include/llvm/IR/GlobalAlias.h
The file was modifiedllvm/lib/Object/ModuleSymbolTable.cpp
The file was modifiedllvm/lib/Object/IRSymtab.cpp
The file was modifiedllvm/lib/Transforms/Utils/SplitModule.cpp
The file was modifiedllvm/test/LTO/Resolution/X86/ifunc.ll
The file was modifiedllvm/lib/IR/Globals.cpp
Commit 1e3c6fc7cb9d2ee6a5328881f95d6643afeadbff by nikita.ppv
[JumpThreading] Ignore free instructions

This is basically D108837 but for jump threading. Free instructions
should be ignored for the threading decision. JumpThreading already
skips some free instructions (like pointer bitcasts), but does not
skip various free intrinsics -- in fact, it currently gives them a
fairly large cost of 2.

Differential Revision: https://reviews.llvm.org/D110290
The file was modifiedllvm/test/Transforms/JumpThreading/free_instructions.ll
The file was modifiedllvm/lib/Transforms/Scalar/JumpThreading.cpp
The file was modifiedllvm/test/Transforms/PhaseOrdering/inlining-alignment-assumptions.ll
The file was modifiedllvm/include/llvm/Transforms/Scalar/JumpThreading.h
Commit bbc74a11bc15f4ce962ac7f915309145dcfc2582 by clementval
[fir][NFC] rename canBePointerOrHeapElementType to cannotBePointerOrHeapElementType

This patch is part of the upstreaming effort from fir-dev branch.
Rename the function so the name conveys better what it does.

Reviewed By: jeanPerier

Differential Revision: https://reviews.llvm.org/D110323

Co-authored-by: schweitz
Co-authored-by: jeanPerier
The file was modifiedflang/lib/Optimizer/Dialect/FIRType.cpp
Commit deb2ca566ae70303042e3ab9296978895a817bf8 by jay.foad
Revert "[LiveIntervals] Fix repairOldRegInRange for simple def cases"

This reverts commit 8229cb74125322ff337cfe316ab35c6ebf412bde.

It was failing on buildbots with expensive checks enabled.
The file was modifiedllvm/test/CodeGen/AMDGPU/extract-load-i1.ll
The file was modifiedllvm/test/CodeGen/X86/mul-shift-reassoc.ll
The file was modifiedllvm/lib/CodeGen/LiveIntervals.cpp
The file was modifiedllvm/test/CodeGen/ARM/signext-inreg.ll
The file was removedllvm/test/CodeGen/AMDGPU/twoaddr-regsequence.mir
Commit 2155aa79d7019b620906d94ae6be72179bfd4880 by clementval
[fir][NFC] Remove fir.cmpf replaced by mlir.cmpf

fir.cmpf op is not necessary anymore as it is replaced by mlir.cmpf.
This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: jeanPerier

Differential Revision: https://reviews.llvm.org/D110327

Co-authored-by: schweitzpgi
Co-authored-by: jeanPerier
The file was modifiedflang/include/flang/Optimizer/Dialect/FIROps.h
The file was modifiedflang/lib/Lower/IntrinsicCall.cpp
The file was modifiedflang/test/Fir/fir-ops.fir
The file was modifiedflang/lib/Optimizer/Dialect/FIROps.cpp
The file was modifiedflang/include/flang/Optimizer/Dialect/FIROps.td
Commit e2050f94b65322f886eade488e4398cb38a480df by david.green
[ARM] Extra tests for unpredicated qr MVE intrinsics.
The file was modifiedllvm/test/CodeGen/Thumb2/mve-qrintr.ll
Commit e6126faba060d5341dae6c5cc99a22a80d8c4d23 by Louis Dionne
[libc++] Remove unused macro in __config

That macro was being defined but not used anywhere in libc++, so it
must be safe to remove it.

As a fly-by fix, also remove mentions of this macro in other places
in LLVM, to make sure they were not depending on the value defined in
libc++.

Differential Revision: https://reviews.llvm.org/D110289
The file was modifiedclang-tools-extra/clangd/unittests/JSONTransportTests.cpp
The file was modifiedllvm/lib/Support/LockFileManager.cpp
The file was modifiedlibcxx/include/__config
Commit 4393e3776b41471afbd37cb13fe5b777243fedd1 by pklausler
[flang] Implement READ(SIZE=) and INQUIRE(IOLENGTH=) in runtime

Count input characters corresponding to formatted edit descriptors
for READ(SIZE=); count output bytes for INQUIRE(IOLENGTH=).

The I/O APIs GetSize() and GetLength() were adjusted to return
std::size_t as function results.

Basic unit tests were added (and others fixed).

Differential Revision: https://reviews.llvm.org/D110291
The file was modifiedflang/include/flang/Runtime/io-api.h
The file was modifiedflang/runtime/io-stmt.cpp
The file was modifiedflang/runtime/descriptor-io.h
The file was modifiedflang/runtime/unit.cpp
The file was modifiedflang/runtime/io-stmt.h
The file was modifiedflang/runtime/edit-input.cpp
The file was modifiedflang/runtime/io-api.cpp
The file was modifiedflang/unittests/Runtime/ExternalIOTest.cpp
Commit 6bc9c8dfe32cc4662f2ed9041af527f69dfff13b by leonardchan
[compiler-rt][profile] Add padding after binary IDs

Some tests with binary IDs would fail with error: no profile can be merged.
This is because raw profiles could have unaligned headers when emitting binary
IDs. This means padding should be emitted after binary IDs are emitted to
ensure everything else is aligned. This patch accounts for that padding in
__llvm_write_binary_ids.

Differential Revision: https://reviews.llvm.org/D110188
The file was modifiedcompiler-rt/lib/profile/InstrProfilingPlatformLinux.c
Commit c22329972f02f9d51e2f9ea54d9075a4a808ffde by Raphael Isemann
[lldb] Add a C language REPL to test LLDB's REPL infrastructure

LLDB has a bunch of code that implements REPL support, but all that code is
unreachable as no language in master currently has an implemented REPL backend.
The only REPL that exists is in the downstream Swift fork. All patches for this
generic REPL code therefore also only have tests downstream which is clearly not
a good situation.

This patch implements a basic C language REPL on top of LLDB's REPL framework.
Beside implementing the REPL interface and hooking it up into the plugin
manager, the only other small part of this patch is making the `--language` flag
of the expression command compatible with the `--repl` flag. The `--repl` flag
uses the value of `--language` to see which REPL should be started, but right
now the `--language` flag is only available in OptionGroups 1 and 2, but not in
OptionGroup 3 where the `--repl` flag is declared.

The REPL currently can currently only start if a running target exists. I'll add
the 'create and run a dummy executable' logic from Swift (which is requires when
doing `lldb --repl`) when I have time to translate all this logic to something
that will work with Clang.

I should point out that the REPL currently uses the C expression parser's
approach to persistent variables where only result variables and the ones
starting with a '$' are transferred between expressions. I'll fix that in a
follow up patch. Also the REPL currently doesn't work in a non-interactive
terminal. This seems to be fixed in the Swift fork, so I assume one of our many
REPL downstream changes addresses the issue.

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D87281
The file was addedlldb/test/API/repl/clang/Makefile
The file was addedlldb/test/API/repl/clang/main.c
The file was addedlldb/source/Plugins/REPL/Clang/ClangREPL.cpp
The file was addedlldb/source/Plugins/REPL/Clang/CMakeLists.txt
The file was modifiedlldb/source/Plugins/CMakeLists.txt
The file was modifiedlldb/source/Commands/Options.td
The file was addedlldb/source/Plugins/REPL/Clang/ClangREPL.h
The file was addedlldb/source/Plugins/REPL/CMakeLists.txt
The file was addedlldb/test/API/repl/clang/TestClangREPL.py