Changes

Summary

  1. [DFSan][NFC] Fix shadowing variable name. (details)
  2. [SLP] Incorrect handling of external scalar values (details)
  3. [SCEV] PtrToInt on non-integral pointers is allowed (details)
  4. [NFC][X86] lowerVECTOR_SHUFFLE(): drop FIXME about widening to i128 (YMM half) element type (details)
  5. [OpenMP] Remove unused variables from libomp code (details)
  6. [flang][driver] Add `-fdebug-dump-all` (details)
  7. [flang][nfc] Move `external-hello-world` to flang/examples (details)
  8. [ORC] Switch to WrapperFunction utility for calls to registration functions. (details)
  9. [FuncSpec] Statistics (details)
  10. [OpenMP][NFC] Add back suppression of warning (details)
  11. [AMDGPU] Use defvar in SOPInstructions.td. NFC. (details)
  12. [flang] Check there's no dependency on C++ libs (details)
  13. [AMDGPU] Set more flags on Real instructions (details)
  14. [yaml2obj] Fix bug when referencing items in SectionHeaderTable (details)
  15. [yaml2obj][obj2yaml] Support custom ELF section header string table name (details)
  16. [FuncSpec] Add test for a call site that will never be executed. NFC. (details)
  17. [flang] Add clang-tidy check for braces around if (details)
  18. [FuncSpec] Remove other passes in a test RUN line. NFC. (details)
  19. [flang] Fixup 7ddbf2633911a5c378ad6af01e250f6f252b9032 (details)
  20. [ARM] Extra tests for sign extended floating point compares. NFC (details)
Commit e652d991699fcd337b4ebb355fb14553d644d4c4 by browneee
[DFSan][NFC] Fix shadowing variable name.
The file was modifiedllvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
Commit 96cded5b796f405d91c4b403078fbb13f13a056b by ybrevnov
[SLP] Incorrect handling of external scalar values

Reviewed By: ABataev

Differential Revision: https://reviews.llvm.org/D103954
The file was addedllvm/test/Transforms/SLPVectorizer/slp-hr-with-reuse.ll
The file was modifiedllvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
Commit a3113df21994fafd87d623e13364321659f4585c by lebedev.ri
[SCEV] PtrToInt on non-integral pointers is allowed

As per (committed without review) @reames's rGac81cb7e6dde9b0890ee1780eae94ab96743569b change,
we are now allowed to produce `ptrtoint` for non-integral pointers.
This will unblock further unbreaking of SCEV regarding int-vs-pointer type confusion.

Reviewed By: mkazantsev

Differential Revision: https://reviews.llvm.org/D104322
The file was modifiedllvm/lib/Analysis/ScalarEvolution.cpp
Commit 308f6a5245a249e08efbdaa73b6cc6e693e0185f by lebedev.ri
[NFC][X86] lowerVECTOR_SHUFFLE(): drop FIXME about widening to i128 (YMM half) element type

As per the discussion in D103818, so far, this does not appear to be worthwhile.

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D103818
The file was modifiedllvm/lib/Target/X86/X86ISelLowering.cpp
Commit cff215565e9351511d805f72e62803718be6aaa4 by protze
[OpenMP] Remove unused variables from libomp code

Several variables were left unused as a result of different patches removing
their use.

Two variables have some use:
`poll_count` is used by the KMP_BLOCKING macro only under certain conditions.
Adding (void) to tell the compiler to ignore the unused variable.

`padding` is a dummy stack allocation with no intent to be used. Also adding
(void) to make the compiler ignore the unused variable.

Differential Revision: https://reviews.llvm.org/D104303
The file was modifiedopenmp/runtime/src/kmp_affinity.cpp
The file was modifiedopenmp/runtime/src/kmp_ftn_entry.h
The file was modifiedopenmp/runtime/src/kmp_wait_release.h
The file was modifiedopenmp/runtime/src/z_Linux_util.cpp
The file was modifiedopenmp/runtime/src/kmp_csupport.cpp
The file was modifiedopenmp/runtime/src/kmp_runtime.cpp
The file was modifiedopenmp/runtime/cmake/LibompHandleFlags.cmake
The file was modifiedopenmp/runtime/src/kmp_lock.cpp
Commit a6be6e31f1810012922e50dab0d4c15cdf990d2e by andrzej.warzynski
[flang][driver] Add `-fdebug-dump-all`

The new option will run the semantic checks and then dump the parse tree
and all the symbols. This is equivalent to running the driver twice,
once with `-fdebug-dump-parse-tree` and then with
the `-fdebug-dump-symbols` action flag.

Currently we wouldn't be able to achieve the same by simply running:
```
flang-new -fc1 -fdebug-dump-parse-tree -fdebug-dump-symbols <input-file>
```
That's because the new driver will only run one frontend action per
invocation (both of the flags used here are action flags). Diverging
from this design would lead to costly compromises and it's best avoided.

We may want to consider re-designing our debugging actions (and action
options) in the future so that there's more code re-use. For now, I'm
focusing on making sure that we support all the major cases requested by
our users.

Differential Revision: https://reviews.llvm.org/D104305
The file was modifiedflang/include/flang/Frontend/FrontendOptions.h
The file was modifiedclang/include/clang/Driver/Options.td
The file was modifiedflang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
The file was modifiedflang/test/Driver/driver-help.f90
The file was modifiedflang/lib/Frontend/FrontendActions.cpp
The file was addedflang/test/Driver/dump-all.f90
The file was modifiedflang/include/flang/Frontend/FrontendActions.h
The file was modifiedflang/lib/Frontend/CompilerInvocation.cpp
Commit 062644bb399bd05fd0aeb3cb9d52fa0014db0bdd by andrzej.warzynski
[flang][nfc] Move `external-hello-world` to flang/examples

As `external-hello-world` is not really a test, I am moving it from
`flang/unittest/Runtime` to `flang/examples` (it makes a lot of sense as
an example). I've not modified the source code (apart from adjusting the
include paths).

Differential Revision: https://reviews.llvm.org/D104320
The file was addedflang/examples/external-hello.cpp
The file was modifiedflang/CMakeLists.txt
The file was addedflang/examples/CMakeLists.txt
The file was removedflang/unittests/Runtime/external-hello.cpp
The file was modifiedflang/unittests/Runtime/CMakeLists.txt
Commit 834616146b7d94258456542fd64fed95dbd9e4b1 by Lang Hames
[ORC] Switch to WrapperFunction utility for calls to registration functions.

Addresses FIXMEs in TPC-based EH-frame and debug object registration code by
replacing manual argument serialization with WrapperFunction utility calls.
The file was modifiedllvm/include/llvm/ExecutionEngine/Orc/Shared/WrapperFunctionUtils.h
The file was modifiedllvm/lib/ExecutionEngine/Orc/TPCDebugObjectRegistrar.cpp
The file was modifiedllvm/lib/ExecutionEngine/Orc/TPCEHFrameRegistrar.cpp
The file was modifiedllvm/include/llvm/ExecutionEngine/Orc/TPCDebugObjectRegistrar.h
The file was modifiedllvm/include/llvm/ExecutionEngine/Orc/TargetProcessControl.h
Commit 49ab3b1735b66d48940a08a5daaa6398e98754ea by sjoerd.meijer
[FuncSpec] Statistics

Adds some bookkeeping for collecting the number of specialised functions and a
test for that.

Differential Revision: https://reviews.llvm.org/D104102
The file was addedllvm/test/Transforms/FunctionSpecialization/function-specialization-stats.ll
The file was modifiedllvm/lib/Transforms/IPO/FunctionSpecialization.cpp
Commit d2a7871b5e6a1b7c377c403ab7975f244113be63 by protze
[OpenMP][NFC] Add back suppression of warning

Commit cff215565e9 did not fix all unused variables in different builds,
so adding back the suppression for now.
The file was modifiedopenmp/runtime/cmake/LibompHandleFlags.cmake
Commit 37109974af4b33189a599735afa67ed57c27b8ab by jay.foad
[AMDGPU] Use defvar in SOPInstructions.td. NFC.

Factor out repeated !cast<SOP*_Pseudo>(NAME) into a new "defvar ps",
just to improve readability and maintainability.

Differential Revision: https://reviews.llvm.org/D104306
The file was modifiedllvm/lib/Target/AMDGPU/SOPInstructions.td
Commit 7ddbf2633911a5c378ad6af01e250f6f252b9032 by diana.picus
[flang] Check there's no dependency on C++ libs

Add a test to make sure the flang runtime doesn't pull in the C++
runtime libraries.

This is achieved by adding a C file that calls some functions from the
runtime (currently only CpuTime, but we should probably add anything
complicated enough, e.g. IO-related things). We force the C compiler to
use -std=c90 to make sure it's really in C mode (we don't really care
which version of the standard, this one is probably more widely
available). We only enable this test if CMAKE_C_COMPILER is set to
something (which is probably always true in practice).

Differential Revision: https://reviews.llvm.org/D104290
The file was modifiedflang/test/lit.site.cfg.py.in
The file was addedflang/test/Runtime/no-cpp-dep.c
The file was modifiedflang/test/lit.cfg.py
Commit 6f778fed8e50a00a08297705148774b67a9da9c8 by jay.foad
[AMDGPU] Set more flags on Real instructions

This does not affect codegen, which only tests these flags on Pseudo
instructions, but might help llvm-mca which has to work with Real
instructions. In particular setting LGKM_CNT on DS instructions helps
with the problem identified in D104149.

Differential Revision: https://reviews.llvm.org/D104293
The file was modifiedllvm/lib/Target/AMDGPU/FLATInstructions.td
The file was modifiedllvm/lib/Target/AMDGPU/SMInstructions.td
The file was modifiedllvm/lib/Target/AMDGPU/BUFInstructions.td
The file was modifiedllvm/lib/Target/AMDGPU/DSInstructions.td
Commit fef3bfb1b23af09668d20b09f09c65cc14b5479c by james.henderson
[yaml2obj] Fix bug when referencing items in SectionHeaderTable

There was an off-by-one error caused by an index (which included an
index for the null section header) being used to check against the size
of a list of sections (which didn't include the null section header).

This is a partial fix for https://bugs.llvm.org/show_bug.cgi?id=50506.

Reviewed by: MaskRay

Differential Revision: https://reviews.llvm.org/D104098
The file was modifiedllvm/test/tools/yaml2obj/ELF/section-headers.yaml
The file was modifiedllvm/lib/ObjectYAML/ELFEmitter.cpp
Commit 5c1639fe064b548adff67d45e1f8cedae395ed6f by james.henderson
[yaml2obj][obj2yaml] Support custom ELF section header string table name

This patch adds support for a new field in the FileHeader, which states
the name to use for the section header string table. This also allows
combining the string table with another string table in the object, e.g.
the symbol name string table. The field is optional. By default,
.shstrtab will continue to be used.

This partially fixes https://bugs.llvm.org/show_bug.cgi?id=50506.

Reviewed by: Higuoxing

Differential Revision: https://reviews.llvm.org/D104035
The file was modifiedllvm/lib/ObjectYAML/ELFYAML.cpp
The file was addedllvm/test/tools/obj2yaml/ELF/shstrtab.yaml
The file was modifiedllvm/lib/ObjectYAML/ELFEmitter.cpp
The file was addedllvm/test/tools/yaml2obj/ELF/shstrtab.yaml
The file was modifiedllvm/tools/obj2yaml/elf2yaml.cpp
The file was modifiedllvm/include/llvm/ObjectYAML/ELFYAML.h
The file was modifiedllvm/test/tools/obj2yaml/ELF/invalid-section-name.yaml
Commit 29843cbc88f6f91bc8eb350f847a4b07070d8765 by sjoerd.meijer
[FuncSpec] Add test for a call site that will never be executed. NFC.
The file was addedllvm/test/Transforms/FunctionSpecialization/function-specialization-noexec.ll
Commit 45cd405dc07bbc259ea251c8f5f5e2bca7a6112c by diana.picus
[flang] Add clang-tidy check for braces around if

Flang diverges from the llvm coding style in that it requires braces
around the bodies of if/while/etc statements, even when the body is
a single statement.

This commit adds the readability-braces-around-statements check to
flang's clang-tidy config file. Hopefully the premerge bots will pick it
up and report violations in Phabricator.

We also explicitly disable the check in the directories corresponding to
the Lower and Optimizer libraries, which rely heavily on mlir and llvm
and therefore follow their coding style. Likewise for the tools
directory.

We also fix any outstanding violations in the runtime and in
lib/Semantics.

Differential Revision: https://reviews.llvm.org/D104100
The file was modifiedflang/lib/Optimizer/.clang-tidy
The file was modifiedflang/docs/C++style.md
The file was modifiedflang/lib/Lower/.clang-tidy
The file was modifiedflang/lib/Semantics/check-acc-structure.cpp
The file was modifiedflang/.clang-tidy
The file was modifiedflang/lib/Semantics/canonicalize-acc.cpp
The file was modifiedflang/include/flang/Optimizer/.clang-tidy
The file was modifiedflang/lib/Semantics/check-omp-structure.cpp
The file was modifiedflang/unittests/RuntimeGTest/CrashHandlerFixture.cpp
The file was modifiedflang/lib/Semantics/resolve-directives.cpp
The file was modifiedflang/include/flang/Lower/.clang-tidy
The file was modifiedflang/runtime/ISO_Fortran_binding.cpp
The file was addedflang/tools/.clang-tidy
Commit c8a3fce7769633157cd8598f7bc1210c89a7aefb by sjoerd.meijer
[FuncSpec] Remove other passes in a test RUN line. NFC.
The file was modifiedllvm/test/Transforms/FunctionSpecialization/function-specialization-stats.ll
Commit 10ae933b0b1af00a04a251cf560bb935f1a9f18a by diana.picus
[flang] Fixup 7ddbf2633911a5c378ad6af01e250f6f252b9032

Replace C++ comments with C-style comments (not sure why my C compiler
doesn't complain about this).
The file was modifiedflang/test/Runtime/no-cpp-dep.c
Commit 3f18fc5ece720ae2b956ab77a9378bbcf33dc89f by david.green
[ARM] Extra tests for sign extended floating point compares. NFC
The file was modifiedllvm/test/CodeGen/Thumb2/mve-pred-ext.ll