LLVM/project adddcefllvm/include/llvm/Analysis ValueTracking.h, llvm/lib/Analysis ValueTracking.cpp

[ValueTracking][InstCombine] Preserve samesign when flipping icmp strictness (#209097)

Preserve the `samesign` flag when canonicalizing non-strict integer
comparisons to strict form, so subsequent folds can use it. For example:

```
icmp samesign uge i8 %x, 42
  ->
icmp samesign ugt i8 %x, 41
```

Adjusting the constant is only valid if it preserves the comparison's
poison domain. For a `samesign` predicate, this requires the adjustment
to preserve the constant's sign bit.

This patch checks the normal signed or unsigned overflow boundary, and
all sign-crossing cases like:
```
increment: signed-max -> signed-min

    [3 lines not shown]
DeltaFile
+102-0llvm/test/Transforms/InstCombine/icmp-samesign-canonicalize.ll
+13-3llvm/lib/Analysis/ValueTracking.cpp
+5-2llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
+2-0llvm/include/llvm/Analysis/ValueTracking.h
+122-54 files

LLVM/project 959f7b6llvm/lib/Target/RISCV RISCVOptWInstrs.cpp RISCVGatherScatterLowering.h

[RISCV] Rename Legacy Pass Creation Functions

This renames the createPass functions for the passes ported to the new
pass manager so it's clearer that they relate to the legacy versions of
the passes.
DeltaFile
+5-5llvm/lib/Target/RISCV/RISCVTargetMachine.cpp
+1-1llvm/lib/Target/RISCV/RISCVOptWInstrs.cpp
+1-1llvm/lib/Target/RISCV/RISCVGatherScatterLowering.h
+1-1llvm/lib/Target/RISCV/RISCVGatherScatterLowering.cpp
+1-1llvm/lib/Target/RISCV/RISCVFoldMemOffset.h
+1-1llvm/lib/Target/RISCV/RISCVFoldMemOffset.cpp
+10-105 files not shown
+15-1511 files

LLVM/project 7196f93cmake/Modules LLVMVersion.cmake

Bump version to 23.1.0-rc3
DeltaFile
+1-1cmake/Modules/LLVMVersion.cmake
+1-11 files

LLVM/project 3561134libc/src/__support/builtins floatuntixf.h fixunsxfti.h, libc/test/shared shared_builtins_test.cpp

[compiler-rt][builtins] libc-backed float80-int conversion builtins
DeltaFile
+99-0libc/src/__support/builtins/CMakeLists.txt
+45-0libc/test/shared/shared_builtins_test.cpp
+41-0libc/src/__support/builtins/floatuntixf.h
+41-0libc/src/__support/builtins/fixunsxfti.h
+41-0libc/src/__support/builtins/fixxfti.h
+41-0libc/src/__support/builtins/floattixf.h
+308-026 files not shown
+1,071-032 files

LLVM/project da1d4celibc/shared/builtins extendhfxf2.h, libc/src/__support/FPUtil dyadic_float.h

[compiler-rt][builtins] libc-backed float80-bfloat16/float16 conversion builtins
DeltaFile
+78-17libc/src/__support/builtins/fpconvert_helper.h
+38-24libc/src/__support/FPUtil/dyadic_float.h
+41-0libc/src/__support/builtins/extendhfxf2.h
+40-0libc/src/__support/builtins/truncxfhf2.h
+39-0libc/src/__support/builtins/truncxfbf2.h
+35-0libc/shared/builtins/extendhfxf2.h
+271-4111 files not shown
+475-4117 files

LLVM/project 0183269libc/src/__support/builtins fixunstfdi.h fixtfsi.h

[compiler-rt][builtins] libc-backed quad-to-int conversion builtins
DeltaFile
+79-0libc/src/__support/builtins/CMakeLists.txt
+41-0libc/src/__support/builtins/fixunstfti.h
+41-0libc/src/__support/builtins/fixtfti.h
+40-0libc/src/__support/builtins/fixunstfdi.h
+40-0libc/src/__support/builtins/fixtfsi.h
+40-0libc/src/__support/builtins/fixtfdi.h
+281-017 files not shown
+732-023 files

LLVM/project 5857ec3libc/test/shared shared_builtins_test.cpp

[libc][builtins][test] missed int-floating conversion tests
DeltaFile
+66-0libc/test/shared/shared_builtins_test.cpp
+66-01 files

LLVM/project 217a9f1libc/src/__support/builtins floatsitf.h floatditf.h

[compiler-rt][builtins] libc-backed int-to-quad conversion builtins
DeltaFile
+68-0libc/src/__support/builtins/CMakeLists.txt
+41-0libc/src/__support/builtins/floatuntitf.h
+41-0libc/src/__support/builtins/floattitf.h
+40-0libc/src/__support/builtins/floatsitf.h
+40-0libc/src/__support/builtins/floatditf.h
+40-0libc/src/__support/builtins/floatunditf.h
+270-017 files not shown
+721-123 files

LLVM/project c92a80flibc/test/shared shared_builtins_test.cpp

fix conflicts
DeltaFile
+2-5libc/test/shared/shared_builtins_test.cpp
+2-51 files

LLVM/project 960d302compiler-rt/lib/builtins comparetf2.cpp, libc/shared/builtins getf2.h letf2.h

[compiler-rt][builtins] libc-backed quad-float comparison builtins
DeltaFile
+49-0compiler-rt/lib/builtins/comparetf2.cpp
+36-0libc/src/__support/builtins/letf2.h
+36-0libc/src/__support/builtins/getf2.h
+36-0libc/src/__support/builtins/unordtf2.h
+35-0libc/shared/builtins/getf2.h
+35-0libc/shared/builtins/letf2.h
+227-06 files not shown
+321-012 files

LLVM/project 476f6d2compiler-rt/lib/builtins comparedf2.cpp, libc/shared/builtins gedf2.h ledf2.h

[compiler-rt][builtins] libc-backed double-float comparison builtins
DeltaFile
+54-0compiler-rt/lib/builtins/comparedf2.cpp
+30-0libc/src/__support/builtins/ledf2.h
+30-0libc/src/__support/builtins/gedf2.h
+30-0libc/src/__support/builtins/unorddf2.h
+29-0libc/shared/builtins/gedf2.h
+29-0libc/shared/builtins/ledf2.h
+202-06 files not shown
+280-012 files

LLVM/project 315db3cclang/lib/AST/ByteCode Program.h Compiler.cpp

[clang][bytecode][NFC] Fix some copies in for-range loops (#215544)
DeltaFile
+1-1clang/lib/AST/ByteCode/Program.h
+1-1clang/lib/AST/ByteCode/Compiler.cpp
+1-1clang/lib/AST/ByteCode/ByteCodeEmitter.cpp
+3-33 files

LLVM/project c3713a1llvm/include/llvm/IR DebugInfoMetadata.h, llvm/lib/CodeGen/AsmPrinter DwarfExpression.cpp

[DebugInfo][NFC] Add typed DIExpression operand views (#215682)

DIExpression users check an opcode and then read its arguments with
numbered getArg() calls. Add typed views for the operations with
repeated raw accesses and use their named accessors in those consumers.

The views reuse ExprOperand's pointer storage and LLVM's cast helpers. A
failed dyn_cast returns an empty view, so conditional matches don't need
an optional wrapper. Reading one is a bug, so getOp() and getArg() now
assert the operand is there rather than dereferencing null.

The only interesting change is that getActiveBits loses the fallthrough
from its extract case into its fragment case. The two shared one read
because both opcodes keep their size in the same argument; now each
names its own through its view and they share a lambda for
the narrowing. A unit test covers both paths.

Overall a bit more code, but quite a bit more readable IMO.


    [2 lines not shown]
DeltaFile
+183-3llvm/include/llvm/IR/DebugInfoMetadata.h
+166-0llvm/unittests/IR/MetadataTest.cpp
+85-43llvm/lib/IR/DebugInfoMetadata.cpp
+51-47llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp
+8-8llvm/lib/IR/DIExpressionOptimizer.cpp
+8-6llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
+501-1074 files not shown
+518-12410 files

LLVM/project 643b283mlir/include/mlir/Target/LLVMIR ModuleImport.h, mlir/lib/Target/LLVMIR ModuleImport.cpp

[MLIR][LLVM] Preserve global value metadata operands on import (#203017)

Import metadata operands that refer to an `llvm::GlobalValue` as
`#llvm.md_global_value` attributes. Resolve each reference to the MLIR
symbol assigned during module import, retaining synthesized names for
nameless globals.

Report unsupported metadata when an operand has no symbol-backed
representation in the imported module. This covers local values,
intrinsics with dedicated import conversions, and `llvm.global_ctors` or
`llvm.global_dtors`.
DeltaFile
+95-5mlir/test/Target/LLVMIR/Import/intrinsic-unregistered.ll
+41-21mlir/lib/Target/LLVMIR/ModuleImport.cpp
+58-0mlir/test/Target/LLVMIR/Import/import-failure.ll
+12-0mlir/include/mlir/Target/LLVMIR/ModuleImport.h
+206-264 files

LLVM/project 8682571clang/lib/AST/ByteCode EvalEmitter.h Source.h

[clang][bytecode] Clean up SourceMapper related code (#215528)

Instead of having different `SourceMapper` implementations, just ask the
`Function` directly if we have one, and fall back to the `SourceMapper`
otherwise.

We now only have one `SourceMapper` implementation though:
`EvalEmitter`. And the only reason we have this is so we don't have a
circular dependency between `InterpState` and `EvalEmitter`.
DeltaFile
+21-9clang/lib/AST/ByteCode/InterpFrame.cpp
+6-14clang/lib/AST/ByteCode/Source.cpp
+6-7clang/lib/AST/ByteCode/InterpState.h
+5-5clang/lib/AST/ByteCode/Source.h
+3-5clang/lib/AST/ByteCode/EvalEmitter.h
+41-405 files

LLVM/project c4112d7clang/lib/AST/ByteCode Interp.cpp

[clang][bytecode][NFC] Remove redundant isInvalidDecl() check (#215546)

This is already checked earlier in the same function.
DeltaFile
+0-4clang/lib/AST/ByteCode/Interp.cpp
+0-41 files

LLVM/project 8c3abd4llvm/lib/Target/WebAssembly WebAssemblyISelLowering.cpp, llvm/test/CodeGen/WebAssembly simd-extending-convert.ll

[WebAssembly][DAGCombine] Avoid scalarizing v8i8 to v8f16 conversions (#213636)

WebAssembly FP16 can convert `v8i16` to `v8f16`, but direct `v8i8` to
`v8f16` conversions were scalarized during SelectionDAG type
legalization.

This results in lane extractions, scalar conversions, calls to
`__truncsfhf2`, and reconstruction of the result vector.

We should extend `v8i8` to `v8i16` in `performVectorExtendToFPCombine`
before type legalization. This allows the existing WebAssembly combines
to select:

- `i16x8.extend_low_i8x16_{s,u}`
- `f16x8.convert_i16x8_s`
DeltaFile
+25-0llvm/test/CodeGen/WebAssembly/simd-extending-convert.ll
+6-4llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
+31-42 files

LLVM/project b0045c3clang/include/clang/InstallAPI FileList.h

[clang][InstallAPI] Fix doc comment weirdness (#215462)

We shouldn't be using a documentation comment here.
DeltaFile
+3-3clang/include/clang/InstallAPI/FileList.h
+3-31 files

LLVM/project ae2241fclang/lib/AST/ByteCode InterpBuiltin.cpp

[clang][bytecode][NFC] Avoid an APFloat copy (#215543)
DeltaFile
+1-1clang/lib/AST/ByteCode/InterpBuiltin.cpp
+1-11 files

LLVM/project 267c447mlir/include/mlir/Dialect/Utils ReshapeOpsUtils.h

[mlir][NFC] Remove internal linkage from reshape op helper templates (#214759)

Another case of the cleanup done for #208001, which enabled
-Wunused-template under -Wall. Both helpers are `static` in
ReshapeOpsUtils.h, which reaches many TUs via Linalg.h, Tensor.h and
MemRef.h, so clang warns wherever they are not instantiated. Dropping
`static` gives them vague linkage.
DeltaFile
+4-4mlir/include/mlir/Dialect/Utils/ReshapeOpsUtils.h
+4-41 files

LLVM/project 9214296mlir/include/mlir/Bytecode BytecodeImplementation.h, mlir/include/mlir/IR AffineMap.h OpDefinition.h

[mlir][NFC] Remove internal linkage from core header function templates (#214756)

These are more of the cases fixed alongside #208001, which enabled
-Wunused-template under -Wall. Each template is `static` in a widely
included header, so clang warns in every TU that includes it without
instantiating it. Dropping `static` gives them vague linkage and
silences the warning.
DeltaFile
+8-11mlir/include/mlir/IR/PDLPatternMatch.h.inc
+6-7mlir/include/mlir/IR/OpDefinition.h
+3-3mlir/include/mlir/Pass/PassOptions.h
+2-2mlir/include/mlir/IR/AffineMap.h
+2-2mlir/include/mlir/Bytecode/BytecodeImplementation.h
+21-255 files

LLVM/project 0621d38bolt/lib/Profile DataAggregator.cpp

[Perf2bolt] Support multi-PID filtering for multiple perf inputs (#215541)

#199324 added support for multiple perf inputs in perf2bolt. Building on
that, this patch additionally supports filtering by multiple PIDs via
--pid=pid1,pid2...
DeltaFile
+25-16bolt/lib/Profile/DataAggregator.cpp
+25-161 files

LLVM/project 3924889llvm/test/CodeGen/NVPTX cmpxchg-sm90.ll f32x2-instructions.ll

[NVPTX] Cleanup PTX ISA subtarget features (#214623)
DeltaFile
+1,514-802llvm/test/CodeGen/NVPTX/reduction-intrinsics.ll
+654-654llvm/test/CodeGen/NVPTX/tcgen05-st.ll
+573-573llvm/test/CodeGen/NVPTX/atomicrmw-sm90.ll
+493-301llvm/test/CodeGen/NVPTX/i32x2-instructions.ll
+354-298llvm/test/CodeGen/NVPTX/f32x2-instructions.ll
+276-276llvm/test/CodeGen/NVPTX/cmpxchg-sm90.ll
+3,864-2,90489 files not shown
+8,229-7,04695 files

LLVM/project ebc7fc7llvm/unittests/ADT SmallVectorTest.cpp, llvm/unittests/IR IntrinsicsTest.cpp

llvm/unittests: Prune unused templates [-Wunused-template] (#215565)
DeltaFile
+0-5llvm/unittests/Support/RecyclerTest.cpp
+0-5llvm/unittests/ADT/SmallVectorTest.cpp
+0-3llvm/unittests/IR/IntrinsicsTest.cpp
+0-133 files

LLVM/project aa4e3bfclang/lib/CIR/CodeGen CIRGenModule.cpp, clang/test/CIR/CodeGen lambda-generic-in-cxx11abi-lambda.cpp

[CIR] Fix a linking problem with a abi_tag deduced lambda (#215702)

This showed up in self build, but only happens when there is a lambda
with a deduced return type inside another lambda, that returns a type
with an abi_tag on it (std::string in this case). The problem was that
we weren't pulling our mangled name out of the cache, and instead were
re-calculating it every time. This takes code effectively-exactly from
classic-codegen an d puts it into CIRGenModule.cpp

Note the teest is a little fragile for the reproducer, so it needs to be
its own file. Also, there are some parts that are not necessary in it to
reproduce (the 'i' in particular) because this avoids us having 'padded'
lambdas, which results in a call-conv NYI. I considered disabling that,
but it is more work to go back and un-do that flag later, than to just
deal with an extra 'i' for the near future.
DeltaFile
+49-0clang/test/CIR/CodeGen/lambda-generic-in-cxx11abi-lambda.cpp
+10-0clang/lib/CIR/CodeGen/CIRGenModule.cpp
+59-02 files

LLVM/project c6d3d17llvm/lib/Target/RISCV RISCVPassRegistry.def RISCV.h

[RISCV] Port Gather/Scatter Lowering to NewPM (#215669)

This change also adds some missing pass dependencies to the legacy
version of the pass, to reflect some analyses that are already being
used.

Assisted-by: AI
DeltaFile
+72-45llvm/lib/Target/RISCV/RISCVGatherScatterLowering.cpp
+40-0llvm/lib/Target/RISCV/RISCVGatherScatterLowering.h
+0-3llvm/lib/Target/RISCV/RISCV.h
+2-1llvm/lib/Target/RISCV/RISCVTargetMachine.cpp
+2-1llvm/lib/Target/RISCV/RISCVCodeGenPassBuilder.cpp
+2-0llvm/lib/Target/RISCV/RISCVPassRegistry.def
+118-505 files not shown
+124-5011 files

LLVM/project 1de960bllvm/lib/CodeGen TypePromotion.cpp, llvm/test/CodeGen/RISCV pr148084.ll

[TypePromotion][RISCV][ARM] Ignore the condition operand of selects. (#215685)

We don't need to promote the condition operand in order to promote a
select. It must always be an i1 type so it doesn't matter where it comes
from.

The change to pr148084.ll is a regression, but I don't think it's
directly related to select. TypePromotion is using a zero extend
promotion which makes constants that are harder to materialize and
prevents the use of `not`. This kind of thing can happen independent of
selects being involved.
DeltaFile
+29-29llvm/test/Transforms/TypePromotion/ARM/casts.ll
+17-10llvm/test/CodeGen/RISCV/pr148084.ll
+7-0llvm/lib/CodeGen/TypePromotion.cpp
+53-393 files

LLVM/project 006cd0dlibcxx/test/benchmarks/containers/associative map.bench.cpp unordered_map.bench.cpp, libcxx/test/benchmarks/format formatter_float.bench.cpp write_int_comparison.bench.cpp

[libc++] Fix duplicate names in benchmarks (#215676)

A few benchmarks were using names that were reused elsewhere in the test
suite. All benchmarks must have a unique name, otherwise we can't
distinguish them in LNT.
DeltaFile
+17-11libcxx/test/benchmarks/format/write_int_comparison.bench.cpp
+17-11libcxx/test/benchmarks/format/write_double_comparison.bench.cpp
+4-1libcxx/test/benchmarks/format/formatter_float.bench.cpp
+2-1libcxx/test/benchmarks/containers/associative/unordered_map.bench.cpp
+1-1libcxx/test/benchmarks/containers/associative/map.bench.cpp
+41-255 files

LLVM/project 1b6df09clang/test/CodeGen/RISCV/rvv-intrinsics-autogenerated/zvabd/non-policy/non-overloaded vwabdau.c, clang/test/CodeGen/RISCV/rvv-intrinsics-autogenerated/zvabd/non-policy/overloaded vwabdau.c

[Clang][RISCV] Fix vwabda[u] operand order (#215494)

See https://github.com/riscv-non-isa/riscv-rvv-intrinsic-doc/pull/435.
DeltaFile
+195-195clang/test/CodeGen/RISCV/rvv-intrinsics-autogenerated/zvabd/policy/overloaded/vwabda.c
+195-195clang/test/CodeGen/RISCV/rvv-intrinsics-autogenerated/zvabd/policy/non-overloaded/vwabda.c
+187-187clang/test/CodeGen/RISCV/rvv-intrinsics-autogenerated/zvabd/policy/overloaded/vwabdau.c
+187-187clang/test/CodeGen/RISCV/rvv-intrinsics-autogenerated/zvabd/policy/non-overloaded/vwabdau.c
+102-102clang/test/CodeGen/RISCV/rvv-intrinsics-autogenerated/zvabd/non-policy/overloaded/vwabdau.c
+102-102clang/test/CodeGen/RISCV/rvv-intrinsics-autogenerated/zvabd/non-policy/non-overloaded/vwabdau.c
+968-9682 files not shown
+1,166-1,1668 files

LLVM/project 1a1b1e9llvm/lib/Target/AMDGPU SILoadStoreOptimizer.cpp, llvm/test/CodeGen/AMDGPU merge-tbuffer-gfx9.mir merge-tbuffer-gfx12.mir

[AMDGPU] Gate TBUFFER merging on relaxed OOB mode (#212695)

SILoadStoreOptimizer can combine adjacent TBUFFER accesses into a wider
typed buffer instruction. This changes the granularity of hardware OOB
handling and may affect neighboring components when an access is
partially
out of bounds.

Only allow TBUFFER load/store merging when
`amdgpu.tbuffer.oob.mode` is set to relaxed. Keep the accesses separate
when
the flag is absent, any, or strict to preserve strict OOB semantics.

Reference: https://github.com/llvm/llvm-project/pull/160922
DeltaFile
+189-257llvm/test/CodeGen/AMDGPU/merge-tbuffer-gfx11.mir
+127-175llvm/test/CodeGen/AMDGPU/merge-tbuffer-gfx9.mir
+127-175llvm/test/CodeGen/AMDGPU/merge-tbuffer-gfx12.mir
+127-175llvm/test/CodeGen/AMDGPU/merge-tbuffer-gfx10.mir
+6-0llvm/lib/Target/AMDGPU/SILoadStoreOptimizer.cpp
+576-7825 files