LLVM/project 5d98710llvm/lib/CodeGen/SelectionDAG DAGCombiner.cpp, llvm/lib/Target/AArch64 AArch64ISelLowering.cpp

[SelectionDAG] Move VSelect sign pattern check from AArch64 to general SelectionDAG (#151840)

For some reason the check is already there, but it bails out. Doing the
transform in SelDAG has no negative effect.
DeltaFile
+1,003-0llvm/test/CodeGen/X86/cmp-select-sign.ll
+0-30llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+7-2llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+1,010-323 files

LLVM/project d20a3c0llvm/test/tools/dsymutil/X86 module-warnings.test

[dsymutil] Update module-warnings.test to run with both linkers (#195474)

The classic linker emits a combined .debug_macinfo table and warns about
MacroLists it has to drop because no compile unit references them. The
parallel linker emits .debug_macinfo per compile unit, so unreferenced
lists are never emitted and have no corresponding warning.
DeltaFile
+11-3llvm/test/tools/dsymutil/X86/module-warnings.test
+11-31 files

LLVM/project 8a5d5d0clang/include/clang/CIR/Dialect/IR CIROps.td, clang/lib/CIR/Dialect/IR CIRDialect.cpp

[CIR] Use declarative TableGen constraints for overflow flag verification

Replace hand-written C++ verifiers with PredOpTrait-based constraints
(FlagRequiresIntType, HasAtMostOneOfAttrs). Introduce CIR_SaturatableBinaryOp
base class and use append/prepend ODS directives to compose arguments, format,
and traits across the op hierarchy. Fix HasAtMostOneOfAttrsPred to use
accessor methods instead of dollar-sign references. Add Commutative trait
to AddOp and MulOp.
DeltaFile
+49-35clang/include/clang/CIR/Dialect/IR/CIROps.td
+0-39clang/lib/CIR/Dialect/IR/CIRDialect.cpp
+49-742 files

LLVM/project c64084cclang/include/clang/CIR/Dialect/IR CIROps.td

[CIR][NFC] Rename SignBitOp to CIR_SignBitOp

Align with the CIR_ prefix naming convention used by other op
definitions in CIROps.td.
DeltaFile
+1-1clang/include/clang/CIR/Dialect/IR/CIROps.td
+1-11 files

LLVM/project 8db17fallvm/lib/Transforms/Vectorize VPlanAnalysis.h

[VPlan] Remove unused inferScalarTypeForRecipe declaration (NFC). (#194450)

The declaration is not used, remove it.
DeltaFile
+0-2llvm/lib/Transforms/Vectorize/VPlanAnalysis.h
+0-21 files

LLVM/project 34197a9clang/include/clang/CIR/Dialect/IR CIROps.td, clang/lib/CIR/Dialect/IR CIRDialect.cpp

[CIR] Use declarative TableGen constraints for overflow flag verification

Replace hand-written C++ verifiers with PredOpTrait-based constraints
(FlagRequiresIntType, HasAtMostOneOfAttrs). Introduce CIR_SaturatableBinaryOp
base class and use append/prepend ODS directives to compose arguments, format,
and traits across the op hierarchy. Fix HasAtMostOneOfAttrsPred to use
accessor methods instead of dollar-sign references. Add Commutative trait
to AddOp and MulOp.
DeltaFile
+50-35clang/include/clang/CIR/Dialect/IR/CIROps.td
+0-39clang/lib/CIR/Dialect/IR/CIRDialect.cpp
+50-742 files

LLVM/project ea1505allvm/include/llvm/IR Constant.h, llvm/lib/IR Constants.cpp

[NFCI][IR] Add DataLayout pointer to zero and null value related APIs

When the semantics of `ConstantPointerNull` change to represent a semantic null
pointer in the future, a null value won't necessarily be a zero value anymore.
Because of that, the entire LLVM constant infrastructure will need to change. As
a first step, this PR adds an optional data layout pointer to `isNullValue`,
`isZeroValue`, `getNullValue`, and `getZeroValue`. It isn't used yet, since a
null value is still a zero value right now.
DeltaFile
+227-0llvm/unittests/IR/ConstantsTest.cpp
+104-11llvm/lib/IR/Constants.cpp
+20-2llvm/include/llvm/IR/Constant.h
+351-133 files

LLVM/project d1a9dfellvm/include/llvm/IR Constant.h, llvm/lib/IR Constants.cpp

[NFCI][IR] Add DataLayout pointer to zero and null value related APIs

When the semantics of `ConstantPointerNull` change to represent a semantic null
pointer in the future, a null value won't necessarily be a zero value anymore.
Because of that, the entire LLVM constant infrastructure will need to change. As
a first step, this PR adds an optional data layout pointer to `isNullValue`,
`isZeroValue`, `getNullValue`, and `getZeroValue`. It isn't used yet, since a
null value is still a zero value right now.
DeltaFile
+227-0llvm/unittests/IR/ConstantsTest.cpp
+126-11llvm/lib/IR/Constants.cpp
+20-2llvm/include/llvm/IR/Constant.h
+373-133 files

LLVM/project 0555d59clang/test/CodeGen target-data.c, clang/test/CodeGenOpenCL amdgpu-env-amdgcn.cl

Revert "[AMDGPU] Update data layout string to use the new pointer spec about null pointer value" (#195460)

Reverts llvm/llvm-project#194101 since the infrastructure to use that is
not ready such that updating it right now will cause some inconsistency.
DeltaFile
+6-7llvm/lib/TargetParser/TargetDataLayout.cpp
+4-4clang/test/CodeGen/target-data.c
+3-3lld/test/ELF/lto/amdgcn-oses.ll
+1-1lld/test/ELF/lto/r600.ll
+1-1lld/test/ELF/lto/amdgcn.ll
+1-1clang/test/CodeGenOpenCL/amdgpu-env-amdgcn.cl
+16-176 files

LLVM/project f66331ellvm/test/tools/llubi stack_overflow.ll store_dead.ll, llvm/tools/llubi/lib Interpreter.cpp ExecutorBase.cpp

[llubi] Improve diagnostics and add stacktrace (#195449)

This PR improves UB diagnostics by making `reportImmediateUB` return a
temporary streamable object. Stacktrace on UB is also added.
DeltaFile
+40-34llvm/tools/llubi/lib/Interpreter.cpp
+50-13llvm/tools/llubi/lib/ExecutorBase.cpp
+38-21llvm/tools/llubi/lib/Library.cpp
+53-2llvm/tools/llubi/lib/ExecutorBase.h
+11-0llvm/test/tools/llubi/stack_overflow.ll
+3-1llvm/test/tools/llubi/store_dead.ll
+195-7134 files not shown
+277-8340 files

LLVM/project 267e3d3clang/test/CodeGen target-data.c, clang/test/CodeGenOpenCL amdgpu-env-amdgcn.cl

Revert "[AMDGPU] Update data layout string to use the new pointer spec about …"

This reverts commit 1a861970f2ba5a8e0bdc47423a892d5f39a25c05.
DeltaFile
+6-7llvm/lib/TargetParser/TargetDataLayout.cpp
+4-4clang/test/CodeGen/target-data.c
+3-3lld/test/ELF/lto/amdgcn-oses.ll
+1-1lld/test/ELF/lto/r600.ll
+1-1lld/test/ELF/lto/amdgcn.ll
+1-1clang/test/CodeGenOpenCL/amdgpu-env-amdgcn.cl
+16-176 files

LLVM/project 2ce499bllvm/include/llvm/IR Constant.h, llvm/lib/IR Constants.cpp

[NFCI][IR] Add DataLayout pointer to zero and null value related APIs

When the semantics of `ConstantPointerNull` change to represent a semantic null
pointer in the future, a null value won't necessarily be a zero value anymore.
Because of that, the entire LLVM constant infrastructure will need to change. As
a first step, this PR adds an optional data layout pointer to `isNullValue`,
`isZeroValue`, `getNullValue`, and `getZeroValue`. It isn't used yet, since a
null value is still a zero value right now.
DeltaFile
+144-0llvm/unittests/IR/ConstantsTest.cpp
+25-2llvm/include/llvm/IR/Constant.h
+15-3llvm/lib/IR/Constants.cpp
+184-53 files

LLVM/project 7d925b9libcxx/include/__random discard_block_engine.h shuffle_order_engine.h

[libc++] Make __is_seed_sequence a variable template (#195420)

This makes things a bit more readable and improves compile times a bit.
DeltaFile
+4-5libcxx/include/__random/discard_block_engine.h
+4-5libcxx/include/__random/shuffle_order_engine.h
+2-4libcxx/include/__random/is_seed_sequence.h
+2-2libcxx/include/__random/linear_congruential_engine.h
+2-2libcxx/include/__random/mersenne_twister_engine.h
+2-2libcxx/include/__random/independent_bits_engine.h
+16-201 files not shown
+18-227 files

LLVM/project fd51c78clang/lib/AST DeclTemplate.cpp, clang/lib/Sema SemaTemplateDeductionGuide.cpp SemaTemplate.cpp

[clang] fix alias ctad producing function template with no template parameters (#195303)
DeltaFile
+40-43clang/lib/Sema/SemaTemplateDeductionGuide.cpp
+18-9clang/lib/Sema/SemaTemplate.cpp
+9-0clang/lib/AST/DeclTemplate.cpp
+4-3clang/test/SemaCXX/cxx20-ctad-type-alias.cpp
+3-3clang/lib/Sema/SemaInit.cpp
+2-2clang/test/SemaTemplate/deduction-guide.cpp
+76-604 files not shown
+82-6210 files

LLVM/project b506ef0clang/lib/CodeGen/TargetBuiltins AMDGPU.cpp, llvm/lib/Analysis ValueTracking.cpp

[ValueTracking] Add CharWidth argument to getConstantStringInfo (NFC)

The method assumes that host chars and target chars have the same width.
Add a CharWidth argument so that it can bail out if the requested char
width differs from the host char width.

Alternatively, the check could be done at call sites, but this is more
error-prone.

In the future, this method will be replaced with a different one that
allows host/target chars to have different widths. The prototype will
be the same except that StringRef is replaced with something that is
byte width agnostic. Adding CharWidth argument now reduces the future
diff.
DeltaFile
+72-31llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
+9-3llvm/lib/Transforms/AggressiveInstCombine/AggressiveInstCombine.cpp
+5-2llvm/lib/Analysis/ValueTracking.cpp
+2-2clang/lib/CodeGen/TargetBuiltins/AMDGPU.cpp
+2-2llvm/lib/Transforms/Utils/AMDGPUEmitPrintf.cpp
+2-2llvm/lib/Target/AMDGPU/AMDGPUPrintfRuntimeBinding.cpp
+92-424 files not shown
+96-4610 files

LLVM/project 3a59b36llvm/include/llvm/IR PatternMatch.h, llvm/lib/Analysis InstructionSimplify.cpp

[IR] Account for byte width in m_PtrAdd

The method has few uses yet, so just pass DL argument to it. The change
follows m_PtrToIntSameSize, and I don't see a better way of delivering
the byte width to the method.
DeltaFile
+19-6llvm/unittests/IR/PatternMatch.cpp
+8-5llvm/include/llvm/IR/PatternMatch.h
+4-3llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
+3-2llvm/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp
+1-1llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
+1-1llvm/lib/Analysis/InstructionSimplify.cpp
+36-186 files

LLVM/project 68d0d2bllvm/include/llvm/IR IRBuilder.h, llvm/lib/Transforms/Instrumentation SanitizerCoverage.cpp

[IRBuilder] Add getByteTy and use it in CreatePtrAdd

The change requires DataLayout instance to be available, which, in turn,
requires insertion point to be set. In-tree tests detected only one case
when the function was called without setting an insertion point, it was
changed to create a constant expression directly.
DeltaFile
+22-0llvm/unittests/IR/IRBuilderTest.cpp
+8-2llvm/include/llvm/IR/IRBuilder.h
+2-3llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
+32-53 files

LLVM/project 6950e52clang/lib/CodeGen ItaniumCXXABI.cpp, llvm/include/llvm/IR Constants.h

Use DL in ConstantExpr::getPtrAdd() / ConstantExpr::getInBoundsPtrAdd()
DeltaFile
+9-9llvm/lib/Analysis/ScalarEvolution.cpp
+9-9llvm/include/llvm/IR/Constants.h
+9-0llvm/lib/IR/Constants.cpp
+5-3llvm/lib/Transforms/IPO/LowerTypeTests.cpp
+2-1clang/lib/CodeGen/ItaniumCXXABI.cpp
+2-1llvm/unittests/IR/PatternMatch.cpp
+36-237 files not shown
+43-3013 files

LLVM/project 2b27589llvm/lib/Transforms/Utils SimplifyLibCalls.cpp, llvm/test/Transforms/InstCombine/SimplifyLibCalls memcpy-b16.ll memset-b16.ll

[SimplifyLibCalls] Add initial support for non-8-bit bytes

The patch makes CharWidth argument of `getStringLength` mandatory
and ensures the correct values are passed in most cases.
This is *not* a complete support for unusual byte widths in
SimplifyLibCalls since `getConstantStringInfo` returns false for those.
The code guarded by `getConstantStringInfo` returning true is unchanged
because the changes are currently not testable.
DeltaFile
+126-67llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
+69-0llvm/test/Transforms/InstCombine/SimplifyLibCalls/memcpy-b16.ll
+66-0llvm/test/Transforms/InstCombine/SimplifyLibCalls/memset-b16.ll
+50-0llvm/test/Transforms/InstCombine/SimplifyLibCalls/strcmp-b32.ll
+47-0llvm/test/Transforms/InstCombine/SimplifyLibCalls/stpncpy-b16.ll
+45-0llvm/test/Transforms/InstCombine/SimplifyLibCalls/strchr-b16.ll
+403-6729 files not shown
+932-10435 files

LLVM/project 5d7713bllvm/lib/Analysis ValueTracking.cpp

[ValueTracking] Make isBytewiseValue byte width agnostic

This is a simple change to show how easy it can be to support unusual
byte widths in the middle end.
DeltaFile
+14-13llvm/lib/Analysis/ValueTracking.cpp
+14-131 files

LLVM/project 37f8c63llvm/include/llvm/IR Intrinsics.td Intrinsics.h, llvm/lib/IR Intrinsics.cpp Core.cpp

[IR] Make @llvm.memset prototype byte width dependent

This patch changes the type of the value argument of @llvm.memset and
similar intrinsics from i8 to iN, where N is the byte width specified
in data layout string.
Note that the argument still has fixed type (not overloaded), but type
checker will complain if the type does not match the byte width.

Ideally, the type of the argument would be dependent on the address
space of the pointer argument. It is easy to do this (and I did it
downstream as a PoC), but since data layout string doesn't currently
allow different byte widths for different address spaces, I refrained
from doing it now.
DeltaFile
+37-25llvm/lib/IR/Intrinsics.cpp
+9-4llvm/include/llvm/IR/Intrinsics.td
+6-3llvm/include/llvm/IR/Intrinsics.h
+2-2llvm/lib/IR/Core.cpp
+3-1llvm/lib/IR/Function.cpp
+2-1llvm/lib/IR/AutoUpgrade.cpp
+59-366 files not shown
+68-4212 files

LLVM/project 20f765cllvm/include/llvm/IR DataLayout.h, llvm/lib/IR DataLayout.cpp

[DataLayout] Add byte specification

This patch adds byte specification to data layout string.
The specification is `b:<size>`, where `<size>` is the size of a byte
in bits (later referred to as "byte width").

Limitations:
* The only values allowed for byte width are 8, 16, and 32.
16-bit bytes are popular, and my downstream target has 32-bit bytes.
These are the widths I'm going to add tests for in follow-up patches,
so this restriction only exists because other widths are untested.
* It is assumed that bytes are the same in all address spaces.
Supporting different byte widths in different address spaces would
require adding an address space argument to all DataLayout methods
that query ABI / preferred alignments because they return *byte*
alignments, and those will be different for different address spaces.
This is too much effort, but it can be done in the future if the need
arises, the specification reserves address space number before ':'.
DeltaFile
+68-19llvm/lib/IR/DataLayout.cpp
+16-6llvm/include/llvm/IR/DataLayout.h
+84-252 files

LLVM/project 3823341llvm/lib/Transforms/Vectorize VPlanTransforms.cpp, llvm/test/Transforms/LoopVectorize reduction-inloop-uf4.ll consecutive-ptr-uniforms.ll

Reapply "[VPlan] Run removeDeadRecipes early." (#195325) (#195445)

This reverts commit 2a9699ccd128d7f94372d18c97229e1934b8506e.

Recommit contains a small fix for skipping dead recipes when finding
induction casts.

Original message:
The initial simplifyRecipes run can leave dead recipes, which
removeDeadRecipes can clean up, similar for dead instructions in the
input.

PR: https://github.com/llvm/llvm-project/pull/190191
DeltaFile
+8-25llvm/test/Transforms/LoopVectorize/VPlan/predicator.ll
+15-10llvm/test/Transforms/LoopVectorize/reduction-inloop-uf4.ll
+10-6llvm/test/Transforms/LoopVectorize/AArch64/transform-narrow-interleave-to-widen-memory-with-wide-ops-chained.ll
+10-5llvm/test/Transforms/LoopVectorize/consecutive-ptr-uniforms.ll
+13-1llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+6-6llvm/test/Transforms/LoopVectorize/tail-folding-optimize-vector-induction-width.ll
+62-5330 files not shown
+132-13136 files

LLVM/project 82f9618libc/src/__support/math CMakeLists.txt llrintf16.h, libc/src/math/generic CMakeLists.txt

[libc][math] Refactor lrint_lround family to header-only (#195441)

Refactors the lrint_lround math family to be header-only.

part of: #147386

Target Functions:
  - llrint
  - llrintbf16
  - llrintf
  - llrintf128
  - llrintf16
  - llrintl
  - llround
  - llroundbf16
  - llroundf
  - llroundf128
  - llroundf16
  - llroundl

    [11 lines not shown]
DeltaFile
+352-12utils/bazel/llvm-project-overlay/libc/BUILD.bazel
+228-0libc/src/__support/math/CMakeLists.txt
+24-42libc/src/math/generic/CMakeLists.txt
+48-0libc/test/shared/CMakeLists.txt
+33-0libc/src/__support/math/llrintf16.h
+33-0libc/src/__support/math/llrintf128.h
+718-5473 files not shown
+2,045-19979 files

LLVM/project 516a9d4mlir/docs/Traits _index.md, mlir/include/mlir/IR OpDefinition.h OpBase.td

[MLIR] Add HasAncestor op trait

Add HasAncestor/AncestorOneOf traits that verify an operation has a
specific ancestor anywhere in the parent chain, unlike HasParent which
only checks the immediate parent. This enables declarative verification
for ops that can be nested arbitrarily deep inside a required ancestor.
DeltaFile
+79-0mlir/test/IR/traits.mlir
+26-0mlir/include/mlir/IR/OpDefinition.h
+10-0mlir/docs/Traits/_index.md
+9-0mlir/test/lib/Dialect/Test/TestOps.td
+8-0mlir/include/mlir/IR/OpBase.td
+132-05 files

LLVM/project 1ed1761llvm/lib/Transforms/Utils CloneFunction.cpp

[NFC][LLVM] Simplify `PruningFunctionCloner::cloneInstruction` (#195389)

Add early returns and decrease indendation of the code that does
implements calls to constrained intrinsics.
DeltaFile
+57-62llvm/lib/Transforms/Utils/CloneFunction.cpp
+57-621 files

LLVM/project 7b026acllvm/lib/Transforms/Vectorize VPlanTransforms.cpp, llvm/test/Transforms/LoopVectorize/X86 replicating-load-store-costs.ll

[VPlan] Simplify extract-lane of all single-scalars (#194838)

Checking against vputils::isSingleScalar is sufficient for both
correctness and profitability.
DeltaFile
+3-5llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+0-1llvm/test/Transforms/LoopVectorize/X86/replicating-load-store-costs.ll
+3-62 files

LLVM/project 482d0f0llvm/test/Transforms/LoopVectorize cast-induction.ll

[LV] Add test for crash with VPlan-based DCE (NFC) (#195438)

Add a test with a dead cast, causing the revert in 2a9699ccd12, due to
https://lab.llvm.org/buildbot/#/builders/67/builds/3821.
DeltaFile
+152-0llvm/test/Transforms/LoopVectorize/cast-induction.ll
+152-01 files

LLVM/project 2447939clang-tools-extra/clang-tidy/misc UnusedParametersCheck.cpp UnusedParametersCheck.h, clang-tools-extra/docs ReleaseNotes.rst

[Clang-Tidy] Skip `misc-unused-parameters` in macro. (#194999)

The new parameter allows to skip the check for the cases when we need to
use the macro, but there is no immediate way to fix the macro itself. It
recently come up with a gradual adoption of clang-tidy and not all parts
of the code could be fixed at once.

Simply enabling it using `clang-tidy-diff` is not enough, since
`misc-unused-parameters` would cause false-positive, since the given
diff didn't introduce the unused parameters and might be not easy to
change.

The given parameters allow for better incremental adoption.

---------

Co-authored-by: Dmitrii Kuragin <dkuragin at adobe.com>
Co-authored-by: EugeneZelenko <eugene.zelenko at gmail.com>
DeltaFile
+21-0clang-tools-extra/test/clang-tidy/checkers/misc/unused-parameters-macro.cpp
+8-0clang-tools-extra/docs/clang-tidy/checks/misc/unused-parameters.rst
+5-1clang-tools-extra/clang-tidy/misc/UnusedParametersCheck.cpp
+5-0clang-tools-extra/docs/ReleaseNotes.rst
+1-0clang-tools-extra/test/clang-tidy/infrastructure/dump-config-filtering.cpp
+1-0clang-tools-extra/clang-tidy/misc/UnusedParametersCheck.h
+41-16 files

LLVM/project 1b1e14flibc/src/__support/math f16addl.h f16addf128.h, libc/test/shared shared_math_constexpr_test.cpp CMakeLists.txt

[libc][math] Qualify f16add functions to constexpr (#195429)

Signed-off-by: udaykiriti <udaykiriti624 at gmail.com>
DeltaFile
+11-0libc/test/shared/shared_math_constexpr_test.cpp
+4-0libc/test/shared/CMakeLists.txt
+1-1libc/src/__support/math/f16addl.h
+1-1libc/src/__support/math/f16addf128.h
+1-1libc/src/__support/math/f16addf.h
+1-1libc/src/__support/math/f16add.h
+19-46 files