Changes

Summary

  1. Run chromium's llvm update script with python3. (details)
Commit 55e9668c3fe654aa5f129a528e76aafcd14a0e21 by eugenis
Run chromium's llvm update script with python3.
The file was modifiedzorg/buildbot/builders/sanitizers/buildbot_functions.sh (diff)

Summary

  1. [AMDGPU] Implement llvm.amdgcn.mulhi.[i,u]24 intrinsics. (details)
  2. [AMDGPU] Enable 48-bit mul in AMDGPUCodeGenPrepare. (details)
  3. [PowerPC] use right extend type for SCEV (details)
  4. [libunwind] Take 2: Use the from-scratch testing configuration by default (details)
  5. [AMDGPU] Add constrained shift pattern matches. (details)
  6. [clang] Use consistent punctuation at end of Block NULL comment (details)
  7. [clang] Simplify CFG block printing code a bit (details)
  8. [clang] Make loop in CFGBuilder::VisitCXXTryStmt() more canonical (details)
  9. [clang] Implement CFG construction for @try and @catch (details)
  10. [openmp][lit] Add support to OpenMP lit.cfg for ROCR_VISIBLE_DEVICES env-var (details)
  11. [AMDGPU] Remove unused CSR defs (details)
  12. [clangd] IncludeCleaner: don't stop the traversal (details)
  13. sanitizer_common: fix deadlock detector output (details)
  14. tsan: turn off COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED (details)
  15. [libc++] Include nasty_macros.h when running tests with from-scratch configs (details)
  16. Specify Clang vector builtins. (details)
  17. [AIX][XCOFF] parsing xcoff object file auxiliary header (details)
  18. [SLP]Do not reorder reduction nodes. (details)
  19. [SystemZ] Improvement of emitMemMemWrapper() (details)
  20. [libFuzzer] Improve corpus replacement unit test. (details)
  21. [clang] Do not traverse EnumDecl's type in RecursiveASTVisitor (details)
  22. [clangd] Fix a hover crash on templated spaceship operator. (details)
  23. [clangd] AddUsing: Fix support for template specializations. (details)
  24. [lld-macho] Put GOT into `__DATA` segment where appropriate (details)
  25. [x86] add test/run for mayLoadFold with alignment; NFC (details)
  26. [Clang] Add elementwise min/max builtins. (details)
  27. [CodeGen, Hexagon] Use MachineBasicBlock::phis (NFC) (details)
  28. [mlir] Fix getVectorReductionOp (details)
  29. [analyzer] Fix StringChecker for Unknown params (details)
  30. [LoopVectorize] Clean up VPReductionRecipe::execute. NFC (details)
Commit 9bd5cfeb1fa4d7a235c1c665c7800b7891ee38a8 by abinav.puthanpurayil
[AMDGPU] Implement llvm.amdgcn.mulhi.[i,u]24 intrinsics.

These intrinsics maps to the 24-bit v_mul_hi instructions.

This change also fixes an incorrect assumption on the associativity of
24-bit mulhi in its SDNode record in tblgen.

Differential Revision: https://reviews.llvm.org/D112394
The file was addedllvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-amdgcn.mulhi.i24.mir
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp
The file was modifiedllvm/lib/Target/AMDGPU/VOP2Instructions.td
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPUInstrInfo.td
The file was addedllvm/test/CodeGen/AMDGPU/llvm.amdgcn.mulhi.u24.ll
The file was modifiedllvm/include/llvm/IR/IntrinsicsAMDGPU.td
The file was addedllvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-amdgcn.mulhi.u24.mir
The file was addedllvm/test/CodeGen/AMDGPU/llvm.amdgcn.mulhi.i24.ll
Commit 781dd39b7b6d6a3afecf7097c4fa51e194cac057 by abinav.puthanpurayil
[AMDGPU] Enable 48-bit mul in AMDGPUCodeGenPrepare.

We were bailing out of creating 24-bit muls for results wider than 32
bits in AMDGPUCodeGenPrepare. With the 24-bit mulhi intrinsic, this
change teaches AMDGPUCodeGenPrepare to generate the 48-bit mul
correctly.

Differential Revision: https://reviews.llvm.org/D112395
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp
The file was modifiedllvm/test/CodeGen/AMDGPU/amdgpu-codegenprepare-mul24.ll
Commit 631f44f3381fbdf369311f04f6150180434e9a84 by czhengsz
[PowerPC] use right extend type for SCEV

Fix an issue caused by D108750

Reviewed By: nemanjai

Differential Revision: https://reviews.llvm.org/D112502
The file was addedllvm/test/CodeGen/PowerPC/common-chain-aix32.ll
The file was modifiedllvm/lib/Target/PowerPC/PPCLoopInstrFormPrep.cpp
Commit 56b74613bf9168bb79e0088b424ec0b6dd0a66c9 by Louis Dionne
[libunwind] Take 2: Use the from-scratch testing configuration by default

Summary:
This commit switches libunwind from using the complicated logic in
libc++'s testing configuration to a from-scratch configuration.
I tried to make sure that all cases that were handled in the old
config were handled by this one too, so hopefully this shouldn't
break anyone. However, if you encounter issues with this change,
please let me know and feel free to revert if I don't reply quickly.

This change was engineered to be easily revertable.

This commit is a re-application of 5a8ad80b6fa5, which was reverted in
070a2ddcb665 because it broke the Bootstrapping build. This has now been
addressed by tweaking the from-scratch config.

Differential Revision: https://reviews.llvm.org/D112082
The file was modifiedlibunwind/CMakeLists.txt
Commit 61e3b9fefe1341e83ee959e0f533004ced0161f2 by abinav.puthanpurayil
[AMDGPU] Add constrained shift pattern matches.

The motivation for this is due to clang's conformance to
https://www.khronos.org/registry/OpenCL/specs/3.0-unified/html/OpenCL_C.html#operators-shift
which makes clang emit (<shift> a, (and b, <width> - 1)) for `a <shift> b`
in OpenCL where a is an int of bit width <width>.

Differential revision: https://reviews.llvm.org/D110231
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/fshr.ll
The file was modifiedllvm/lib/Target/AMDGPU/VOP3Instructions.td
The file was addedllvm/test/CodeGen/AMDGPU/constrained-shift.ll
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPUInstructions.td
The file was modifiedllvm/lib/Target/AMDGPU/SOPInstructions.td
The file was modifiedllvm/lib/Target/AMDGPU/VOP2Instructions.td
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/fshl.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/shift-i64-opts.ll
The file was modifiedllvm/lib/Target/AMDGPU/VOP3PInstructions.td
The file was modifiedllvm/lib/Target/AMDGPU/VOPInstructions.td
The file was modifiedllvm/test/CodeGen/AMDGPU/fshr.ll
Commit d054b31d5975f6cffeef8c9f3fa57e1c4b60d427 by thakis
[clang] Use consistent punctuation at end of Block NULL comment

No behavior change.
The file was modifiedclang/lib/Analysis/CFG.cpp
Commit aa42785d01cb498c1eb880e9f0e08f01006839c6 by thakis
[clang] Simplify CFG block printing code a bit

No behavior change.
The file was modifiedclang/lib/Analysis/CFG.cpp
Commit 0b7c9addce69ca089a23334490758907dd4ab0db by thakis
[clang] Make loop in CFGBuilder::VisitCXXTryStmt() more canonical

No behavior change.
The file was modifiedclang/lib/Analysis/CFG.cpp
Commit 04f30795f1663843b219393040946136786aa591 by thakis
[clang] Implement CFG construction for @try and @catch

@finally is still not implemented.

With this, clang can emit -Wreturn-type warnings for functions containing
@try/@catch (but not yet @finally), and -Wunreachable-code also works for those
functions.

The implementation is similar to D36914.

Part of PR46693.

Differential Revision: https://reviews.llvm.org/D112287
The file was addedclang/test/Sema/warn-unreachable.mm
The file was modifiedclang/test/SemaObjC/try-catch.m
The file was modifiedclang/lib/Analysis/CFG.cpp
The file was modifiedclang/test/Sema/warn-unreachable.c
The file was addedclang/test/Sema/warn-unreachable.m
Commit be03ef3ed1d18b8d5cf34816369dda94f474ccad by ron.lieberman
[openmp][lit] Add support to OpenMP lit.cfg for ROCR_VISIBLE_DEVICES env-var

add support for ROCR_VISIBLE_DEVICES similar to name and purpose
as CUDA_VISIBLE_DEVICES

Differential Revision: https://reviews.llvm.org/D112503
The file was modifiedopenmp/libomptarget/test/lit.cfg
Commit eb16570ab004ba2b9fa8b12ccc8cc12690ebe242 by sebastian.neubauer
[AMDGPU] Remove unused CSR defs

CSR_AMDGPU_VGPRs_24_255 and CSR_AMDGPU_VGPRs_32_255 are not used
anywhere, so remove them.

Differential Revision: https://reviews.llvm.org/D112535
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPUCallingConv.td
Commit 1c2e249f938c50e1b331a1f7adc83c0a381f3897 by kbobyrev
[clangd] IncludeCleaner: don't stop the traversal

I was under the impression that `return false;` in the
RecursiveASTVisitor stops the traversal for the subtree but it appears
that it stops the whole tree traversal, so this change introduces a bug
where `ReferencedLocationCrawler` will not collect any symbols past an
enum.

This is a follow-up on D112209.
The file was modifiedclang-tools-extra/clangd/IncludeCleaner.cpp
Commit d53abf834c4fde7a904b9cb7b1913ee38c768f21 by dvyukov
sanitizer_common: fix deadlock detector output

Print PC of the previous lock, not the current one.
The current one will be printed during unwind.

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D112533
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_mutex.cpp
Commit 5ec832269eedeeddcf00d34efd7272a107e2c7c1 by dvyukov
tsan: turn off COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED

All tsan interceptors check for initialization and/or initialize things
as necessary lazily, so we can pretend everything is initialized in the
COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED check to avoid double-checking
for initialization (this is only necessary for sanitizers that don't
handle initialization on common grounds).

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D112446
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp
Commit 6d52773547d99ec20e07cdd70197894378e96457 by Louis Dionne
[libc++] Include nasty_macros.h when running tests with from-scratch configs

This was forgotten when setting up the from-scratch configs.

Differential Revision: https://reviews.llvm.org/D112460
The file was modifiedlibcxx/test/configs/apple-libc++-shared.cfg.in
The file was modifiedlibcxx/test/configs/llvm-libc++-shared-gcc.cfg.in
The file was modifiedlibcxx/test/configs/llvm-libc++-shared.cfg.in
The file was modifiedlibcxx/test/configs/ibm-libc++-shared.cfg.in
The file was modifiedlibcxx/test/configs/llvm-libc++-static.cfg.in
Commit 025988ded6b2a57022dbf9775f35a1a933584bfa by flo
Specify Clang vector builtins.

This patch specifies a set of vector builtins for Clang, as discussed on
cfe-dev:
https://lists.llvm.org/pipermail/cfe-dev/2021-September/068999.html
https://lists.llvm.org/pipermail/cfe-dev/2021-October/069070.html

Reviewed By: scanon

Differential Revision: https://reviews.llvm.org/D111529
The file was modifiedclang/docs/LanguageExtensions.rst
Commit 158083f0de033dec4f4f9a68f558da6e68d30c35 by zhijian
[AIX][XCOFF] parsing xcoff object file auxiliary header
Summary:

The patch supports parsing the xcoff object file auxiliary header with llvm-readobj with option "auxiliary-headers"

the format of auxiliary header as
https://www.ibm.com/support/knowledgecenter/en/ssw_aix_72/filesreference/XCOFF.html#XCOFF__fyovh386shar

Reviewers: James Henderson, Jason Liu, Hubert Tong, Esme yi, Sean Fertile.

Differential Revision: https://reviews.llvm.org/D82549
The file was addedllvm/test/tools/llvm-readobj/XCOFF/Inputs/xcoff-32-xlc-obj.o
The file was modifiedllvm/tools/llvm-readobj/llvm-readobj.cpp
The file was addedllvm/test/tools/llvm-readobj/XCOFF/lit.local.cfg
The file was modifiedllvm/include/llvm/Object/XCOFFObjectFile.h
The file was addedllvm/test/tools/llvm-readobj/XCOFF/Inputs/xcoff-32-xlc-exec
The file was modifiedllvm/tools/llvm-readobj/Opts.td
The file was addedllvm/test/tools/llvm-readobj/XCOFF/Inputs/xcoff-32-xlc-obj-malform.o
The file was modifiedllvm/tools/llvm-readobj/ObjDumper.h
The file was modifiedllvm/lib/Object/XCOFFObjectFile.cpp
The file was addedllvm/test/tools/llvm-readobj/XCOFF/Inputs/xcoff-64-xlc-exec
The file was modifiedllvm/docs/CommandGuide/llvm-readobj.rst
The file was modifiedllvm/tools/llvm-readobj/XCOFFDumper.cpp
The file was addedllvm/test/tools/llvm-readobj/XCOFF/xcoff-auxiliary-header.test
Commit ce14d1b690d886ff6022a5cc0f2e40cc8ecb9a46 by a.bataev
[SLP]Do not reorder reduction nodes.

The final reduction nodes should not be reordered, the order does not
matter for reductions. Also, it might be profitable to vectorize smaller
reduction trees, reduction cost may compensate small tree cost.

Part of D111574

Differential Revision: https://reviews.llvm.org/D112467
The file was modifiedllvm/test/Transforms/SLPVectorizer/X86/horizontal-list.ll
The file was modifiedllvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
The file was modifiedllvm/test/Transforms/PhaseOrdering/X86/vector-reductions.ll
Commit bb506938be820df8c7992b7c567fa93afaab2bc4 by paulsson
[SystemZ] Improvement of emitMemMemWrapper()

It was discovered that an extra register COPY remained when expanding a
(variable length) memory operation with a loop and there was another use of
the involved address register(s) afterwards.

A simple fix for this is to COPY the address registers before the loop and
use that new vreg instead.

Review: Ulrich Weigand

Differential Revision: https://reviews.llvm.org/D112065
The file was modifiedllvm/lib/Target/SystemZ/SystemZISelLowering.cpp
The file was modifiedllvm/test/CodeGen/SystemZ/memset-05.ll
Commit 082d2ad015bdc3c70768d02beba905489daa1c0e by mascasa
[libFuzzer] Improve corpus replacement unit test.

Verify that SecondII is not replaced.
The file was modifiedcompiler-rt/lib/fuzzer/tests/FuzzerUnittest.cpp
Commit 03506722e0c348ce52d87f7f37f024d7adec5c43 by kbobyrev
[clang] Do not traverse EnumDecl's type in RecursiveASTVisitor

This is inconsistent with the code and comments in
RecursiveASTVisitor.h and is not a correct behavior:

https://github.com/llvm/llvm-project/blob/main/clang/include/clang/AST/RecursiveASTVisitor.h#L1879-L1880

> We shouldn't traverse D->getTypeForDecl(); it's a result of
> declaring the type, not something that was written in the source.

Fixes the failures in 1c2e249f938c50e1b331a1f7adc83c0a381f3897
The file was modifiedclang/include/clang/AST/RecursiveASTVisitor.h
Commit e8f4a01189143854f30e2bb622baa729a42f152d by adamcz
[clangd] Fix a hover crash on templated spaceship operator.

We make assumption that:
getDeclForComment(getDeclForComment(X)) == getDeclForComment(X)
but this is not true if you have a template
instantionation of a template instantiation, which is the case when, for
example, you have a <=> operator in a templated class.

This fix makes getDeclForComment() call itself recursively to ensure
this property is always true.

Fixes https://github.com/clangd/clangd/issues/901

Differential Revision: https://reviews.llvm.org/D112527
The file was modifiedclang-tools-extra/clangd/unittests/HoverTests.cpp
The file was modifiedclang-tools-extra/clangd/Hover.cpp
Commit 2174524116a8379fb7a6453253524ec972b158df by adamcz
[clangd] AddUsing: Fix support for template specializations.

Before this change, we would add "using std::vector<int>" instead of
just "using std::vector;", which would not even compile.

Fixes https://github.com/clangd/clangd/issues/904

Differential Revision: https://reviews.llvm.org/D112530
The file was modifiedclang-tools-extra/clangd/refactor/tweaks/AddUsing.cpp
The file was modifiedclang-tools-extra/clangd/unittests/tweaks/AddUsingTests.cpp
Commit 622150ad5f21149ae010188a06707d07b4d3865b by jezng
[lld-macho] Put GOT into `__DATA` segment where appropriate

We were previously always emitting the GOT into `__DATA_CONST`, even for
target platforms where it should end up in `__DATA`.

I stumbled onto this while trying to use the `class-dump` tool -- with
the wrong segment names, it fails to locate the ObjC runtime info and
therefore fails to dump any classes.

Reviewed By: #lld-macho, oontvoo

Differential Revision: https://reviews.llvm.org/D112500
The file was modifiedlld/MachO/SyntheticSections.cpp
The file was modifiedlld/test/MachO/builtin-rename.s
Commit 4f423e91276d302550b3b4d932c6694297d6882e by spatel
[x86] add test/run for mayLoadFold with alignment; NFC
The file was modifiedllvm/test/CodeGen/X86/vec_insert-5.ll
Commit 1ef25d28c19e3b2e956ffcb39c91f98c154f9b3f by flo
[Clang] Add elementwise min/max builtins.

This patch implements __builtin_elementwise_max and
__builtin_elementwise_min, as specified in D111529.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D111985
The file was modifiedclang/include/clang/Sema/Sema.h
The file was modifiedclang/lib/Sema/SemaChecking.cpp
The file was addedclang/test/CodeGen/builtins-elementwise-math.c
The file was modifiedclang/include/clang/Basic/DiagnosticSemaKinds.td
The file was modifiedclang/lib/CodeGen/CGBuiltin.cpp
The file was addedclang/test/Sema/builtins-elementwise-math.c
The file was addedclang/test/SemaCXX/builtins-elementwise-math.cpp
The file was modifiedclang/include/clang/Basic/Builtins.def
Commit c3e698e2f532262058691701d424da464012f0c0 by kazu
[CodeGen, Hexagon] Use MachineBasicBlock::phis (NFC)
The file was modifiedllvm/lib/Target/Hexagon/HexagonConstPropagation.cpp
The file was modifiedllvm/lib/CodeGen/ModuloSchedule.cpp
The file was modifiedllvm/lib/CodeGen/MachinePipeliner.cpp
Commit b9ae741d3e809ec38a4131f5d1c48131be3af256 by amy.zhuang
[mlir] Fix getVectorReductionOp

1.Combining kind min/max of Vector reduction op has been changed to
  minf/maxf, minsi/maxsi, and minui/maxui. Modify getVectorReductionOp
  accordingly.
2.Add min/max to supported reductions.

Reviewed By: dcaballe, nicolasvasilache

Differential Revision: https://reviews.llvm.org/D112246
The file was modifiedmlir/lib/Analysis/AffineAnalysis.cpp
The file was modifiedmlir/lib/Dialect/StandardOps/IR/Ops.cpp
The file was modifiedmlir/lib/Dialect/Vector/VectorOps.cpp
The file was modifiedmlir/test/Dialect/Affine/SuperVectorize/vectorize_reduction.mlir
Commit c18407217e91abea73555e07956d7132dd093bd2 by balazs.benics
[analyzer] Fix StringChecker for Unknown params

It seems like protobuf crashed the `std::string` checker.
Somehow it acquired `UnknownVal` as the sole `std::string` constructor
parameter, causing a crash in the `castAs<Loc>()`.

This patch addresses this.

Reviewed By: martong

Differential Revision: https://reviews.llvm.org/D112551
The file was modifiedclang/test/Analysis/std-string.cpp
The file was modifiedclang/lib/StaticAnalyzer/Checkers/StringChecker.cpp
Commit b716d0aa94f1c0b8779f06953171f626cd828bf0 by rosie.sumpter
[LoopVectorize] Clean up VPReductionRecipe::execute. NFC

Use RdxDesc->getOpcode instead of getUnderlingInstr()->getOpcode.
Move the code which finds Kind and IsOrdered to be outside the for loop
since neither of these change with the vector part.

Differential Revision: https://reviews.llvm.org/D112547
The file was modifiedllvm/lib/Transforms/Vectorize/LoopVectorize.cpp