Changes

Summary

  1. [AArch64] Add abs intrinsic costs (details)
  2. [clang][cli] Store additional optimization remarks info (details)
  3. [clang][cli] Round-trip the whole CompilerInvocation (details)
  4. AArch64: relax address-space assertion in FastISel. (details)
  5. [CodeGen] Canonicalise adds/subs of i1 vectors using XOR (details)
  6. Prefer /usr/bin/env xxx over /usr/bin/xxx where xxx = perl, python, awk (details)
  7. [lldb] Let ClangASTImporter assert that the target AST has an external source (details)
  8. [lldb][NFC] Remove some obsolete comments in ClangASTImporter.cpp (details)
  9. Support standalone build of clang-tidy unittest (details)
  10. [X86][SSE] Move unaryshuffle(xor(x,-1)) -> xor(unaryshuffle(x),-1) fold into helper. NFCI. (details)
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 modifiedllvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
The file was addedllvm/test/Analysis/CostModel/AArch64/abs.ll
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/lib/Frontend/CompilerInvocation.cpp
The file was modifiedclang/lib/CodeGen/CodeGenAction.cpp
The file was modifiedclang/include/clang/Basic/CodeGenOptions.h
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/include/clang/Frontend/CompilerInvocation.h
The file was modifiedclang/include/clang/Basic/DiagnosticDriverKinds.td
The file was modifiedclang/test/Frontend/round-trip-cc1-args.c
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/test/CodeGen/X86/avx512-mask-op.ll
The file was modifiedllvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
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 modifiedllvm/utils/findsym.pl
The file was modifiedclang/utils/TestUtils/pch-test.pl
The file was modifiedclang/utils/analyzer/reducer.pl
The file was modifiedllvm/utils/GenLibDeps.pl
The file was modifiedllvm/utils/llvm-compilers-check
The file was modifiedpolly/lib/External/isl/doc/mypod2latex
The file was modifiedlldb/docs/use/python-reference.rst
The file was modifiedopenmp/runtime/tools/check-execstack.pl
The file was modifieddebuginfo-tests/llgdb-tests/test_debuginfo.pl
The file was modifiedlldb/scripts/disasm-gdb-remote.pl
The file was modifiedopenmp/runtime/tools/message-converter.pl
The file was modifiedclang/www/demo/index.cgi
The file was modifiedclang/test/make_test_dirs.pl
The file was modifiedopenmp/runtime/tools/check-instruction-set.pl
The file was modifiedllvm/utils/codegen-diff
The file was modifiedclang/tools/scan-build/bin/set-xcode-analyzer
The file was modifiedllvm/utils/llvm-native-gxx
The file was modifiedclang/utils/analyzer/update_plist_test.pl
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