SuccessChanges

Summary

  1. [clangd] Factor out the heuristic resolver code into its own class (details)
  2. [gn build] Port 9510b0940265 (details)
  3. [flang][f18] Make -fdebug-dump-{symbols|parse-tree} imply -fsyntax-only (details)
  4. Lower math.expm1 to intrinsics in the GPUToNVVM and GPUToROCDL conversions. (details)
  5. [SCEVExpander] Migrate costAndCollectOperands to use InstructionCost. (details)
  6. [flang][driver] Add options for unparsing (details)
  7. [mlir][Linalg] Generalize vector::transfer hoisting on tensors. (details)
  8. [flang][driver] Remove unused code (nfc) (details)
  9. [RISCV] Add patterns for scalable-vector fabs & fcopysign (details)
  10. [RISCV] Fix a crash in fixed-length build_vector lowering (details)
  11. [RISCV] Remove unused CHECKs from recent test addition (details)
  12. [llvm-symbolizer][test] Add explicit tests for CODE and DATA (details)
  13. [mlir] Don't return nullptrs from scf::IfOp::getSuccessorRegions (details)
  14. [flang][driver] Add extension options and -finput-charset (details)
Commit 9510b09402659e6ba6e29b9caf0504c89bc72871 by zeratul976
[clangd] Factor out the heuristic resolver code into its own class

The patch also does some cleanup on the interface of the entry
points from TargetFinder into the heuristic resolution code.

Since the heuristic resolver is created in a place where the
ASTContext is available, it can store the ASTContext and the
NameFactory hack can be removed.

Differential revision: https://reviews.llvm.org/D92290
The file was addedclang-tools-extra/clangd/HeuristicResolver.cpp
The file was modifiedclang-tools-extra/clangd/refactor/Rename.cpp
The file was modifiedclang-tools-extra/clangd/refactor/tweaks/ExtractFunction.cpp
The file was modifiedclang-tools-extra/clangd/SemanticHighlighting.cpp
The file was modifiedclang-tools-extra/clangd/unittests/FindTargetTests.cpp
The file was modifiedclang-tools-extra/clangd/refactor/tweaks/DefineInline.cpp
The file was modifiedclang-tools-extra/clangd/ASTSignals.cpp
The file was modifiedclang-tools-extra/clangd/CMakeLists.txt
The file was modifiedclang-tools-extra/clangd/ParsedAST.cpp
The file was modifiedclang-tools-extra/clangd/Hover.cpp
The file was modifiedclang-tools-extra/clangd/FindTarget.cpp
The file was modifiedclang-tools-extra/clangd/FindTarget.h
The file was modifiedclang-tools-extra/clangd/XRefs.cpp
The file was modifiedclang-tools-extra/clangd/ParsedAST.h
The file was addedclang-tools-extra/clangd/HeuristicResolver.h
The file was modifiedclang-tools-extra/clangd/refactor/tweaks/RemoveUsingNamespace.cpp
The file was modifiedclang-tools-extra/clangd/refactor/tweaks/DefineOutline.cpp
Commit 72af70127c4c8ca582e58cc3dee5466083adadb0 by llvmgnsyncbot
[gn build] Port 9510b0940265
The file was modifiedllvm/utils/gn/secondary/clang-tools-extra/clangd/BUILD.gn
Commit 548549e88ac4a1908206b888be24592e1dbcc38f by andrzej.warzynski
[flang][f18] Make -fdebug-dump-{symbols|parse-tree} imply -fsyntax-only

The following _action_ options are always used with `-fsyntax-only`
(also an _action_ option):
  * -fdebug-dump-symbols
  * -fdebug-dump-parse-tree
This patch makes the above options imply `-fsyntax-only`.

From the perspective of `f18` this change saves typing and is otherwise
a non-functional change. But it will simplify things in the new driver,
`flang-new`, in which only the last action option is taken into account
and executed. In other words, the following would only run
`-fsyntax-only`:
```
flang-new -fdebug-dump-symbols -fsyntax-only <input>
```
whereas this would only run `-fdebug-dump-symbols`:
```
flang-new -fsyntax-only -fdebug-dump-symbols <input>
```

Differential Revision: https://reviews.llvm.org/D96528
The file was modifiedflang/test/Semantics/offsets01.f90
The file was modifiedflang/test/Semantics/typeinfo01.f90
The file was modifiedflang/test/Semantics/data08.f90
The file was modifiedflang/test/Semantics/resolve100.f90
The file was modifiedflang/tools/f18/f18.cpp
The file was modifiedflang/test/Semantics/oldparam01.f90
The file was modifiedflang/test/Semantics/rewrite01.f90
The file was modifiedflang/test/Evaluate/test_folding.sh
The file was modifiedflang/test/Semantics/offsets03.f90
The file was modifiedflang/test/Semantics/oldparam02.f90
The file was modifiedflang/test/Semantics/data05.f90
The file was modifiedflang/test/Semantics/offsets02.f90
Commit 07cc77187a2fb558c5642f267a83b3621498f381 by akuegel
Lower math.expm1 to intrinsics in the GPUToNVVM and GPUToROCDL conversions.

This adds the lowering for expm1 for GPU backends.

Differential Revision: https://reviews.llvm.org/D96756
The file was modifiedmlir/lib/Conversion/GPUToROCDL/LowerGpuOpsToROCDLOps.cpp
The file was modifiedmlir/lib/Conversion/GPUToNVVM/LowerGpuOpsToNVVMOps.cpp
The file was modifiedmlir/test/Conversion/GPUToNVVM/gpu-to-nvvm.mlir
The file was modifiedmlir/test/Conversion/GPUToROCDL/gpu-to-rocdl.mlir
Commit 00fe10c6a65173c9c578babd19f8fee44d07a761 by sander.desmalen
[SCEVExpander] Migrate costAndCollectOperands to use InstructionCost.

This patch changes costAndCollectOperands to use InstructionCost for
accumulated cost values.

isHighCostExpansion will return true if the cost has exceeded the budget.

Reviewed By: CarolineConcatto, ctetreau

Differential Revision: https://reviews.llvm.org/D92238
The file was modifiedllvm/include/llvm/Transforms/Utils/ScalarEvolutionExpander.h
The file was modifiedllvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
Commit 96d229c9abdfb2836e18a554bfb63b5d52aeebfa by andrzej.warzynski
[flang][driver] Add options for unparsing

This patch adds the following compiler frontend driver options:
  * -fdebug-unparse (f18 spelling: -funparse)
  * -fdebug-unparse-with-symbols (f18 spelling: -funparse-with-symbols)
The new driver will only accept the new spelling. `f18` will accept both
the original and the new spelling.

A new base class for frontend actions is added: `PrescanAndSemaAction`.
This is added to reduce code duplication that otherwise these new
options would lead to. Implementation from
  * `ParseSyntaxOnlyAction::ExecutionAction`
is moved to:
  * `PrescanAndSemaAction::BeginSourceFileAction`
This implementation is now shared between:
  * PrescanAndSemaAction
  * ParseSyntaxOnlyAction
  * DebugUnparseAction
  * DebugUnparseWithSymbolsAction

All tests that don't require other yet unimplemented options are
updated. This way `flang-new -fc1` is used instead of `f18` when
`FLANG_BUILD_NEW_DRIVER` is set to `On`. In order to facilitate this,
`%flang_fc1` is added in the LIT configuration (lit.cfg.py).

`asFortran` from f18.cpp is duplicated as `getBasicAsFortran` in
FrontendOptions.cpp. At this stage it's hard to find a good place to
share this method. I suggest that we revisit this once a switch from
`f18` to `flang-new` is complete.

Differential Revision: https://reviews.llvm.org/D96483
The file was modifiedflang/test/Semantics/canondo04.f90
The file was modifiedflang/test/Semantics/doconcurrent02.f90
The file was modifiedflang/test/Semantics/label07.f90
The file was modifiedflang/test/Parser/continuation-in-if.f
The file was modifiedflang/test/Semantics/doconcurrent04.f90
The file was modifiedflang/test/Parser/pp-dir-comments.f90
The file was modifiedflang/test/Semantics/doconcurrent03.f90
The file was modifiedflang/test/Semantics/canondo03.f90
The file was modifiedflang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
The file was modifiedflang/test/lit.cfg.py
The file was modifiedflang/lib/Parser/CMakeLists.txt
The file was modifiedflang/include/flang/Frontend/FrontendActions.h
The file was modifiedflang/test/Semantics/label10.f90
The file was modifiedflang/lib/Frontend/FrontendActions.cpp
The file was modifiedflang/test/Semantics/label03.f90
The file was modifiedflang/tools/f18/f18.cpp
The file was modifiedflang/lib/Frontend/CMakeLists.txt
The file was modifiedflang/test/Semantics/label06.f90
The file was modifiedclang/include/clang/Driver/Options.td
The file was modifiedflang/lib/Frontend/CompilerInvocation.cpp
The file was modifiedflang/test/Semantics/canondo01.f90
The file was modifiedflang/test/Semantics/label15.f90
The file was modifiedflang/test/Semantics/label13.f90
The file was modifiedflang/test/Semantics/doconcurrent07.f90
The file was modifiedflang/test/Semantics/canondo05.f90
The file was modifiedflang/test/Semantics/defined-ops.f90
The file was modifiedflang/test/Semantics/label02.f90
The file was modifiedflang/test/Semantics/label09.f90
The file was modifiedflang/test/Semantics/critical04.f90
The file was modifiedflang/test/Semantics/label05.f90
The file was modifiedflang/lib/Frontend/FrontendOptions.cpp
The file was modifiedflang/test/Semantics/label04.f90
The file was modifiedflang/test/Semantics/label08.f90
The file was modifiedflang/test/Semantics/canondo02.f90
The file was modifiedflang/test/Flang-Driver/driver-help.f90
The file was modifiedflang/test/Semantics/label12.f90
The file was modifiedflang/include/flang/Frontend/FrontendOptions.h
Commit 21debeae785dc4d7c9718fe5b46857a2c2ce6670 by nicolas.vasilache
[mlir][Linalg] Generalize vector::transfer hoisting on tensors.

This revision adds support for hoisting "subtensor + vector.transfer_read" / "subtensor_insert + vector.transfer_write pairs" across scf.for.
The unit of hoisting becomes a HoistableRead / HoistableWrite struct which contains a pair of "vector.transfer_read + optional subtensor" / "vector.transfer_write + optional subtensor_insert".
scf::ForOp canonicalization patterns are applied greedily on the successful application of the transformation to cleanup the IR more eagerly and potentially expose more transformation opportunities.

Differential revision: https://reviews.llvm.org/D96731
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/Hoisting.cpp
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/CodegenStrategy.cpp
The file was modifiedmlir/test/Dialect/Linalg/hoisting.mlir
Commit df22133a8a402ed2d31ff92482678c5092792e66 by andrzej.warzynski
[flang][driver] Remove unused code (nfc)
The file was modifiedflang/include/flang/Frontend/FrontendOptions.h
Commit b8701990202cd305236401f76331d53e65953ef2 by fraser
[RISCV] Add patterns for scalable-vector fabs & fcopysign

The patterns mostly follow the scalar counterparts, save for some extra
optimizations to match the vector/scalar forms.

The patch adds a DAGCombine for ISD::FCOPYSIGN to try and reorder
ISD::FNEG around any ISD::FP_EXTEND or ISD::FP_TRUNC of the second
operand. This helps us achieve better codegen to match vfsgnjn.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D96028
The file was modifiedllvm/lib/Target/RISCV/RISCVISelLowering.cpp
The file was modifiedllvm/lib/Target/RISCV/RISCVInstrInfoVSDPatterns.td
The file was addedllvm/test/CodeGen/RISCV/rvv/vfabs-sdnode.ll
The file was addedllvm/test/CodeGen/RISCV/rvv/vfcopysign-sdnode.ll
Commit 04977ce5ce1ba9646baa75f1fb91af5d518a121e by fraser
[RISCV] Fix a crash in fixed-length build_vector lowering

Non-splatted non-integer build_vector nodes were mistakenly being
lowered as VID expressions, which should not happen. VID can only be
used to select integer build_vector nodes.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D96718
The file was addedllvm/test/CodeGen/RISCV/rvv/fixed-vectors-fp-buildvec.ll
The file was modifiedllvm/lib/Target/RISCV/RISCVISelLowering.cpp
Commit 0264ee536b4f88f202fab01c9f17943670011dc0 by fraser
[RISCV] Remove unused CHECKs from recent test addition

These didn't show up as failures locally.
The file was modifiedllvm/test/CodeGen/RISCV/rvv/fixed-vectors-fp-buildvec.ll
Commit c96fee98dbff50356f5cc92724e1fcfec2865c42 by james.henderson
[llvm-symbolizer][test] Add explicit tests for CODE and DATA

These directives force the associated address to be interpreted as a
function or data respectively. CODE is the default when not specified.

Differential Revision: https://reviews.llvm.org/D96712

Reviewed by: MaskRay
The file was addedllvm/test/tools/llvm-symbolizer/data.s
The file was addedllvm/test/tools/llvm-symbolizer/code.s
Commit 787d771dce71af03bc23527ca95fcb858934ae7a by tpopp
[mlir] Don't return nullptrs from scf::IfOp::getSuccessorRegions

Previously this might happen if there was no elseRegion and the method
was asked for all successor regions.

Differential Revision: https://reviews.llvm.org/D96764
The file was modifiedmlir/lib/Dialect/SCF/SCF.cpp
Commit 10826ea7b1c12c2afe421448996f98ed66869020 by faris.rehman
[flang][driver] Add extension options and -finput-charset

Add the following options:
* -fimplicit-none and -fno-implicit-none
* -fbackslash and -fno-backslash
* -flogical-abbreviations and -fno-logical-abbreviations
* -fxor-operator and -fno-xor-operator
* -falternative-parameter-statement
* -finput-charset=<value>

Summary of changes:
- Enable extensions in CompilerInvocation#ParseFrontendArgs
- Add encoding_ to Fortran::frontend::FrontendOptions
- Add encoding to Fortran::parser::Options

Differential Revision: https://reviews.llvm.org/D96407
The file was modifiedclang/include/clang/Driver/Options.td
The file was modifiedflang/test/Flang-Driver/driver-help-hidden.f90
The file was addedflang/test/Flang-Driver/escaped-backslash.f90
The file was addedflang/test/Flang-Driver/frontend-forwarding.f90
The file was modifiedflang/test/Semantics/oldparam02.f90
The file was modifiedflang/lib/Frontend/CompilerInvocation.cpp
The file was modifiedflang/test/Flang-Driver/driver-help.f90
The file was modifiedflang/lib/Frontend/CompilerInstance.cpp
The file was addedflang/test/Flang-Driver/implicit-none.f90
The file was modifiedflang/include/flang/Frontend/FrontendOptions.h
The file was modifiedflang/test/Semantics/resolve64.f90
The file was modifiedclang/lib/Driver/ToolChains/Flang.cpp
The file was modifiedflang/include/flang/Parser/parsing.h