LLVM/project ecd2b68llvm/unittests/Transforms/Instrumentation CMakeLists.txt

[CMake] Don't explicitly set folder for InstrumentationTests (#170041)

Use the default of `LLVM/Tests/Unit` to group these tests with other
LLVM unit test targets in the IDE.
DeltaFile
+0-2llvm/unittests/Transforms/Instrumentation/CMakeLists.txt
+0-21 files

LLVM/project 1faaf35llvm/lib/Analysis ValueTracking.cpp

Use isKnownNeverInfOrNaN
DeltaFile
+1-1llvm/lib/Analysis/ValueTracking.cpp
+1-11 files

LLVM/project 4e3699bllvm/lib/Target/RISCV/MCTargetDesc RISCVMCCodeEmitter.cpp, llvm/test/CodeGen/RISCV option-relax-relocation.ll

[RISCV] Mark More Relocs as Relaxable (#151422)

Since this code was last reviewed, more relaxations have been added to
the psABI for existing standard relocations that LLVM didn't have marked
as relaxable.

This change ensures that LLVM marks the following relocations (and their
respective fixups) as relaxable:
- `R_RISCV_JAL`
- `R_RISCV_GOT_HI20`
- `R_RISCV_TPREL_HI20`
- `R_RISCV_TLSDESC_HI20`

This also updates the linker relaxation test to use `-NEXT` to check all
the output lines.

There are lots more emitted relocations, not only due to JAL being
relaxable, but branches are now also marked linker relaxable because
they can be turned into `b<cc>; jal` during assembly relaxation, which
may also be marked relaxable.
DeltaFile
+72-40llvm/test/MC/RISCV/linker-relaxation.s
+27-16llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCCodeEmitter.cpp
+40-2llvm/test/MC/RISCV/long-conditional-jump.s
+20-8llvm/test/CodeGen/RISCV/option-relax-relocation.ll
+17-4llvm/test/MC/RISCV/align.s
+7-3llvm/test/MC/RISCV/Relocations/expr.s
+183-738 files not shown
+208-8014 files

LLVM/project f4a7f70llvm/lib/Target/NVPTX NVPTXISelLowering.cpp, llvm/test/CodeGen/NVPTX combine-mul-wide-type.ll

[NVPTX] Use correct `mul.wide` operand type when matching on `shl` in `combineMulWide` (#168986)

The operand types of a `mul.wide` are half the size of the output type.
`combineMulWide` incorrectly uses the output type of the `mul.wide` for
the operand type instead of the operand type.
DeltaFile
+35-0llvm/test/CodeGen/NVPTX/combine-mul-wide-type.ll
+2-2llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
+37-22 files

LLVM/project 11dcb75clang/include/clang/Analysis CallGraph.h, clang/lib/Analysis CFG.cpp

Add time trace scopes to addToCallGraph & getCFG (#174717)

This PR adds performance instrumentation to `clang::CallGraph` and
`clang::CFG` to aid in benchmarking the overhead of call
graph construction and CFG rebuilding.

This aims to facilitate benchmarking on large codebases like LLVM to
ensure that the performance impact of new analysis-based warnings
remains within acceptable regressions.
DeltaFile
+2-0clang/include/clang/Analysis/CallGraph.h
+2-0clang/lib/Analysis/CFG.cpp
+2-0clang/unittests/Support/TimeProfilerTest.cpp
+6-03 files

LLVM/project 2926b41clang/lib/Analysis UnsafeBufferUsage.cpp, clang/test/SemaCXX warn-unsafe-buffer-usage-libc-functions.cpp

[-Wunsafe-buffer-usage] Fix crashes in "Add check for custom printf/scanf functions #173096" (#174683)

The previous PR #173096 assumes that format attribute parameters always
refer to valid indices of arguments. It is a wrong assumption in itself
because the second attribute parameter could specify the index after the
last named parameter for variadic functions and no actual arguments
passed beyond named parameters. In addition, clang (possibly
incorrectly) allows the following uses of the attribute:

```
void f(const char *) __attribute__((__format__ (__printf__, 1, 2))); // The second attribute argument 2 will not refer to any valid argument at any call of 'f'

void g(const char *) __attribute__((__format__ (__printf__, 1, 99))); // Clang is even quiet on this, if assertions are disabled :(
```
DeltaFile
+83-2clang/test/SemaCXX/warn-unsafe-buffer-usage-libc-functions.cpp
+34-8clang/lib/Analysis/UnsafeBufferUsage.cpp
+117-102 files

LLVM/project 292a77clldb/source/Plugins/Language/CPlusPlus MsvcStlDeque.cpp MsvcStlSmartPointer.cpp

[LLDB][NFC] Remove excessive use of `auto` from MSVC STL formatters (#175019)

Some MSVC STL formatters made excessive use of `auto`, especially the
`std::deque` one
(https://github.com/llvm/llvm-project/pull/172360#pullrequestreview-3639850321).
This PR replaces the uses with the concrete type.
DeltaFile
+11-9lldb/source/Plugins/Language/CPlusPlus/MsvcStlDeque.cpp
+3-2lldb/source/Plugins/Language/CPlusPlus/MsvcStlSmartPointer.cpp
+2-2lldb/source/Plugins/Language/CPlusPlus/MsvcStlAtomic.cpp
+1-1lldb/source/Plugins/Language/CPlusPlus/MsvcStlTree.cpp
+17-144 files

LLVM/project cb6ee6clldb/tools/lldb-dap EventHelper.cpp, lldb/tools/lldb-dap/tool lldb-dap.cpp

[lldb-dap][NFC] Shorten the event thread name (#174837)

On linux thread names are limited to 15 characters, shorten the name of
the event thread if necessary
DeltaFile
+6-1lldb/tools/lldb-dap/EventHelper.cpp
+1-1lldb/tools/lldb-dap/tool/lldb-dap.cpp
+7-22 files

LLVM/project 16afdcellvm/lib/Analysis ValueTracking.cpp, llvm/test/Transforms/Attributor nofpclass-fdiv.ll

ValueTracking: Handle fdiv by known 0 case in computeKnownFPClass

This will help subsume some transforms instsimplify performs
in the middle of SimplifyDemandedFPClass
DeltaFile
+16-16llvm/test/Transforms/Attributor/nofpclass-fdiv.ll
+8-0llvm/lib/Analysis/ValueTracking.cpp
+24-162 files

LLVM/project 5bb93c0llvm/lib/Analysis ValueTracking.cpp, llvm/test/Transforms/Attributor nofpclass-fdiv.ll nofpclass-frem.ll

ValueTracking: Rule out nan for fdiv self special case

Addresses TODO for signaling nan handling.
DeltaFile
+20-2llvm/lib/Analysis/ValueTracking.cpp
+9-9llvm/test/Transforms/Attributor/nofpclass-fdiv.ll
+9-9llvm/test/Transforms/Attributor/nofpclass-frem.ll
+38-203 files

LLVM/project 0a09140llvm/lib/Analysis ValueTracking.cpp

fcAllFlags
DeltaFile
+2-7llvm/lib/Analysis/ValueTracking.cpp
+2-71 files

LLVM/project c00fe1dllvm/lib/Analysis ValueTracking.cpp, llvm/test/Transforms/Attributor nofpclass-fdiv.ll

ValueTracking: Improve sign bit handling for fdiv

This is the fdiv version of 5020e0ff1494137ff12b4ed7c8fa896f8088b17b for
fmul.
DeltaFile
+14-3llvm/lib/Analysis/ValueTracking.cpp
+3-3llvm/test/Transforms/Attributor/nofpclass-fdiv.ll
+17-62 files

LLVM/project ce62529llvm/test/Transforms/Attributor nofpclass-fdiv.ll nofpclass-frem.ll

ValueTracking: Add more baseline tests for fdiv sign tracking

This is the fmul version of 08b1403228953866cb052a3fdb34719a7f4e87e2
DeltaFile
+581-0llvm/test/Transforms/Attributor/nofpclass-fdiv.ll
+549-0llvm/test/Transforms/Attributor/nofpclass-frem.ll
+1,130-02 files

LLVM/project e42f862bolt/lib/Target/AArch64 AArch64MCPlusBuilder.cpp

[BOLT][AArch64] Avoid UB due to shift of negative value. (#174994)

A build with LLVM_USE_SANITIZER=Undefined showed:

  bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp:2277:60:
  runtime error: left shift of negative value -32768

This showed up in bolt/test/AArch64/veneer-lite-mode.s.

It is valid for ADRP's operand to be negative, and not valid to shift it
like that. To perform this shift reliably, cast the value to unsigned.
DeltaFile
+1-1bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp
+1-11 files

LLVM/project ed681dellvm/lib/Transforms/InstCombine InstCombineSimplifyDemanded.cpp, llvm/test/Transforms/InstCombine simplify-demanded-fpclass.ll simplify-demanded-fpclass-shufflevector.ll

InstCombine: Improve SimplifyDemandedFPClass fabs handling

Try to eliminate the fabs if the source is known positive.
DeltaFile
+4-8llvm/test/Transforms/InstCombine/simplify-demanded-fpclass.ll
+5-0llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
+1-2llvm/test/Transforms/InstCombine/simplify-demanded-fpclass-shufflevector.ll
+10-103 files

LLVM/project 2118005llvm/test/Transforms/InstCombine simplify-demanded-fpclass.ll

InstCombine: Add baseline tests for fabs SimplifyDemandedFPClass improvements
DeltaFile
+49-0llvm/test/Transforms/InstCombine/simplify-demanded-fpclass.ll
+49-01 files

LLVM/project 7026c73llvm/lib/Transforms/InstCombine InstCombineSimplifyDemanded.cpp, llvm/test/Transforms/InstCombine simplify-demanded-fpclass.ll

InstCombine: Improve SimplifyDemandedFPClass copysign handling

Recognize cases where the signbit is known.
DeltaFile
+22-0llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
+9-6llvm/test/Transforms/InstCombine/simplify-demanded-fpclass.ll
+31-62 files

LLVM/project e7fd5d7llvm/test/Transforms/InstCombine simplify-demanded-fpclass.ll

InstCombine: Add baseline tests for improved copysign handling
DeltaFile
+64-0llvm/test/Transforms/InstCombine/simplify-demanded-fpclass.ll
+64-01 files

LLVM/project 325869cclang/lib/Headers amo.h, clang/lib/Sema SemaPPC.cpp

[PowerPC] Add AMO load signed builtins (#168747)

This commit adds two Clang builtins for AMO load signed operations:

__builtin_amo_lwat_s for 32-bit signed operations
__builtin_amo_ldat_s for 64-bit signed operations
DeltaFile
+48-0clang/test/CodeGen/PowerPC/ppc-amo-header.c
+40-0clang/test/CodeGen/PowerPC/builtins-ppc-amo.c
+34-0clang/lib/Headers/amo.h
+17-4clang/lib/Sema/SemaPPC.cpp
+9-10llvm/test/CodeGen/PowerPC/amo-enable.ll
+14-2clang/test/CodeGen/PowerPC/builtins-amo-err.c
+162-162 files not shown
+179-168 files

LLVM/project b86c7daflang/lib/Semantics resolve-names.cpp, flang/test/Semantics bug174859.f90

[flang] Fix bad attributes on type parameter symbols (#174870)

When creating new symbols for a derived type's type parameters, the
attributes that accumulated for the type itself were also being applied
to the parameters' symbols. This led to those attributes being emitted
to the module file, rendering it unparseable.

Fixes https://github.com/llvm/llvm-project/issues/174859.
DeltaFile
+14-0flang/test/Semantics/bug174859.f90
+3-0flang/lib/Semantics/resolve-names.cpp
+17-02 files

LLVM/project b4f9012flang/lib/Parser prescan.cpp, flang/test/Driver color-diagnostics-scan.f fixed-free-detection.f90

[flang] Make a non-digit in fixed-form label field an error unless -E (#174836)

A character in a fixed-form source line (as opposed to a comment or
compiler directive) can't have a non-digit in its label field, columns 1
through 5. The prescanner presently emits only a warning for this case.
Retain the warning for -E output, but otherwise diagnose an error.

(This change affected a number of tests that relied on this situation
being a warning just so that they could test prescanner warnings, and
those tests were adjusted to use another warning.)

Fixes https://github.com/llvm/llvm-project/issues/50563.
DeltaFile
+26-16flang/lib/Parser/prescan.cpp
+4-4flang/test/Driver/color-diagnostics-scan.f
+4-4flang/test/Driver/fixed-free-detection.f90
+4-0flang/test/Parser/bug50563.f
+2-2flang/test/Driver/Inputs/free-form-test.f90
+2-2flang/test/Driver/werror-scan.f
+42-284 files not shown
+45-3310 files

LLVM/project 85779e5flang/lib/Semantics check-call.cpp, flang/test/Semantics bug2021.f90

[flang] Silence "used but undefined" warning for LOC(x) (#174807)

When a variable appears as the argument of the extension intrinsic
function LOC(x), assume that it's defined for the purposes of the
warning about variables that are used but never defined, since the
result of the LOC() can be used to define a based Cray pointer.
DeltaFile
+8-0flang/test/Semantics/bug2021.f90
+2-1flang/lib/Semantics/check-call.cpp
+10-12 files

LLVM/project ebdaea6lldb/packages/Python/lldbsuite/test dotest.py

[lldb-dap][windows] fix lldb-dap executable name in test (#175014)

This patch fixes an incorrect name of the `lldb-dap` process on Windows
by appending `.exe` to the name.

This is a prelude to https://github.com/llvm/llvm-project/pull/174635.
DeltaFile
+3-1lldb/packages/Python/lldbsuite/test/dotest.py
+3-11 files

LLVM/project aac91ealldb/tools/lldb-dap/extension package-lock.json package.json

[lldb-dap] Add ovsx as a dev dependency for publish to Open VSX (#175015)

This adds `ovsx` as a developer dependency and adds a new script
"publish-ovsx" for publishing to the Open VSX registry.
DeltaFile
+482-0lldb/tools/lldb-dap/extension/package-lock.json
+3-1lldb/tools/lldb-dap/extension/package.json
+485-12 files

LLVM/project 418eee7llvm/lib/Target/RISCV RISCVISelLowering.cpp

[RISCV] Bail out of combineNarrowableShiftedLoad for types other than scalar int (#175011)

Introduced in #170483 this was only ever meant to trigger for scalar
types. We get an error on rv32gcv for some inputs "Cannot implicitly
convert a scalable size to a fixed-width size in `TypeSize::operator
ScalarTy()`".

While we're editing this function, delete an accidentally repeated
comment.

Minimal reproducer:
```
define <vscale x 4 x ptr> @ham() {
bb:
  %load = load <vscale x 4 x i32>, ptr null, align 4
  %ashr = ashr <vscale x 4 x i32> %load, splat (i32 1)
  %getelementptr = getelementptr i32, ptr null, <vscale x 4 x i32> %ashr
  ret <vscale x 4 x ptr> %getelementptr
}

    [2 lines not shown]
DeltaFile
+4-2llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+4-21 files

LLVM/project e39ddabllvm/bindings/ocaml/irreader llvm_irreader.mli, llvm/examples/OrcV2Examples/OrcV2CBindingsLazy OrcV2CBindingsLazy.c

[llvm-c] Add LLVMParseIRInContext2 (#174085)

This new function is the same as LLVMParseIRInContext except it doesn't
take ownership of the memory buffer. This fixes a wart that has been in
place since 5ebb7b311223bcd21d2b3d25413d1edacefcc63d changed the
underlying internal API to avoid taking ownership.

Reduce nesting in the implementation of LLVMParseIRInContext (now
LLVMParseIRInContext2) as well.

Update examples, OCaml bindings, and tests including plugging some
pre-existing memory leaks. OCaml bindings have renamed `parse_ir` to
`parse_ir_bitcode_or_assembly` to provoke compilation failures in
downstream code; this is intentional as this function now requires the
memory buffer to be disposed by the caller.
DeltaFile
+29-10llvm/test/Bindings/OCaml/irreader.ml
+17-13llvm/lib/IRReader/IRReader.cpp
+13-7llvm/test/Bindings/OCaml/bitreader.ml
+10-7llvm/examples/OrcV2Examples/OrcV2CBindingsLazy/OrcV2CBindingsLazy.c
+17-0llvm/include/llvm-c/IRReader.h
+11-5llvm/bindings/ocaml/irreader/llvm_irreader.mli
+97-429 files not shown
+140-6215 files

LLVM/project 3ae71d3llvm/lib/Transforms/Vectorize SLPVectorizer.cpp, llvm/test/Transforms/SLPVectorizer/RISCV strided-stores-vectorized.ll

[SLP] Use ConstantInt::getSigned for stride argument to strided load/store intrinsics (#175007)

strided-stores-vectorized.ll crashes for RV32 without fixing the
relevant logic in vectorizeTree, because the argument can't be
represented as a 32-bit unsigned value:
```
llvm::APInt::APInt(unsigned int, uint64_t, bool, bool): Assertion `llvm::isUIntN(BitWidth, val) && "Value is not an N-bit unsigned value"' failed.
```

It is intended to be signed, so we simply use ConstantInt::getSigned
instead. This fixes other stride-related instances in the file as well.
For further context, this change is part of unblocking rv32gcv
llvm-test-suite in CI.
DeltaFile
+26-11llvm/test/Transforms/SLPVectorizer/RISCV/strided-stores-vectorized.ll
+3-3llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+29-142 files

LLVM/project 936ae06. .gitignore

[LLVM] Ignore Cursor specific files (#174891)

DeltaFile
+2-0.gitignore
+2-01 files

LLVM/project 4e74fballvm/lib/Target/AMDGPU AMDGPUPromoteAlloca.cpp, llvm/test/CodeGen/AMDGPU promote-alloca-use-after-erase.ll

[AMDGPU] Fix a potential use-after-erase in `AMDGPUPromoteAlloca` pass (#174529)

In some cases, the placeholder itself can be used as the value for its
corresponding block in `SSAUpdater`, and later used as an incoming value
in another block in `GetValueInMiddleOfBlock`. If we erase it too early,
this can lead to a use-after-erase.
DeltaFile
+36-0llvm/test/CodeGen/AMDGPU/promote-alloca-use-after-erase.ll
+12-3llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp
+48-32 files

LLVM/project 75b6493llvm/lib/Analysis ValueTracking.cpp, llvm/test/Transforms/Attributor nofpclass-fdiv.ll nofpclass-frem.ll

ValueTracking: Check if fdiv operand could be undef (#174453)

In the special case for fdiv/frem with the same operands, make
sure the input isn't undef.
DeltaFile
+21-11llvm/test/Transforms/Attributor/nofpclass-fdiv.ll
+21-11llvm/test/Transforms/Attributor/nofpclass-frem.ll
+2-1llvm/lib/Analysis/ValueTracking.cpp
+1-1llvm/test/Transforms/InstSimplify/floating-point-compare.ll
+45-244 files