Changes

Summary

  1. [RISCV] Reuse existing SDLoc and XLenVT in the switch in RISCVISelDAGToDAG::Select. NFC (details)
  2. OpenMP: Fix object clobbering issue when using save-temps (details)
  3. [debugserver] Fix logic to extract app bundle from file path (details)
  4. [clang][RecoveryAST] Add design doc to clang internal manual. (details)
  5. [mlir] Fix emitting attribute documentation (details)
  6. [mlir][nfc] Fix typo in documentation comment (details)
  7. [clang][cli] Add MarshallingInfoEnum multiclass (details)
  8. [clang][cli] Remove marshalling from Opt{In,Out}FFlag (details)
  9. [clangd] NFC, remove an extra "class" keyword. (details)
  10. [AArch64] Add abs intrinsic costs (details)
  11. [clang][cli] Store additional optimization remarks info (details)
  12. [clang][cli] Round-trip the whole CompilerInvocation (details)
  13. AArch64: relax address-space assertion in FastISel. (details)
  14. [CodeGen] Canonicalise adds/subs of i1 vectors using XOR (details)
  15. Prefer /usr/bin/env xxx over /usr/bin/xxx where xxx = perl, python, awk (details)
  16. [lldb] Let ClangASTImporter assert that the target AST has an external source (details)
  17. [lldb][NFC] Remove some obsolete comments in ClangASTImporter.cpp (details)
  18. Support standalone build of clang-tidy unittest (details)
  19. [X86][SSE] Move unaryshuffle(xor(x,-1)) -> xor(unaryshuffle(x),-1) fold into helper. NFCI. (details)
  20. [NARY-REASSOCIATE] Support reassociation of min/max (details)
Commit 159f78fc2f50e385e7cd529d41e19c858ef3e10e by craig.topper
[RISCV] Reuse existing SDLoc and XLenVT in the switch in RISCVISelDAGToDAG::Select. NFC

A SDLoc and XLenVT were already created above the switch.
The file was modifiedllvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
Commit 99951aa68da3c85ba03edf977cd9b22458aae6ca by Pushpinder.Singh
OpenMP: Fix object clobbering issue when using save-temps

There are two preconditions to reproduce the issue,
1. Use -save-temps option
2. Provide the -o option with name equal to the input file name
    without the file extension. For e.g. clang a.c -o a

With the -o specified, the AssembleJobAction after OffloadWrapperJobAction
will produce the object file with same name as host code object file.
Due to this clash, the OffloadWrapperAction overwrites the initial host
object file, which results in lld error. This also fixes the `multiple definition of __dummy.omp_offloading.entry'` issue in D96769 .

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D97273
The file was modifiedclang/test/Driver/openmp-offload-gpu.c
The file was modifiedclang/lib/Driver/Driver.cpp
Commit 011a8e218ea32e1c8bbbeb5925def894ac6513a4 by Jonas Devlieghere
[debugserver] Fix logic to extract app bundle from file path

Fix the logic to find the app bundle in a path by correctly accounting
for paths containing multiple occurrences of `.app`. The new logic will
correctly extract `com.app.Foo.app` from `com.app.Foo.app/com.app.Foo`.

rdar://74666208

Differential revision: https://reviews.llvm.org/D97441
The file was modifiedlldb/tools/debugserver/source/MacOSX/MachProcess.mm
Commit 77a8589e5d2f1b3886a9831ae8468f97741991e7 by hokein.wu
[clang][RecoveryAST] Add design doc to clang internal manual.

Hopefully it would be useful for new developers.

Differential Revision: https://reviews.llvm.org/D96944
The file was modifiedclang/docs/InternalsManual.rst
Commit 699041123eba13a2d5ee253eeeaeb15893d21ce7 by marius.brehler
[mlir] Fix emitting attribute documentation

This fixes the documentation emitted for type parameters. Also adds a
missing empty line, rendered as line break in mark down.

Co-authored-by: Simon Camphausen <simon.camphausen@iml.fraunhofer.de>

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D97267
The file was modifiedmlir/tools/mlir-tblgen/OpDocGen.cpp
Commit 2d870a2f557b6aea9f37594a3341a2e890db8621 by marius.brehler
[mlir][nfc] Fix typo in documentation comment
The file was modifiedmlir/lib/Dialect/Tosa/Transforms/TosaMakeBroadcastable.cpp
Commit 88e45f00c156170ed562bbacad3b2a21633c0f7a by Jan Svoboda
[clang][cli] Add MarshallingInfoEnum multiclass

This patch introduces a tablegen multiclass called `MarshallingInfoEnum`. It has the same semantics as `MarshallingInfoString` had in combination with `AutoNormalizeEnum`, but it's easier to use and follows the convention used for other `MarshallingInfoXxx` multiclasses.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D97375
The file was modifiedllvm/include/llvm/Option/OptParser.td
The file was modifiedclang/include/clang/Driver/Options.td
The file was modifiedclang/docs/InternalsManual.rst
Commit d8a8e5d6240a1db809cd95106910358e69bbf299 by Jan Svoboda
[clang][cli] Remove marshalling from Opt{In,Out}FFlag

We can now express all marshalling semantics in `Opt{In,Out}FFlag` via `BoolFOption`.

This patch moves remaining `Opt{In,Out}FFlag` instances using marshalling to `BoolFOption` and removes marshalling capabilities from `Opt{In,Out}FFlag` entirely.

This simplifies the decisions developers have to make when creating new boolean options:
  * For simple cc1 flag pairs, use `Bool{,F,G}Option`.
  * For cc1 flag pairs that require complex marshalling logic, use `Opt{In,Out}FFlag` and implement marshalling manually.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D97370
The file was modifiedclang/lib/Frontend/CompilerInvocation.cpp
The file was modifiedclang/include/clang/Driver/Options.td
Commit b218f7c4baada3d22bf22bd3ca6e849bb2ce9289 by hokein.wu
[clangd] NFC, remove an extra "class" keyword.
The file was modifiedclang-tools-extra/clangd/ClangdLSPServer.cpp
Commit 30cb9c03b53ee03af2cdf16f4ee645e5dcff7e21 by stelios.ioannou
[AArch64] Add abs intrinsic costs

This patch adds cost-modelling for abs vector intrinsic.

Change-Id: I89007971bfb15f5b4a02a2eadfd43018e9a73976
The file was addedllvm/test/Analysis/CostModel/AArch64/abs.ll
The file was modifiedllvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
Commit a25e4a6da3fe43f631782b1668e0ac023f6b5848 by Jan Svoboda
[clang][cli] Store additional optimization remarks info

After a revision of D96274 changed `DiagnosticOptions` to not store all remark arguments **as-written**, it is no longer possible to reconstruct the arguments accurately from the class.

This is caused by the fact that for `-Rpass=regexp` and friends, `DiagnosticOptions` store only the group name `pass` and not `regexp`. This is the same representation used for the plain `-Rpass` argument.

Note that each argument must be generated exactly once in `CompilerInvocation::generateCC1CommandLine`, otherwise each subsequent call would produce more arguments than the previous one. Currently this works out because of the way `RoundTrip` splits the responsibilities for certain arguments based on what arguments were queried during parsing. However, this invariant breaks when we move to single round-trip for the whole `CompilerInvocation`.

This patch ensures that for one `-Rpass=regexp` argument, we don't generate two arguments (`-Rpass` from `DiagnosticOptions` and `-Rpass=regexp` from `CodeGenOptions`) by shifting the responsibility for handling both cases to `CodeGenOptions`. To distinguish between the cases correctly, additional information is stored in `CodeGenOptions`.

The `CodeGenOptions` parser of `-Rpass[=regexp]` arguments also looks at `-Rno-pass` and `-R[no-]everything`, which is necessary for generating the correct argument regardless of the ordering of `CodeGenOptions`/`DiagnosticOptions` parsing/generation.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D96847
The file was modifiedclang/include/clang/Basic/CodeGenOptions.h
The file was modifiedclang/lib/Frontend/CompilerInvocation.cpp
The file was modifiedclang/lib/CodeGen/CodeGenAction.cpp
Commit d748908fa02b11c7840a7f03c7a52223126bdba9 by Jan Svoboda
[clang][cli] Round-trip the whole CompilerInvocation

Finally, this patch moves from round-tripping one `CompilerInvocation` at a time to round-tripping the invocation as a whole.

This patch includes only the code required to make round-tripping the whole invocation work. More cleanups will be done in a follow-up patch.

Depends on D96847, D97041 & D97042.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D96280
The file was modifiedclang/lib/Frontend/CompilerInvocation.cpp
The file was modifiedclang/test/Frontend/round-trip-cc1-args.c
The file was modifiedclang/include/clang/Basic/DiagnosticDriverKinds.td
The file was modifiedclang/include/clang/Frontend/CompilerInvocation.h
Commit 201ada80ee15aed23728500982857ad3769f6802 by Tim Northover
AArch64: relax address-space assertion in FastISel.

Some people are using alternative address spaces to track GC data, but
otherwise they behave exactly the same. This is the only place in the backend
we even try to care about it so it's really not achieving anything.
The file was modifiedllvm/lib/Target/AArch64/AArch64FastISel.cpp
Commit 87dbcd88651a4e72fc8f5e1594f9b02232277301 by david.sherwood
[CodeGen] Canonicalise adds/subs of i1 vectors using XOR

When calling SelectionDAG::getNode() to create an ADD or SUB
of two vectors with i1 element types we can canonicalise this
to use XOR instead, where 1+1 is treated as wrapping around
to 0 and 0-1 wraps to 1.

I've added the following tests for SVE targets:

  CodeGen/AArch64/sve-pred-arith.ll

and modified some X86 tests to reflect the much simpler codegen
required.

Differential Revision: https://reviews.llvm.org/D97276
The file was modifiedllvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
The file was modifiedllvm/test/CodeGen/X86/avx512-mask-op.ll
The file was addedllvm/test/CodeGen/AArch64/sve-pred-arith.ll
The file was modifiedllvm/test/CodeGen/X86/avx512bw-mask-op.ll
Commit a54f160b3a98b91cd241a555d904a6b6453affc4 by Raphael Isemann
Prefer /usr/bin/env xxx over /usr/bin/xxx where xxx = perl, python, awk

Allow users to use a non-system version of perl, python and awk, which is useful
in certain package managers.

Reviewed By: JDevlieghere, MaskRay

Differential Revision: https://reviews.llvm.org/D95119
The file was modifiedlldb/docs/use/python-reference.rst
The file was modifiedllvm/utils/llvm-native-gxx
The file was modifieddebuginfo-tests/llgdb-tests/test_debuginfo.pl
The file was modifiedclang/utils/TestUtils/pch-test.pl
The file was modifiedllvm/utils/codegen-diff
The file was modifiedllvm/utils/llvm-compilers-check
The file was modifiedclang/utils/analyzer/update_plist_test.pl
The file was modifiedllvm/utils/GenLibDeps.pl
The file was modifiedopenmp/runtime/tools/check-execstack.pl
The file was modifiedpolly/lib/External/isl/doc/mypod2latex
The file was modifiedllvm/utils/findsym.pl
The file was modifiedlldb/scripts/disasm-gdb-remote.pl
The file was modifiedclang/tools/scan-build/bin/set-xcode-analyzer
The file was modifiedclang/utils/analyzer/reducer.pl
The file was modifiedopenmp/runtime/tools/message-converter.pl
The file was modifiedclang/test/make_test_dirs.pl
The file was modifiedopenmp/runtime/tools/check-instruction-set.pl
The file was modifiedclang/www/demo/index.cgi
Commit 7cfa6e1cc64bc41e644cfc4a43bc122790896569 by Raphael Isemann
[lldb] Let ClangASTImporter assert that the target AST has an external source

This prevents people from accidentially using this code outside the
intended setup.
The file was modifiedlldb/source/Plugins/ExpressionParser/Clang/ClangASTImporter.h
Commit 2d6b767c1d15ec736b409370da33009de57de7f2 by Raphael Isemann
[lldb][NFC] Remove some obsolete comments in ClangASTImporter.cpp

The first two comments are incomplete and reference obsolete code. The
last one is just commented out code (that also doesn't look correct).
The file was modifiedlldb/source/Plugins/ExpressionParser/Clang/ClangASTImporter.cpp
Commit f0e461057221ad334cd194211ef4fa31364054e3 by sguelton
Support standalone build of clang-tidy unittest

Apply the same pattern as the one used in clangd/unittests/CMakeLists.txt

Differential Revision: https://reviews.llvm.org/D96788
The file was modifiedclang-tools-extra/unittests/clang-tidy/CMakeLists.txt
Commit 8b82669d56936b135fb0729368a8f5dbb2fb3639 by llvm-dev
[X86][SSE] Move unaryshuffle(xor(x,-1)) -> xor(unaryshuffle(x),-1) fold into helper. NFCI.

We should be able to extend this "canonicalizeShuffleWithBinOps" to handle more generic binop cases where either/both operands can be cheaply shuffled.
The file was modifiedllvm/lib/Target/X86/X86ISelLowering.cpp
Commit 83d134c3c4222e8b8d3d90c099f749a3b3abc8e0 by ybrevnov
[NARY-REASSOCIATE] Support reassociation of min/max

Support reassociation for min/max. With that we should be able to transform min(min(a, b), c) -> min(min(a, c), b) if min(a, c) is already available.

Reviewed By: mkazantsev

Differential Revision: https://reviews.llvm.org/D88287
The file was modifiedllvm/test/Transforms/NaryReassociate/nary-umax.ll
The file was modifiedllvm/include/llvm/Transforms/Scalar/NaryReassociate.h
The file was modifiedllvm/test/Transforms/NaryReassociate/nary-smax.ll
The file was modifiedllvm/test/Transforms/NaryReassociate/nary-umin.ll
The file was modifiedllvm/lib/Transforms/Scalar/NaryReassociate.cpp
The file was modifiedllvm/include/llvm/IR/PatternMatch.h
The file was modifiedllvm/test/Transforms/NaryReassociate/nary-smin.ll