SuccessChanges

Summary

  1. [obj2yaml] - Match ".stack_size" with the original section name, and not the uniquified name. (details)
  2. Add '<' meta command to read in code from external file (details)
  3. [UpdateTestChecks][NFC] Fix spelling (details)
  4. [OpenMP][FIX] Do not crash trying to print a missing (demangled) user condition (details)
  5. [OpenMP][FIX] Do not drop a '$' while demangling declare variant names (details)
  6. [OpenMP] Support nested OpenMP context selectors (declare variant) (details)
  7. [OpenMP] Context selector extensions for return value overloading (details)
  8. [OpenMP] Overload `std::isnan` and friends multiple times for the GPU (details)
  9. [OpenMP] Context selector extensions for template functions (details)
  10. [OpenMP] Support `std::complex` math functions in target regions (details)
  11. [AMDGPU] gfx1030 RT support (details)
  12. Revert "[obj2yaml] - Match ".stack_size" with the original section name, and not the uniquified name." (details)
  13. [SystemZ][z/OS] Set aligned allocation unavailable by default for z/OS (details)
  14. [gn build] unconfuse sync script about "sources = []" in clang/lib/Headers/BUILD.gn (details)
  15. Fix build. (details)
  16. [InstCombine] Add test for infinite combine loop (NFC) (details)
  17. [InstSimplify] Clarify SimplifyWithOpReplaced() return value (details)
  18. Reapply [InstCombine] Simplify select operand based on equality condition (details)
  19. [gn build] Port 56069b5c71c (details)
  20. [UpdateTestChecks] Allow $ in function names (details)
  21. [aarch64][tests] Add tests which show current lack of implicit null support (details)
  22. [flang][msvc] Work around if constexpr (false) evaluation. NFC. (details)
  23. [X86] Add test case for a masked load mask becoming all ones after type legalization. (details)
  24. [DAGCombiner] Teach visitMLOAD to replace an all ones mask with an unmasked load (details)
  25. [lsan] Share platform allocator settings between ASan and LSan (details)
  26. Revert "[lsan] Share platform allocator settings between ASan and LSan" (details)
Commit 14e55f82980cf1342d4d3eea4885a5375e829496 by rahmanl
[obj2yaml] - Match ".stack_size" with the original section name, and not the uniquified name.

Without this patch, obj2yaml decodes the content of only one ".stack_size" section. Other sections are dumped with their full contents.

Reviewed By: grimar, MaskRay

Differential Revision: https://reviews.llvm.org/D87727
The file was modifiedllvm/test/tools/obj2yaml/ELF/stack-sizes.yaml
The file was modifiedllvm/tools/obj2yaml/elf2yaml.cpp
Commit f723d193e2c92ea6903e3debfee32b13354808bc by jingham
Add '<' meta command to read in code from external file

Perform all error handling in ReadCode()

Add :help text describing “< path”, add extra line before Commands

Differential Revision: https://reviews.llvm.org/D87640
The file was modifiedlldb/source/Expression/REPL.cpp
Commit dbde3969ba8e2b396333dc6b139a0b3a88dfbc80 by johannes
[UpdateTestChecks][NFC] Fix spelling
The file was modifiedllvm/utils/UpdateTestChecks/common.py
Commit 6a02932becaeaeb02eddfaed567f3dad3719dd1c by johannes
[OpenMP][FIX] Do not crash trying to print a missing (demangled) user condition

Reviewed By: JonChesterfield

Differential Revision: https://reviews.llvm.org/D85875
The file was modifiedclang/lib/AST/OpenMPClause.cpp
The file was addedclang/test/AST/ast-dump-openmp-begin-declare-variant_13.c
Commit 05fd04eda4b22b09e33753132cbf037a1265c7e2 by johannes
[OpenMP][FIX] Do not drop a '$' while demangling declare variant names

Reviewed By: ABataev

Differential Revision: https://reviews.llvm.org/D85876
The file was modifiedclang/test/AST/ast-dump-openmp-declare-variant-extensions.c
The file was modifiedclang/lib/AST/OpenMPClause.cpp
Commit 5c63ae156e96a20ce96570d4bd2c48a9c8170a9d by johannes
[OpenMP] Support nested OpenMP context selectors (declare variant)

Due to `omp begin/end declare variant`, OpenMP context selectors can be
nested. This patch adds initial support for this so we can use it for
target math variants. We should improve the detection of "equivalent"
scores and user conditions, we should also revisit the data structures
of the OMPTraitInfo object, however, both are not pressing issues right
now.

Reviewed By: JonChesterfield

Differential Revision: https://reviews.llvm.org/D85877
The file was modifiedclang/test/OpenMP/declare_variant_messages.c
The file was modifiedclang/include/clang/Sema/Sema.h
The file was modifiedclang/lib/Sema/SemaOpenMP.cpp
The file was modifiedclang/include/clang/Basic/DiagnosticSemaKinds.td
The file was modifiedclang/lib/Parse/ParseOpenMP.cpp
The file was addedclang/test/AST/ast-dump-openmp-begin-declare-variant_nested.c
The file was modifiedclang/include/clang/Basic/DiagnosticParseKinds.td
The file was modifiedclang/include/clang/Parse/Parser.h
Commit c4b7a1da9d872ed075ce99c80a90b11a135577a0 by johannes
[OpenMP] Context selector extensions for return value overloading

This extension allows to declare variants in between `omp begin/end
declare variant` that do not match the type of the existing function
with that name. Without this extension we would not find a base function
(with a compatible type), therefore create a new one, which would
cause conflicting declarations. With this extension we will not create
"missing" base functions, which basically renders these specializations
harmless. They will be generated but never called.

Reviewed By: JonChesterfield

Differential Revision: https://reviews.llvm.org/D85878
The file was modifiedclang/include/clang/Basic/AttrDocs.td
The file was modifiedclang/include/clang/AST/OpenMPClause.h
The file was modifiedclang/lib/Parse/ParseOpenMP.cpp
The file was addedclang/test/AST/ast-dump-openmp-begin-declare-variant-varying-return.c
The file was modifiedllvm/include/llvm/Frontend/OpenMP/OMPKinds.def
The file was modifiedclang/lib/Sema/SemaOpenMP.cpp
Commit 97652202d1e6964d5d7a1c03a257452c7ad95233 by johannes
[OpenMP] Overload `std::isnan` and friends multiple times for the GPU

`std::isnan` and friends can be found in two variants in the wild, one
returns `bool`, as the standard defines it, one returns `int`, as the C
macros do. So far we kinda hoped the system versions of these functions
will work for people, e.g. they are definitions that can be compiled for
the target. We know that is not the case always so we leverage the
`disable_implicit_base` OpenMP context extension to specialize both
versions of these functions without causing an invalid redeclaration.

Reviewed By: JonChesterfield, tra

Differential Revision: https://reviews.llvm.org/D85879
The file was modifiedclang/lib/Headers/__clang_cuda_cmath.h
The file was addedclang/test/Headers/openmp_device_math_isnan.cpp
The file was modifiedclang/test/Headers/Inputs/include/cmath
Commit 5c1084e8840b02d410ba125cbba466465242d820 by johannes
[OpenMP] Context selector extensions for template functions

With this extension the effects of `omp begin declare variant` will be
applied to template function declarations. The behavior is opt-in and
controlled by the `extension(allow_templates)` trait. While generally
useful, this will enable us to implement complex math function calls by
overloading the templates of the standard library with the ones in
libc++.

Reviewed By: JonChesterfield

Differential Revision: https://reviews.llvm.org/D85735
The file was modifiedclang/include/clang/Sema/Sema.h
The file was modifiedclang/lib/Headers/openmp_wrappers/cmath
The file was modifiedclang/lib/Sema/SemaDecl.cpp
The file was modifiedclang/lib/Sema/SemaOpenMP.cpp
The file was modifiedclang/include/clang/Basic/AttrDocs.td
The file was modifiedclang/lib/Parse/ParseOpenMP.cpp
The file was modifiedclang/lib/Sema/SemaTemplateInstantiateDecl.cpp
The file was addedclang/test/AST/ast-dump-openmp-begin-declare-variant_template_2.cpp
The file was modifiedllvm/include/llvm/Frontend/OpenMP/OMPKinds.def
Commit 56069b5c71ca78749aa983c1e9de6f1e4c049f4b by johannes
[OpenMP] Support `std::complex` math functions in target regions

The last (big) missing piece to get "math" working in OpenMP target
regions (that I know of) was complex math functions, e.g.,
`std::sin(std::complex<double>)`. With this patch we overload the system
template functions for these operations with versions that have been
distilled from `libcxx/include/complex`. We use the same
  `omp begin/end declare variant`
mechanism we use for other math functions before, except that we this
time overload templates (via D85735).

Reviewed By: JonChesterfield

Differential Revision: https://reviews.llvm.org/D85777
The file was addedclang/lib/Headers/openmp_wrappers/complex_cmath.h
The file was modifiedclang/lib/Headers/CMakeLists.txt
The file was modifiedclang/test/Headers/nvptx_device_math_complex.cpp
The file was modifiedclang/test/Headers/Inputs/include/complex
The file was modifiedclang/lib/Headers/openmp_wrappers/complex
The file was addedclang/test/Headers/Inputs/include/type_traits
Commit 91f503c3af190e19974f8832871e363d232cd64c by Stanislav.Mekhanoshin
[AMDGPU] gfx1030 RT support

Differential Revision: https://reviews.llvm.org/D87782
The file was modifiedllvm/test/MC/AMDGPU/gfx1030_new.s
The file was modifiedllvm/lib/Target/AMDGPU/MIMGInstructions.td
The file was modifiedllvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp
The file was modifiedllvm/test/MC/AMDGPU/gfx1011_err.s
The file was modifiedllvm/test/MC/Disassembler/AMDGPU/gfx1030_dasm_new.txt
The file was modifiedllvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp
The file was modifiedllvm/lib/Target/AMDGPU/SIISelLowering.cpp
The file was modifiedllvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
The file was modifiedllvm/include/llvm/IR/IntrinsicsAMDGPU.td
The file was modifiedllvm/lib/Target/AMDGPU/SILoadStoreOptimizer.cpp
The file was addedllvm/test/CodeGen/AMDGPU/llvm.amdgcn.intersect_ray.ll
The file was modifiedllvm/lib/Target/AMDGPU/SIAddIMGInit.cpp
Commit f80f2516a2697218eeb7af80de3b13c38f342987 by rahmanl
Revert "[obj2yaml] - Match ".stack_size" with the original section name, and not the uniquified name."

This reverts commit 14e55f82980cf1342d4d3eea4885a5375e829496.
The file was modifiedllvm/test/tools/obj2yaml/ELF/stack-sizes.yaml
The file was modifiedllvm/tools/obj2yaml/elf2yaml.cpp
Commit 2240ca0bd1502d7baa098da7cb4aca64a6f979d4 by Abhina.Sreeskantharajan
[SystemZ][z/OS] Set aligned allocation unavailable by default for z/OS

Aligned allocation is not supported on z/OS. This patch sets -faligned-alloc-unavailable as default in z/OS toolchain.

Reviewed By: abhina.sreeskantharajan, hubert.reinterpretcast

Differential Revision: https://reviews.llvm.org/D87611
The file was modifiedclang/lib/Driver/ToolChains/ZOS.h
The file was modifiedclang/lib/Sema/SemaExprCXX.cpp
The file was modifiedclang/test/Lexer/aligned-allocation.cpp
The file was modifiedclang/test/Driver/unavailable_aligned_allocation.cpp
The file was modifiedclang/include/clang/Basic/AlignedAllocation.h
The file was modifiedclang/lib/Basic/Targets/OSTargets.h
The file was modifiedclang/lib/Driver/ToolChains/ZOS.cpp
The file was modifiedclang/include/clang/Basic/DiagnosticSemaKinds.td
The file was modifiedclang/include/clang/Basic/Attr.td
The file was modifiedclang/test/SemaCXX/unavailable_aligned_allocation.cpp
Commit 15c378f6e641f34bb9fd3582f9cb83ff686101dc by thakis
[gn build] unconfuse sync script about "sources = []" in clang/lib/Headers/BUILD.gn
The file was modifiedllvm/utils/gn/build/sync_source_lists_from_cmake.py
Commit 6859d95ea2d0f3fe0de2923a3f642170e66a1a14 by michael.hliao
Fix build.
The file was modifiedllvm/lib/Passes/StandardInstrumentations.cpp
Commit 94d912021ff35d33cde96dacd6f1db925fe9f2b8 by nikita.ppv
[InstCombine] Add test for infinite combine loop (NFC)

Test courtesy of bkramer for the infinite combine loop introduced
by D87480.
The file was modifiedllvm/test/Transforms/InstCombine/select.ll
Commit 0bb06f297fe52a5125952cb6f1e264b4e7c48097 by nikita.ppv
[InstSimplify] Clarify SimplifyWithOpReplaced() return value

If SimplifyWithOpReplaced() cannot simplify the value, null should
be returned. Make sure this really does happen in all cases,
including those where SimplifyBinOp() returns the original value.

This does not matter for existing users, but does mattter for
D87480, which would go into an infinite loop otherwise.
The file was modifiedllvm/lib/Analysis/InstructionSimplify.cpp
The file was modifiedllvm/include/llvm/Analysis/InstructionSimplify.h
Commit 222bf3ffbc8419570fc2266a2e7d1c5f58cedaa7 by nikita.ppv
Reapply [InstCombine] Simplify select operand based on equality condition

Reapply after fixing SimplifyWithOpReplaced() to never return
the original value, which would lead to an infinite loop in this
transform.

-----

For selects of the type X == Y ? A : B, check if we can simplify A
by using the X == Y equality and replace the operand if that's
possible. We already try to do this in InstSimplify, but will only
fold if the result of the simplification is the same as B, in which
case the select can be dropped entirely. Here the select will be
retained, just one operand simplified.

As we are performing an actual replacement here, we don't have
problems with refinement / poison values.

Differential Revision: https://reviews.llvm.org/D87480
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
The file was modifiedllvm/test/Transforms/InstCombine/select-binop-cmp.ll
The file was modifiedllvm/test/Transforms/InstCombine/select.ll
The file was modifiedllvm/test/Transforms/InstCombine/rem.ll
Commit 2a078a977e90481954eef69b489fac650ddbdaf6 by llvmgnsyncbot
[gn build] Port 56069b5c71c
The file was modifiedllvm/utils/gn/secondary/clang/lib/Headers/BUILD.gn
Commit ce0eb81c72749d1e96cfc6fb68af3c24b63753cc by David A Greene
[UpdateTestChecks] Allow $ in function names

Some compilers generation functions with '$' in their names, so recognize those
functions.

This also requires recognizing function names inside quotes in some contexts in
order to escape certain characters.

Differential Revision: https://reviews.llvm.org/D82995
The file was addedllvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/hexagon_function_name.ll
The file was addedllvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/mips_function_name.ll
The file was addedllvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/mips_function_name.ll.expected
The file was addedllvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/x86_function_name.ll.expected
The file was addedllvm/test/tools/UpdateTestChecks/update_llc_test_checks/amdgpu-function-name.test
The file was addedllvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/lanai_function_name.ll
The file was addedllvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/function_name.ll.expected
The file was addedllvm/test/tools/UpdateTestChecks/update_llc_test_checks/systemz-function-name.test
The file was addedllvm/test/tools/UpdateTestChecks/update_llc_test_checks/mips-function-name.test
The file was addedllvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/arm_function_name.ll.expected
The file was modifiedllvm/utils/UpdateTestChecks/asm.py
The file was addedllvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/arm_function_name.ll
The file was addedllvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/msp430_function_name.ll
The file was addedllvm/test/tools/UpdateTestChecks/update_llc_test_checks/msp430-function-name.test
The file was addedllvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/wasm_function_name.ll.expected
The file was addedllvm/test/tools/UpdateTestChecks/update_llc_test_checks/x86-function-name.test
The file was addedllvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/riscv_function_name.ll.expected
The file was addedllvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/wasm_function_name.ll
The file was addedllvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/ppc_function_name.ll.expected
The file was addedllvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/sparc_function_name.ll.expected
The file was addedllvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/aarch64_function_name.ll.expected
The file was addedllvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/aarch64_function_name.ll
The file was addedllvm/test/tools/UpdateTestChecks/update_test_checks/function-name.test
The file was addedllvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/systemz_function_name.ll
The file was addedllvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/systemz_function_name.ll.expected
The file was addedllvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/amdgpu_function_name.ll.expected
The file was addedllvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/hexagon_function_name.ll.expected
The file was addedllvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/lanai_function_name.ll.expected
The file was addedllvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/sparc_function_name.ll
The file was addedllvm/test/tools/UpdateTestChecks/update_llc_test_checks/aarch64-function-name.test
The file was addedllvm/test/tools/UpdateTestChecks/update_llc_test_checks/lanai-function-name.test
The file was addedllvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/msp430_function_name.ll.expected
The file was addedllvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/x86_function_name.ll
The file was addedllvm/test/tools/UpdateTestChecks/update_llc_test_checks/riscv-function-name.test
The file was addedllvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/riscv_function_name.ll
The file was addedllvm/test/tools/UpdateTestChecks/update_llc_test_checks/sparc-function-name.test
The file was addedllvm/test/tools/UpdateTestChecks/update_llc_test_checks/wasm-function-name.test
The file was addedllvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/ppc_function_name.ll
The file was addedllvm/test/tools/UpdateTestChecks/update_llc_test_checks/arm-function-name.test
The file was addedllvm/test/tools/UpdateTestChecks/update_llc_test_checks/ppc-function-name.test
The file was modifiedllvm/utils/UpdateTestChecks/common.py
The file was addedllvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/amdgpu_function_name.ll
The file was addedllvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/function_name.ll
The file was addedllvm/test/tools/UpdateTestChecks/update_llc_test_checks/hexagon-function-name.test
Commit 7af4f44c3e3dfb4483fb4dcc200f9376e96d6208 by listmail
[aarch64][tests] Add tests which show current lack of implicit null support

I will be posting a patch which adds appropriate target support shortly; landing the tests so that the diffs are clear.
The file was addedllvm/test/CodeGen/AArch64/implicit-null-check.ll
Commit dee4686227842aa0e8380c7925049a5df9c4f781 by llvm-project
 [flang][msvc] Work around if constexpr (false) evaluation. NFC.

MSVC tries to expand templates that are in the false-branch of a `if constexpr` construct. In this case, the condition checks whether a tuple has at least one element and then is trying to access it using `std::get<0>`, which fails when the tuple has 0 elements.

The workaround is to extract that case into a separate method.

This patch is part of the series to make flang compilable with MS Visual Studio <http://lists.llvm.org/pipermail/flang-dev/2020-July/000448.html>.

Reviewed By: klausler

Differential Revision: https://reviews.llvm.org/D87728
The file was modifiedflang/lib/Parser/basic-parsers.h
Commit 65ef2e50a29630f9f0fba4899045c0058dacfcb0 by craig.topper
[X86] Add test case for a masked load mask becoming all ones after type legalization.

We should be able to turn this into a unmasked load. X86 has an
optimization to detect that the first and last element aren't masked
and then turn the whole thing into an unmasked load and a blend.
That transform is disabled on avx512 though.

But if we know the blend isn't needed, then the unmasked load by
itself should always be profitable.
The file was modifiedllvm/test/CodeGen/X86/masked_load.ll
Commit 89ee4c0314bd08143d954d80bf7678d3a3ecc15a by craig.topper
[DAGCombiner] Teach visitMLOAD to replace an all ones mask with an unmasked load

If we have an all ones mask, we can just a regular masked load. InstCombine already gets this in IR. But the all ones mask can appear after type legalization.

Only avx512 test cases are affected because X86 backend already looks for element 0 and the last element being 1. It replaces this with an unmasked load and blend. The all ones mask is a special case of that where the blend will be removed. That transform is only enabled on avx2 targets. I believe that's because a non-zero passthru on avx2 already requires a separate blend so its more profitable to handle mixed constant masks.

This patch adds a dedicated all ones handling to the target independent DAG combiner. I've skipped extending, expanding, and index loads for now. X86 doesn't use index so I don't know much about it. Extending made me nervous because I wasn't sure I could trust the memory VT had the right element count due to some weirdness in vector splitting. For expanding I wasn't sure if we needed different undef handling.

Differential Revision: https://reviews.llvm.org/D87788
The file was modifiedllvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
The file was modifiedllvm/test/CodeGen/X86/masked_load.ll
Commit c57df3dc09e8b59c55c83ba5c354569a82a5c3b8 by phosek
[lsan] Share platform allocator settings between ASan and LSan

This moves the platform-specific parameter logic from asan into
sanitizer_common so lsan can reuse it.

Patch By: mcgrathr

Differential Revision: https://reviews.llvm.org/D85930
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_allocator.h
The file was modifiedcompiler-rt/lib/lsan/lsan_allocator.h
The file was modifiedcompiler-rt/lib/asan/asan_allocator.h
Commit e3fe203ec7f766ad6028144d266557b0d89b77fe by phosek
Revert "[lsan] Share platform allocator settings between ASan and LSan"

This reverts commit c57df3dc09e8b59c55c83ba5c354569a82a5c3b8 which broke
Windows sanitizer bots.
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_allocator.h
The file was modifiedcompiler-rt/lib/asan/asan_allocator.h
The file was modifiedcompiler-rt/lib/lsan/lsan_allocator.h