OSDN Git Service
Nathan James [Tue, 7 Jul 2020 15:05:09 +0000 (16:05 +0100)]
[ASTMatchers] Added hasDirectBase Matcher
Adds a matcher called `hasDirectBase` for matching the `CXXBaseSpecifier` of a class that directly derives from another class.
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D81552
Pavel Labath [Tue, 7 Jul 2020 14:56:05 +0000 (16:56 +0200)]
[lldb/Utility] Fix float->integral conversions in Scalar APInt getters
These functions were doing a bitcast on the float value, which is not
consistent with the other getters, which were doing a numeric conversion
(47.0 -> 47). Change these to do numeric conversions too.
SharmaRithik [Tue, 7 Jul 2020 14:26:34 +0000 (19:56 +0530)]
[CodeMoverUtils] Make specific analysis dependent checks optional
Summary: This patch makes code motion checks optional which are dependent on
specific analysis example, dominator tree, post dominator tree and dependence
info. The aim is to make the adoption of CodeMoverUtils easier for clients that
don't use analysis which were strictly required by CodeMoverUtils. This will
also help in diversifying code motion checks using other analysis example MSSA.
Authored By: RithikSharma
Reviewer: Whitney, bmahjour, etiotto
Reviewed By: Whitney
Subscribers: Prazek, hiraditya, george.burgess.iv, asbirlea, llvm-commits
Tag: LLVM
Differential Revision: https://reviews.llvm.org/D82566
Guillaume Chatelet [Tue, 7 Jul 2020 14:35:12 +0000 (14:35 +0000)]
[Bitfields][NFC] Make sure bitfields are contiguous
Differential Revision: https://reviews.llvm.org/D83202
Eric Schweitz [Wed, 1 Jul 2020 19:32:44 +0000 (12:32 -0700)]
[flang] Add lowering of I/O statements.
The IO module is where I/O related statements are lowered to calls to the runtime library.
Differential revision: https://reviews.llvm.org/D83267
Balázs Kéri [Tue, 7 Jul 2020 12:21:18 +0000 (14:21 +0200)]
[ASTImporter] Corrected import of repeated friend declarations.
Summary:
Import declarations in correct order if a class contains
multiple redundant friend (type or decl) declarations.
If the order is incorrect this could cause false structural
equivalences and wrong declaration chains after import.
Reviewers: a.sidorin, shafik, a_sidorin
Reviewed By: shafik
Subscribers: dkrupp, Szelethus, gamesh411, teemperor, martong, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D75740
Ye Luo [Tue, 7 Jul 2020 14:13:37 +0000 (10:13 -0400)]
[OpenMP] Use primary context in CUDA plugin
Summary:
Retaining per device primary context is preferred to creating a context owned by the plugin.
From CUDA documentation
1. Note that the use of multiple CUcontext s per device within a single process will substantially degrade performance and is strongly discouraged. Instead, it is highly recommended that the implicit one-to-one device-to-context mapping for the process provided by the CUDA Runtime API be used." from https://docs.nvidia.com/cuda/cuda-runtime-api/group__CUDART__DRIVER.html
2. Right under cuCtxCreate. In most cases it is recommended to use cuDevicePrimaryCtxRetain. https://docs.nvidia.com/cuda/cuda-driver-api/group__CUDA__CTX.html#group__CUDA__CTX_1g65dc0012348bc84810e2103a40d8e2cf
3. The primary context is unique per device and shared with the CUDA runtime API. These functions allow integration with other libraries using CUDA. https://docs.nvidia.com/cuda/cuda-driver-api/group__CUDA__PRIMARY__CTX.html#group__CUDA__PRIMARY__CTX
Two issues are addressed by this patch:
1. Not using the primary context caused interoperability issue with libraries like cublas, cusolver. CUBLAS_STATUS_EXECUTION_FAILED and cudaErrorInvalidResourceHandle
2. On OLCF summit, "Error returned from cuCtxCreate" and "CUDA error is: invalid device ordinal"
Regarding the flags of the primary context. If it is inactive, we set CU_CTX_SCHED_BLOCKING_SYNC. If it is already active, we respect the current flags.
Reviewers: grokos, ABataev, jdoerfert, protze.joachim, AndreyChurbanov, Hahnfeld
Reviewed By: jdoerfert
Subscribers: openmp-commits, yaxunl, guansong, sstefan1, tianshilei1992
Tags: #openmp
Differential Revision: https://reviews.llvm.org/D82718
Alexey Bataev [Tue, 7 Jul 2020 13:33:06 +0000 (09:33 -0400)]
[DEBUGINFO]Add dwarf versions to the test, NFC.
Pavel Labath [Tue, 7 Jul 2020 13:23:49 +0000 (15:23 +0200)]
[lldb/test] Fix lldbutil.run_to_***_breakpoint for shared libraries
Even non-remote targets may need to set the launch environment
((DY)LD_LIBRARY_PATH, specifically) to run successfully.
Also, add an assertion to better detect the case when launching a target
fails and the breakpoint is never hit.
Roman Lebedev [Tue, 7 Jul 2020 13:53:19 +0000 (16:53 +0300)]
[Scalarizer] When gathering scattered scalar, don't replace it with itself
The (previously-crashing) test-case would cause us to seemingly-harmlessly
replace some use with something else, but we can't replace it with itself,
so we would crash.
Liu, Chen3 [Tue, 7 Jul 2020 13:22:27 +0000 (21:22 +0800)]
[X86] Fix a bug that when lowering byval argument
When an argument has 'byval' attribute and should be
passed on the stack according calling convention,
a stack copy would be emitted twice. This will cause
the real value will be put into stack where the pointer
should be passed.
Differential Revision: https://reviews.llvm.org/D83175
Joel E. Denny [Tue, 7 Jul 2020 13:48:22 +0000 (09:48 -0400)]
[OpenMP][NFC] Remove hard-coded line numbers from more tests
This is a continuation of D82224.
Reviewed By: grokos
Differential Revision: https://reviews.llvm.org/D83057
Georgii Rymar [Mon, 6 Jul 2020 13:43:01 +0000 (16:43 +0300)]
[llvm-readobj] - Refactor the MipsGOTParser<ELFT> to stop using report_fatal_error().
`MipsGOTParser` is a helper class that is used to dump MIPS GOT and PLT.
There is a problem with it: it might call report_fatal_error() on invalid input.
When this happens, the tool reports a crash:
```
# command stderr:
LLVM ERROR: Cannot find PLTGOT dynamic table tag.
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backt
race.
Stack dump:
...
```
Such error were not tested. In this patch I've refactored `MipsGOTParser`:
I've splitted handling of GOT and PLT to separate methods. This allows to propagate
any possible errors to caller and should allow to dump the PLT when something is wrong
with the GOT and vise versa in the future.
I've added tests for each `report_fatal_error()`
and now calling the `reportError` instead. In the future we might want to switch to
reporting warnings, but it requres the additional testing and should
be performed independently.
I've kept `unwrapOrError` calls untouched for now as I'd like to focus on eliminating
`report_fatal_error` calls in this patch only.
Differential revision: https://reviews.llvm.org/D83225
Nathan James [Tue, 7 Jul 2020 13:30:52 +0000 (14:30 +0100)]
[NFC] Use hasAnyName matcher in place of anyOf(hasName()...)
Georgii Rymar [Tue, 7 Jul 2020 13:22:10 +0000 (16:22 +0300)]
[llvm-readobj] - Fix indentation in broken-dynamic-reloc.test. NFC.
Fix a broken indentation introduced my myself in rG4a3c3d741a17.
Georgii Rymar [Mon, 6 Jul 2020 15:07:35 +0000 (18:07 +0300)]
[llvm-readobj] - Don't abort when dumping dynamic relocations when an object has both REL and RELA.
Currently, llvm-readobj calls `report_fatal_error` when an object has
both REL and RELA dynamic relocations.
llvm-readelf is able to handle this case properly. This patch adds such a test case
and adjusts the llvm-readobj code to follow (and be consistent with its own RELR and PLTREL cases).
Differential revision: https://reviews.llvm.org/D83232
Sam McCall [Thu, 2 Jul 2020 21:51:26 +0000 (23:51 +0200)]
[clangd] Store index in '.cache/clangd/index' instead of '.clangd/index'
Summary:
.clangd/index was well-intentioned in
2754942cbaef, but `.clangd` is the best
filename for the clangd config file (matching .clang-format and .clang-tidy).
And of course we can't have both .clangd/index and .clangd...
There are a few overlapping goals to satisfy:
- it should be clear from the directory name that this is transient
data that is safe to delete at the cost of recomputation, i.e. a cache
- it should be easy and self-documenting to blacklist these files in .gitignore
- we should have some consistency between filenames in-tree and
corresponding files in user storage (e.g. under XDG's ~/.cache/)
- we should be consistent across platforms (including windows, which
doesn't have distinct cache vs config directories)
So the plan is:
$PROJECT/.clangd (project config)
$PROJECT/.cache/clangd/index/ (project index)
$PROJECT/.cache/clangd/modules/ (maybe in future)
$XDG_CONFIG_HOME/clangd/config.yaml (user config)
$XDG_CACHE_HOME/clangd/index/ (index of non-project files)
$XDG_CACHE_HOME/clangd/modules/ (maybe in future)
This is sensible if XDG_{CONFIG,CACHE}_HOME coincide, and has a simple
.gitignore rule going forward: `.cache/`.
The monorepo gitignore is updated to reflect the backwards-compatible practice:
ignore .clangd/ (with trailing slash) matching index files from clangd 9/10
ignore .cache matching index from clangd 11+, and potentially other tools.
The entries from llvm-project/llvm gitignore are removed (obsolete).
Reviewers: kadircet, hokein
Subscribers: ilya-biryukov, MaskRay, jkorous, omtcyfz, arphaman, usaxena95, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D83099
Benjamin Kramer [Tue, 7 Jul 2020 10:49:32 +0000 (12:49 +0200)]
[mlir][VectorOps] Lower vector.outerproduct of int vectors
vector.fma and mulf don't work on integers. Use a muli/addi pair or
plain muli instead.
Differential Revision: https://reviews.llvm.org/D83292
Lei Zhang [Tue, 7 Jul 2020 12:28:25 +0000 (08:28 -0400)]
[mlir][spirv] Introduce OwningSPIRVModuleRef for ownership
Similar to OwningModuleRef, OwningSPIRVModuleRef signals ownership
transfer clearly. This is useful for APIs like spirv::deserialize,
where a spirv::ModuleOp is returned by deserializing SPIR-V binary
module.
This addresses the ASAN error as reported in
https://bugs.llvm.org/show_bug.cgi?id=46272
Differential Revision: https://reviews.llvm.org/D81652
Ayal Zaks [Sun, 7 Jun 2020 08:36:57 +0000 (11:36 +0300)]
[LV] Vectorize without versioning-for-unit-stride under -Os/-Oz
If a loop is in a function marked OptSize, Loop Access Analysis should refrain
from generating runtime checks for unit strides that will version the loop.
If a loop is in a function marked OptSize and its vectorization is enabled, it
should be vectorized w/o any versioning.
Fixes PR46228.
Differential Revision: https://reviews.llvm.org/D81345
Raphael Isemann [Tue, 7 Jul 2020 11:30:52 +0000 (13:30 +0200)]
[lldb] Make TestIOHandlerResizeNoEditline pass with Python 2
io.BytesIO seems to produce a stream in Python 2 which isn't recognized
as a file object in the SWIG API, so this test fails for Python 2 (and I assume
also an old SWIG version needs to be involved).
Instead just open an empty input file which is a file object in all Python
versions to make this test pass everywhere.
Georgii Rymar [Tue, 7 Jul 2020 11:43:34 +0000 (14:43 +0300)]
[llvm-readobj] - Add prepending # to mips-got.test and mips-plt.test. NFC.
It was requested in D83225 review to do it separately.
Haojian Wu [Tue, 7 Jul 2020 11:35:22 +0000 (13:35 +0200)]
[clang-tidy] Fix an unused-raii check crash on objective-c++.
Differential Revision: https://reviews.llvm.org/D83293
Georgii Rymar [Fri, 3 Jul 2020 14:24:09 +0000 (17:24 +0300)]
[llvm-readobj] - Refine the error reporting in LLVMStyle<ELFT>::printELFLinkerOptions.
It is possible to:
1) Avoid using the `unwrapOrError` calls and hence allow to continue dumping even when
something is not OK with one of SHT_LLVM_LINKER_OPTIONS sections.
2) replace `reportWarning` with `reportUniqueWarning` calls. In this method it is no-op,
because it is not possible to have a duplicated warnings anyways, but since we probably
want to switch to `reportUniqueWarning` globally, this is a good thing to do.
This patch addresses both these points.
Differential revision: https://reviews.llvm.org/D83131
Georgii Rymar [Thu, 2 Jul 2020 12:01:35 +0000 (15:01 +0300)]
[llvm-readobj] - Split the printHashSymbols. NFCI.
This introduces `printHashTableSymbols` and
`printGNUHashTableSymbols` to split the `printHashSymbols`.
It makes the code more readable and consistent.
Differential revision: https://reviews.llvm.org/D83040
Kerry McLaughlin [Tue, 7 Jul 2020 10:29:12 +0000 (11:29 +0100)]
[SVE][CodeGen] Legalisation of unpredicated store instructions
Summary:
When splitting a store of a scalable type, the new address is
calculated in SplitVecOp_STORE using a vscale and an add instruction.
Reviewers: sdesmalen, efriedma, david-arm
Reviewed By: david-arm
Subscribers: tschuett, hiraditya, psnobl, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D83041
Georgii Rymar [Mon, 6 Jul 2020 10:45:49 +0000 (13:45 +0300)]
[llvm-readobj] - Refactor ELFDumper<ELFT>::getStaticSymbolName.
This is a followup for D83129.
It is possible to make `getStaticSymbolName` report warnings inside
and return the "<?>" on a error. This allows to encapsulate errors handling
and slightly simplifies the logic in callers code.
Differential revision: https://reviews.llvm.org/D83208
Georgii Rymar [Fri, 3 Jul 2020 13:23:46 +0000 (16:23 +0300)]
[llvm-readobj] - Allow dumping partially corrupted SHT_LLVM_CALL_GRAPH_PROFILE sections.
The code we have currently reports an error if something is not right with the
profile section. Instead we can report a warning and continue dumping when it is possible.
This patch does it.
Differential revision: https://reviews.llvm.org/D83129
Kerry McLaughlin [Tue, 7 Jul 2020 09:35:41 +0000 (10:35 +0100)]
[SVE][CodeGen] Legalisation of unpredicated load instructions
Summary:
When splitting a load of a scalable type, the new address is
calculated in SplitVecRes_LOAD using a vscale and an add instruction.
This patch also adds a DAG combiner fold to visitADD for vscale:
- Fold (add (vscale(C0)), (vscale(C1))) to (add (vscale(C0 + C1)))
Reviewers: sdesmalen, efriedma, david-arm
Reviewed By: david-arm
Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D82792
Manuel Klimek [Mon, 6 Jul 2020 12:02:54 +0000 (14:02 +0200)]
Hand Allocator and IdentifierTable into FormatTokenLexer.
This allows us to share the allocator in the future so we can create tokens while parsing.
Differential Revision: https://reviews.llvm.org/D83218
Guillaume Chatelet [Tue, 7 Jul 2020 09:54:13 +0000 (09:54 +0000)]
[NFC] Adding the align attribute on Atomic{CmpXchg|RMW}Inst
This is the first step to add support for the align attribute to AtomicRMWInst and AtomicCmpXchgInst.
Next step is to add support in IRBuilder and BitcodeReader.
Bug: https://bugs.llvm.org/show_bug.cgi?id=27168
Differential Revision: https://reviews.llvm.org/D83136
Pavel Labath [Mon, 6 Jul 2020 09:04:58 +0000 (11:04 +0200)]
[lldb/DWARF] Add a utility function for (forceful) completion of types
Summary:
Unify the code for requiring a complete type and move it into a single
place. The only functional change is that the "cannot start a definition
of an incomplete type" is upgrated from a runtime error/warning to an
lldbassert. An plain assert might also be fine, since (AFAICT) this can
only happen in case of a programmer error.
Reviewers: teemperor, aprantl, shafik
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D83199
Georgii Rymar [Thu, 2 Jul 2020 10:38:42 +0000 (13:38 +0300)]
[llvm-readobj] - Fix a crash scenario in GNUStyle<ELFT>::printHashSymbols().
We might crash when the dynamic symbols table is empty (or not found)
and --hash-symbols is requested. Both .hash and .gnu.hash logic is affected.
The patch fixes this issue.
Differential revision: https://reviews.llvm.org/D83037
Kiran Kumar T P [Tue, 7 Jul 2020 08:56:22 +0000 (14:26 +0530)]
[flang][OpenMP] Enhance parser support for flush construct to OpenMP 5.0
Summary:
This patch enhances parser support for flush construct to OpenMP 5.0 by including memory-order-clause.
2.18.8 flush Construct
!$omp flush [memory-order-clause] [(list)]
where memory-order-clause is
acq_rel
release
acquire
The patch includes code changes and testcase modifications.
Reviewed By: klausler, kiranchandramohan
Differential Revision: https://reviews.llvm.org/D82177
River Riddle [Tue, 7 Jul 2020 08:35:23 +0000 (01:35 -0700)]
[mlir][NFC] Remove usernames and google bug numbers from TODO comments.
These were largely leftover from when MLIR was a google project, and don't really follow LLVM guidelines.
David Sherwood [Fri, 19 Jun 2020 08:06:21 +0000 (09:06 +0100)]
[SVE] Add more warnings checks to clang and LLVM SVE tests
There are now more SVE tests in LLVM and Clang that do not
emit warnings related to invalid use of EVT::getVectorNumElements()
and VectorType::getNumElements(). For these tests I have added
additional checks that there are no warnings in order to prevent
any future regressions.
Differential Revision: https://reviews.llvm.org/D82943
David Sherwood [Thu, 25 Jun 2020 07:19:49 +0000 (08:19 +0100)]
[SVE][CodeGen] Fix bug when falling back to DAG ISel
In an earlier commit
584d0d5c1749c13625a5d322178ccb4121eea610 I
added functionality to allow AArch64 CodeGen support for falling
back to DAG ISel when Global ISel encounters scalable vector
types. However, it seems that we were not falling back early
enough as llvm::getLLTForType was still being invoked for scalable
vector types.
I've added a new fallback function to the call lowering class in
order to catch this problem early enough, rather than wait for
lowerFormalArguments to reject scalable vector types.
Differential Revision: https://reviews.llvm.org/D82524
David Sherwood [Mon, 29 Jun 2020 08:39:22 +0000 (09:39 +0100)]
[CodeGen] Fix warnings in sve-vector-splat.ll and sve-trunc.ll
This patch fixes all remaining warnings in:
llvm/test/CodeGen/AArch64/sve-trunc.ll
llvm/test/CodeGen/AArch64/sve-vector-splat.ll
I hit some warnings related to getCopyPartsToVector. I fixed two
issues:
1. In widenVectorToPartType() we assumed that we'd always be
using BUILD_VECTOR nodes to expand from one vector type to another,
which is incorrect for scalable vector types. I've fixed this for now
by simply bailing out immediately for scalable vectors.
2. In getCopyToPartsVector() I've changed the code to compare
the element counts of different types.
Differential Revision: https://reviews.llvm.org/D83028
Craig Topper [Tue, 7 Jul 2020 07:27:50 +0000 (00:27 -0700)]
[X86] Add 64bit and retpoline-external-thunk to list of featuers in X86TargetParser.def.
'64bit' shows up from -march=native on 64-bit capable CPUs.
'retpoline-eternal-thunk' isn't a real feature but shows up
when -mretpoline-external-thunk is passed to clang.
Craig Topper [Tue, 7 Jul 2020 07:17:59 +0000 (00:17 -0700)]
[X86] Remove assert for missing features from X86::getImpliedFeatures
This is failing on the bots. Remove while I try to figure out
what feature I missed in the table.
Craig Topper [Tue, 7 Jul 2020 06:50:41 +0000 (23:50 -0700)]
[X86] Merge X86TargetInfo::setFeatureEnabled and X86TargetInfo::setFeatureEnabledImpl. NFC
setFeatureEnabled is a virtual function. setFeatureEnabledImpl
was its implementation. This split was to avoid virtual calls
when we need to call setFeatureEnabled in initFeatureMap.
With C++11 we can use 'final' on setFeatureEnabled to enable
the compiler to perform de-virtualization for the initFeatureMap
calls.
Carl Ritson [Tue, 7 Jul 2020 06:40:35 +0000 (15:40 +0900)]
[AMDGPU] Update isFMAFasterThanFMulAndFAdd assumptions
MAD/MAC is no longer always available.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D83207
Saiyedul Islam [Tue, 7 Jul 2020 06:15:26 +0000 (06:15 +0000)]
[libomptarget] Implement atomic inc and fence functions for AMDGCN using clang builtins
This function uses __builtin_amdgcn_atomic_inc32():
uint32_t atomicInc(uint32_t *address, uint32_t max);
These functions use __builtin_amdgcn_fence():
__kmpc_impl_threadfence()
__kmpc_impl_threadfence_block()
__kmpc_impl_threadfence_system()
They will take place of current mechanism of directly calling IR functions.
Reviewed By: JonChesterfield
Differential Revision: https://reviews.llvm.org/D83132
Saiyedul Islam [Tue, 7 Jul 2020 06:13:43 +0000 (06:13 +0000)]
[AMDGPU] Change Clang AMDGCN atomic inc/dec builtins to take unsigned values
builtin_amdgcn_atomic_inc32(uint *Ptr, uint Val, unsigned MemoryOrdering, const char *SyncScope)
builtin_amdgcn_atomic_inc64(uint64_t *Ptr, uint64_t Val, unsigned MemoryOrdering, const char *SyncScope)
builtin_amdgcn_atomic_dec32(uint *Ptr, uint Val, unsigned MemoryOrdering, const char *SyncScope)
builtin_amdgcn_atomic_dec64(uint64_t *Ptr, uint64_t Val, unsigned MemoryOrdering, const char *SyncScope)
As AMDGCN IR instrinsic for atomic inc/dec does unsigned comparison,
these clang builtins should also take unsigned types instead of signed
int types.
Reviewed By: JonChesterfield
Differential Revision: https://reviews.llvm.org/D83121
Craig Topper [Tue, 7 Jul 2020 05:47:54 +0000 (22:47 -0700)]
[X86] Move the feature dependency handling in X86TargetInfo::setFeatureEnabledImpl to a table based lookup in X86TargetParser.cpp
Previously we had to specify the forward and backwards feature dependencies separately which was error prone. And as dependencies have gotten more complex it was hard to be sure the transitive dependencies were handled correctly. The way it was written was also not super readable.
This patch replaces everything with a table that lists what features a feature is dependent on directly. Then we can recursively walk through the table to find the transitive dependencies. This is largely based on how we handle subtarget features in the MC layer from the tablegen descriptions.
Differential Revision: https://reviews.llvm.org/D83273
Max Kazantsev [Tue, 7 Jul 2020 06:03:30 +0000 (13:03 +0700)]
[Test] Add one more missing optimization opportunity test
Craig Topper [Tue, 7 Jul 2020 05:11:17 +0000 (22:11 -0700)]
[X86] Remove duplicate SSE4A feature bit from X86TargetParser.def. NFC
We had both SSE4A and SSE4_A. So remove one of them.
Martin Waitz [Tue, 7 Jul 2020 04:40:01 +0000 (04:40 +0000)]
[mlir] resolve types from attributes in assemblyFormat
An operation can specify that an operation or result type matches the
type of another operation, result, or attribute via the `AllTypesMatch`
or `TypesMatchWith` constraints.
Use these constraints to also automatically resolve types in the
automatically generated assembly parser.
This way, only the attribute needs to be listed in `assemblyFormat`,
e.g. for constant operations.
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D78434
Sameer Arora [Mon, 6 Jul 2020 21:53:24 +0000 (14:53 -0700)]
[llvm-install-name-tool] Merge install-name options
This diff merges all options for llvm-install-name-tool under a single
function processLoadCommands. Also adds another test case for -add_rpath
option.
Test plan: make check-all
Reviewed by: jhenderson, alexshap, smeenai, Ktwu
Differential Revision: https://reviews.llvm.org/D82812
Nemanja Ivanovic [Tue, 7 Jul 2020 03:06:53 +0000 (22:06 -0500)]
[PowerPC] Do not RAUW combined nodes in VECTOR_SHUFFLE legalization
When legalizing shuffles, we make an attempt to combine it into
a PPC specific canonical form that avoids a need for a swap. If the
combine is successful, we RAUW the node and the custom legalization
replaces the now dead node instead of the one it should replace.
Remove that erroneous call to RAUW.
LLVM GN Syncbot [Tue, 7 Jul 2020 02:20:39 +0000 (02:20 +0000)]
[gn build] Port
939d8309dbd
Valentin Clement [Tue, 7 Jul 2020 02:19:43 +0000 (22:19 -0400)]
[openmp] Move isAllowedClauseForDirective to tablegen + add clause version to OMP.td
Summary:
Generate the isAllowedClauseForDirective function from tablegen. This patch introduce
the VersionedClause in the tablegen file so that clause can be encapsulated in this class to
specify a range of validity on a directive.
VersionedClause has default minVersion, maxVersion so it can be used without them or
minVersion.
Reviewers: jdoerfert, jdenny
Reviewed By: jdenny
Subscribers: yaxunl, hiraditya, guansong, jfb, sstefan1, aaron.ballman, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D82982
Xiang1 Zhang [Tue, 7 Jul 2020 01:50:17 +0000 (09:50 +0800)]
[X86-64] Support Intel AMX Intrinsic
INTEL ADVANCED MATRIX EXTENSIONS (AMX).
AMX is a new programming paradigm, it has a set of 2-dimensional registers
(TILES) representing sub-arrays from a larger 2-dimensional memory image and
operate on TILES.
These intrinsics use direct TMM register number as its params.
Spec can be found in Chapter 3 here https://software.intel.com/content/www/us/en/develop/download/intel-architecture-instruction-set-extensions-programming-reference.html
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D83111
Mauricio Sifontes [Tue, 7 Jul 2020 01:59:11 +0000 (01:59 +0000)]
Create the framework and testing environment for MLIR Reduce - a tool
with the objective to reduce large test cases into smaller ones while
preserving their interesting behavior.
Implement the framework to parse the command line arguments, parse the
input MLIR test case into a module and call reduction passes on the MLIR module.
Implement the Tester class which allows the different reduction passes to test the
interesting behavior of the generated reduced variants of the test case and keep track
of the most reduced generated variant.
Biplob Mishra [Mon, 6 Jul 2020 23:49:19 +0000 (18:49 -0500)]
[PowerPC] Implement Vector Splat Immediate Builtins in Clang
Implements builtins for the following prototypes:
vector signed int vec_splati (const signed int);
vector float vec_splati (const float);
vector double vec_splatid (const float);
vector signed int vec_splati_ins (vector signed int, const unsigned int,
const signed int);
vector unsigned int vec_splati_ins (vector unsigned int, const unsigned int,
const unsigned int);
vector float vec_splati_ins (vector float, const unsigned int, const float);
Differential Revision: https://reviews.llvm.org/D82520
Amy Kwan [Tue, 7 Jul 2020 00:58:04 +0000 (19:58 -0500)]
[PowerPC][Power10] Exploit the xxsplti32dx instruction when lowering VECTOR_SHUFFLE.
This patch aims to exploit the xxsplti32dx XT, IX, IMM32 instruction when lowering VECTOR_SHUFFLEs.
We implement lowerToXXSPLTI32DX when lowering vector shuffles to check if:
- Element size is 4 bytes
- The RHS is a constant vector (and constant splat of 4-bytes)
- The shuffle mask is a suitable mask for the XXSPLTI32DX instruction where it is one of the 32 masks:
<0, 4-7, 2, 4-7>
<4-7, 1, 4-7, 3>
Differential Revision: https://reviews.llvm.org/D83245
Paula Toth [Tue, 7 Jul 2020 01:15:27 +0000 (18:15 -0700)]
[libc] Add documentation for clang-tidy checks.
Reviewers: sivachandra
Reviewed By: sivachandra
Subscribers: tschuett, ecnelises, libc-commits
Tags: #libc-project
Differential Revision: https://reviews.llvm.org/D82846
David Blaikie [Tue, 7 Jul 2020 01:01:57 +0000 (18:01 -0700)]
[ModuloSchedule] Devirtualize PeelingModuloScheduleExpander::expand as it's not needed
The use case is out of tree code deriving from this class - but without
a need to use the base class polymorphically, so skip the virtualization
and virtual dtor.
Post-commit review from
50ac7ce94f34c5f43b02185ae0c33e150e78b044
Jordan Rupprecht [Tue, 7 Jul 2020 00:44:33 +0000 (17:44 -0700)]
Revert "[LV] Enable the LoopVectorizer to create pointer inductions"
This reverts commit
a8fe12065ec8137e55a6a8b35dd5355477c2ac16.
It causes a crash when building gzip. Will post the detailed reduced test case to D81267.
LLVM GN Syncbot [Tue, 7 Jul 2020 00:37:49 +0000 (00:37 +0000)]
[gn build] Port
05f2b5ccfc5
LLVM GN Syncbot [Tue, 7 Jul 2020 00:37:49 +0000 (00:37 +0000)]
[gn build] Port
Nico Weber [Tue, 7 Jul 2020 00:37:02 +0000 (20:37 -0400)]
fix typos to cycle bots
Wolfgang Pieb [Wed, 1 Jul 2020 21:28:52 +0000 (14:28 -0700)]
Correct 3 spelling errors in headers and doc strings.
Amara Emerson [Mon, 6 Jul 2020 22:12:12 +0000 (15:12 -0700)]
Fix sdk version test to use 99.99.99 as a max dummy version instead of 10.99.99.
Was failing on macOS 11 hosts which is > 10.99.99
Sanjay Patel [Mon, 6 Jul 2020 22:03:55 +0000 (18:03 -0400)]
[DAGCombiner] reassociate reciprocal sqrt expression to eliminate FP division
X / (fabs(A) * sqrt(Z)) --> X / sqrt(A*A*Z) --> X * rsqrt(A*A*Z)
In the motivating case from PR46406:
https://bugs.llvm.org/show_bug.cgi?id=46406
...this is restoring the sequence that was originally in the source code.
We extracted a term from within the sqrt because we do not know in
instcombine whether a target will expand a sqrt call.
Note: we could say that the transform in IR should be restricted, but
that would not solve the problem if the source was originally in the
pattern shown here.
This is a gray area for fast-math-flag requirements. I think we should at
least check fast-math-flags on the fdiv and fmul because I view this
transform as 2 pieces: reassociate the fmul operands and form reciprocal
from the fdiv (as with the existing transform). We could argue that the
sqrt also needs FMF, but that was not required before, so we should change
that in a follow-up patch if that seems better.
We don't currently have a way to check that the target will produce a sqrt
or recip estimate without actually creating nodes (the APIs are SDValue
getSqrtEstimate() and SDValue getRecipEstimate()), so we clean up
speculatively created nodes if we are not able to create an estimate.
The x86 test with doubles verifies that we are not changing a test with
no estimate sequence.
Differential Revision: https://reviews.llvm.org/D82716
Eric Christopher [Mon, 6 Jul 2020 22:39:42 +0000 (15:39 -0700)]
Temporarily Revert "[llvm-install-name-tool] Merge install-name options" as it breaks the objcopy build.
This reverts commit
c143900a0851b2c7b7d52e4825c7f073b3474cf6.
Yuanfang Chen [Mon, 6 Jul 2020 22:10:54 +0000 (15:10 -0700)]
[NFC] change getLimitedCodeGenPipelineReason to static function
Roman Lebedev [Mon, 6 Jul 2020 22:31:36 +0000 (01:31 +0300)]
[NFCI][llvm-reduce] ReduceOperandBundles: actually put Module forward-declaration back into llvm namespace
MinJae Hwang [Mon, 6 Jul 2020 22:29:38 +0000 (18:29 -0400)]
Modifications to the algorithm sort benchmark
Summary:
Modifies the algorithm sort bench:
- shows sorting time per element, instead of sorting time per array.
This would make comparison between different sizes of arrays easier.
- adds std::pair benchmark cases.
- uses a large number of arrays to benchmark, instead of repeatedly sorting the same array.
* sorting the same array again and again would not show actual sorting performance over randomized data sets.
Reviewers: EricWF, #libc, mvels
Reviewed By: EricWF, #libc, mvels
Subscribers: mgrang, libcxx-commits
Tags: #libc
Differential Revision: https://reviews.llvm.org/D81770
Peyton, Jonathan L [Mon, 3 Feb 2020 20:29:08 +0000 (14:29 -0600)]
[OpenMP] Add GOMP 5.0 loop entry points
This patch adds missing GOMP_5.0 loop entry points which incorporate
new non-monotonic default into entry point name. Since monotonic
schedules are a subset of nonmonotonic, it is acceptable to use
monotonic as the implementation. This patch simply has the nonmonotonic
(and possibly non-monontonic) versions of the loop entry points as
wrappers around the monotonic ones.
Differential Revision: https://reviews.llvm.org/D73922
Roman Lebedev [Mon, 6 Jul 2020 22:16:37 +0000 (01:16 +0300)]
[llvm-reduce] Reducing call operand bundles
Summary:
This would have been marginally useful to me during/for rG7ea46aee3670981827c04df89b2c3a1cbdc7561b.
With ongoing migration to representing assumes via operand bundles on the assume, this will be gradually more useful.
Reviewers: nickdesaulniers, diegotf, dblaikie, george.burgess.iv, jdoerfert, Tyker
Reviewed By: nickdesaulniers
Subscribers: hiraditya, mgorny, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D83177
Roman Lebedev [Mon, 6 Jul 2020 22:16:36 +0000 (01:16 +0300)]
[NFCI][IR] Introduce CallBase::Create() wrapper
Summary:
It is reasonably common to want to clone some call with different bundles.
Let's actually provide an interface to do that.
Reviewers: chandlerc, jdoerfert, dblaikie, nickdesaulniers
Reviewed By: nickdesaulniers
Subscribers: llvm-commits, hiraditya
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D83248
Sameer Arora [Mon, 6 Jul 2020 21:53:24 +0000 (14:53 -0700)]
[llvm-install-name-tool] Merge install-name options
This diff merges all options for llvm-install-name-tool under a single
function processLoadCommands. Also adds another test case for -add_rpath
option.
Test plan: make check-all
Reviewed by: jhenderson, alexshap, smeenai, Ktwu
Differential Revision: https://reviews.llvm.org/D82812
Roman Lebedev [Mon, 6 Jul 2020 21:25:19 +0000 (00:25 +0300)]
[Scalarizer] Centralize instruction DCE
As reported in https://reviews.llvm.org/D83101#
2133062
the new visitInsertElementInst()/visitExtractElementInst() functionality
is causing miscompiles (previously-crashing test added)
It is due to the fact how the infra of Scalarizer is dealing with DCE,
it was not updated or was it ready for such scalar value forwarding.
It always assumed that the moment we "scalarized" something,
it can go away, and did so with prejudice.
But that is no longer safe/okay to do.
Instead, let's prevent it from ever shooting itself into foot,
and let's just accumulate the instructions-to-be-deleted
in a vector, and collectively cleanup (those that are *actually* dead)
them all at the end.
All existing tests are not reporting any new garbage leftovers,
but maybe it's test coverage issue.
Craig Topper [Mon, 6 Jul 2020 21:58:31 +0000 (14:58 -0700)]
[X86] Centalize the 'sse4' hack to a single place in X86TargetInfo::setFeatureEnabledImpl. NFCI
Instead of detecting the string in 2 places. Just swap the string
to 'sse4.1' or 'sse4.2' at the top of the function.
Prep work for a patch to switch the rest of this function to a
table based system. And I don't want to include 'sse4a' in the
table.
Joachim Protze [Sun, 21 Jun 2020 15:25:20 +0000 (17:25 +0200)]
[OpenMP][Tests] Fix/Mark compatibilty for GCC
Reviewed by: Hahnfeld, saiislam
Differential Revision: https://reviews.llvm.org/D82267
Zixu Wang [Mon, 6 Jul 2020 21:52:12 +0000 (14:52 -0700)]
[clang] Enable errors for undefined TARGET_OS_ macros in Darwin driver
Add clang option `-Wundef-prefix=TARGET_OS_` and `-Werror=undef-prefix`
to Darwin driver.
Differential Revision: https://reviews.llvm.org/D83250
Eric Christopher [Mon, 6 Jul 2020 21:49:21 +0000 (14:49 -0700)]
Fix [-Werror,-Wsign-compare] in dominator unit test.
Bruno Ricci [Mon, 6 Jul 2020 21:37:30 +0000 (22:37 +0100)]
[Support][NFC] Fix Wdocumentation warning in ADT/Bitfields.h
\tparam is used for template parameters instead of \param.
Stanislav Mekhanoshin [Thu, 2 Jul 2020 19:02:39 +0000 (12:02 -0700)]
[AMDGPU] Tweak getTypeLegalizationCost()
Even though wide vectors are legal they still cost more as we
will have to eventually split them. Not all operations can
be uniformly done on vector types.
Conservatively add the cost of splitting at least to 8 dwords,
which is our widest possible load.
We are more or less lying to cost mode with this change but
this can prevent vectorizer from creation of wide vectors which
results in RA problems for us.
Differential Revision: https://reviews.llvm.org/D83078
Bruno Ricci [Mon, 6 Jul 2020 20:50:23 +0000 (21:50 +0100)]
[clang] Rework how and when APValues are dumped
Currently APValues are dumped as a single string. This becomes quickly
completely unreadable since APValue is a tree-like structure. Even a simple
example is not pretty:
struct S { int arr[4]; float f; };
constexpr S s = { .arr = {1,2}, .f = 3.1415f };
// Struct fields: Array: Int: 1, Int: 2, 2 x Int: 0, Float: 3.
141500e+00
With this patch this becomes:
-Struct
|-field: Array size=4
| |-elements: Int 1, Int 2
| `-filler: 2 x Int 0
`-field: Float 3.
141500e+00
Additionally APValues are currently only dumped as part of visiting a
ConstantExpr. This patch also dump the value of the initializer of constexpr
variable declarations:
constexpr int foo(int a, int b) { return a + b - 42; }
constexpr int a = 1, b = 2;
constexpr int c = foo(a, b) > 0 ? foo(a, b) : foo(b, a);
// VarDecl 0x62100008aec8 <col:3, col:57> col:17 c 'const int' constexpr cinit
// |-value: Int -39
// `-ConditionalOperator 0x62100008b4d0 <col:21, col:57> 'int'
// <snip>
Do the above by moving the dump functions to TextNodeDumper which already has
the machinery to display trees. The cases APValue::LValue, APValue::MemberPointer
and APValue::AddrLabelDiff are left as they were before (unimplemented).
We try to display multiple elements on the same line if they are considered to
be "simple". This is to avoid wasting large amounts of vertical space in an
example like:
constexpr int arr[8] = {0,1,2,3,4,5,6,7};
// VarDecl 0x62100008bb78 <col:3, col:42> col:17 arr 'int const[8]' constexpr cinit
// |-value: Array size=8
// | |-elements: Int 0, Int 1, Int 2, Int 3
// | `-elements: Int 4, Int 5, Int 6, Int 7
Differential Revision: https://reviews.llvm.org/D83183
Reviewed By: aaron.ballman
Matt Arsenault [Sun, 5 Jul 2020 17:17:02 +0000 (13:17 -0400)]
AMDGPU/GlobalISel: Add types to special inputs
When passing special ABI inputs, we have no existing context for the
type to use.
Arlo Siemsen [Mon, 6 Jul 2020 20:17:22 +0000 (13:17 -0700)]
Add option LLVM_NM to allow specifying the location of the llvm-nm tool
The new option works like the existing LLVM_TABLEGEN, and
LLVM_CONFIG_PATH options. Instead of building llvm-nm, the build uses
the executable defined by LLVM_NM.
This is useful for cross-compilation scenarios where the host cannot run
the cross-compiled tool, and recursing into another cmake build is not
an option (due to required DEFINE's, for example).
Reviewed By: smeenai
Differential Revision: https://reviews.llvm.org/D83022
Adrian Prantl [Mon, 6 Jul 2020 20:15:28 +0000 (13:15 -0700)]
Use CMAKE_OSX_SYSROOT instead of the environment variable SYSROOT
to detect energy support in debugserver. The way that Swift
build-script is invoked the former may be overridden manually.
<rdar://problem/
63840635>
Tim Keith [Mon, 6 Jul 2020 20:03:00 +0000 (13:03 -0700)]
[flang] Add missing include for std::min
This was causing the build to fail on macos.
Differential Revision: https://reviews.llvm.org/D83237
Nicolai Hähnle [Wed, 24 Jun 2020 08:32:55 +0000 (10:32 +0200)]
DomTree: add private create{Child,Node} helpers
Summary:
Aside from unifying the code a bit, this change smooths the
transition to use of future "opaque generic block references"
in the type-erased dominator tree base class.
Change-Id: If924b092cc8561c4b6a7450fe79bc96df0e12472
Reviewers: arsenm, RKSimon, mehdi_amini, courbet
Subscribers: wdng, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D83086
Nicolai Hähnle [Mon, 18 May 2020 14:28:28 +0000 (16:28 +0200)]
DomTree: Remove getRoots() accessor
Summary:
Avoid exposing details about how roots are stored. This enables subsequent
type-erasure changes.
v5:
- cleanup a unit test by using EXPECT_EQ instead of EXPECT_TRUE
Change-Id: I532b774cc71f2224e543bc7d79131d97f63f093d
Reviewers: arsenm, RKSimon, mehdi_amini, courbet
Subscribers: jvesely, wdng, hiraditya, kuhar, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D83085
Nicolai Hähnle [Mon, 18 May 2020 14:28:26 +0000 (16:28 +0200)]
DomTree: Remove the releaseMemory() method
Summary:
It is fully redundant with reset().
Change-Id: I25850b9f08eace757cf03cbb8780e970aca7f51a
Reviewers: arsenm, RKSimon, mehdi_amini, courbet
Subscribers: wdng, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D83084
Nicolai Hähnle [Mon, 18 May 2020 14:28:24 +0000 (16:28 +0200)]
DomTree: Remove getChildren() accessor
Summary:
Avoid exposing details about how children are stored. This will enable
subsequent type-erasure changes.
New methods are introduced to cover common access patterns.
Change-Id: Idb5f4b1b9c84e4cc71ddb39bb52a388682f5674f
Reviewers: arsenm, RKSimon, mehdi_amini, courbet
Subscribers: qcolombet, sdardis, wdng, hiraditya, jrtc27, zzheng, atanasyan, asbirlea, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D83083
Wouter van Oortmerssen [Fri, 26 Jun 2020 23:59:02 +0000 (16:59 -0700)]
[WebAssembly] Added 64-bit memory.grow/size/copy/fill
This covers both the existing memory functions as well as the new bulk memory proposal.
Added new test files since changes where also required in the inputs.
Also removes unused init/drop intrinsics rather than trying to make them work for 64-bit.
Differential Revision: https://reviews.llvm.org/D82821
Paula Toth [Mon, 6 Jul 2020 19:43:29 +0000 (12:43 -0700)]
[libc] Add documentation for integration tests.
Reviewers: sivachandra
Reviewed By: sivachandra
Subscribers: MaskRay, tschuett, ecnelises, libc-commits
Tags: #libc-project
Differential Revision: https://reviews.llvm.org/D82907
Wouter van Oortmerssen [Tue, 30 Jun 2020 00:53:09 +0000 (17:53 -0700)]
[WebAssembly] 64-bit memory limits
Kazushi (Jam) Marukawa [Mon, 6 Jul 2020 18:49:59 +0000 (03:49 +0900)]
[VE] Support symbol with offset in assembly
Summary:
Change MCExpr to support Aurora VE's modifiers. Change asmparser to use
existing MCExpr parser (parseExpression) to parse an expression contining
symbols with modifiers and offsets. Also add several regression tests
of MC layer.
Reviewers: simoll, k-ishizaka
Reviewed By: simoll
Subscribers: hiraditya, llvm-commits
Tags: #llvm, #ve
Differential Revision: https://reviews.llvm.org/D83170
Julian Lettner [Fri, 12 Jun 2020 00:34:39 +0000 (17:34 -0700)]
[Sanitizer] Fix demangling for Swift symbol names
The Swift symbol name prefix has changed from `_T0` to `_$s` as
documented here [1]. This prevents Swift names from properly being
symbolicated when using the in-process LLVM symbolizer. The best way to
fix this seems to be to avoid the duplication of "Is this a Swift symbol
name?" here. We can simply remove this check as `swift_demangle`
already returns null for non-Swift names [2,3].
The check was included in the initial support for Swift name demangling
to avoid superfluous calls to `dlsym()` [4]. A subsequent commit
changed this logic to retrieve the `swift_demangle` function pointer
eagerly during sanitizer initialization, but did not remove the check
[5].
[1] https://github.com/apple/swift/blob/master/docs/ABI/Mangling.rst
[2] https://github.com/apple/swift/blob/
b5a8b518eae54cea997f3b0954760fc7858829f6/include/swift/Demangling/Demangle.h#L643
[3] https://github.com/apple/swift/blob/
b5a8b518eae54cea997f3b0954760fc7858829f6/stdlib/public/runtime/Demangle.cpp#L656
[4] https://reviews.llvm.org/D19135
[5] https://reviews.llvm.org/D20015
rdar://
62753845
Reviewers: kubamracek, delcypher, dcoughlin, samsonov, thakis
Reviewed By: kubamracek
Differential Revision: https://reviews.llvm.org/D81705
William S. Moses [Mon, 6 Jul 2020 19:00:29 +0000 (12:00 -0700)]
[ELF] Drop an unneeded reference to `symtab` from SymbolTable::addSymbol
The Symbol Table in LLD references the global object to add a symbol rather than adding it to itself.
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D83184
Kevin P. Neal [Mon, 6 Jul 2020 18:54:56 +0000 (14:54 -0400)]
Revert "[FPEnv][Clang][Driver] Disable constrained floating point on targets lacking support."
My mistake, I had a blocking reviewer.
This reverts commit
39d2ae0afb2312a15e4d15a0855b35b4e1c49fc4.
This reverts commit
bfdafa32a0fa4b2745627fe57dd253db10ac3fcf.
This reverts commit
2b35511350454dd22997f129ee529e3fdb129ac2.
Differential Revision: https://reviews.llvm.org/D80952
Kazushi (Jam) Marukawa [Mon, 6 Jul 2020 18:35:31 +0000 (03:35 +0900)]
[VE] Change to use isa
Summary: Change to use isa instead of dyn_cast to avoid a warning.
Reviewers: simoll, k-ishizaka
Reviewed By: simoll
Subscribers: hiraditya, llvm-commits
Tags: #llvm, #ve
Differential Revision: https://reviews.llvm.org/D83200
Kevin P. Neal [Mon, 6 Jul 2020 18:41:15 +0000 (14:41 -0400)]
[FPEnv][Clang][Driver] Failing tests are now expected failures only on PowerPC
Mark these tests as only failing on PowerPC. Avoids unexpected passes on
other bots.
Fingers crossed.
Differential Revision: https://reviews.llvm.org/D80952
Matt Arsenault [Fri, 19 Jun 2020 19:45:16 +0000 (15:45 -0400)]
AMDGPU: Don't ignore carry out user when expanding add_co_pseudo
This was resulting in a missing vreg def in the use select
instruction.
The output of the pseudo doesn't make sense, since it really shouldn't
have the vreg output in the first place, and instead an implicit scc
def to match the real scalar behavior.
We could have easier to understand tests if we selected scalar
versions of the [us]{add|sub}.with.overflow intrinsics.
This does still end up producing vector code in the end, since it gets
moved later.
Pete Steinfeld [Tue, 30 Jun 2020 19:03:28 +0000 (12:03 -0700)]
[flang] Bug fix for ambiguous references to data and functions
Summary:
A program may erroneously reference the same name as both a data object
and as a function. Some of these references were causing an internal
error in expression analysis.
It was already the case that a symbol referenced in a parse tree for a
call was changed from an `Entity` to a `ProcEntity`. I added code to
detect when a symbol was referenced in a parse tree as an array element
gets changed from an `Entity` to an `ObjectEntity`. Then, if an
`ObjectEntity` gets called as a function or a `ProcEntity` gets
referenced as a data object, errors get emitted.
This analysis was previously confined to the name resolution of the
specification part of a `ProgramTree`. I added a pass to the execution
part of a `ProgramTree` to catch names declared in blocks.
Reviewers: tskeith, klausler, DavidTruby
Subscribers: llvm-commits
Tags: #llvm, #flang
Differential Revision: https://reviews.llvm.org/D82903