Changes

Summary

  1. [flang] Operands of SIGN() need not have same kind (details)
  2. [Inliner] Preserve !prof metadata when converting call to invoke. (details)
  3. [flang] Correct folding of SPREAD() for higher ranks (details)
  4. [mlir-LSP] Ensure existing documents are process synchronously (details)
  5. [gn build] (manually) port a2f2dfde48ac (clang-fuzzer-dictionary) (details)
  6. [flang] Refine handling of short character actual arguments (details)
  7. [mlir][doc] Move documentation of extensible dialects (details)
  8. [trace][intelpt] Support system-wide tracing [2] - Add a dummy --per-core-tracing option (details)
  9. [trace][intelpt] Support system-wide tracing [3] - Refactor IntelPTThreadTrace (details)
  10. [gn build] Port 7b73de9ec2b1 (details)
  11. Add the ability to debug through an exec into ld (details)
  12. [flang] Ensure that structure constructors fold parameter references (details)
  13. [polly] Fix type in function name. NFC. (details)
  14. [flang] Fix to UnwrapConvertedExpr() (details)
  15. [flang] Correct actual/dummy procedure compatibility for ALLOCATABLE/POINTER functions (details)
  16. [AArch64] Remove ADDC, ADDE, SUBC, SUBE support, use the CARRY ops instead (details)
  17. [flang] Allow PDTs with LEN parameters in REDUCE() (details)
  18. [flang] Allow NULL() actual argument for optional dummy procedure (details)
  19. [AMDGPU] Generate checks in llvm.amdgcn.softwqm.ll (details)
  20. [AMDGPU] Pre-commit test for D124981. NFC. (details)
  21. [flang] Allow implicit declaration of DATA objects in inner procedures (details)
  22. [flang] Refine error checking in specification expressions (details)
  23. [flang] Reverse a reversed type compatibility check (details)
  24. [mlgo] Support exposing more features than those supported by models (details)
  25. Add x86 to REQUIRES line in test as suggested in https://reviews.llvm.org/D124105. (details)
  26. [gn build] Port 059e03476cbb (details)
  27. [flang] Accept POINTER followed by INTERFACE (details)
  28. [NFC] follow up code cleanup after D123837 (details)
  29. [flang] Allow ENTRY function result symbol usage before the ENTRY (details)
  30. [RISCV][NFC] Add 'rv32izvfh' invalid arch test (details)
  31. [clang][Driver] Add more tests for riscv (details)
  32. [NFC] Modify the comment to reflect the changes in decoder (details)
Commit 18dd123c56754edf62c7042dcf23185c3727610f by pklausler
[flang] Operands of SIGN() need not have same kind

The standard requires that the operands of the intrinsic function
SIGN() must have the same type (INTEGER or REAL), but they are not
required to have the same kind.

Differential Revision: https://reviews.llvm.org/D125105
The file was modifiedflang/lib/Evaluate/intrinsics.cpp
The file was modifiedflang/test/Evaluate/folding02.f90
Commit 9641b9be9dfc599cbb6a812c1e587eff2ddd8707 by hoy
[Inliner] Preserve !prof metadata when converting call to invoke.

When a callee function is inlined via an invoke instruction, every function call inside the callee, if not an invoke,  will be converted to an invoke after cloned to the caller body. I found that during the conversion the !prof metadata was dropped. This in turned caused a cloned indirect call not properly promoted in subsequent passes.

The particular scenario I was investigating was with AutoFDO and thinLTO. In prelink, no ICP was triggered (neither by the sample loader nor PGO ICP), no indirect call was promoted. This is because 1) the particular indirect call did not have inlined samples;  and 2) PGO ICP was intentionally disabled.  After inlining, the prof metadata was dropped. Then in postlink, PGO ICP jumped in but didn't do anything. Thus the opportunity was missed.

I'm making a simple fix to preserve !prof metadata when converting call to invoke.

Reviewed By: davidxl

Differential Revision: https://reviews.llvm.org/D125249
The file was addedllvm/test/Transforms/Inline/profile_meta_invoke.ll
The file was modifiedllvm/lib/Transforms/Utils/Local.cpp
Commit 85fdbc1569f5c97daafd6a0daade54282806aa6a by pklausler
[flang] Correct folding of SPREAD() for higher ranks

The construction of the dimension order vector used to populate the
result array was incorrect, leading to a scrambled-looking result
for rank-3 and higher results.  Fix, and extend tests.

Differential Revision: https://reviews.llvm.org/D125113
The file was modifiedflang/test/Evaluate/fold-spread.f90
The file was modifiedflang/lib/Evaluate/fold-implementation.h
Commit 867cd5007d1124f839fdf8c5b51442586ae7d360 by riddleriver
[mlir-LSP] Ensure existing documents are process synchronously

This prevents races where we accidentally launched multiple servers.
The file was modifiedmlir/utils/vscode/src/mlirContext.ts
Commit 42915e2be231983a6476eabc059d114d60742ded by thakis
[gn build] (manually) port a2f2dfde48ac (clang-fuzzer-dictionary)
The file was modifiedclang/tools/clang-fuzzer/dictionary/CMakeLists.txt
The file was modifiedllvm/utils/gn/secondary/clang/test/BUILD.gn
The file was addedllvm/utils/gn/secondary/clang/tools/clang-fuzzer/dictionary/BUILD.gn
Commit be768164a7837bcb87cb6409731d23dc2c00dcfe by pklausler
[flang] Refine handling of short character actual arguments

Actual arguments whose lengths are less than the expected length
of their corresponding dummy argument are errors; but this needs
to be refined.  Short actual arguments that are variables remain
errors, but those that are expressions can be (again) extended on
the right with blanks.

Differential Revision: https://reviews.llvm.org/D125115
The file was modifiedflang/lib/Semantics/check-call.cpp
The file was modifiedflang/test/Semantics/call03.f90
Commit 67d0bc27c0fde04a3e0c7130419eb1b8a5fda7db by riddleriver
[mlir][doc] Move documentation of extensible dialects

Merge the documentation of the definition of extensible dialects
with the definition of dialects.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D125200
The file was modifiedmlir/docs/DefiningDialects.md
The file was removedmlir/docs/ExtensibleDialects.md
Commit b8d1776fc58d56af30d446386788e377d25dd512 by walter erquinigo
[trace][intelpt] Support system-wide tracing [2] - Add a dummy --per-core-tracing option

This updates the documentation of the gdb-remote protocol, as well as the help messages, to include the new --per-core-tracing option.

Differential Revision: https://reviews.llvm.org/D124640
The file was modifiedlldb/test/API/commands/trace/TestTraceStartStop.py
The file was modifiedlldb/source/Plugins/Process/Linux/IntelPTCollector.cpp
The file was modifiedlldb/source/Plugins/Trace/intel-pt/TraceIntelPT.h
The file was modifiedlldb/source/Plugins/Trace/intel-pt/CommandObjectTraceStartIntelPT.cpp
The file was modifiedlldb/test/API/commands/trace/multiple-threads/TestTraceStartStopMultipleThreads.py
The file was modifiedlldb/source/Utility/TraceIntelPTGDBRemotePackets.cpp
The file was modifiedlldb/source/Plugins/Trace/intel-pt/TraceIntelPTConstants.h
The file was modifiedlldb/source/Plugins/Trace/intel-pt/TraceIntelPT.cpp
The file was modifiedlldb/docs/lldb-gdb-remote.txt
The file was modifiedlldb/source/Plugins/Trace/intel-pt/TraceIntelPTOptions.td
The file was modifiedlldb/packages/Python/lldbsuite/test/tools/intelpt/intelpt_testcase.py
The file was modifiedlldb/source/Plugins/Trace/intel-pt/CommandObjectTraceStartIntelPT.h
The file was modifiedlldb/include/lldb/Utility/TraceIntelPTGDBRemotePackets.h
Commit 7b73de9ec2b19df040c919d3004dfbead9b6ac59 by walter erquinigo
[trace][intelpt] Support system-wide tracing [3] - Refactor IntelPTThreadTrace

I'm refactoring IntelPTThreadTrace into IntelPTSingleBufferTrace so that it can
both single threads or single cores. In this diff I'm basically renaming the
class, moving it to its own file, and removing all the pieces that are not used
along with some basic cleanup.

Differential Revision: https://reviews.llvm.org/D124648
The file was modifiedlldb/include/lldb/Utility/TraceIntelPTGDBRemotePackets.h
The file was modifiedlldb/source/Plugins/Process/Linux/CMakeLists.txt
The file was addedlldb/source/Plugins/Process/Linux/IntelPTSingleBufferTrace.h
The file was modifiedlldb/source/Utility/TraceIntelPTGDBRemotePackets.cpp
The file was modifiedlldb/unittests/Process/Linux/PerfTests.cpp
The file was modifiedlldb/docs/lldb-gdb-remote.txt
The file was removedlldb/unittests/Process/Linux/IntelPTCollectorTests.cpp
The file was modifiedlldb/source/Plugins/Process/Linux/Perf.cpp
The file was modifiedlldb/source/Plugins/Trace/intel-pt/TraceIntelPTSessionSaver.cpp
The file was modifiedlldb/source/Plugins/Process/Linux/IntelPTCollector.h
The file was addedlldb/source/Plugins/Process/Linux/IntelPTSingleBufferTrace.cpp
The file was modifiedlldb/unittests/Process/Linux/CMakeLists.txt
The file was modifiedlldb/source/Plugins/Trace/intel-pt/TraceIntelPT.cpp
The file was modifiedlldb/source/Plugins/Process/Linux/Perf.h
The file was modifiedlldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
The file was modifiedlldb/source/Plugins/Process/Linux/IntelPTCollector.cpp
Commit ee0e00b1983e7d173f9b47683bba8715642353aa by llvmgnsyncbot
[gn build] Port 7b73de9ec2b1
The file was modifiedllvm/utils/gn/secondary/lldb/source/Plugins/Process/Linux/BUILD.gn
Commit 879a47a55ffb94976cbac1d191ef53be135d86a7 by gclayton
Add the ability to debug through an exec into ld

A previous commit enabled LLDB to be able to debug a program launched via ld: https://reviews.llvm.org/D108061.

This commit adds the ability to debug a program launched via ld when it happens during an exec into the dynamic loader. There was an issue where after the exec we would locate the rendezvous structure right away but it didn't contain any valid values and we would try to set the dyanamic loader breakpoint at address zero. This patch fixes that and adds a test.

Differential Revision: https://reviews.llvm.org/D125253
The file was modifiedlldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
The file was addedlldb/test/API/functionalities/dyld-exec-linux/TestDyldExecLinux.py
The file was addedlldb/test/API/functionalities/dyld-exec-linux/Makefile
The file was addedlldb/test/API/functionalities/dyld-exec-linux/main.cpp
Commit a054c882053e63e6fce7b412a93dc7fc228f11fd by pklausler
[flang] Ensure that structure constructors fold parameter references

Structure contructors for instances of parameterized derived types
must have their components' values folded in the context of the values
of the type parameters.

Differential Revision: https://reviews.llvm.org/D125116
The file was modifiedflang/lib/Evaluate/fold.cpp
The file was addedflang/test/Semantics/structconst05.f90
Commit b554c643c5bc3688fd0dfa646480b8337023a6fd by llvm-project
[polly] Fix type in function name. NFC.
The file was modifiedpolly/lib/Transform/ScheduleTreeTransform.cpp
Commit 6f14dbedd942d9a30abcf2e067083a826eab23db by pklausler
[flang] Fix to UnwrapConvertedExpr()

The utility UnwrapConvertedExpr() was failing to unwrap a
converted TypeParamInquiry operation when called from runtime
derived type description table construction, leading to an
abort in semantics.

Differential Revision: https://reviews.llvm.org/D125119
The file was modifiedflang/include/flang/Evaluate/tools.h
Commit 948d0b340b86b9f0ba79195bdd67451832727fbf by pklausler
[flang] Correct actual/dummy procedure compatibility for ALLOCATABLE/POINTER functions

Functions returning ALLOCATABLE or POINTER arrays have descriptor inquiries in
their results' shape expressions that won't compare equal.  These functions
need only be checked for compatible ranks (& of course other characteristics).

Differential Revision: https://reviews.llvm.org/D125123
The file was modifiedflang/lib/Evaluate/characteristics.cpp
Commit 59fea9380dae01697157057e33a8b2fd8cb94de6 by deadalnix
[AArch64] Remove ADDC, ADDE, SUBC, SUBE support, use the CARRY ops instead

This cleans up tech debt. Similar to D33390 .

Reviewed By: Kmeakin

Differential Revision: https://reviews.llvm.org/D125150
The file was modifiedllvm/lib/Target/AArch64/AArch64ISelLowering.cpp
Commit 45ac2c730bc4f78d2d90a76e98fab66de92433b6 by pklausler
[flang] Allow PDTs with LEN parameters in REDUCE()

The type compatibility checks for the ARRAY= argument and the dummy
arguments and result of the OPERATION= argument to the REDUCE intrinsic
function need to allow for parameterized data types with LEN parameters.
(Their values are required to be identical but this is not a numbered
constraint requiring a compilation time check).

Differential Revision: https://reviews.llvm.org/D125124
The file was modifiedflang/test/Semantics/reduce01.f90
The file was modifiedflang/lib/Evaluate/intrinsics.cpp
Commit 78a166b47beb919b50594f13c1d0c23bda3e4fd7 by pklausler
[flang] Allow NULL() actual argument for optional dummy procedure

A disassociated procedure pointer is allowed to be passed as an absent
actual argument that corresponds to an optional dummy procedure,
but not NULL(); accept that case as well.

Differential Revision: https://reviews.llvm.org/D125127
The file was modifiedflang/test/Semantics/call02.f90
The file was modifiedflang/lib/Semantics/check-call.cpp
Commit dcd69d82baad437405d8dd4b5c4b2e137be2d730 by carl.ritson
[AMDGPU] Generate checks in llvm.amdgcn.softwqm.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/llvm.amdgcn.softwqm.ll
Commit 78ab7adbd39ecfd04da5937a78a33f59b89ee310 by carl.ritson
[AMDGPU] Pre-commit test for D124981. NFC.
The file was modifiedllvm/test/CodeGen/AMDGPU/llvm.amdgcn.softwqm.ll
Commit 3382edf9b96caae4f1e2fde1b6611be95191de14 by pklausler
[flang] Allow implicit declaration of DATA objects in inner procedures

DATA statements in inner procedures were not treating undeclared objects
as implicitly declared variables if the DATA statement appeared in a
specification part; they were treated as host-associated symbols instead.
This was incorrect.  Fix DATA statement name resolution to always treat
DATA as if it had appeared in the executable part.

Differential Revision: https://reviews.llvm.org/D125129
The file was addedflang/test/Semantics/data16.f90
The file was modifiedflang/lib/Semantics/resolve-names.cpp
Commit 5d5d2a0b197fa02abac5ccf295731ca826864ddd by pklausler
[flang] Refine error checking in specification expressions

The rules in the Fortran standard for specification expressions
are full of special cases and exceptions, and semantics didn't get
them exactly right.  It is valid to refer to an INTENT(OUT) dummy
argument in a specification expression in the context of a
specification inquiry function like SIZE(); it is not valid to
reference an OPTIONAL dummy argument outside of the context of
PRESENT.  This patch makes the specification expression checker
a little context-sensitive about whether it's examining an actual
argument of a specification inquiry intrinsic function or not.

Differential Revision: https://reviews.llvm.org/D125131
The file was modifiedflang/test/Semantics/symbol13.f90
The file was modifiedflang/lib/Evaluate/intrinsics.cpp
The file was modifiedflang/test/Semantics/spec-expr.f90
The file was modifiedflang/lib/Evaluate/check-expression.cpp
Commit eef76f9821b845b684c9f54d4f3b6d67c0dc2acc by pklausler
[flang] Reverse a reversed type compatibility check

The semantic test for an intrinsic assignment to a polymorphic
derived type entity from a type that is an extension of its base
type was reversed, so it would allow assignments that it shouldn't
and disallowed some that it should; and the test case for it
incorectly assumed that the invalid semantics were correct.
Fix the code and the test, and add a new test for the invalid
case (LHS type is an extension of the RHS type).

Differential Revision: https://reviews.llvm.org/D125135
The file was modifiedflang/lib/Semantics/tools.cpp
The file was modifiedflang/test/Semantics/selecttype03.f90
Commit c35ad9ee4f21c03baaea65e2479e9d08c4b4acd2 by mtrofin
[mlgo] Support exposing more features than those supported by models

This allows the compiler to support more features than those supported by a
model. The only requirement (development mode only) is that the new
features must be appended at the end of the list of features requested
from the model. The support is transparent to compiler code: for
unsupported features, we provide a valid buffer to copy their values;
it's just that this buffer is disconnected from the model, so insofar
as the model is concerned (AOT or development mode), these features don't
exist. The buffers are allocated at setup - meaning, at steady state,
there is no extra allocation (maintaining the current invariant). These
buffers has 2 roles: one, keep the compiler code simple. Second, allow
logging their values in development mode. The latter allows retraining
a model supporting the larger feature set starting from traces produced
with the old model.

For release mode (AOT-ed models), this decouples compiler evolution from
model evolution, which we want in scenarios where the toolchain is
frequently rebuilt and redeployed: we can first deploy the new features,
and continue working with the older model, until a new model is made
available, which can then be picked up the next time the compiler is built.

Differential Revision: https://reviews.llvm.org/D124565
The file was modifiedllvm/unittests/Analysis/CMakeLists.txt
The file was modifiedllvm/lib/Analysis/TFUtils.cpp
The file was modifiedllvm/lib/Analysis/DevelopmentModeInlineAdvisor.cpp
The file was modifiedllvm/lib/CodeGen/MLRegallocEvictAdvisor.cpp
The file was modifiedllvm/unittests/Analysis/MLModelRunnerTest.cpp
The file was modifiedllvm/include/llvm/Analysis/MLModelRunner.h
The file was modifiedllvm/lib/Analysis/NoInferenceModelRunner.cpp
The file was modifiedllvm/include/llvm/Analysis/TensorSpec.h
The file was modifiedllvm/include/llvm/Analysis/ModelUnderTrainingRunner.h
The file was modifiedllvm/include/llvm/Analysis/NoInferenceModelRunner.h
The file was modifiedllvm/lib/Analysis/MLInlineAdvisor.cpp
The file was modifiedllvm/unittests/Analysis/TFUtilsTest.cpp
The file was modifiedllvm/include/llvm/Analysis/InlineModelFeatureMaps.h
The file was modifiedllvm/include/llvm/Analysis/ReleaseModeModelRunner.h
The file was modifiedllvm/lib/Analysis/ModelUnderTrainingRunner.cpp
Commit 62f7dc7c037c880f0179ce29be3a7310e5cfa548 by douglas.yung
Add x86 to REQUIRES line in test as suggested in https://reviews.llvm.org/D124105.
The file was modifiedlld/test/ELF/lto/stats-file-option.ll
Commit f6d4769894484bc9e89f83d12679e3dc31c4b4eb by llvmgnsyncbot
[gn build] Port 059e03476cbb
The file was modifiedllvm/utils/gn/secondary/llvm/unittests/Analysis/BUILD.gn
Commit 8594b051fb40312e991d94f0c7eb09accd8ac822 by pklausler
[flang] Accept POINTER followed by INTERFACE

As is already supported for dummy procedures, we need to also accept
declarations of procedure pointers that consist of a POINTER attribute
statement followed by an INTERFACE block.  (The case of an INTERFACE
block followed by a POINTER statement already works.)

While cleaning this case up, adjust the utility predicate IsProcedurePointer()
to recognize it (namely a SubprogramDetails symbol with Attr::POINTER)
and delete IsProcName().  Extend tests, and add better comments to
symbol.h to document the two ways in which procedure pointers are
represented.

Differential Revision: https://reviews.llvm.org/D125139
The file was modifiedflang/test/Semantics/nullify02.f90
The file was modifiedflang/lib/Semantics/check-nullify.cpp
The file was modifiedflang/lib/Semantics/resolve-names.cpp
The file was modifiedflang/include/flang/Semantics/symbol.h
The file was modifiedflang/test/Semantics/procinterface01.f90
The file was modifiedflang/lib/Lower/ConvertType.cpp
The file was modifiedflang/lib/Evaluate/tools.cpp
The file was modifiedflang/include/flang/Semantics/tools.h
The file was modifiedflang/lib/Semantics/data-to-inits.cpp
The file was modifiedflang/lib/Semantics/tools.cpp
Commit debd9bf3f0198984cb4ae66c16758e0c8eeb2e9e by yedeng.yd
[NFC] follow up code cleanup after D123837

Reviewed By: iains

Differential Revision: https://reviews.llvm.org/D124149
The file was modifiedclang/lib/Sema/SemaLookup.cpp
Commit 8c407f4a1121ac3eaf46ca6e92f0976c196ce35b by pklausler
[flang] Allow ENTRY function result symbol usage before the ENTRY

In a function, ENTRY E without an explicit RESULT() creates a
function result entity also named E that is storage associated with
the enclosing function's result.  f18 was emitting an incorrect error
message if that function result E was referenced without any
declaration prior to its ENTRY statement when it should have been
implicitly declared instead.

Differential Revision: https://reviews.llvm.org/D125144
The file was modifiedflang/test/Semantics/entry01.f90
The file was modifiedflang/lib/Semantics/resolve-names.cpp
Commit eccf5efeccfab6b1028dd3bd7adf239d5f0a6381 by ben.shi
[RISCV][NFC] Add 'rv32izvfh' invalid arch test

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D125210
The file was modifiedllvm/test/MC/RISCV/attribute-arch-invalid.s
Commit 88c336d8eff03fc59a669c9ae4f2e415d95ff07c by ben.shi
[clang][Driver] Add more tests for riscv

Reviewed By: benshi001

Differential Revision: https://reviews.llvm.org/D125157
The file was modifiedclang/test/Driver/riscv-arch.c
Commit 1284ce917b5ab16a2ec4447e0f0500af96c39e64 by ox59616e
[NFC] Modify the comment to reflect the changes in decoder
The file was modifiedllvm/utils/TableGen/DecoderEmitter.cpp