LLVM/project 23b7a13clang/test/CodeGen c-strings.c

[clang][NFC] Remove alignment checks from test/CodeGen/c-strings.c (#196501)

and re-enable it on more targets.

I don't think this test was intended to check for alignment. Those
expectations were added as part of FileCheck-izing the test in
e29dadb6403c8b0d3658f9bbbe2f5fbde5431fdb and we've been working around
them or xfailing the test since.
DeltaFile
+4-26clang/test/CodeGen/c-strings.c
+4-261 files

LLVM/project 8503d7allvm/lib/Analysis AliasAnalysis.cpp, llvm/test/Analysis/BasicAA atomics.ll

Revert "[AA] No synchronization effects for never-escaping identified local (…"

This reverts commit 8a230212a560a60bef18e576ad62b0554158b3b3.
DeltaFile
+22-24llvm/test/Analysis/BasicAA/atomics.ll
+11-28llvm/lib/Analysis/AliasAnalysis.cpp
+8-0llvm/test/Transforms/DeadStoreElimination/fence.ll
+3-3llvm/test/Transforms/LICM/atomics.ll
+2-2llvm/test/Transforms/GVN/fence.ll
+2-0llvm/test/Transforms/GVN/simplify-icf-cache-invalidation.ll
+48-571 files not shown
+49-587 files

LLVM/project 8e9493fclang/lib/CIR/CodeGen CIRGenFunction.cpp

fix Address emission
DeltaFile
+1-1clang/lib/CIR/CodeGen/CIRGenFunction.cpp
+1-11 files

LLVM/project c1084a8llvm/test/Transforms/InstSimplify call.ll

update test
DeltaFile
+3-12llvm/test/Transforms/InstSimplify/call.ll
+3-121 files

LLVM/project a419733llvm/test/Transforms/InstSimplify call.ll

add test
DeltaFile
+81-0llvm/test/Transforms/InstSimplify/call.ll
+81-01 files

LLVM/project b5371acllvm/lib/Analysis InstructionSimplify.cpp

[InstSimplify] Fold fshl/fshr of complementary shifts to identity
DeltaFile
+11-0llvm/lib/Analysis/InstructionSimplify.cpp
+11-01 files

LLVM/project 58936f7utils/bazel/llvm-project-overlay/mlir BUILD.bazel

[Bazel] Fixes ce6605a (#196880)

This fixes ce6605a4931a294bd17b5e56658b701b18d2bcf9.

Co-authored-by: Google Bazel Bot <google-bazel-bot at google.com>
DeltaFile
+5-1utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
+5-11 files

LLVM/project 8a23021llvm/lib/Analysis AliasAnalysis.cpp, llvm/test/Analysis/BasicAA atomics.ll

[AA] No synchronization effects for never-escaping identified local (#193939)

Fences and other synchronizing operations (such as atomic accesses
stronger than monotonic) are modelled as reading and writing all memory,
in order to enforce their implied ordering constraints.

Currently, this happens even for identified function locals that do not
escape. This patch excludes those objects.

Notably, we can *not* reason based on captures-before here, because the
synchronizing operation still has an effect even if the object only
escapes *later*.

The hope here is that with this restriction in place, it may be viable
to respect potential synchronization inside non-nosync function calls.
DeltaFile
+24-22llvm/test/Analysis/BasicAA/atomics.ll
+28-11llvm/lib/Analysis/AliasAnalysis.cpp
+0-8llvm/test/Transforms/DeadStoreElimination/fence.ll
+3-3llvm/test/Transforms/LICM/atomics.ll
+2-2llvm/test/Transforms/GVN/fence.ll
+0-2llvm/test/Transforms/GVN/simplify-icf-cache-invalidation.ll
+57-481 files not shown
+58-497 files

LLVM/project 4ef4f90libc/src/__support/File file.cpp, libc/test/src/__support/File file_test.cpp

[libc] Fix partial multi-byte write detection in File (#196402)

File::write_unlocked(const wchar_t*, size_t) checked 'write_res.value <
1' after writing a converted UTF-8 sequence. For multi-byte characters,
a short platform write (e.g. 2 of 3 bytes for a 3-byte character) passed
this check and was counted as a successful write. The output stream
would then contain an incomplete UTF-8 sequence with no error reported
to the caller.

Changed the check to 'write_res.value < char_size' and set the error
indicator on the stream when it triggers.

Added a regression test using a mock File subclass that limits
platform_write to 2 bytes per call, simulating short writes on pipes and
sockets.

Assisted-by: Automated tooling, human reviewed.

---------

Co-authored-by: Michael Jones <michaelrj at google.com>
DeltaFile
+86-0libc/test/src/__support/File/file_test.cpp
+4-2libc/src/__support/File/file.cpp
+90-22 files

LLVM/project 1a683f6clang-tools-extra/test/clang-tidy/checkers/readability redundant-casting.cpp

[clang-tidy][NFC] Fix tests on 32bit ARM (#196873)

Should fix
https://github.com/llvm/llvm-project/pull/191386#issuecomment-4408294981.
DeltaFile
+1-1clang-tools-extra/test/clang-tidy/checkers/readability/redundant-casting.cpp
+1-11 files

LLVM/project 422678dllvm/lib/Transforms/Scalar LoopFuse.cpp, llvm/test/Transforms/LoopFusion loop_invariant.ll

[LoopFusion] Remove SCEV-based dependence analysis path (#195864)

Loop Fusion has used Dependence Analysis (DA) as the default dependence
check since the option default was flipped in #187309. The SCEV-based
strategy and the combined "all" mode were retained only for fallback and
experimentation, with a comment noting that the SCEV code would be
removed in a follow-up.

This patch removes the SCEV-based dependence path and the now-unused
selector machinery.

Fixes #194821.

Assisted by Cursor.
DeltaFile
+65-199llvm/lib/Transforms/Scalar/LoopFuse.cpp
+1-8llvm/test/Transforms/LoopFusion/loop_invariant.ll
+66-2072 files

LLVM/project eba2d58llvm/test/CodeGen/AArch64 bf16-v8-instructions.ll bf16-instructions.ll, llvm/test/CodeGen/AMDGPU ctlz_zero_poison.ll ctlz_zero_undef.ll

Merge upstream/main into users/mariusz-sikora-at-amd/add-mov-b64-feature
DeltaFile
+4,634-367llvm/test/CodeGen/RISCV/rvv/fixed-vectors-reduction-fp.ll
+3,071-1,257llvm/test/CodeGen/AArch64/bf16-v8-instructions.ll
+2,614-0llvm/test/CodeGen/AMDGPU/ctlz_zero_poison.ll
+0-2,614llvm/test/CodeGen/AMDGPU/ctlz_zero_undef.ll
+1,660-649llvm/test/CodeGen/AArch64/bf16-instructions.ll
+1,440-725llvm/test/CodeGen/AArch64/bf16-v4-instructions.ll
+13,419-5,6122,055 files not shown
+64,172-30,8822,061 files

LLVM/project 54a4861clang/include/clang/CIR MissingFeatures.h, clang/lib/CIR/CodeGen Address.h CIRGenModule.cpp

Fix tests
DeltaFile
+8-5clang/lib/CIR/CodeGen/Address.h
+5-3clang/lib/CIR/CodeGen/CIRGenModule.cpp
+4-1clang/lib/CIR/CodeGen/CIRGenExprCXX.cpp
+1-0clang/include/clang/CIR/MissingFeatures.h
+18-94 files

LLVM/project e9197e8clang/include/clang/CIR/Dialect/Builder CIRBaseBuilder.h, clang/lib/CIR/CodeGen CIRGenFunction.h Address.h

fix fmt and some coding conventions
DeltaFile
+7-8clang/lib/CIR/CodeGen/CIRGenFunction.h
+2-2clang/lib/CIR/CodeGen/Address.h
+1-1clang/lib/CIR/CodeGen/CIRGenDecl.cpp
+1-1clang/lib/CIR/CodeGen/CIRGenExpr.cpp
+1-1clang/include/clang/CIR/Dialect/Builder/CIRBaseBuilder.h
+12-135 files

LLVM/project f62f8d8clang/lib/CIR/CodeGen CIRGenExpr.cpp Address.h, clang/test/CIR/CodeGen amdgpu-stack-alloca-array-decay.cpp

[CIR][CIRGen] Cast stack allocas to the language-visible address space
DeltaFile
+45-20clang/lib/CIR/CodeGen/CIRGenExpr.cpp
+42-0clang/test/CIR/CodeGen/amdgpu-stack-alloca-array-decay.cpp
+14-0clang/lib/CIR/CodeGen/Address.h
+7-6clang/lib/CIR/CodeGen/CIRGenFunction.cpp
+12-0clang/lib/CIR/CodeGen/CIRGenFunction.h
+5-4clang/lib/CIR/CodeGen/CIRGenDecl.cpp
+125-303 files not shown
+134-349 files

LLVM/project ed50ea5llvm/lib/IR LLVMContextImpl.h

[DebugInfo] Pack DILocation hash inputs (#196556)

Pack DILocation fields before hashing. Now that column is 16-bits
Line/Column/ImplicitCode fit in one 64-bit value (32 + 16 + 1 = 49 bits)
and AtomGroup and AtomRank also fit cleanly in one 64-bit value (61 + 3
= 64 bits).

Fewer hash_combine inputs on the hot DILocation path is a small
compile-time improvement.

CTMark geomean:
- stage1-ReleaseLTO-g: -0.10%
- stage1-O0-g: -0.23%
- stage1-aarch64-O0-g: -0.19%
- stage2-O0-g: -0.07%

https://llvm-compile-time-tracker.com/compare.php?from=71fef6d5a306d1adf8bf7d30d2fe9e286380fecf&to=1d80b5f5aa98561d2ba09adc3f20c3eacd24cb88&stat=instructions%3Au

Assisted-by: codex
DeltaFile
+5-3llvm/lib/IR/LLVMContextImpl.h
+5-31 files

LLVM/project f16e1b3llvm/include/llvm/CodeGen/GlobalISel CombinerHelper.h, llvm/lib/CodeGen/GlobalISel CombinerHelper.cpp

[GlobalISel] Avoid repeated target info queries in combiners (#196530)

tryCombineAllImpl queries target info for every instruction. Cache
TargetInstrInfo/TargetRegisterInfo/RegisterBankInfo in CombinerHelper
and pass to executeMatchTable instead.

This avoids repeated virtual calls on the combiner executeMatchTable
path.

CTMark -0.08% geomean improvement on aarch64-O0-g.

https://llvm-compile-time-tracker.com/compare.php?from=71fef6d5a306d1adf8bf7d30d2fe9e286380fecf&to=13bc49510657450402c066098e3a4b7d1af9d0e6&stat=instructions%3Au

Assisted-by: codex
DeltaFile
+8-0llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h
+2-3llvm/utils/TableGen/GlobalISelCombinerEmitter.cpp
+1-2llvm/test/TableGen/GlobalISelCombinerEmitter/match-table.td
+1-0llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
+12-54 files

LLVM/project a7e4e25llvm/include/llvm/CodeGen/GlobalISel GIMatchTableExecutorImpl.h, llvm/test/TableGen/GlobalISelCombinerEmitter match-table.td

[GlobalISel] Delay match table builder initialization (#196506)

MachineIRBuilder::setInstrAndDebugLoc is expensive, delay until needed.

CTMark -0.10% geomean improvement on aarch64-O0-g.

https://llvm-compile-time-tracker.com/compare.php?from=71fef6d5a306d1adf8bf7d30d2fe9e286380fecf&to=8a87845dfde9de9d141b42d2fce92fcf3be02276&stat=instructions%3Au

Assisted-by: codex
DeltaFile
+12-0llvm/include/llvm/CodeGen/GlobalISel/GIMatchTableExecutorImpl.h
+0-1llvm/test/TableGen/GlobalISelCombinerEmitter/match-table.td
+0-1llvm/utils/TableGen/GlobalISelCombinerEmitter.cpp
+12-23 files

LLVM/project 5c7854clibc/src/stdlib environ_internal.cpp setenv.h, libc/src/stdlib/linux setenv.cpp CMakeLists.txt

[libc][stdlib] Add setenv (#163018)

Add the POSIX setenv() function, with EnvironmentManager::set()
handling environment array management and ownership tracking.

Registered for x86_64, aarch64, and riscv architectures. Integration
tests cover overwrite/no-overwrite semantics, empty/invalid names,
empty values, and repeated replacement.

Assisted-by: Automated tooling, human reviewed.

---------

Co-authored-by: Michael Jones <michaelrj at google.com>
DeltaFile
+175-0libc/test/integration/src/stdlib/setenv_test.cpp
+50-0libc/src/stdlib/environ_internal.cpp
+48-0libc/src/stdlib/linux/setenv.cpp
+25-0libc/src/stdlib/setenv.h
+15-0libc/src/stdlib/linux/CMakeLists.txt
+12-0libc/test/integration/src/stdlib/CMakeLists.txt
+325-06 files not shown
+351-012 files

LLVM/project cbc6e86clang/lib/AST/ByteCode Interp.h Compiler.cpp, clang/test/AST/ByteCode cxx14.cpp

[clang][bytecode] Allow const mutation in all variable initializers (#195794)

So the attached test case works even though it's just an `InitListExpr`.
DeltaFile
+12-0clang/test/AST/ByteCode/cxx14.cpp
+11-0clang/lib/AST/ByteCode/Interp.h
+6-0clang/lib/AST/ByteCode/Compiler.cpp
+4-0clang/lib/AST/ByteCode/Opcodes.td
+33-04 files

LLVM/project ce6605amlir/include/mlir/Dialect/LLVMIR NVVMOps.td NVVMDialect.td

[MLIR][NVVM][NFC] Restructure NVVM dialect (#195811)

Moves the declarations of the NVVM dialect and some widely used enums
(`FPRoundingModeAttr` and `SaturationModeAttr`) to separate files to make
them easier to maintain and also use in the NVGPU dialect.
DeltaFile
+7-136mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td
+94-0mlir/include/mlir/Dialect/LLVMIR/NVVMDialect.td
+72-0mlir/include/mlir/Dialect/LLVMIR/NVVMEnums.td
+173-1363 files

LLVM/project 5a03b84llvm/lib/Target/AArch64 AArch64TargetTransformInfo.cpp, llvm/test/Analysis/CostModel/AArch64 ctpop.ll sve-ctpop.ll

[AArch64][CostModel] Model sve costs for ctpop (#192428)

Targets supporting sve prefer sve for ctpop with fixed length vectors.
Update cost model to reflect the same.
DeltaFile
+146-41llvm/test/Analysis/CostModel/AArch64/ctpop.ll
+38-0llvm/test/Analysis/CostModel/AArch64/sve-ctpop.ll
+14-3llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
+198-443 files

LLVM/project b84d09fclang/include/clang/CIR MissingFeatures.h, clang/lib/CIR/CodeGen CIRGenModule.cpp

ROllback to TODO for AArch64 Function Multi Versioning
DeltaFile
+0-35clang/test/CIR/Lowering/fmv-features.cir
+2-26clang/lib/CIR/CodeGen/CIRGenModule.cpp
+1-0clang/include/clang/CIR/MissingFeatures.h
+3-613 files

LLVM/project 907d9c7clang/lib/CIR/CodeGen CIRGenModule.cpp, clang/test/CIR/Lowering fmv-features.cir

use interleaveComma and features.reserve
DeltaFile
+35-0clang/test/CIR/Lowering/fmv-features.cir
+6-3clang/lib/CIR/CodeGen/CIRGenModule.cpp
+41-32 files

LLVM/project e7a6a39clang/include/clang/CIR MissingFeatures.h, clang/lib/CIR/CodeGen CIRGenModule.cpp

[CIR] Implement function target/tune attrs and FMV metadata.
DeltaFile
+244-0clang/test/CIR/CodeGen/attr-target-aarch64.c
+186-0clang/test/CIR/CodeGen/attr-target-x86.c
+74-0clang/test/CIR/CodeGenHIP/attr-target-amdgpu.hip
+66-3clang/lib/CIR/CodeGen/CIRGenModule.cpp
+0-1clang/include/clang/CIR/MissingFeatures.h
+570-45 files

LLVM/project 805e38cclang/include/clang/CIR MissingFeatures.h, clang/lib/CIR/CodeGen Address.h CIRGenModule.cpp

Fix tests
DeltaFile
+8-5clang/lib/CIR/CodeGen/Address.h
+5-3clang/lib/CIR/CodeGen/CIRGenModule.cpp
+4-1clang/lib/CIR/CodeGen/CIRGenExprCXX.cpp
+1-0clang/include/clang/CIR/MissingFeatures.h
+18-94 files

LLVM/project 1bcdc4bclang/lib/Interpreter IncrementalParser.h, clang/tools/libclang CIndexDiagnostic.cpp

[NFC] Fix C++23 build failures caused by incomplete types (#196814)
DeltaFile
+6-0llvm/lib/Target/BPF/BPFAsmPrinter.cpp
+6-0llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
+1-4clang/lib/Interpreter/IncrementalParser.h
+2-2llvm/lib/Target/BPF/BPFAsmPrinter.h
+2-1llvm/utils/TableGen/Common/GlobalISel/GlobalISelMatchTable.h
+3-0clang/tools/libclang/CIndexDiagnostic.cpp
+20-72 files not shown
+24-98 files

LLVM/project 21c75f0llvm/lib/Transforms/InstCombine InstCombinePHI.cpp

[InstCombine][NFC] Change the order of checks in SliceUpIllegalIntegerPHI for faster compile time. (#183726)

SliceUpIllegalIntegerPHI searches for PHIs that have illegal type and
are only used by trunc or trunc(lshr) operations. It bails out if
encounters invoke or EH pad instructions.
It first checks whether it encounters invoke or EH pad, which is time
consuming as it checks every instruction. Then it checks whether it is
used by trunc or trunc(lshr). The former check is generally loose, while
the latter one is stricter. Switch the order of the checks will speed up
compilation.

Signed-off-by: XinlongZHANG-Bob <zhangxinlong.bob at bytedance.com>
DeltaFile
+28-26llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp
+28-261 files

LLVM/project dccd300llvm/test/Transforms/LoopVectorize consecutive-ptr-uniforms.ll

[LV][NFC] Reshape pointer_iv_non_uniform_0 test to use distinct loads (#196494)

The followup [patch](https://github.com/llvm/llvm-project/pull/196080)
is folding some of the idempotent binary ops This test has `sub x - x`
operation which is affected by the followup patch. This patch is making
the test immune to the fold.
DeltaFile
+5-5llvm/test/Transforms/LoopVectorize/consecutive-ptr-uniforms.ll
+5-51 files

LLVM/project 07aad88clang/include/clang/CIR/Dialect/Builder CIRBaseBuilder.h, clang/lib/CIR/CodeGen CIRGenFunction.h Address.h

fix fmt and some coding conventions
DeltaFile
+7-8clang/lib/CIR/CodeGen/CIRGenFunction.h
+2-2clang/lib/CIR/CodeGen/Address.h
+1-1clang/lib/CIR/CodeGen/CIRGenDecl.cpp
+1-1clang/lib/CIR/CodeGen/CIRGenExpr.cpp
+1-1clang/include/clang/CIR/Dialect/Builder/CIRBaseBuilder.h
+12-135 files