UnstableChanges

Summary

  1. [llvm-exegesis][X86] Ignore a few unmeasurable opcodes. (details)
  2. [RISCV] Use existing method for the LMUL1 type. NFCI. (details)
  3. [MLIR][affine] Certain Call Ops to prevent fusion (details)
  4. [Test] Two more interesting test cases & their codegen counterparts (details)
  5. [DAG] expandAddSubSat - break if-else chain. NFCI. (details)
  6. [mlir] Mark OpState::removeAttr() deprecated. (details)
  7. [X86] Remove unnecessary custom lowering of v16i1/v32i1 ADD/SUB (details)
  8. [DAG] Fold vXi1 multiplies -> and (details)
  9. [docs][JITLink] Few typo fixes in JITLink design/API doc (details)
  10. [Driver] Flush file in locked area (details)
  11. [X86] Remove unnecessary custom lowering of vXi1 SADDSAT/SSUBSAT/UADDSAT/USUBSAT (details)
  12. [Orc] Use extensible RTTI for the orc::ObjectLayer class hierarchy (details)
  13. [clang][cli] Fix build failure in CompilerInvocation (details)
  14. [clang][cli] Implement '-cuid=' marshalling (details)
  15. Revert "[NARY-REASSOCIATE] Support reassociation of min/max" (details)
  16. [InstCombine] Avoid redundant or out-of-order debug value sinking (details)
  17. [mlir] Replace deprecated 'getAttrs' (details)
  18. [X86] Allow PTILEZEROV and PTILELOADDV to be rematerializable (details)
  19. [clangd][remote] Add flag to set idletimeout (details)
  20. [libcxxabi] Fewer assumptions about path from libcxx to libcxxabi (details)
  21. [mlir] Silence some deprecation warnings after dffc487b07d9a50f8c65eccb9241f72af3486c79 (details)
  22. [mlir][linalg] Allow TC ops taking an unused shaped operand. (details)
  23. [Utils] collectBitParts - bail for integers > 128-bits (details)
  24. [mlir][linalg] Add pooling ops to Linalg TC ops. (details)
  25. [libc++] Remove the now unused macos-trunk and macos-backdeployment CI scripts (details)
  26. [ADT][NFC] Add extra typedefs to `ArrayRef` and `MutableArrayRef` (details)
  27. [lldb] Add deref support to libc++ unique_ptr synthetic (details)
  28. [llvm][utils] Support dereferencing llvm::Optional lldb formatter (details)
  29. [llvm][utils] Rename lldb dict variables to internal_dict (details)
  30. [AMDGPU] Better codegen for i64 bitreverse (details)
  31. Fix assert to use getTypeStoreSize instead of getPrimitiveSizeInBits, (details)
  32. [llvm][utils] Fix innocuous off by one in lldb formatters (details)
  33. [X86][AVX] SimplifyDemandedBitsForTargetNode - add basic X86ISD::VBROADCAST handling. (details)
  34. [PDB] Fix unsigned integer overflow (details)
  35. [MLIR][linalg] Make integer matmul ops cast before multiplying (details)
  36. [AMDGPU] Add selection pattern for v_xnor_b32 (details)
  37. [NFC] MCRegister fixes in RegisterClassInfo, and const-ed APIs (details)
  38. [libc++] Allow running CI on macOS when Ninja isn't installed outside of Xcode (details)
  39. [NFC] Const-ed 2 APIs in VirtRegMap (details)
  40. [NFC][regalloc] const-ed APIs, using MCRegister instead of unsigned (details)
  41. [InstCombine][NFC]Add a test for logical reductions. (details)
  42. [libc++] Make the from-scratch config work on macOS out-of-the-box (details)
  43. Add a helper for matching simple recurrence cycles (details)
  44. Change some addUsedGlobal to addUsedOrCompilerUsedGlobal (details)
  45. [libcxx] cleans up __cpp_concepts mess (details)
  46. Use helper introduced in 8020be0b8 to simplify ValueTracking [NFC] (details)
  47. [clang-tidy] Remove some test c++ mode restrictions. (details)
  48. [SanitizerCoverage] Clarify llvm.used/llvm.compiler.used and partially fix unmatched metadata sections on Windows (details)
  49. [clang-tidy][NFC] Tweak some generation of diag messages (details)
  50. [dfsan] Propagate origins for callsites (details)
  51. [scudo][test] Disable -Wfree-nonheap-object (details)
  52. Be more mathematicly precise about definition of recurrence [NFC] (details)
  53. [RISCV] Call SelectBaseAddr on the base pointer in the custom isel for vector loads and stores. (details)
  54. [dfsan] Do not test origin-tracking in atomic.cpp (details)
  55. [cgp] Minor code improvement - reuse an existing named helper [NFC] (details)
  56. Use getAlign() on atomicrmw/cmpxchg instructions, now that it's available. (details)
  57. [SystemZ] Introducing assembler dialects for the Z backend (details)
  58. [AMDGPU] Skip unclusterd rescheduling w/o ld/st (details)
Commit b16cbd8890a08ea265b8d3f3499a29b58bfa3b4a by courbet
[llvm-exegesis][X86] Ignore a few unmeasurable opcodes.

Differential Revision: https://reviews.llvm.org/D90744
The file was modifiedllvm/tools/llvm-exegesis/lib/X86/Target.cpp
Commit 37014db0134b6df3945a7d4b1a835f8daefecb79 by fraser
[RISCV] Use existing method for the LMUL1 type. NFCI.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D97467
The file was modifiedllvm/lib/Target/RISCV/RISCVISelLowering.cpp
Commit ce0f10a1d19b559938870ba6172b517417bc2c76 by uday
[MLIR][affine] Certain Call Ops to prevent fusion

Fixes a bug in affine fusion pipeline where an incorrect fusion is performed
despite a Call Op that potentially modifies memrefs under consideration
exists between source and target.

Fixes part of https://bugs.llvm.org/show_bug.cgi?id=49220

Reviewed By: bondhugula, dcaballe

Differential Revision: https://reviews.llvm.org/D97252
The file was modifiedmlir/lib/Transforms/LoopFusion.cpp
The file was modifiedmlir/test/Transforms/loop-fusion.mlir
Commit a754dc235834fd4e0c63a0a35933e001e17b3921 by mkazantsev
[Test] Two more interesting test cases & their codegen counterparts
The file was addedllvm/test/CodeGen/X86/overflowing-iv-codegen.ll
The file was modifiedllvm/test/CodeGen/X86/overflowing-iv.ll
Commit 73adc26ac0bea7b7fd01f1faa8ea2911d730b55d by llvm-dev
[DAG] expandAddSubSat - break if-else chain. NFCI.

Fix styleguide issue - each if() block always returns so we don't need to make them a if-else chain.
The file was modifiedllvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
Commit dffc487b07d9a50f8c65eccb9241f72af3486c79 by csigg
[mlir] Mark OpState::removeAttr() deprecated.

Fix call sites.

The method will be removed 2 weeks later.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D97530
The file was modifiedmlir/lib/Conversion/SPIRVToLLVM/SPIRVToLLVM.cpp
The file was modifiedmlir/test/lib/Transforms/TestConvVectorization.cpp
The file was modifiedmlir/test/lib/Transforms/TestLinalgTransforms.cpp
The file was modifiedmlir/lib/Dialect/SPIRV/Transforms/LowerABIAttributesPass.cpp
The file was modifiedmlir/lib/Dialect/GPU/IR/GPUDialect.cpp
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/Tiling.cpp
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/CodegenStrategy.cpp
The file was modifiedmlir/include/mlir/IR/OpDefinition.h
Commit 40b8b4a466e3ea9ca438b776ce02c272a1b665da by llvm-dev
[X86] Remove unnecessary custom lowering of v16i1/v32i1 ADD/SUB

These were missed in D97478
The file was modifiedllvm/lib/Target/X86/X86ISelLowering.cpp
Commit aefe8f2f6c9e61b7bee92924b381321b4b5053ec by llvm-dev
[DAG] Fold vXi1 multiplies -> and

This allows us to remove X86 custom lowering of vXi1 MUL, which helps simplify a load of mask math.

Mentioned in D97478 post review.
The file was modifiedllvm/test/CodeGen/X86/avx512bw-mask-op.ll
The file was modifiedllvm/test/CodeGen/X86/avx512-mask-op.ll
The file was modifiedllvm/lib/Target/X86/X86ISelLowering.cpp
The file was modifiedllvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Commit 57f8f2375789ec007e46b7e38ded4c645ad61f51 by Stefan Gränitz
[docs][JITLink] Few typo fixes in JITLink design/API doc
The file was modifiedllvm/docs/JITLink.rst
Commit 04c3071c16d799a4406c1742f239e8381c00b2b8 by sepavloff
[Driver] Flush file in locked area

When writing report file by option -proc-stat-report some part of output
can be written to unlocked file because destructor of raw_fd_ostream
calls `flush()`. In high thread contention environment it can result in
file operation failure. With this change `flush` is called explicitly when
file is locked, so call of `flush()` in the destructor does not cause
write to file.
The file was modifiedclang/lib/Driver/Driver.cpp
Commit 7ac4c956afa2587cf19c96993a6cfa693a6de532 by llvm-dev
[X86] Remove unnecessary custom lowering of vXi1 SADDSAT/SSUBSAT/UADDSAT/USUBSAT

As discussed on D97478. The removal of the custom tag causes some changes in the add/sub-overflow expansion as it no longer expands to sat-arith codegen.
The file was modifiedllvm/test/CodeGen/X86/vec_ssubo.ll
The file was modifiedllvm/test/CodeGen/X86/vec_saddo.ll
The file was modifiedllvm/lib/Target/X86/X86ISelLowering.cpp
Commit 406ef36b03f911014018ba7ee1d3259567b14575 by Stefan Gränitz
[Orc] Use extensible RTTI for the orc::ObjectLayer class hierarchy

So far we had no way to distinguish between JITLink and RuntimeDyld in lli. Instead, we used implicit knowledge that RuntimeDyld would be used for linking ELF. In order to get D97337 to work with lli though, we have to move on and allow JITLink for ELF. This patch uses extensible RTTI to allow external clients to add their own layers without touching the LLVM sources.

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D97338
The file was modifiedllvm/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h
The file was modifiedllvm/lib/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.cpp
The file was modifiedllvm/include/llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h
The file was modifiedllvm/include/llvm/ExecutionEngine/Orc/ObjectTransformLayer.h
The file was modifiedllvm/lib/ExecutionEngine/Orc/ObjectTransformLayer.cpp
The file was modifiedllvm/lib/ExecutionEngine/Orc/Layer.cpp
The file was modifiedllvm/tools/lli/lli.cpp
The file was modifiedllvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp
The file was modifiedllvm/include/llvm/ExecutionEngine/Orc/Layer.h
Commit 8dc70bdcd0fe4efb65876dce0144d9c3386a2f07 by Jan Svoboda
[clang][cli] Fix build failure in CompilerInvocation

There is a report that https://reviews.llvm.org/D96280 causes a build failure with error: too few template arguments for class template 'SmallVector'. This patch attempts to fix that by explicitly specifying N for SmallVector<T, N>.
The file was modifiedclang/lib/Frontend/CompilerInvocation.cpp
Commit cb81135f94e58ce0a0e91d764841acee90eeb59f by Jan Svoboda
[clang][cli] Implement '-cuid=' marshalling

This patch adds marshalling to the `-cuid=` option introduced in D95007.

Reviewed By: Bigcheese

Differential Revision: https://reviews.llvm.org/D97461
The file was modifiedclang/lib/Frontend/CompilerInvocation.cpp
The file was modifiedclang/include/clang/Driver/Options.td
Commit 13a5cac2ba919b4d02a296428b58919231e08569 by ybrevnov
Revert "[NARY-REASSOCIATE] Support reassociation of min/max"

This reverts commit 83d134c3c4222e8b8d3d90c099f749a3b3abc8e0.
The file was modifiedllvm/include/llvm/Transforms/Scalar/NaryReassociate.h
The file was modifiedllvm/test/Transforms/NaryReassociate/nary-umin.ll
The file was modifiedllvm/lib/Transforms/Scalar/NaryReassociate.cpp
The file was modifiedllvm/test/Transforms/NaryReassociate/nary-smax.ll
The file was modifiedllvm/include/llvm/IR/PatternMatch.h
The file was modifiedllvm/test/Transforms/NaryReassociate/nary-smin.ll
The file was modifiedllvm/test/Transforms/NaryReassociate/nary-umax.ll
Commit ec7b9b0c18bb9c9669231bdfa71b0aa7a71140c1 by stephen.tozer
[InstCombine] Avoid redundant or out-of-order debug value sinking

This patch modifies TryToSinkInstruction in the InstCombine pass, to prevent
redundant debug intrinsics from being produced, and also prevent the intrinsics
from being emitted in an incorrect order. It does this by ensuring that when
this pass sinks an instruction and creates clones of the debug intrinsics that
use that instruction, it inserts those debug intrinsics in their original order,
and only inserts the last debug intrinsic for each variable in the Instruction's
block.

Differential revision: https://reviews.llvm.org/D95463
The file was modifiedllvm/lib/Transforms/InstCombine/InstructionCombining.cpp
The file was modifiedllvm/test/Transforms/InstCombine/debuginfo_add.ll
The file was modifiedllvm/test/Transforms/InstCombine/debuginfo-sink.ll
Commit 56774bdda5788e48dce1ae87de1ff378918e318e by marius.brehler
[mlir] Replace deprecated 'getAttrs'

'getAttrs' has been explicitly marked deprecated. This patch refactors
to use Operation::getAttrs().

Reviewed By: csigg

Differential Revision: https://reviews.llvm.org/D97546
The file was modifiedmlir/lib/Conversion/OpenMPToLLVM/OpenMPToLLVM.cpp
The file was modifiedmlir/test/lib/Dialect/Test/TestDialect.cpp
The file was modifiedmlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp
The file was modifiedmlir/lib/Dialect/SPIRV/IR/SPIRVOps.cpp
The file was modifiedmlir/lib/Conversion/GPUCommon/GPUOpsLowering.cpp
The file was modifiedmlir/lib/Dialect/SPIRV/Transforms/SPIRVConversion.cpp
The file was modifiedmlir/lib/Conversion/SCFToGPU/SCFToGPU.cpp
The file was modifiedmlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp
Commit ad9091c5fa9f3749496d1a8ce8481f0011ed40da by pengfei.wang
[X86] Allow PTILEZEROV and PTILELOADDV to be rematerializable

Spilling and reloading AMX registers are expensive. We allow PTILEZEROV
and PTILELOADDV to be rematerializable to avoid the register spilling.

Reviewed By: LuoYuanke

Differential Revision: https://reviews.llvm.org/D97453
The file was modifiedllvm/test/CodeGen/X86/AMX/amx-across-func.ll
The file was modifiedllvm/lib/Target/X86/X86InstrAMX.td
The file was modifiedllvm/test/CodeGen/X86/AMX/amx-spill-merge.ll
The file was modifiedllvm/lib/Target/X86/X86InstrInfo.cpp
The file was modifiedllvm/test/CodeGen/X86/AMX/amx-lower-tile-copy.ll
Commit 1a5dfb7db23e3c0aec0b4356a60b9d6b7c8f9683 by kadircet
[clangd][remote] Add flag to set idletimeout

By default gRPC has no idletimeout and some firewalls might drop idle
connections after a certain period. This results in idle clients
shouting into void until server resets the connection.

Differential Revision: https://reviews.llvm.org/D97536
The file was modifiedclang-tools-extra/clangd/index/remote/server/Server.cpp
Commit 72b18a86e11ebc970be96a8c2b11aa3a31c14c5d by thakis
[libcxxabi] Fewer assumptions about path from libcxx to libcxxabi

This is useful for projects that pull in libcxx and libcxxabi and build
them using out-of-tree build files, but don't make them sibling
directories (or don't call the sibling directories libcxx and libcxxabi
for some reason).

Fixes PR49313.

Differential Revision: https://reviews.llvm.org/D97379
The file was modifiedllvm/utils/gn/secondary/libcxxabi/src/BUILD.gn
The file was modifiedlibcxxabi/src/CMakeLists.txt
The file was modifiedlibcxxabi/src/stdlib_stdexcept.cpp
Commit 4941fef9c41c42ac11cbe6fcc3e6a43511a5dfed by benny.kra
[mlir] Silence some deprecation warnings after dffc487b07d9a50f8c65eccb9241f72af3486c79
The file was modifiedmlir/include/mlir/IR/FunctionSupport.h
The file was modifiedmlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp
The file was modifiedmlir/tools/mlir-tblgen/OpFormatGen.cpp
Commit 855a1196049705344ec90cc1f3fd09b426416311 by hanchung
[mlir][linalg] Allow TC ops taking an unused shaped operand.

If one operand is not used in the formula, it will be considered a
shaped operand. And the result of indexing map of the operand will be the first
reduction dims.

Depends On D97383

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D97384
The file was modifiedmlir/test/mlir-linalg-ods-gen/test-linalg-ods-gen.tc
The file was modifiedmlir/docs/Dialects/Linalg.md
The file was modifiedmlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-gen.cpp
Commit 455d43b951ae31dac133a8650532797f01343a36 by llvm-dev
[Utils] collectBitParts - bail for integers > 128-bits

collectBitParts uses int8_t for the bit indices, leaving a 128-bit limit.

We already test for this before calling collectBitParts, but rGb94c215592bd added truncate handling which meant we could end up processing wider integers.

Thanks to @manojgupta for the repro.
The file was modifiedllvm/lib/Transforms/Utils/Local.cpp
The file was modifiedllvm/test/Transforms/InstCombine/bswap.ll
Commit bfd3771c9eecdb5fd8d3f2714e5fc3500bb7d4da by hanchung
[mlir][linalg] Add pooling ops to Linalg TC ops.

- Add EDSC builders for std_cmpf_ogt and std_cmpf_olt.
- Add pooling_nhwc_min/max/sum ops

Depends On D97384

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D97385
The file was modifiedmlir/test/Dialect/Linalg/generalize-named-ops.mlir
The file was modifiedmlir/include/mlir/Dialect/StandardOps/EDSC/Intrinsics.h
The file was modifiedmlir/test/Dialect/Linalg/named-ops.mlir
The file was modifiedmlir/include/mlir/Dialect/Linalg/IR/LinalgNamedStructuredOpsSpec.tc
Commit cb3de0950309ad0f3546e6e7c5e75eb3bf146662 by Louis Dionne
[libc++] Remove the now unused macos-trunk and macos-backdeployment CI scripts

We use the run-buildbot script everywhere now.
The file was removedlibcxx/utils/ci/macos-trunk.sh
The file was removedlibcxx/utils/ci/macos-backdeployment.sh
Commit 9909237d992000d651b32212d15111453485a6b0 by vlad.vinogradov
[ADT][NFC] Add extra typedefs to `ArrayRef` and `MutableArrayRef`

* `value_type`
* `pointer`
* `const_pointer`
* `reference`
* `const_reference`
* `const_reverse_iterator`
* `size_type`
* `difference_type`

It makes `ArrayRef` and `MutableArrayRef` types fully compliant with STL Container concept.

Reviewed By: lattner, courbet

Differential Revision: https://reviews.llvm.org/D95611
The file was modifiedllvm/include/llvm/ADT/ArrayRef.h
Commit 3a677b29a3b3f6a2539843db4d56ba59689fc0a0 by davelee.com
[lldb] Add deref support to libc++ unique_ptr synthetic

Add frame variable dereference suppport to libc++ `std::unique_ptr`.

This change allows for commands like `v *thing_up` and `v thing_up->m_id`. These commands now work the same way they would with raw pointers, and as they would with expression. This is done by adding an unaccounted for child member named `$$dereference$$`.

Without this change, the command would have to be written as `v *thing_up.__value_` or v thing_up.__value_->m_id` which exposes internal structure and is more clumsy to type.

Additionally, the existing tests were updated. See also https://reviews.llvm.org/D97165 which added deref support for `std::shared_ptr`.

Differential Revision: https://reviews.llvm.org/D97524
The file was modifiedlldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/unique_ptr/main.cpp
The file was modifiedlldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp
The file was modifiedlldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/unique_ptr/TestDataFormatterLibcxxUniquePtr.py
The file was modifiedlldb/source/Plugins/Language/CPlusPlus/LibCxx.h
Commit 408456f53eccd9b2280840aff8fa99f865024544 by davelee.com
[llvm][utils] Support dereferencing llvm::Optional lldb formatter

Add deref support to `llvm::Optional` in `lldbDataFormatters.py`.

This creates a synthetic provider that adds dereference support, but otherwise proxies all access to the underlying value.

With this change, an optional value can be displayed by running `v *someOptional`, and its contents can be accessed with the arrow `operator->`, for example `v someOpt->HasThing`. This matches expressions usable from expression evaluation.

See also D97165 and D97524.

Differential Revision: https://reviews.llvm.org/D97525
The file was modifiedllvm/utils/lldbDataFormatters.py
Commit 8d1b6afcea6c30db7728d966d9281ab373eaa9e1 by davelee.com
[llvm][utils] Rename lldb dict variables to internal_dict

Most lldb scripts use `internal_dict`. Also, `dict` is a builtin constructor,
it's good habit to avoid using it as a variable name.
The file was modifiedllvm/utils/lldbDataFormatters.py
Commit 3ad5216ed88e303cb5d37864bb83b0eec81144af by jay.foad
[AMDGPU] Better codegen for i64 bitreverse

Differential Revision: https://reviews.llvm.org/D97547
The file was modifiedllvm/lib/Target/AMDGPU/SIISelLowering.cpp
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/regbankselect-bitreverse.mir
The file was modifiedllvm/lib/Target/AMDGPU/SIInstrInfo.cpp
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-bitreverse.mir
The file was modifiedllvm/test/CodeGen/AMDGPU/bitreverse.ll
The file was modifiedllvm/lib/Target/AMDGPU/SIInstrInfo.h
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/legalize-bitreverse.mir
The file was modifiedllvm/lib/Target/AMDGPU/SOPInstructions.td
Commit 740e69b6fdc2b1415065f3d20acc4d10a73edb00 by jyknight
Fix assert to use getTypeStoreSize instead of getPrimitiveSizeInBits,
per comment on D97223.
The file was modifiedllvm/lib/CodeGen/AtomicExpandPass.cpp
Commit a01a406bba8ac624a876f8d5720e1d4949a5b0fa by davelee.com
[llvm][utils] Fix innocuous off by one in lldb formatters

num_children is "last_index" + 1, thus
    num_children + 1 = "last_index" + 2

this worked anyway because the index of `$$dereference$$` would work as long as
it was past the last index.
The file was modifiedllvm/utils/lldbDataFormatters.py
Commit ed1f45bce9fb4688a4ab06862b25c6d55b5dc415 by llvm-dev
[X86][AVX] SimplifyDemandedBitsForTargetNode - add basic X86ISD::VBROADCAST handling.

Simplify through to the scalar/vector source operand.
The file was modifiedllvm/test/CodeGen/X86/vector-shuffle-combining-avx2.ll
The file was modifiedllvm/lib/Target/X86/X86ISelLowering.cpp
Commit 301551ae8e8f54fd66867c9411fcc17b2f02be7d by thakis
[PDB] Fix unsigned integer overflow

When building with -fsanitize=unsigned-integer-overflow, this code
causes a diagnostic like:

    ../../llvm/lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp:159:15:
    runtime error: unsigned integer overflow:
    90 - 229 cannot be represented in type 'unsigned long'

unsigned integer overflow is well defined and it isn't an issue in
practice, but in obscure scenarios (S1.size() small, S2.size over 2GB
on 32-bit systems) it could even be a bug.

So use the usual idiom for implementing cmp functions instead of the
gernally considered buggy idiom :)
See e.g. https://www.gnu.org/software/libc/manual/html_node/Comparison-Functions.html
or https://stackoverflow.com/questions/10996418/efficient-integer-compare-function/10997428#10997428

Differential Revision: https://reviews.llvm.org/D97557
The file was modifiedllvm/lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp
Commit 21bb63893e8557df7a7ab690ad98cb5979099186 by gcmn
[MLIR][linalg] Make integer matmul ops cast before multiplying

Right now they multiply before casting which means they would frequently
overflow. There are various reasonable ways to do this, but until we
have robust op description infra, this is a simple and safe default. More
careful treatments are likely to be hardware specific, as well (e.g.
using an i8*i8->i16 mul instruction).

Reviewed By: nicolasvasilache, mravishankar

Differential Revision: https://reviews.llvm.org/D97505
The file was modifiedmlir/test/Dialect/Linalg/vectorization.mlir
The file was modifiedmlir/include/mlir/Dialect/Linalg/IR/LinalgNamedStructuredOpsSpec.tc
Commit dc2259537a30127808efc4ee68ec5b0cae5c983a by jay.foad
[AMDGPU] Add selection pattern for v_xnor_b32

This allows GlobalISel to use this instruction where available. I assume
SelectionDAG always selects s_xnor_b32 so it isn't affected by this
change.

Differential Revision: https://reviews.llvm.org/D97560
The file was modifiedllvm/lib/Target/AMDGPU/VOP2Instructions.td
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/xnor.ll
The file was modifiedllvm/lib/Target/AMDGPU/SIInstrInfo.td
Commit a00f7dc2d539bae2702e871e0767e4effb87ceb6 by mtrofin
[NFC] MCRegister fixes in RegisterClassInfo, and const-ed APIs
The file was modifiedllvm/include/llvm/CodeGen/RegisterClassInfo.h
Commit f8e810c359b51c911dfb3be1f8c48f28356c09ec by Louis Dionne
[libc++] Allow running CI on macOS when Ninja isn't installed outside of Xcode

Xcode does bundle Ninja, so we can use that Ninja if there's no system-wide
Ninja installed. This is useful on some CI bots we have that don't come
with Ninja pre-installed.
The file was modifiedlibcxx/utils/ci/run-buildbot
Commit a2bfc43ae10e9ed1252d96fd25add647c42b79f9 by mtrofin
[NFC] Const-ed 2 APIs in VirtRegMap
The file was modifiedllvm/lib/CodeGen/VirtRegMap.cpp
The file was modifiedllvm/include/llvm/CodeGen/VirtRegMap.h
Commit 3e992326a510035adcddd284399ba67db374131c by mtrofin
[NFC][regalloc] const-ed APIs, using MCRegister instead of unsigned
The file was modifiedllvm/lib/CodeGen/RegAllocGreedy.cpp
Commit 7820518d55f9c40cd55adbe7185743e1bd2c936d by a.bataev
[InstCombine][NFC]Add a test for logical reductions.
The file was addedllvm/test/Transforms/InstCombine/vector-logical-reductions.ll
Commit 27f9ed78506329cbf14b91eb545ca7419a983e00 by Louis Dionne
[libc++] Make the from-scratch config work on macOS out-of-the-box
The file was modifiedlibcxx/test/configs/libcxx-trunk-shared.cfg.in
The file was modifiedlibcxx/test/configs/libcxx-trunk-static.cfg.in
Commit 8020be0b8b57e0d29d93f0a4a5b2e9bbfd2242e7 by listmail
Add a helper for matching simple recurrence cycles

This helper came up in another review, and I've got about 4 different patches with copies of this copied into it.  Time to precommit the routine.  :)
The file was modifiedllvm/lib/Analysis/ValueTracking.cpp
The file was modifiedllvm/include/llvm/Analysis/ValueTracking.h
Commit 28cb620321f5461255423f84c85e6891b5174c13 by i
Change some addUsedGlobal to addUsedOrCompilerUsedGlobal

An global value in the `llvm.used` list does not have GC root semantics on ELF targets.
This will be changed in a subsequent backend patch.

Change some `llvm.used` in the ELF code path to use `llvm.compiler.used` to
prevent undesired GC root semantics.

Change one extern "C" alias (due to `__attribute__((used))` in extern "C") to use `llvm.compiler.used` on all targets.

GNU ld has a rule "`__start_/__stop_` references from a live input section retain the associated C identifier name sections",
which LLD may drop entirely (currently refined to exclude SHF_LINK_ORDER/SHF_GROUP) in a future release (the rule makes it clumsy to GC metadata sections; D96914 added a way to try the potential future behavior).
For `llvm.used` global values defined in a C identifier name section, keep using `llvm.used` so that
the future LLD change will not affect them.

rnk kindly categorized the changes:
```
ObjC/blocks: this wants GC root semantics, since ObjC mainly runs on Mac.
MS C++ ABI stuff: wants GC root semantics, no change
OpenMP: unsure, but GC root semantics probably don't hurt
CodeGenModule: affected in this patch to *not* use GC root semantics so that __attribute__((used)) behavior remains the same on ELF, plus two other minor use cases that don't want GC semantics
Coverage: Probably want GC root semantics
CGExpr.cpp: refers to LTO, wants GC root
CGDeclCXX.cpp: one is MS ABI specific, so yes GC root, one is some other C++ init functionality, which should form GC roots (C++ initializers can have side effects and must run)
CGDecl.cpp: Changed in this patch for __attribute__((used))
```

Differential Revision: https://reviews.llvm.org/D97446
The file was modifiedclang/lib/CodeGen/CodeGenModule.h
The file was modifiedclang/lib/CodeGen/CGDecl.cpp
The file was modifiedclang/test/CodeGenCUDA/llvm-used.cu
The file was modifiedclang/test/CodeGen/2005-12-04-AttributeUsed.c
The file was modifiedclang/test/CodeGen/attr-used.c
The file was modifiedclang/test/CodeGen/keep-static-consts.cpp
The file was modifiedclang/lib/CodeGen/CodeGenModule.cpp
The file was modifiedclang/test/CodeGen/attr-x86-interrupt.c
The file was modifiedclang/test/CodeGenCXX/attr-x86-interrupt.cpp
The file was modifiedclang/test/CodeGen/attr-msp430.c
The file was modifiedclang/test/CodeGen/attr-target-mv.c
The file was modifiedclang/test/CodeGenCXX/extern-c.cpp
Commit e4dd614ae81194b0a50361a91f8bd4364916ef2e by cjdb
[libcxx] cleans up __cpp_concepts mess

libc++ was previously a bit confused by what the value of __cpp_concepts
should be. Also replaces `__floating_point` with `floating_point` now
that it exists.

Differential Revision: https://reviews.llvm.org/D97015
The file was modifiedlibcxx/include/numbers
The file was modifiedlibcxx/include/random
The file was modifiedlibcxx/utils/generate_feature_test_macro_components.py
The file was modifiedlibcxx/include/version
The file was modifiedlibcxx/utils/libcxx/test/features.py
The file was modifiedlibcxx/include/concepts
The file was modifiedlibcxx/test/std/language.support/support.limits/support.limits.general/numbers.version.pass.cpp
The file was modifiedlibcxx/test/std/language.support/support.limits/support.limits.general/version.version.pass.cpp
Commit ebd3aeba273736596163d498c38cc32e743bed31 by listmail
Use helper introduced in 8020be0b8 to simplify ValueTracking [NFC]

Direct rewrite of the code the helper was extracted from.
The file was modifiedllvm/include/llvm/Analysis/ValueTracking.h
The file was modifiedllvm/lib/Analysis/ValueTracking.cpp
Commit b18f14d6897b9e9f34ffd0d8ed46b8ac596fbf05 by n.james93
[clang-tidy] Remove some test c++ mode restrictions.

Some comments are redundant, others just simple fixes.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D97544
The file was modifiedclang-tools-extra/test/clang-tidy/checkers/abseil-upgrade-duration-conversions.cpp
The file was modifiedclang-tools-extra/test/clang-tidy/checkers/portability-simd-intrinsics-ppc.cpp
The file was modifiedclang-tools-extra/test/clang-tidy/checkers/portability-simd-intrinsics-x86.cpp
The file was modifiedclang-tools-extra/test/clang-tidy/checkers/abseil-time-subtraction.cpp
The file was modifiedclang-tools-extra/test/clang-tidy/checkers/abseil-faster-strsplit-delimiter.cpp
The file was modifiedclang-tools-extra/test/clang-tidy/checkers/google-readability-casting.cpp
Commit b55f29c194d31cb51096d80b5e2710fc3385a7ef by i
[SanitizerCoverage] Clarify llvm.used/llvm.compiler.used and partially fix unmatched metadata sections on Windows

`__sancov_pcs` parallels the other metadata section(s). While some optimizers
(e.g. GlobalDCE) respect linker semantics for comdat and retain or discard the
sections as a unit, some (e.g.  GlobalOpt/ConstantMerge) do not. So we have to
conservatively retain all unconditionally in the compiler.

When a comdat is used, the COFF/ELF linkers' GC semantics ensure the
associated parallel array elements are retained or discarded together,
so `llvm.compiler.used` is sufficient.

Otherwise (MachO (see rL311955/rL311959), COFF special case where comdat is not
used), we have to use `llvm.used` to conservatively make all sections retain by
the linker. This will fix the Windows problem once internal linkage
GlobalObject's in `llvm.used` are retained via `/INCLUDE:`.

Reviewed By: morehouse, vitalybuka

Differential Revision: https://reviews.llvm.org/D97432
The file was modifiedllvm/test/Instrumentation/SanitizerCoverage/trace-pc-guard.ll
The file was modifiedllvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
Commit 1a721b6a2634d9740b389a7604275b426c22600a by n.james93
[clang-tidy][NFC] Tweak some generation of diag messages

Fix up cases where diag is called by piecing together a string in favour of placeholders.
Fix up cases where select could be used instead of duplicating the message for sake of 1 word difference.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D97488
The file was modifiedclang-tools-extra/clang-tidy/bugprone/ExceptionEscapeCheck.cpp
The file was modifiedclang-tools-extra/clang-tidy/modernize/UseEqualsDefaultCheck.cpp
The file was modifiedclang-tools-extra/clang-tidy/misc/UnconventionalAssignOperatorCheck.cpp
The file was modifiedclang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitialization.cpp
The file was modifiedclang-tools-extra/clang-tidy/modernize/UseNodiscardCheck.cpp
The file was modifiedclang-tools-extra/clang-tidy/abseil/DurationFactoryFloatCheck.cpp
The file was modifiedclang-tools-extra/clang-tidy/modernize/AvoidCArraysCheck.cpp
The file was modifiedclang-tools-extra/clang-tidy/performance/NoexceptMoveConstructorCheck.cpp
The file was modifiedclang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp
The file was modifiedclang-tools-extra/clang-tidy/bugprone/ParentVirtualCallCheck.cpp
The file was modifiedclang-tools-extra/clang-tidy/portability/SIMDIntrinsicsCheck.cpp
The file was modifiedclang-tools-extra/clang-tidy/readability/QualifiedAutoCheck.cpp
The file was modifiedclang-tools-extra/clang-tidy/misc/UniqueptrResetReleaseCheck.cpp
The file was modifiedclang-tools-extra/clang-tidy/abseil/StringFindStartswithCheck.cpp
The file was modifiedclang-tools-extra/clang-tidy/modernize/UseTransparentFunctorsCheck.cpp
The file was modifiedclang-tools-extra/clang-tidy/readability/UseAnyOfAllOfCheck.cpp
The file was modifiedclang-tools-extra/clang-tidy/performance/MoveConstructorInitCheck.cpp
The file was modifiedclang-tools-extra/clang-tidy/performance/UnnecessaryValueParamCheck.cpp
The file was modifiedclang-tools-extra/clang-tidy/llvm/PreferRegisterOverUnsignedCheck.cpp
The file was modifiedclang-tools-extra/test/clang-tidy/checkers/misc-uniqueptr-reset-release.cpp
Commit a47d435bc4307ca71612dd03f09f12f7ff6b461f by jianzhouzh
[dfsan] Propagate origins for callsites

This is a part of https://reviews.llvm.org/D95835.

Each customized function has two wrappers. The
first one dfsw is for the normal shadow propagation. The second one dfso is used
when origin tracking is on. It calls the first one, and does additional
origin propagation. Which one to use can be decided at instrumentation
time. This is to ensure minimal additional overhead when origin tracking
is off.

Reviewed-by: morehouse

Differential Revision: https://reviews.llvm.org/D97483
The file was modifiedllvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
The file was modifiedcompiler-rt/lib/dfsan/dfsan.syms.extra
The file was addedllvm/test/Instrumentation/DataFlowSanitizer/origin_call.ll
The file was addedllvm/test/Instrumentation/DataFlowSanitizer/origin_abilist.ll
Commit bed888242662c2327b32b91a03635e079ad5667e by leonardchan
[scudo][test] Disable -Wfree-nonheap-object

As of 4f395db86b5cc11bb56853323d3cb1d4b6db5a0b which contains updates to
-Wfree-nonheap-object, a line in this test will trigger the warning. This
particular line is ok though since it's meant to test a free on a bad pointer.

Differential Revision: https://reviews.llvm.org/D97516
The file was modifiedcompiler-rt/lib/scudo/standalone/tests/wrappers_c_test.cpp
Commit f2cfef35966a24265b9e3c1b5ef8e64dcd5f431a by listmail
Be more mathematicly precise about definition of recurrence [NFC]

This clarifies the interface of the matchSimpleRecurrence helper introduced in 8020be0b8 for non-commutative operators.  After ebd3aeba, I realized the original way I framed the routine was inconsistent.  For shifts, we only matched the the LHS form, but for sub we matched both and the caller wanted that information.  So, instead, we now consistently match both forms for non-commutative operators and the caller becomes responsible for filtering if needed.  I tried to put a clear warning in the header because I suspect the RHS form of e.g. a sub recurrence is non-obvious for most folks.  (It was for me.)
The file was modifiedllvm/include/llvm/Analysis/ValueTracking.h
The file was modifiedllvm/lib/Analysis/ValueTracking.cpp
Commit b183cbfacd32ef7ac128ec0327c5972fd7e7f9c6 by craig.topper
[RISCV] Call SelectBaseAddr on the base pointer in the custom isel for vector loads and stores.

This will allow FrameIndex as the base address instead of
emitting a separate ADDI from isel. eliminateFrameIndex will likely turn
it back into an ADDI, but this makes things consistent with the
SDPatterns and VLPatterns.

I only tested one case for simplicity. I can test more if reviewers
want.

Reviewed By: frasercrmck

Differential Revision: https://reviews.llvm.org/D97221
The file was modifiedllvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
The file was addedllvm/test/CodeGen/RISCV/rvv/frameindex-addr.ll
Commit c5c316f6d9eeecae6de538ff554ae8066ebecb91 by jianzhouzh
[dfsan] Do not test origin-tracking in atomic.cpp

This would cause linking errors after https://reviews.llvm.org/D97483
that introduced new prefixes for ABI wrappers with origin tracking mode.
We will renable this after the full origin tracking is checked in.
The file was modifiedcompiler-rt/test/dfsan/atomic.cpp
Commit 0832a58e22dedb26c508405fbd4f0cc8de562244 by listmail
[cgp] Minor code improvement - reuse an existing named helper [NFC]
The file was modifiedllvm/lib/CodeGen/CodeGenPrepare.cpp
Commit 6de6455752c139bd3f13443be6a5046e9199f037 by jyknight
Use getAlign() on atomicrmw/cmpxchg instructions, now that it's available.

These locations were missed as part of adding alignment to the
instructions, and were still making their own alignment assumptions.
The file was modifiedllvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
The file was modifiedllvm/lib/Target/X86/X86ISelLowering.cpp
Commit bcc1aba6c4ee657840a306eadafa371cecd6a957 by kai
[SystemZ] Introducing assembler dialects for the Z backend

- This patch introduces a different assembler dialect ("hlasm") for z/OS.
  The default dialect has now been given the "att" dialect name. For this
  appropriate changes have been added to SystemZ.td.
- This patch also makes a few changes to SystemZInstrFormats.td which
  restrict a few condition code mnemonics to just the "att" dialect
  variant (he, le, lh, nhe, nle, nlh). These extended condition code
  mnemonics are not available in HLASM.
- A new private function has been introduced in SystemZAsmParser.cpp to
  return the assembler dialect set in SystemZMCAsmInfo.cpp. The reason we
  couldn't/haven't explicitly queried the overriden getAssemblerDialect
  function from AsmParser is outlined in this thread here. This returned
  dialect is directly passed onto the relevant matcher functions which taken
  in a variantID, so that the matcher functions can appropriately choose an
  instruction based on the variant.

Reviewed By: uweigand

Differential Revision: https://reviews.llvm.org/D94250
The file was modifiedllvm/lib/Target/SystemZ/SystemZInstrFormats.td
The file was modifiedllvm/lib/Target/SystemZ/SystemZ.td
The file was modifiedllvm/lib/Target/SystemZ/MCTargetDesc/SystemZMCAsmInfo.cpp
The file was modifiedllvm/lib/Target/SystemZ/AsmParser/SystemZAsmParser.cpp
Commit 635993f07bd617818097286eca0bdacb91a9afb5 by Stanislav.Mekhanoshin
[AMDGPU] Skip unclusterd rescheduling w/o ld/st

We are attempting rescheduling without load store clustering
if occupancy limits were not met with clustering. Skip this
for regions which do not have any loads or stores at all.

In a set of kernels I am experimenting with this improves
scheduling time by ~30%.

Differential Revision: https://reviews.llvm.org/D97342
The file was modifiedllvm/lib/Target/AMDGPU/GCNSchedStrategy.h
The file was modifiedllvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp