LLVM/project 51f178dclang/lib/StaticAnalyzer/Checkers MallocChecker.cpp, clang/test/Analysis NewDelete-atomics.cpp

[analyzer] MallocChecker: Recognize std::atomics in smart pointer suppression. (#90918)

Fixes #90498.

Same as 5337efc69cdd5 for atomic builtins, but for `std::atomic` this
time. This is useful because even though the actual builtin atomic is
still there, it may be buried beyond the inlining depth limit.

Also add one popular custom smart pointer class name to the name-based
heuristics, which isn't necessary to fix the bug but arguably a good
idea regardless.
DeltaFile
+109-9clang/test/Analysis/NewDelete-atomics.cpp
+15-4clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
+7-0clang/test/Analysis/Inputs/system-header-simulator-cxx.h
+131-133 files

LLVM/project 73a0144bolt/test/X86 jump-table-fixed-ref-pic.test, bolt/test/X86/Inputs jump-table-fixed-ref-pic.s

[BOLT] Add test case for PIC fixed indirect jump (#91547)

A compiler can generate a redundant indirection for a jump via a fixed
jump table target. Add a test case that covers such pattern that covers
PIC case. We already have non-PIC case detection.

Currently XFAIL.
DeltaFile
+35-0bolt/test/X86/Inputs/jump-table-fixed-ref-pic.s
+9-0bolt/test/X86/jump-table-fixed-ref-pic.test
+44-02 files

LLVM/project 62b5b61clang/lib/Sema SemaLookup.cpp SemaTemplate.cpp, clang/test/CXX/temp/temp.res/temp.dep/temp.dep.type p4.cpp

[Clang][Sema] Fix lookup of dependent operator= outside of complete-class contexts (#91498)

Fixes a crash caused by #90152.
DeltaFile
+20-15clang/lib/Sema/SemaLookup.cpp
+13-0clang/test/CXX/temp/temp.res/temp.dep/temp.dep.type/p4.cpp
+2-5clang/lib/Sema/SemaTemplate.cpp
+35-203 files

LLVM/project ba5170fllvm/test/Transforms/InstCombine lshr.ll

[InstCombine] Thwart complexity-based canonicalization in shl-add test (NFC) (#91413)

Fixed test for #88193
DeltaFile
+4-2llvm/test/Transforms/InstCombine/lshr.ll
+4-21 files

LLVM/project 409ff97llvm/lib/Transforms/InstCombine InstCombineShifts.cpp

[InstCombine] Fix comment from #88193 (NFC) (#91427)

It is inaccurate and needs to be corrected.
DeltaFile
+2-2llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp
+2-21 files

LLVM/project 1aaab33llvm/lib/TargetParser RISCVISAInfo.cpp

[RISCV] Don't use std::vector<std::string> for split extensions in RISCVISAInfo::parseArchString. NFC (#91538)

We can use a SmallVector<StringRef>.

Adjust the code so we check for empty strings in the loop instead of
making a copy of the vector returned from StringRef::split.

This overlaps with #91532 which also removed the std::vector, but
that PR may be more controversial.
DeltaFile
+18-31llvm/lib/TargetParser/RISCVISAInfo.cpp
+18-311 files

LLVM/project 96568f3llvm/docs LangRef.rst, llvm/include/llvm/Transforms/Instrumentation PGOCtxProfLowering.h

[llvm][ctx_profile] Add instrumentation lowering (#90821)

This adds the instrumentation lowering pass.

(Tracking Issue: #89287, RFC referenced there)
DeltaFile
+326-0llvm/lib/Transforms/Instrumentation/PGOCtxProfLowering.cpp
+229-0llvm/test/Transforms/PGOProfile/ctx-instrumentation.ll
+43-5llvm/docs/LangRef.rst
+17-0llvm/test/Transforms/PGOProfile/ctx-instrumentation-invalid-roots.ll
+4-1llvm/include/llvm/Transforms/Instrumentation/PGOCtxProfLowering.h
+5-0llvm/lib/Passes/PassBuilderPipelines.cpp
+624-62 files not shown
+626-68 files

LLVM/project 1710c8cflang/lib/Lower Bridge.cpp, flang/test/Lower/HLFIR custom-intrinsic.f90 binary-ops.f90

[flang] Lowering changes for assigning dummy_scope to hlfir.declare. (#90989)

The lowering produces fir.dummy_scope operation if the current
function has dummy arguments. Each hlfir.declare generated
for a dummy argument is then using the result of fir.dummy_scope
as its dummy_scope operand. This is only done for HLFIR.

I was not able to find a reliable way to identify dummy symbols
in `genDeclareSymbol`, so I added a set of registered dummy symbols
that is alive during the variables instantiation for the current
function. The set is initialized during the mapping of the dummy
argument symbols to their MLIR values. It is reset right after
all variables are instantiated - this is done to avoid generating
hlfir.declare operations with dummy_scope for the clones of
the dummy symbols (e.g. this happens with OpenMP privatization).

If this can be done in a cleaner way, please advise.
DeltaFile
+52-51flang/test/Lower/HLFIR/custom-intrinsic.f90
+42-42flang/test/Lower/HLFIR/binary-ops.f90
+62-11flang/lib/Lower/Bridge.cpp
+23-23flang/test/Lower/HLFIR/assignment-intrinsics.f90
+21-21flang/test/Lower/HLFIR/designators.f90
+21-21flang/test/Lower/OpenMP/parallel-firstprivate-clause-scalar.f90
+221-169131 files not shown
+806-696137 files

LLVM/project 36d8b37llvm/test/CodeGen/RISCV imm.ll, llvm/test/CodeGen/RISCV/rv64-legal-i32 imm.ll

[RISCV] Add another missed Zbs constant materialization test. NFC

This can be LI+BCLRI+BCLRI.
DeltaFile
+67-0llvm/test/CodeGen/RISCV/imm.ll
+43-0llvm/test/CodeGen/RISCV/rv64-legal-i32/imm.ll
+110-02 files

LLVM/project c0b5a96llvm/test/CodeGen/RISCV imm.ll, llvm/test/CodeGen/RISCV/rv64-legal-i32 imm.ll

[RISCV] Add tests where we could use Zbs instructions in constant materialization. NFC
DeltaFile
+137-0llvm/test/CodeGen/RISCV/rv64-legal-i32/imm.ll
+116-0llvm/test/CodeGen/RISCV/imm.ll
+253-02 files

LLVM/project 2fb3774llvm/lib/Transforms/Vectorize SLPVectorizer.cpp, llvm/test/Transforms/SLPVectorizer/AArch64 gather-with-minbith-user.ll user-node-not-in-bitwidths.ll

Revert "[SLP]Fix PR91467: Look through scalar cast, when trying to cast to another type."

This reverts commit 2475efa91d8b4fa8f1a2d16052cb6d14be7d5dc6.

Causes crashes, see comments on https://github.com/llvm/llvm-project/commit/2475efa91d8b4fa8f1a2d16052cb6d14be7d5dc6.
DeltaFile
+8-1llvm/test/Transforms/SLPVectorizer/AArch64/gather-with-minbith-user.ll
+6-1llvm/test/Transforms/SLPVectorizer/AArch64/user-node-not-in-bitwidths.ll
+1-5llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+2-1llvm/test/Transforms/SLPVectorizer/SystemZ/minbitwidth-root-trunc.ll
+17-84 files

LLVM/project 99052c4llvm/unittests/IR DebugInfoTest.cpp

[gardening][DebugInfo][NFC] Improve comment on HashingDISubprogram test (#91543)

DeltaFile
+3-2llvm/unittests/IR/DebugInfoTest.cpp
+3-21 files

LLVM/project 64f4cebllvm/include/llvm/IR Instructions.h, llvm/lib/IR ProfDataUtils.cpp Instructions.cpp

[Inline][PGO] After inline, update InvokeInst profile counts in caller and cloned callee (#83809)

A related change is https://reviews.llvm.org/D133121, which correctly
preserves both branch weights and value profiles for invoke instruction.
* If the branch weight of the `invokeinst` specifies taken / not-taken branches, there is no scale.
DeltaFile
+28-10llvm/test/Transforms/Inline/update_invoke_prof.ll
+20-0llvm/lib/IR/ProfDataUtils.cpp
+12-0llvm/lib/IR/Instructions.cpp
+9-2llvm/lib/Transforms/Utils/InlineFunction.cpp
+3-0llvm/include/llvm/IR/Instructions.h
+72-125 files

LLVM/project 1610eaallvm/include/llvm/ProfileData MemProf.h

[memprof] Make Version2 officially available (#91541)

DeltaFile
+1-1llvm/include/llvm/ProfileData/MemProf.h
+1-11 files

LLVM/project 7ec8a33lldb/include/lldb/Symbol SymbolContext.h, lldb/source/Breakpoint BreakpointLocation.cpp

[lldb] Display breakpoint locations using display name (#90297)

Adds a `show_function_display_name` parameter to
`SymbolContext::DumpStopContext`. This
parameter defaults to false, but `BreakpointLocation::GetDescription`
sets it to true.

This is NFC in mainline lldb, and will be used to modify how Swift
breakpoint locations are printed.
DeltaFile
+11-2lldb/source/Symbol/SymbolContext.cpp
+3-2lldb/source/Core/Address.cpp
+1-1lldb/source/Breakpoint/BreakpointLocation.cpp
+1-0lldb/include/lldb/Symbol/SymbolContext.h
+16-54 files

LLVM/project e37bd6clibc/hdr fenv_macros.h

[libc][fenv] Add missing FE_* definitions for some environment. (#91519)

DeltaFile
+41-0libc/hdr/fenv_macros.h
+41-01 files

LLVM/project 2bbd468llvm/include/llvm/ProfileData InstrProf.h, llvm/lib/ProfileData InstrProf.cpp

clang-format
DeltaFile
+4-3llvm/lib/ProfileData/InstrProf.cpp
+3-3llvm/include/llvm/ProfileData/InstrProf.h
+7-62 files

LLVM/project fcf945fllvm/lib/CodeGen/SelectionDAG DAGCombiner.cpp, llvm/test/CodeGen/AArch64 addimm-mulimm.ll

[DAG] Fold add(mul(add(A, CA), CM), CB) -> add(mul(A, CM), CM*CA+CB) (#90860)

This is useful when the inner add has multiple uses, and so cannot be
canonicalized by pushing the constants down through the mul. This patch
adds patterns for both `add(mul(add(A, CA), CM), CB)` and with an extra add
`add(add(mul(add(A, CA), CM), B) CB)` as the second can come up when
lowering geps.
DeltaFile
+31-36llvm/test/CodeGen/AArch64/addimm-mulimm.ll
+60-0llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+91-362 files

LLVM/project 965f3callvm/include/llvm/Target/GlobalISel Combine.td, llvm/test/CodeGen/AArch64/GlobalISel combine-bitreverse-shift.ll

[GISel] Fold bitreverse(shl/srl(bitreverse(x),y)) -> srl/shl(x,y) (#91355)

Sibling patch to #89897
DeltaFile
+34-98llvm/test/CodeGen/AArch64/GlobalISel/combine-bitreverse-shift.ll
+25-1llvm/include/llvm/Target/GlobalISel/Combine.td
+59-992 files

LLVM/project 6422502llvm/include/llvm/ProfileData InstrProf.h, llvm/lib/ProfileData InstrProf.cpp

incorporate review feedback
DeltaFile
+6-5llvm/include/llvm/ProfileData/InstrProf.h
+0-4llvm/lib/ProfileData/InstrProf.cpp
+6-92 files

LLVM/project cec6665llvm/lib/Transforms/Utils SimplifyLibCalls.cpp, llvm/test/Transforms/InstCombine simplify-libcalls-new.ll

[MemProf] Optionally update hints on existing hot/cold new calls (#91047)

If directed by an option, update hints on calls to new that already
provide a hot/cold hint.
DeltaFile
+173-3llvm/test/Transforms/InstCombine/simplify-libcalls-new.ll
+115-22llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
+288-252 files

LLVM/project b52160dlldb/include/lldb/Target Language.h, lldb/source/Core Mangled.cpp

[lldb] Consult Language plugin in GetDisplayDemangledName (#90294)

Give language plugins the opportunity to provide a language specific
display name.

This will be used in a follow up commit. The purpose of this change is
to ultimately display breakpoint locations with a more human friendly
demangling of Swift symbols.
DeltaFile
+4-0lldb/include/lldb/Target/Language.h
+2-0lldb/source/Core/Mangled.cpp
+6-02 files

LLVM/project b1da82amlir/lib/Dialect/Arith/IR ArithOps.cpp, mlir/test/Transforms constant-fold.mlir

[mlir][arith] Fix overflow bug in arith::CeilDivSIOp::fold (#90947)

The folder for arith::CeilDivSIOp should only be applied when it can be
guaranteed that no overflow would happen. The current implementation
works fine when both dividends are positive and the only arithmetic
operation is the division itself.

However, in cases where either the dividend or divisor is negative (or
both),
the division is split into multiple arith operations, e.g.: `- ( -a /
b)`. That's
additional 2 operations on top of the actual division that can overflow 
- the folder should check all 3 ops for overflow. 

The current logic doesn't do that - it effectively only checks the last
operation
(i.e. the division). It breaks when using e.g. MININT values (e.g. -128
for
8-bit integers) - negating such values overflows.

    [4 lines not shown]
DeltaFile
+38-0mlir/test/Transforms/constant-fold.mlir
+25-9mlir/lib/Dialect/Arith/IR/ArithOps.cpp
+63-92 files

LLVM/project 559accfllvm/lib/Target/AMDGPU VOP3PInstructions.td

[AMDGPU] Add VOP3_PACKED to V_PK_{MIN|MAX}IMUM_F16 profile (#91512)

NFCI as far as I understand, added for consitency.
DeltaFile
+2-2llvm/lib/Target/AMDGPU/VOP3PInstructions.td
+2-21 files

LLVM/project e3938f4offload/plugins-nextgen/common/include/Utils ELF.h, offload/plugins-nextgen/common/src/Utils ELF.cpp

[Offload] Detect native ELF machine from preprocessor (#91282)

Summary:
This gets the target's corresponding ELF value from the preprocessor.
We use this to detect if a given ELF is compatible with the CPU
offloading impolementation for OpenMP. Previously we used defitions from
CMake, but this is easier for people to understand as there may be new
users of this in the future.
DeltaFile
+15-0offload/plugins-nextgen/common/src/Utils/ELF.cpp
+4-6offload/plugins-nextgen/host/src/rtl.cpp
+0-5offload/plugins-nextgen/host/CMakeLists.txt
+3-0offload/plugins-nextgen/common/include/Utils/ELF.h
+22-114 files

LLVM/project 5526c8amlir/include/mlir/Dialect/LLVMIR LLVMOps.td, mlir/lib/Dialect/LLVMIR/IR LLVMDialect.cpp

[MLIR] Model llvm.inline_asm side_effects (#91507)

Allow more cleanups on inline_asm ops modeling side effects based on the
side_effect attributed.
DeltaFile
+13-0mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
+11-0mlir/test/Dialect/LLVMIR/canonicalize.mlir
+1-1mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
+25-13 files

LLVM/project 9047331llvm/test/CodeGen/AArch64 addimm-mulimm.ll

[AArch64] Add some additional add mul imm tests with multiple uses. NFC
DeltaFile
+279-20llvm/test/CodeGen/AArch64/addimm-mulimm.ll
+279-201 files

LLVM/project 63c38bacompiler-rt/test/asan/TestCases/Posix fake_stack_gc.cpp

[Sanitizers] Fix fake_test_gc not working on devices (#91284)

The way the LIT RUN command is currently constructed ( %run not --crash
%t ) causes the test failure on devices - since 'not' is a LLVM built
command, not available on devices.

Changing the command to read 'not --crash %run %t' fixes it, as 'not'
now executes on the host running the test.

rdar://115914588

Co-authored-by: Mariusz Borsa <m_borsa at apple.com>
DeltaFile
+1-1compiler-rt/test/asan/TestCases/Posix/fake_stack_gc.cpp
+1-11 files

LLVM/project 1464aeellvm/test/Analysis/LoopAccessAnalysis non-constant-distance-backward.ll

[LAA] Add tests with non-constant backward deps with known min value.

Add a set of tests with non-constant backward dependences, where the
minimum value is known (via the start value of the outer AddRec).
DeltaFile
+258-0llvm/test/Analysis/LoopAccessAnalysis/non-constant-distance-backward.ll
+258-01 files

LLVM/project 878c141mlir/include/mlir/Tools/lsp-server-support Protocol.h, mlir/lib/Tools/lsp-server-support Protocol.cpp

[mlir-lsp] Add DiagnosticTag from LSP spec (#91396)

Adds the [DiagnosticTag][diagtag] LSP construct to the LSP support
headers. I also added a unit test file to validate that the `tags` array
is omitted entirely if it's empty.

The LSP spec requires that `Diagnostic::tags` be an array; in order to
conform to that I used `std::vector`, as `SmallVector` doesn't have JSON
decoding support (you can encode it to JSON, but not decode it from
JSON).

[diagtag]:
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.18/specification/#diagnosticTag
DeltaFile
+51-0mlir/unittests/Tools/lsp-server-support/Protocol.cpp
+18-1mlir/lib/Tools/lsp-server-support/Protocol.cpp
+13-0mlir/include/mlir/Tools/lsp-server-support/Protocol.h
+1-0mlir/unittests/Tools/lsp-server-support/CMakeLists.txt
+83-14 files