LLVM/project d43b360llvm/lib/Transforms/Vectorize SLPVectorizer.cpp, llvm/test/Transforms/SLPVectorizer/X86 reduced-value-replace-extractelement-cost.ll

[SLP] Fix reduction cost crash for reduced values replaced by extractelement

A reduced value may be replaced by an extractelement while vectorizing a
previous subvector, so it is no longer a key in ReducedValsToOps.
Look through replaced values to the reduction operation among their users.

Fixes #204814

Reviewers: 

Pull Request: https://github.com/llvm/llvm-project/pull/204847
DeltaFile
+61-0llvm/test/Transforms/SLPVectorizer/X86/reduced-value-replace-extractelement-cost.ll
+15-2llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+76-22 files

LLVM/project 1eb9056llvm/test/MC/AMDGPU gfx13_asm_vop3_dpp16.s

[AMDGPU][NFC] Templatise and roundtrip gfx13_asm_vop3_dpp16.s

Again, this is based on the templatised version of
gfx12_asm_vop3_dpp16.s with the GFX13-specific changes re-applied
on top of it.

gfx13_dasm_vop3_dpp16.txt was never upstreamed, so no changes for
the disassembler side.
DeltaFile
+12,991-3,310llvm/test/MC/AMDGPU/gfx13_asm_vop3_dpp16.s
+12,991-3,3101 files

LLVM/project fd6a30blibcxx/test/libcxx/gdb gdb_pretty_printer_test.sh.cpp, libcxx/utils/gdb/libcxx printers.py

[libcxx] Make std::pair pretty-printer ABI-independent (#201768)

std::pair is printed explicitly instead of relying on GDB's default
struct formatting to keep output stable across ABI configurations.

With _LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR (default on
some platforms, e.g. FreeBSD), std::pair gains an empty
__non_trivially_copyable_base base class. GDB would otherwise render
this as <...__non_trivially_copyable_base<...>> = {<No data fields>},
which makes output ABI-dependent.

Only first and second are meaningful, so print them directly.
DeltaFile
+15-0libcxx/utils/gdb/libcxx/printers.py
+13-0libcxx/test/libcxx/gdb/gdb_pretty_printer_test.sh.cpp
+28-02 files

LLVM/project 28c99aelibcxx/include regex, libcxx/test/std/re/re.traits transform_primary.pass.cpp

Fix __transform_primary in FreeBSD

FreeBSD's strxfrm() encodes collation weights one level at a time,
separating the primary, secondary, and tertiary with '.' bytes. Since
primary equivalence only depends on the primary collation weight, ignore
everything after the first separator when constructing the transformed
key.

This patch the intended behavior of primary equivalence and avoids
relying on glibc's fixed-size collation-key representation.
DeltaFile
+23-0libcxx/include/regex
+0-1libcxx/test/std/re/re.traits/transform_primary.pass.cpp
+23-12 files

LLVM/project 29692c1libc/src/libgen dirname.cpp basename.cpp, libc/test/src/libgen dirname_test.cpp basename_test.cpp

[libc] Implement basename and dirname in libgen.h (#204554)

Added the POSIX standard functions basename and dirname under a new
libgen.h header. The implementations modify the input path in-place
using cpp::string_view to determine boundaries safely.

Added find_last_not_of to cpp::string_view to support trailing slash
removal.

Implemented:
* libc/include/libgen.yaml, libgen.h.def: Public API definitions.
* libc/src/libgen/basename.cpp, dirname.cpp: Generic implementations.
* libc/test/src/libgen/: Unit and hermetic tests.

Registered the new entrypoints for all active Linux targets (x86_64,
aarch64, arm, riscv) and added docgen configuration.

Assisted-by: Automated tooling, human reviewed.
DeltaFile
+74-0libc/test/src/libgen/dirname_test.cpp
+62-0libc/test/src/libgen/basename_test.cpp
+48-0libc/src/libgen/dirname.cpp
+43-0libc/test/src/libgen/CMakeLists.txt
+42-0libc/src/libgen/basename.cpp
+30-0libc/src/libgen/dirname.h
+299-016 files not shown
+458-022 files

LLVM/project 0f2f6b2libc/src/stdlib qsort_util.h

Address comment that was missed
DeltaFile
+2-2libc/src/stdlib/qsort_util.h
+2-21 files

LLVM/project 22dce64llvm/lib/Target/AMDGPU SIInstrInfo.cpp SIInstrInfo.h

[AMDGPU] Remove some functions unused since #105645. NFC. (#204844)
DeltaFile
+0-159llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
+0-18llvm/lib/Target/AMDGPU/SIInstrInfo.h
+0-1772 files

LLVM/project 646a1b5libc/test/src/stdlib QsortReentrantTest.h

Address comments and add some code comments
DeltaFile
+17-11libc/test/src/stdlib/QsortReentrantTest.h
+17-111 files

LLVM/project 467a5feclang/lib/Analysis/FlowSensitive FormulaSerialization.cpp, clang/lib/CodeGen CGHLSLRuntime.cpp

[clang] Avoid premature Twine .str() materialization (#204830)

Several call sites pass `expr.str()` to parameters of type `const
llvm::Twine &`, forcing a throwaway heap std::string that is immediately
rewrapped into a Twine. Drop the `.str()` and let Twine accept the
StringRef/concatenation directly.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply at anthropic.com>
DeltaFile
+4-4clang/lib/CodeGen/CGHLSLRuntime.cpp
+2-3clang/lib/Analysis/FlowSensitive/FormulaSerialization.cpp
+2-2clang/lib/Driver/Driver.cpp
+1-2clang/lib/Parse/ParseOpenMP.cpp
+1-1clang/lib/Format/Format.cpp
+1-1clang/lib/Driver/ToolChains/Clang.cpp
+11-133 files not shown
+14-169 files

LLVM/project 87a2cd9llvm/test/CodeGen/AMDGPU vector-reduce-umin.ll integer-mad-patterns.ll, llvm/test/CodeGen/AMDGPU/GlobalISel fdiv.f32.ll

AMDGPU/GlobalISel: Remove -new-reg-bank-select option

AMDGPU's -global-isel pipeline that uses AMDGPURegBankSelect and
AMDGPURegBankLegalize, previously -global-isel -new-reg-bank-select,
is now the default -global-isel pipeline.

Remove -new-reg-bank-select option from the compiler.
Remove -new-reg-bank-select from all llvm regression tests.
Edit a couple comments to reference RegBankLegalize instead of
-new-reg-bank-select.
DeltaFile
+12-12llvm/test/CodeGen/AMDGPU/vector-reduce-umin.ll
+12-12llvm/test/CodeGen/AMDGPU/integer-mad-patterns.ll
+12-12llvm/test/CodeGen/AMDGPU/vector-reduce-umax.ll
+12-12llvm/test/CodeGen/AMDGPU/GlobalISel/fdiv.f32.ll
+12-12llvm/test/CodeGen/AMDGPU/vector-reduce-smax.ll
+11-11llvm/test/CodeGen/AMDGPU/llvm.amdgcn.wave.shuffle.ll
+71-71891 files not shown
+2,531-2,539897 files

LLVM/project 5bb3690llvm/lib/Target/AMDGPU/AsmParser AMDGPUAsmParser.cpp, llvm/lib/Target/SPIRV SPIRVCommandLine.cpp

[llvm][Target] Avoid premature Twine .str() materialization (#204836)

Call sites in the AMDGPU and SPIRV parsers and the SystemZ AsmPrinter /
InstrInfo pass `expr.str()` (or `.str().c_str()`) to parameters of type
`const llvm::Twine &`, forcing a throwaway heap std::string that is
immediately rewrapped into a Twine. Drop the materialization and let
Twine accept the concatenation directly.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply at anthropic.com>
DeltaFile
+7-8llvm/lib/Target/SystemZ/SystemZAsmPrinter.cpp
+2-4llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp
+3-2llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
+2-2llvm/lib/Target/SPIRV/SPIRVCommandLine.cpp
+14-164 files

LLVM/project 7b79470clang/include/clang/Options Options.td, clang/lib/Driver/ToolChains Clang.cpp

address comments
DeltaFile
+3-3clang/include/clang/Options/Options.td
+1-1clang/lib/Driver/ToolChains/Clang.cpp
+4-42 files

LLVM/project 41b2fb2clang/docs LanguageExtensions.rst, clang/include/clang/Options Options.td

Enable driver changes for fexec-charset
DeltaFile
+14-6clang/lib/Driver/ToolChains/Clang.cpp
+14-4clang/include/clang/Options/Options.td
+11-3clang/test/Driver/clang_f_opts.c
+10-0llvm/lib/Support/TextEncoding.cpp
+4-3clang/test/Driver/cl-options.c
+3-3clang/docs/LanguageExtensions.rst
+56-193 files not shown
+60-199 files

LLVM/project adc342bclang/lib/AST ASTContext.cpp, clang/lib/Lex TextEncoding.cpp

Convert the key before cache lookup to prevent encoding differences
DeltaFile
+9-9clang/lib/AST/ASTContext.cpp
+1-1clang/lib/Lex/TextEncoding.cpp
+10-102 files

LLVM/project 5288c12clang/include/clang/Basic TargetInfo.h, clang/lib/AST ASTContext.cpp

convert to exec-charset inside getPredefinedStringLiteralFromCache, test __builtin_FILE()
DeltaFile
+10-0clang/lib/AST/ASTContext.cpp
+4-0clang/test/CodeGen/systemz-charset.cpp
+3-0clang/lib/Basic/TargetInfo.cpp
+2-1clang/lib/Lex/TextEncoding.cpp
+2-0clang/include/clang/Basic/TargetInfo.h
+21-15 files

LLVM/project 669d4d6clang/lib/Lex TextEncoding.cpp, clang/lib/Sema SemaChecking.cpp

do not convert character by character
DeltaFile
+6-4clang/lib/Sema/SemaChecking.cpp
+1-1clang/lib/Lex/TextEncoding.cpp
+7-52 files

LLVM/project 50b34fdclang/include/clang/Lex TextEncoding.h, clang/lib/Lex TextEncoding.cpp

fix CI
DeltaFile
+2-2clang/lib/Lex/TextEncoding.cpp
+1-0clang/include/clang/Lex/TextEncoding.h
+3-22 files

LLVM/project 37f6827clang/lib/AST PrintfFormatString.cpp FormatString.cpp, clang/lib/Sema SemaChecking.cpp

Add format string handling
DeltaFile
+58-31clang/lib/AST/PrintfFormatString.cpp
+46-40clang/lib/AST/FormatString.cpp
+33-21clang/lib/Sema/SemaChecking.cpp
+25-11clang/lib/AST/FormatStringParsing.h
+15-8clang/lib/AST/ScanfFormatString.cpp
+19-0llvm/lib/Support/TextEncoding.cpp
+196-1117 files not shown
+233-12013 files

LLVM/project 5b71164clang/include/clang/AST Expr.h, clang/include/clang/Sema Sema.h

fix CI
DeltaFile
+15-0clang/lib/AST/Expr.cpp
+6-0clang/include/clang/AST/Expr.h
+3-2clang/lib/Sema/SemaExpr.cpp
+2-2clang/include/clang/Sema/Sema.h
+1-1clang/lib/Parse/Parser.cpp
+0-1clang/lib/Parse/ParseDecl.cpp
+27-66 files

LLVM/project 8cd93a5clang/test/CodeGen systemz-charset.c

fix CI
DeltaFile
+2-0clang/test/CodeGen/systemz-charset.c
+2-01 files

LLVM/project e71999cclang/include/clang/Sema Sema.h

Remove old include
DeltaFile
+0-1clang/include/clang/Sema/Sema.h
+0-11 files

LLVM/project 6e3ddcaclang/include/clang/Sema Sema.h, clang/lib/Parse ParseDecl.cpp ParseExpr.cpp

add ParserConversionAction, do not translate unevaluated strings
DeltaFile
+6-6clang/lib/Sema/SemaExpr.cpp
+10-0clang/lib/Parse/ParseDecl.cpp
+8-0clang/test/CodeGen/systemz-charset-diag.cpp
+3-3clang/lib/Parse/ParseExpr.cpp
+5-0clang/test/CodeGen/systemz-charset.c
+3-1clang/include/clang/Sema/Sema.h
+35-103 files not shown
+42-109 files

LLVM/project 1601764clang/include/clang/Sema Sema.h

Fix build failure
DeltaFile
+1-0clang/include/clang/Sema/Sema.h
+1-01 files

LLVM/project 27a8c84clang/lib/Frontend FrontendAction.cpp

remove change in ReadOriginalFileName, since we have another PR to change it to an unevaluated string
DeltaFile
+1-3clang/lib/Frontend/FrontendAction.cpp
+1-31 files

LLVM/project 43d8b33clang/include/clang/Basic LangOptions.h, clang/include/clang/Lex TextEncoding.h

use LiteralEncoding internally, address other comments
DeltaFile
+8-8clang/lib/Lex/TextEncoding.cpp
+6-6clang/lib/Frontend/InitPreprocessor.cpp
+10-0clang/test/CodeGen/systemz-charset.c
+4-4clang/include/clang/Lex/TextEncoding.h
+2-2clang/include/clang/Options/Options.td
+2-2clang/include/clang/Basic/LangOptions.h
+32-225 files not shown
+37-2711 files

LLVM/project f3d5d18clang/lib/Lex LiteralSupport.cpp, clang/test/CodeGen systemz-charset.cpp

remove extra conversion from utf32 to utf8 in CharLiteralParser
DeltaFile
+19-16clang/lib/Lex/LiteralSupport.cpp
+1-0clang/test/CodeGen/systemz-charset.cpp
+20-162 files

LLVM/project ceae0cbclang/include/clang/Basic TargetInfo.h, clang/include/clang/Lex TextEncodingConfig.h

Move function to TargetInfo, remove unused includes
DeltaFile
+7-0clang/include/clang/Basic/TargetInfo.h
+0-7llvm/lib/TargetParser/Triple.cpp
+2-3clang/lib/Frontend/InitPreprocessor.cpp
+0-4llvm/include/llvm/TargetParser/Triple.h
+0-3clang/include/clang/Lex/TextEncodingConfig.h
+9-175 files

LLVM/project 3c6a5e9clang/include/clang/Lex LiteralSupport.h, clang/lib/Lex TextEncoding.cpp

change default of StringLiteralParser to NoConversion instead of CA_ToExecEncoding
DeltaFile
+2-1clang/lib/Sema/SemaExpr.cpp
+1-1clang/lib/Lex/TextEncoding.cpp
+1-1clang/include/clang/Lex/LiteralSupport.h
+4-33 files

LLVM/project f178adbclang/include/clang/Lex TextEncodingConfig.h LiteralSupport.h, clang/lib/Lex LiteralSupport.cpp TextEncodingConfig.cpp

This patch enables the fexec-charset option to control the execution charset of string literals. It sets the default internal charset, system charset, and execution charset for z/OS and UTF-8 for all other platforms.
DeltaFile
+139-31clang/lib/Lex/LiteralSupport.cpp
+70-0clang/test/CodeGen/systemz-charset.cpp
+58-0clang/test/CodeGen/systemz-charset.c
+45-0clang/lib/Lex/TextEncodingConfig.cpp
+34-0clang/include/clang/Lex/TextEncodingConfig.h
+12-7clang/include/clang/Lex/LiteralSupport.h
+358-3813 files not shown
+409-4519 files

LLVM/project 1b11e7bclang/include/clang/Lex TextEncodingConfig.h TextEncoding.h, clang/lib/Frontend InitPreprocessor.cpp

rename TextEncodingConfig to TextEncoding, address other comments
DeltaFile
+0-45clang/lib/Lex/TextEncodingConfig.cpp
+43-0clang/lib/Lex/TextEncoding.cpp
+0-31clang/include/clang/Lex/TextEncodingConfig.h
+30-0clang/include/clang/Lex/TextEncoding.h
+6-6clang/lib/Frontend/InitPreprocessor.cpp
+6-6clang/lib/Lex/LiteralSupport.cpp
+85-887 files not shown
+100-10513 files