LLVM/project 5dbeb29clang/bindings/python/clang cindex.py, clang/bindings/python/tests/cindex test_location.py test_source_range.py

[libclang/python] Type-annotate SourceLocation and SourceRange (#180193)

This adds type annotations to the `SourceLocation` and `SourceRange`
classes, enough to pass a strict typecheck. This resolves 29 strict
typing errors as the next step towards
https://github.com/llvm/llvm-project/issues/76664
DeltaFile
+30-28clang/bindings/python/clang/cindex.py
+4-0clang/docs/ReleaseNotes.rst
+1-1clang/bindings/python/tests/cindex/test_location.py
+1-1clang/bindings/python/tests/cindex/test_source_range.py
+36-304 files

LLVM/project ac57c4apolly/lib/CodeGen IslNodeBuilder.cpp, polly/lib/External/isl isl_ast_codegen.c GIT_HEAD_ID

[Polly] Update isl to isl-0.27-78-gfc484e00 (#180377)

Update isl to include
https://repo.or.cz/isl.git/commit/fc484e004200964f8f18249de1f510393ec924a9
which fixes #180000.

The isl update also fixes #34710 which had the same cause but with an
empty access domain (#180000 has an empty statement domain). Thus we
also revert 163cacb46960be4dd0d8562737bbf0ea97cb14ad which now only adds
unnecessary overhead.

A regression test has been added to isl which is why we do not add a
test in Polly.

Fixes: #180000

Thanks @skimo-openhub for the fix and @thapgua for the bugreport.
DeltaFile
+0-86polly/test/CodeGen/empty_domain_in_context.ll
+14-3polly/lib/External/isl/isl_ast_codegen.c
+12-0polly/lib/External/isl/test_inputs/codegen/polly2.st
+2-0polly/lib/External/isl/test_inputs/codegen/polly2.c
+1-1polly/lib/External/isl/GIT_HEAD_ID
+0-2polly/lib/CodeGen/IslNodeBuilder.cpp
+29-926 files

LLVM/project a177ce4clang/include/clang/Analysis/Analyses/LifetimeSafety Loans.h, clang/lib/Analysis/LifetimeSafety FactsGenerator.cpp Checker.cpp

Field and interior paths
DeltaFile
+158-100clang/include/clang/Analysis/Analyses/LifetimeSafety/Loans.h
+50-41clang/test/Sema/warn-lifetime-safety-invalidations.cpp
+46-42clang/lib/Analysis/LifetimeSafety/FactsGenerator.cpp
+30-47clang/lib/Analysis/LifetimeSafety/Checker.cpp
+58-9clang/lib/Analysis/LifetimeSafety/Loans.cpp
+16-2clang/lib/Analysis/LifetimeSafety/LoanPropagation.cpp
+358-2415 files not shown
+379-26311 files

LLVM/project 88dff28llvm/lib/Target/AMDGPU SIInsertWaitcnts.cpp

[AMDGPU][SIInsertWaitcnts][NFC] Make a few WaitcntBracket member functions private (#180018)

The user of the WaitcntBrackets class shouldn't need to know about how
the scoreboard has been implemented internally. So I think it is best to
provide a higher level API that hides things like scoreUB, scoreLB and
score ranges.

This patch makes getScoreUB(), getScoreLB() and getScoreRange() private
and introduces new functions that don't expose the internal
implementation:
- getOutstanding(T)
- hasPendingVMEM(VMEMID, T)
- empty(T)

I also noticed that getSGPRScore() and getVMemScore() are not used
externally so these are now private.
DeltaFile
+24-19llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
+24-191 files

LLVM/project bf86aeaclang/include/clang/Analysis/Analyses/LifetimeSafety Loans.h, clang/lib/Analysis/LifetimeSafety FactsGenerator.cpp Checker.cpp

Field and interior paths
DeltaFile
+158-100clang/include/clang/Analysis/Analyses/LifetimeSafety/Loans.h
+46-42clang/lib/Analysis/LifetimeSafety/FactsGenerator.cpp
+45-35clang/test/Sema/warn-lifetime-safety-invalidations.cpp
+30-47clang/lib/Analysis/LifetimeSafety/Checker.cpp
+58-9clang/lib/Analysis/LifetimeSafety/Loans.cpp
+16-2clang/lib/Analysis/LifetimeSafety/LoanPropagation.cpp
+353-2354 files not shown
+371-25010 files

LLVM/project f73a0b9clang/include/clang/Driver Driver.h, clang/lib/Driver Driver.cpp

[clang] Remove unused parameter from Driver::DiagnoseInputExistence (NFC) (#177876)

DeltaFile
+5-5clang/lib/Driver/Driver.cpp
+1-2clang/include/clang/Driver/Driver.h
+6-72 files

LLVM/project 0c4f809llvm/lib/Transforms/Vectorize VPlanRecipes.cpp LoopVectorize.cpp

[VPlan] Compute predicated load/store costs in VPlan. (NFC) (#179129)

Update VPReplicateReicpe::computeCost to compute predicated load/store
costs directly, unless the pointer is uniform. In that case, the legacy
cost model uses a different logic, which will be migrated separately.

PR: https://github.com/llvm/llvm-project/pull/179129
DeltaFile
+26-9llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
+8-4llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+5-0llvm/lib/Transforms/Vectorize/VPlanHelpers.h
+39-133 files

LLVM/project 42e4045clang/docs ClangFormatStyleOptions.rst, clang/include/clang/Format Format.h

[clang-format][doc] Add GNU style link in KeepFormFeed option (#176654)

It was not clear from the description what this option does.
Added small example to demostrate its behavior.
DeltaFile
+2-1clang/docs/ClangFormatStyleOptions.rst
+2-1clang/include/clang/Format/Format.h
+4-22 files

LLVM/project ec059d8llvm/lib/Transforms/Scalar DeadStoreElimination.cpp, llvm/test/Transforms/DeadStoreElimination simple.ll

[DSE] Handle variable offsets with sized dead_on_return (#180364)

With a sized dead_on_return, we need to not eliminate stores if there
are to a pointer with a variable offset from the underlying object
marked dead_on_return. This manifested as an assertion failure as
BaseValue/V ended up not being equal. It's possible we could do a range
analysis to try and prove the variable offset stays within bounds, but
this case seems to come up relatively rarely (only reproducible with a
UBSan build of LLVM) and is probably not worth the compile time.

Fixes #180361.
DeltaFile
+11-0llvm/test/Transforms/DeadStoreElimination/simple.ll
+5-1llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
+16-12 files

LLVM/project 39622a7llvm/utils profcheck-xfail.txt

[ProfCheck] Add PreISelIntrinsicLoweringTest to XFail

Introduced in 191af6c254a83c9eb72df92a5db534d8fd4f0701. Should not be a
complicated fix, but move to the xfail list for now so the bot gets back
to green while we work on fixing.
DeltaFile
+1-0llvm/utils/profcheck-xfail.txt
+1-01 files

LLVM/project a947599llvm/include/llvm/CodeGen/GlobalISel MachineIRBuilder.h LegalizerHelper.h, llvm/lib/CodeGen/GlobalISel LegalizerHelper.cpp

[AMDGPU][GlobalISel] Add lowering for G_FMODF (#180152)

Add generic expansion for G_FMODF matching the SelectionDAG
implementation.

Enable G_FMODF lowering for AMDGPU with tests.

Related: #179434
DeltaFile
+425-191llvm/test/CodeGen/AMDGPU/llvm.modf.ll
+31-0llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
+10-0llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
+4-3llvm/include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h
+1-0llvm/include/llvm/CodeGen/GlobalISel/LegalizerHelper.h
+471-1945 files

LLVM/project 9dd5542clang/include/clang/AST HLSLResource.h, clang/lib/CodeGen CGHLSLRuntime.cpp

[clang][NFC] Replace includes of "Attrs.inc" with "Attr.h" (#180356)

"clang/AST/Attrs.inc" is not a self-contained header and is not intended
to be included directly. Instead, "clang/AST/Attr.h" is the header that
users need.
DeltaFile
+1-1clang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp
+1-1clang/lib/CodeGen/CGHLSLRuntime.cpp
+1-1clang/lib/Sema/SemaExpr.cpp
+0-1clang/lib/Sema/SemaHLSL.cpp
+0-1clang/include/clang/AST/HLSLResource.h
+0-1clang/lib/Sema/SemaRISCV.cpp
+3-66 files

LLVM/project be4dbf5lld/ELF OutputSections.cpp

[lld][ELF] Remove redundant size check in nopInstrFill

We checked twice of size is equal to zero. This is not necessary and
makes the code a little bit less readable.

Reviewers: MaskRay, tmsri

Pull Request: https://github.com/llvm/llvm-project/pull/180304
DeltaFile
+0-2lld/ELF/OutputSections.cpp
+0-21 files

LLVM/project f72da50llvm/test/tools/obj2yaml/ELF bb-addr-map-pgo-analysis-map.yaml, llvm/tools/obj2yaml elf2yaml.cpp

[obj2yaml] Support SHT_LLVM_BB_ADDR_MAP version 5

e9368a056dff94815b3c43a0da78e7c1e5b3d4f4 missed updating the obj2yaml
version check. This was causing obj2yaml to error on object files
generated by the most recent clang.

Reviewers: rlavaee, jh7370

Pull Request: https://github.com/llvm/llvm-project/pull/180303
DeltaFile
+4-4llvm/test/tools/obj2yaml/ELF/bb-addr-map-pgo-analysis-map.yaml
+1-1llvm/tools/obj2yaml/elf2yaml.cpp
+5-52 files

LLVM/project 8b5e95bllvm/lib/Transforms/Scalar InferAddressSpaces.cpp, llvm/test/Transforms/InferAddressSpaces/NVPTX nullptr.ll

[InferAddressSpaces] Initialize op(generic const, generic const, ...) -> generic (#172143)

Fixes #171890
If the pointer operands of an instruction are all constants with generic
AS, we always infer the AS of the instruction as uninitialized finally.
And the rewrite process will skip cloning the instruction, producing
invalid IR.
This patch fixes it by inferring the AS of this kind of instruction as
flat. Maybe we can fold the operator with all constants to get better
performance, but I think this case is rare in the real world.
DeltaFile
+22-0llvm/test/Transforms/InferAddressSpaces/NVPTX/nullptr.ll
+8-1llvm/lib/Transforms/Scalar/InferAddressSpaces.cpp
+30-12 files

LLVM/project 8bced61llvm/include/llvm/DebugInfo/PDB/Native FormatUtil.h InputFile.h, llvm/lib/Support MathExtras.cpp

[NFC][ADT] add NumDigitsBase10 to MathExtra and update some current users (#165479)

DeltaFile
+0-43llvm/include/llvm/DebugInfo/PDB/Native/FormatUtil.h
+35-0llvm/lib/Support/MathExtras.cpp
+11-10llvm/tools/llvm-pdbutil/DumpOutputStyle.cpp
+15-0llvm/unittests/Support/MathExtrasTest.cpp
+5-4llvm/include/llvm/DebugInfo/PDB/Native/InputFile.h
+3-3llvm/tools/llvm-pdbutil/MinimalTypeDumper.cpp
+69-605 files not shown
+76-6411 files

LLVM/project f1d8d03clang/lib/Sema SemaExpr.cpp, clang/test/SemaHIP hip-builtin-lvalue-to-rvalue.hip

[HIP][Sema] Fix incorrect CK_NoOp for lvalue-to-rvalue conversion in … (#180314)

…builtin args

The HIP implicit address space cast for builtin pointer arguments used
CK_NoOp to convert lvalue args to rvalues.

This caused an assertion failure in LifetimeSafety analysis:
  Assertion `Dst->getLength() == Src->getLength()` failed
in FactsGenerator::flow() in some cases.

Use DefaultLvalueConversion which correctly emits CK_LValueToRValue.
DeltaFile
+19-0clang/test/SemaHIP/hip-builtin-lvalue-to-rvalue.hip
+4-3clang/lib/Sema/SemaExpr.cpp
+23-32 files

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

Revert "[ValueTracking] Propagate sign information out of loop" (#180354)

Reverts llvm/llvm-project#175590

Break https://lab.llvm.org/buildbot/#/builders/55/builds/23820 and clang
DeltaFile
+0-220llvm/test/Transforms/AggressiveInstCombine/X86/pr175590.ll
+0-90llvm/lib/Analysis/ValueTracking.cpp
+0-18llvm/include/llvm/Analysis/ValueTracking.h
+0-3283 files

LLVM/project 2a74e02llvm/lib/CodeGen/SelectionDAG SelectionDAGBuilder.cpp, llvm/test/CodeGen/X86 selectiondag-dbgvalue-null-crash.ll

Revert "[SelectionDAG] Fix null pointer dereference in resolveDanglingDebugInfo" (#180352)

Reverts llvm/llvm-project#174341

Break https://lab.llvm.org/buildbot/#/builders/24/builds/17324
DeltaFile
+0-46llvm/test/CodeGen/X86/selectiondag-dbgvalue-null-crash.ll
+1-1llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+1-472 files

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

Revert "[ValueTracking] Propagate sign information out of loop (#175590)"

This reverts commit 7054a4b8f9923a41619657a748465de572af71bd.
DeltaFile
+0-220llvm/test/Transforms/AggressiveInstCombine/X86/pr175590.ll
+0-90llvm/lib/Analysis/ValueTracking.cpp
+0-18llvm/include/llvm/Analysis/ValueTracking.h
+0-3283 files

LLVM/project e3c5bf8llvm/lib/CodeGen/SelectionDAG SelectionDAGBuilder.cpp, llvm/test/CodeGen/X86 selectiondag-dbgvalue-null-crash.ll

Revert "[SelectionDAG] Fix null pointer dereference in resolveDanglingDebugIn…"

This reverts commit 9e8caa78349f21ba6f27e718d7f8461c8dcfd809.
DeltaFile
+0-46llvm/test/CodeGen/X86/selectiondag-dbgvalue-null-crash.ll
+1-1llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+1-472 files

LLVM/project b0cc73dllvm/lib/CodeGen/GlobalISel GISelValueTracking.cpp, llvm/test/CodeGen/AArch64/GlobalISel knownbits-rotl-rotr.mir

[GlobalISel] add G_ROTL, G_ROTR to computeKnownBits (#166365)

Adresses one of the subtasks of #150515.

The code is ported from `SelectionDAG::computeKnownBits` and tests are
loosely based on `AArch64/GlobalISel/knownbits-shl.mir`.
DeltaFile
+270-0llvm/test/CodeGen/AArch64/GlobalISel/knownbits-rotl-rotr.mir
+20-0llvm/lib/CodeGen/GlobalISel/GISelValueTracking.cpp
+290-02 files

LLVM/project 1acc200llvm/include/llvm/CodeGen LiveStacks.h, llvm/lib/CodeGen LiveStacks.cpp StackSlotColoring.cpp

[NFC][LiveStacks] Use vectors instead of map and unordred_map (#165477)

DeltaFile
+19-25llvm/include/llvm/CodeGen/LiveStacks.h
+22-19llvm/lib/CodeGen/LiveStacks.cpp
+5-15llvm/lib/CodeGen/StackSlotColoring.cpp
+3-3llvm/lib/Target/AMDGPU/AMDGPUMarkLastScratchLoad.cpp
+3-2llvm/lib/Target/AMDGPU/AMDGPURewriteAGPRCopyMFMA.cpp
+52-645 files

LLVM/project 2002a59libcxx/test/std/thread/thread.semaphore lost_wakeup.timed.pass.cpp

[libc++][test][NFC] remove unused and global variables in the test (#179038)

Fixes #178855
DeltaFile
+6-8libcxx/test/std/thread/thread.semaphore/lost_wakeup.timed.pass.cpp
+6-81 files

LLVM/project f52f97bllvm/test/Transforms/SLPVectorizer/X86 shl-to-add-transformation5.ll

[SLP][NFC]Add another shl-to-add modeling test, NFC
DeltaFile
+57-0llvm/test/Transforms/SLPVectorizer/X86/shl-to-add-transformation5.ll
+57-01 files

LLVM/project d94caealibc/shared/math ffmal.h, libc/src/__support/math ffmal.h CMakeLists.txt

[libc][math] Refactor ffmal to Header Only. (#179069)

closes #175326

Part of #147386
DeltaFile
+28-0libc/src/__support/math/ffmal.h
+25-0libc/shared/math/ffmal.h
+11-1utils/bazel/llvm-project-overlay/libc/BUILD.bazel
+10-0libc/src/__support/math/CMakeLists.txt
+2-4libc/src/math/generic/ffmal.cpp
+1-1libc/src/math/generic/CMakeLists.txt
+77-63 files not shown
+80-69 files

LLVM/project 15832a6libc/shared/math sqrtf128.h, libc/src/__support/math sqrtf128.h CMakeLists.txt

[libc][math] Refactor sqrtf128 to header only (#177760)

Closes #177652 
DeltaFile
+454-0libc/src/__support/math/sqrtf128.h
+2-422libc/src/math/generic/sqrtf128.cpp
+29-0libc/shared/math/sqrtf128.h
+16-1utils/bazel/llvm-project-overlay/libc/BUILD.bazel
+15-0libc/src/__support/math/CMakeLists.txt
+1-7libc/src/math/generic/CMakeLists.txt
+517-4303 files not shown
+521-4309 files

LLVM/project e890821llvm/lib/Transforms/Scalar LoopStrengthReduce.cpp, llvm/test/Transforms/LoopStrengthReduce/X86 debuginfo-scev-salvage-ptrtoaddr.ll

[LSR] Support SCEVPtrToAddr in SCEVDbgValueBuilder.

Allow SCEVPtrToAddr as cast in assertion in SCEVDbgValueBuilder.
SCEVPtrToAddr is handled similarly to SCEVPtrToInt.

Fixes a crash with debug info after bd40d1de9c9ee, which started to
generate ptrtoaddr instead of ptrtoint expressions.
DeltaFile
+61-0llvm/test/Transforms/LoopStrengthReduce/X86/debuginfo-scev-salvage-ptrtoaddr.ll
+2-1llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
+63-12 files

LLVM/project f6219e8mlir/include/mlir/Interfaces ExecutionProgressOpInterface.td ExecutionProgressOpInterface.h, mlir/lib/Dialect/SCF/IR SCF.cpp

[mlir][Interfaces] Add `ExecutionProgressOpInterface` + folding pattern (#179039)

Add the `ExecutionProgressOpInterface` with an interface method to check
if an operation "must progress". Add `mustProgress` attributes to
`scf.for` and `scf.while` (default value is "true").

`mustProgress` corresponds to the [`llvm.loop.mustprogress`
metadata](https://llvm.org/docs/LangRef.html#langref-llvm-loop-mustprogress).

Also add a canonicalization pattern to erase `RegionBranchOpInterface`
ops that must progress but loop infinitely (and are non-side-effecting).
This canonicalization pattern is enabled for `scf.for` and `scf.while`.

RFC: https://discourse.llvm.org/t/infinite-loops-and-dead-code/89530

[mlir] Fix build after #179039 (#179180)

Fix build after #179039.
DeltaFile
+73-30mlir/lib/Interfaces/ControlFlowInterfaces.cpp
+51-0mlir/test/Dialect/SCF/canonicalize.mlir
+45-3mlir/lib/Dialect/SCF/IR/SCF.cpp
+48-0mlir/include/mlir/Interfaces/ExecutionProgressOpInterface.td
+39-0mlir/lib/Dialect/UB/IR/UBOps.cpp
+29-0mlir/include/mlir/Interfaces/ExecutionProgressOpInterface.h
+285-3313 files not shown
+368-4419 files

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

[ValueTracking] Propagate sign information out of loop (#175590)

LLVM converts sqrt libcall to intrinsic call if the argument is within
the range(greater than or equal to 0.0). In this case the compiler is
not able to deduce the non-negativity on its own. Extended ValueTracking
to understand such loops.

Fixes llvm/llvm-project#174813
DeltaFile
+220-0llvm/test/Transforms/AggressiveInstCombine/X86/pr175590.ll
+90-0llvm/lib/Analysis/ValueTracking.cpp
+18-0llvm/include/llvm/Analysis/ValueTracking.h
+328-03 files