LLVM/project c6efcc9mlir/include/mlir/Transforms Mem2Reg.h, mlir/lib/Transforms Mem2Reg.cpp

[MLIR][Mem2Reg] Improve performance by avoiding recomputations (#91444)

This commit ensures that Mem2Reg reuses the `DominanceInfo` as well as
block index maps to avoid expensive recomputations. Due to the recent
migration to `OpBuilder`, the promotion of a slot does no longer replace
blocks. Having stable blocks makes the `DominanceInfo` preservable and
additionally allows to cache block index maps between different
promotions.

Performance measurements on very large functions show an up to 4x
speedup by these changes.
DeltaFile
+46-19mlir/lib/Transforms/Mem2Reg.cpp
+1-0mlir/include/mlir/Transforms/Mem2Reg.h
+47-192 files

LLVM/project 9c09b08clang/include/clang/Basic AttrDocs.td, clang/lib/Parse ParseHLSL.cpp

Revert "[HLSL] Support packoffset attribute in AST (#89836)" (#91473)

This reverts commit c5509fedc5757fffece385d9d068e36b26793ade.
DeltaFile
+0-122clang/test/SemaHLSL/packoffset-invalid.hlsl
+0-100clang/test/AST/HLSL/packoffset.hlsl
+0-88clang/lib/Parse/ParseHLSL.cpp
+0-80clang/lib/Sema/SemaHLSL.cpp
+0-52clang/lib/Sema/SemaDeclAttr.cpp
+0-20clang/include/clang/Basic/AttrDocs.td
+0-4624 files not shown
+0-48410 files

LLVM/project f97f04emlir/tools/mlir-src-sharder mlir-src-sharder.cpp

[mlir] Fixing a regression that '-D' option of llvm-tblgen is unregistered. (#91329)

PR #89664 introduced a regression that it unregistered llvm-tblgen
option `-D` for macros. The test `TestOps.cpp` failed due to passing a
macros to llvm-tblgen.

It caused our internal build to fail because we append `-DLOCAL_NAME`
into `LLVM_TABLEGEN_FLANGS` in `llvm/lib/cmake/llvm/TableGen.cmake` as

```
list(APPEND LLVM_TABLEGEN_FLAGS "-DLOCAL_NAME")
```

And in `./llvm/lib/Target/PowerPC/PPC.td`, we check it for some
downstream code as:

```
...
#ifdef LOCAL_NAME

    [10 lines not shown]
DeltaFile
+10-0mlir/tools/mlir-src-sharder/mlir-src-sharder.cpp
+10-01 files

LLVM/project 40b322bllvm/test/Analysis/ScalarEvolution backedge-taken-count-guard-info.ll, llvm/test/Transforms/IndVarSimplify trip-count-expansion-loop-guard-preserve-nsw.ll

[SCEV] Add tests for missed NSW preservation during loop guard handling.

Add test coverage for missed simplification.
DeltaFile
+47-0llvm/test/Transforms/IndVarSimplify/trip-count-expansion-loop-guard-preserve-nsw.ll
+34-0llvm/test/Analysis/ScalarEvolution/backedge-taken-count-guard-info.ll
+81-02 files

LLVM/project 665af09llvm/include/llvm/TargetParser Triple.h, llvm/lib/Target/DirectX DXILMetadata.cpp

[DirectX backend] emits metadata for DXIL version. (#88350)

Emit named metadata "dx.version" for DXIL version.

Default to DXIL 1.0
DeltaFile
+79-0llvm/unittests/TargetParser/TripleTest.cpp
+12-0llvm/test/CodeGen/DirectX/Metadata/dxilVer-1.8.ll
+12-0llvm/test/CodeGen/DirectX/Metadata/dxilVer-1.0.ll
+12-0llvm/lib/Target/DirectX/DXILMetadata.cpp
+11-0llvm/lib/TargetParser/Triple.cpp
+4-0llvm/include/llvm/TargetParser/Triple.h
+130-02 files not shown
+132-08 files

LLVM/project 7b1d6a7mlir/include/mlir/Dialect/Tensor/IR TensorOps.td, mlir/include/mlir/IR OpDefinition.h OpBase.td

[mlir][IR] Support op interfaces in `HasParent` trait

This commit adds support for op interfaces to `HasParent`: an op interface can now be specified as a parent.

To produce useful error messages, a new helper function `getInterfaceName` is generated for every op interface. This is similar to `getOperationName`, which is generated for operations.

This commit addresses a TODO in `TensorOps.td`.
DeltaFile
+22-1mlir/include/mlir/IR/OpDefinition.h
+8-2mlir/tools/mlir-tblgen/OpInterfacesGen.cpp
+9-0mlir/test/Dialect/Tensor/invalid.mlir
+0-4mlir/lib/Dialect/Tensor/IR/TensorOps.cpp
+1-2mlir/include/mlir/Dialect/Tensor/IR/TensorOps.td
+1-1mlir/include/mlir/IR/OpBase.td
+41-106 files

LLVM/project 3ceacd8clang/test/CodeGenCoroutines coro-dwarf.cpp

[Coro] Relax a debug-info test (#91401)

Debug-info metadata does not have a strictly defined order. Check that
elements are linked to each other correctly, not that metadata appears
in a particular order.
DeltaFile
+6-10clang/test/CodeGenCoroutines/coro-dwarf.cpp
+6-101 files

LLVM/project 686a206llvm/lib/Transforms/IPO SampleProfile.cpp, llvm/test/Transforms/SampleProfile overflow.ll

[SampleProfileLoader] Fix integer overflow in generateMDProfMetadata (#90217)

This patch fixes an integer overflow in the SampleProfileLoader pass.
The issue occurs when weights are saturated and Profi isn't being used.

This patch also adds a newline to a debug message to make it more
readable.
DeltaFile
+77-0llvm/test/Transforms/SampleProfile/overflow.ll
+4-2llvm/lib/Transforms/IPO/SampleProfile.cpp
+2-0llvm/test/Transforms/SampleProfile/Inputs/overflow.proftext
+83-23 files

LLVM/project c84c74ellvm/test/CodeGen/AArch64 sve-extract-fixed-from-scalable-vector.ll

[LLVM][CodeGen][SVE] Add tests for vector extracts from unpacked types.
DeltaFile
+76-2llvm/test/CodeGen/AArch64/sve-extract-fixed-from-scalable-vector.ll
+76-21 files

LLVM/project db4cf7c.github CODEOWNERS

Update CODEOWNERS

Adding myself to linalg dialect
DeltaFile
+2-2.github/CODEOWNERS
+2-21 files

LLVM/project 737e0bcllvm/include/llvm/CodeGen/GlobalISel GenericMachineInstrs.h CombinerHelper.h, llvm/include/llvm/Target/GlobalISel Combine.td

[GlobalIsel] combine ext of trunc with flags (#87115)

https://github.com/llvm/llvm-project/pull/85592

https://discourse.llvm.org/t/rfc-add-nowrap-flags-to-trunc/77453

https://github.com/llvm/llvm-project/pull/88609
DeltaFile
+353-0llvm/test/CodeGen/AArch64/GlobalISel/combine-with-flags.mir
+75-8llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
+53-0llvm/include/llvm/CodeGen/GlobalISel/GenericMachineInstrs.h
+17-1llvm/include/llvm/Target/GlobalISel/Combine.td
+9-4llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h
+7-5llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp
+514-182 files not shown
+522-218 files

LLVM/project c5509feclang/include/clang/Basic AttrDocs.td, clang/lib/Parse ParseHLSL.cpp

[HLSL] Support packoffset attribute in AST (#89836)

Add HLSLPackOffsetAttr to save packoffset in AST.

Since we have to parse the attribute manually in ParseHLSLAnnotations,
we could create the ParsedAttribute with a integer offset parameter
instead of string. This approach avoids parsing the string if the offset
is saved as a string in HLSLPackOffsetAttr.

For #57914.
DeltaFile
+122-0clang/test/SemaHLSL/packoffset-invalid.hlsl
+100-0clang/test/AST/HLSL/packoffset.hlsl
+88-0clang/lib/Parse/ParseHLSL.cpp
+80-0clang/lib/Sema/SemaHLSL.cpp
+52-0clang/lib/Sema/SemaDeclAttr.cpp
+20-0clang/include/clang/Basic/AttrDocs.td
+462-04 files not shown
+484-010 files

LLVM/project c5a6fd7mlir/include/mlir/Transforms Mem2Reg.h, mlir/lib/Transforms Mem2Reg.cpp

[MLIR][Mem2Reg] Change API to always retry promotion after changes

This commit modifies the Mem2Reg's API to always attempt a full
promotion on all the passed in "allocators". This ensures that the pass
does not require unnecessary walks over the regions and improves caching
benefits.
DeltaFile
+35-25mlir/lib/Transforms/Mem2Reg.cpp
+3-3mlir/include/mlir/Transforms/Mem2Reg.h
+38-282 files

LLVM/project 943617dclang/lib/CodeGen CGExprAgg.cpp

Typo fix; NFC
DeltaFile
+1-1clang/lib/CodeGen/CGExprAgg.cpp
+1-11 files

LLVM/project 4df88d0clang/test/OpenMP tile_codegen.cpp tile_codegen_tile_for.cpp, openmp/runtime/test/transform/tile parallel-wsloop-collapse-foreach.cpp iterfor.cpp

Fix for-each and iterator loops
DeltaFile
+678-209clang/test/OpenMP/tile_codegen.cpp
+366-0openmp/runtime/test/transform/tile/parallel-wsloop-collapse-foreach.cpp
+233-0openmp/runtime/test/transform/tile/iterfor.cpp
+228-0openmp/runtime/test/transform/tile/foreach.cpp
+108-104clang/test/OpenMP/tile_codegen_tile_for.cpp
+199-0openmp/runtime/test/transform/unroll/factor_parallel-wsloop-collapse-foreach.cpp
+1,812-31312 files not shown
+2,500-43918 files

LLVM/project b6fbe42clang/test/OpenMP tile_codegen.cpp tile_codegen_tile_for.cpp, openmp/runtime/test/transform/tile parallel-wsloop-collapse-foreach.cpp iterfor.cpp

Fix for-each and iterator loops
DeltaFile
+678-209clang/test/OpenMP/tile_codegen.cpp
+366-0openmp/runtime/test/transform/tile/parallel-wsloop-collapse-foreach.cpp
+233-0openmp/runtime/test/transform/tile/iterfor.cpp
+228-0openmp/runtime/test/transform/tile/foreach.cpp
+108-104clang/test/OpenMP/tile_codegen_tile_for.cpp
+199-0openmp/runtime/test/transform/unroll/factor_parallel-wsloop-collapse-foreach.cpp
+1,812-31312 files not shown
+2,504-43918 files

LLVM/project 018e06fclang/test/OpenMP tile_codegen.cpp tile_codegen_tile_for.cpp, openmp/runtime/test/transform/tile parallel-wsloop-collapse-foreach.cpp iterfor.cpp

Fix for-each and iterator loops
DeltaFile
+678-209clang/test/OpenMP/tile_codegen.cpp
+366-0openmp/runtime/test/transform/tile/parallel-wsloop-collapse-foreach.cpp
+233-0openmp/runtime/test/transform/tile/iterfor.cpp
+228-0openmp/runtime/test/transform/tile/foreach.cpp
+108-104clang/test/OpenMP/tile_codegen_tile_for.cpp
+199-0openmp/runtime/test/transform/unroll/factor_parallel-wsloop-collapse-foreach.cpp
+1,812-31313 files not shown
+2,504-47319 files

LLVM/project 6fa0961clang/lib/StaticAnalyzer/Checkers MIGChecker.cpp

[analyzer] Use explicit call description mode in MIGChecker (#91331)

This commit explicitly specifies the matching mode (C library function,
any non-method function, or C++ method) for the `CallDescription`s
constructed in the checker `osx.MIG`.

The code was simplified to use a `CallDescriptionMap` instead of a raw
vector of pairs.

This change won't cause major functional changes, but isn't NFC because
it ensures that e.g. call descriptions for a non-method function won't
accidentally match a method that has the same name.

Separate commits have already performed this change in other checkers:
- easy cases: e2f1cbae45f81f3cd9a4d3c2bcf69a094eb060fa,
    6d64f8e1feee014e72730a78b62d9d415df112ff
- MallocChecker: d6d84b5d1448e4f2e24b467a0abcf42fe9d543e9
- iterator checkers: 06eedffe0d2782922e63cc25cb927f4acdaf7b30
- InvalidPtr checker: 024281d4d26344f9613b9115ea1fcbdbdba23235

    [6 lines not shown]
DeltaFile
+13-13clang/lib/StaticAnalyzer/Checkers/MIGChecker.cpp
+13-131 files

LLVM/project 1922011llvm/lib/Target/PowerPC PPCISelDAGToDAG.cpp PPCAsmPrinter.cpp, llvm/test/CodeGen/PowerPC aix-small-local-dynamic-tls-largeaccess.ll aix-small-local-dynamic-tls-types.ll

[PowerPC][AIX] Refactor existing logic to handle non-zero offsets for aix-small-local-dynamic-tls (#89182)

To enable optimized small local-dynamic access sequence for non-zero
offsets, this patch refactors existing
2a50921553798d2db52ca6330c89f0f8a5bc2215.
DeltaFile
+60-88llvm/test/CodeGen/PowerPC/aix-small-local-dynamic-tls-largeaccess.ll
+44-45llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
+23-22llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+2-4llvm/test/CodeGen/PowerPC/aix-small-local-dynamic-tls-types.ll
+129-1594 files

LLVM/project 927913fllvm/lib/Transforms/Utils ValueMapper.cpp

[RemoveDIs] Fix remapping of DbgLabelRecords. (#91447)

We already remapped DILocations for DbgVariableRecords, but
DbgLabelRecords have debug locations too that need to be mapped the same
way.
DeltaFile
+6-3llvm/lib/Transforms/Utils/ValueMapper.cpp
+6-31 files

LLVM/project c35e1f2mlir/lib/Transforms Mem2Reg.cpp

address review comments
DeltaFile
+5-4mlir/lib/Transforms/Mem2Reg.cpp
+5-41 files

LLVM/project 341aeccclang/include/clang/Basic DiagnosticParseKinds.td, clang/lib/Parse ParseOpenMP.cpp

Revert "Revert "Revert "[OpenMP][TR12] change property of map-type modifier."… (#91141)"

This reverts commit a99ce615f19fec6fbb835490b89f53cba3cf9eff.

Caused test failure on following buildbot:
https://lab.llvm.org/buildbot/#/builders/139/builds/65066
DeltaFile
+46-59clang/test/OpenMP/target_map_messages.cpp
+0-58clang/test/OpenMP/target_ast_print.cpp
+8-43clang/lib/Parse/ParseOpenMP.cpp
+0-5clang/include/clang/Basic/DiagnosticParseKinds.td
+54-1654 files

LLVM/project aefad85clang-tools-extra/clangd Preamble.cpp

[clangd] Fix data race surfaced in clangd-tsan buildbot

We can have concurrent accesses to same PreambleData (e.g.
code-completion and ast-builds). Hence we need to
deep copy TargetOpts.
DeltaFile
+3-1clang-tools-extra/clangd/Preamble.cpp
+3-11 files

LLVM/project d4fef93utils/bazel/llvm-project-overlay/libc BUILD.bazel

[bazel][libc] Split up mutex libraries like ab3a9e724d87a4272782f76b90fb0872a6a86939 did
DeltaFile
+33-1utils/bazel/llvm-project-overlay/libc/BUILD.bazel
+33-11 files

LLVM/project df311a2llvm/include/llvm/IR InstrTypes.h, llvm/lib/CodeGen/GlobalISel IRTranslator.cpp

Add interface to check if a call has a deopt bundle (NFC) (#91348)

Encapsulate check that a call has a deopt bundle to make it easier to
change the deopt scheme.
DeltaFile
+5-0llvm/include/llvm/IR/InstrTypes.h
+2-2llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+1-2llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
+1-1llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
+9-54 files

LLVM/project 8f21294lld/test/ELF mips-eh_frame-pic.s, llvm/lib/CodeGen TargetLoweringObjectFileImpl.cpp

MIPS: Use pcrel|sdata4 for eh_frame (#91291)

Gas uses encoding DW_EH_PE_absptr for PIC, and gnu ld converts it to
DW_EH_PE_sdata4|DW_EH_PE_pcrel.
LLD doesn't have this workarounding, thus complains
```
  relocation R_MIPS_32 cannot be used against local symbol; recompile with -fPIC
  relocation R_MIPS_64 cannot be used against local symbol; recompile with -fPIC
```

So, let's generates asm/obj files with `DW_EH_PE_sdata4|DW_EH_PE_pcrel`
encoding. In fact, GNU ld supports such OBJs well.

For N64, maybe we should use sdata8, while GNU ld doesn't support it
well, and in fact sdata4 is enough now. So we just ignore the `Large`
for `MCObjectFileInfo::initELFMCObjectFileInfo`. Maybe we should switch
back to sdata8 once GNU LD supports it well.

Fixes: #58377.
DeltaFile
+4-5llvm/test/MC/Mips/eh-frame.s
+5-3lld/test/ELF/mips-eh_frame-pic.s
+3-3llvm/test/DebugInfo/Mips/eh_frame.ll
+3-3llvm/test/CodeGen/Mips/ehframe-indirect.ll
+3-1llvm/lib/MC/MCObjectFileInfo.cpp
+1-3llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+19-186 files

LLVM/project dd4bf22llvm/lib/Target/X86 X86ISelLowering.cpp, llvm/test/CodeGen/X86 vector-shuffle-256-v4.ll vector-shuffle-combining-avx.ll

[X86] combineBlendOfPermutes - don't introduce lane-crossing permutes without AVX2 support.

Fixes #91433
DeltaFile
+22-0llvm/test/CodeGen/X86/vector-shuffle-256-v4.ll
+12-7llvm/lib/Target/X86/X86ISelLowering.cpp
+2-1llvm/test/CodeGen/X86/vector-shuffle-combining-avx.ll
+36-83 files

LLVM/project 1a49810mlir/test/Conversion/ArmSMEToLLVM arm-sme-to-llvm.mlir, mlir/test/Dialect/ArmSME basic-tile-allocation.mlir tile-allocation.mlir

[mlir][ArmSME][test] Prepare tests for tile allocation changes (#91358)

This patch:

 1. Removes some duplicate test cases
 2. Removes unnecessary uses of `-convert-arm-sme-to-llvm`
 3. Ensures tile values have uses via `test.some_use()`

1 and 2 will make these tests easier to update. 3 will be needed as
ArmSME operations will be pure.
DeltaFile
+406-0mlir/test/Dialect/ArmSME/basic-tile-allocation.mlir
+0-371mlir/test/Dialect/ArmSME/tile-allocation.mlir
+29-14mlir/test/Dialect/ArmSME/tile-zero-masks.mlir
+22-2mlir/test/Conversion/ArmSMEToLLVM/arm-sme-to-llvm.mlir
+6-14mlir/test/Dialect/ArmSME/enable-arm-za.mlir
+4-3mlir/test/Dialect/ArmSME/outer-product-fusion.mlir
+467-4042 files not shown
+474-4058 files

LLVM/project 602df27clang/include/clang/Driver Options.td, clang/lib/Driver/ToolChains Flang.cpp

[Flang] RFC: Add support for -w option 1/n (#90420)

Add support for the -w option to switch OFF all Flang
warnings. This patch only supports switching OFF the
frontend warnings.

TODO : Support for MLIR, LLVM and Driver warnings.
TODO : Support interactions between -w, -pedantic, -Wall
DeltaFile
+31-0flang/test/Driver/w-option.f90
+10-0flang/lib/Frontend/CompilerInvocation.cpp
+8-0flang/include/flang/Frontend/CompilerInvocation.h
+4-0clang/lib/Driver/ToolChains/Flang.cpp
+1-1clang/include/clang/Driver/Options.td
+54-15 files

LLVM/project 746bf29flang/lib/Semantics check-omp-structure.cpp, flang/test/Semantics/OpenMP do08.f90

[Flang][OpenMP] Add checks for EXIT from associated loops (#91315)

Extend the checker that deals with CYCLE to handle EXIT also. The
difference for EXIT is that it is not allowed to EXIT from the innermost
associated loops while it is OK to CYCLE in the innermost associated
loop. Also add an incrementer on leaving the DO loop for EXIT checks.
DeltaFile
+32-15flang/lib/Semantics/check-omp-structure.cpp
+31-0flang/test/Semantics/OpenMP/do08.f90
+63-152 files