Commit graph

397763 commits

Author SHA1 Message Date
Kim-Anh Tran 3973d8b29e [lldb] Return all line entries matchign a line if no column is specified
Previously, if no column was specified, ResolveSymbolContext would take
the first match returned by FindLineEntryIndexByFileIndex, and reuse it
to find subsequent exact matches. With the introduction of columns, columns
are now considered when matching the line entries.

This leads to a problem if one wants to get all existing line entries
that match that line, since now the column is also used for the exact match.
This way, all line entries are filtered out that have a different
column number, but the same line number.

This patch changes that by ignoring the column information of the first match
if the original request of ResolveSymbolContext was also ignoring it.

Reviewed By: mib

Differential Revision: https://reviews.llvm.org/D108816
2021-08-30 14:45:46 +02:00
Djordje Todorovic 86f5288eae [LiveDebugValues] Cleanup Transfers when removing Entry Value
If we encounter a new debug value, describing the same parameter,
we should stop tracking the parameter's Entry Value. At that point,
in some cases, the Transfer which uses the parameter's Entry Value,
is already emitted. Thanks to the RemoveRedundantDebugValues pass,
many problems with incorrect instruction order and number of DBG_VALUEs
are fixed. However, we still cannot rely on the rule that each new
debug value is set by the previous non-debug instruction in Machine
Basic Block.

When new parameter debug value triggers removal of Backup Entry Value
for the same parameter, do the cleanup of Transfers emitted from Backup
Entry Values. Get the Transfer Instruction which created the new debug
value and search for debug values already emitted from the to-be-deleted
Backup Entry Value and attached to the Transfer Instruction. If found,
delete the Transfer and remove "primary" Entry Value Var Loc from
OpenRanges.

This patch fixes PR47628.

Patch by Nikola Tesic.

Differential revision: https://reviews.llvm.org/D106856
2021-08-30 14:00:41 +02:00
Jean Perier 58e1a5e4c2 [flang][mlir] Fix FIR after D108899
After 41d4aa7de6, some builder.getStringAttr
calls in FIR were wrong.
2021-08-30 13:51:39 +02:00
Simon Moll a5791badde [clang] Add gcc-toolset-10 support (RHEL/CentOS 8)
Clang only adds GCC paths for RHEL <= 7 'devtoolset-<N>' Software
Collections (SCL).  This generalizes this support to also include the
'gcc-toolset-10' SCL in RHEL/CentOS 8.

Reviewed By: stephan.dollberg

Differential Revision: https://reviews.llvm.org/D108908
2021-08-30 13:33:30 +02:00
Simon Pilgrim af2920ec6f [TTI][X86] getArithmeticInstrCost - move opcode canonicalization before all target-specific costs. NFCI.
The GLM/SLM special cases still get tested first but after the the MUL/DIV/REM pattern detection - this will be necessary for when we make the SLM vXi32 MUL canonicalization generic to improve PMULLW/PMULHW/PMADDDW cost support etc.
2021-08-30 12:24:59 +01:00
Simon Pilgrim 7c25a32840 Fix MSVC "signed/unsigned mismatch" comparison warning. NFCI. 2021-08-30 12:11:09 +01:00
Raphael Isemann f3ad3ea471 [lldb][NFC] Remove TypeSystemClang::CreateFunctionType overload
This can just be a default argument.
2021-08-30 12:28:20 +02:00
Anton Afanasyev 3f0c6100a2 [CMake][NFC] Add comment about new --gdb-index option used with -gsplit-dwarf
Follow-up of https://reviews.llvm.org/D108776
2021-08-30 12:36:55 +03:00
Dmitry Vyukov 37b78291c6 tsan: add a comment to CallUserSignalHandler
Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D108907
2021-08-30 11:33:19 +02:00
Roman Lebedev 795d142d23
[NFCI][IndVars] rewriteLoopExitValues(): don't expand SCEV's until needed
Previously, we'd expand *ALL* the SCEV's eagerly, because we needed to
check with `isValidRewrite()`, and discard bad rewrite candidates,
but now that we do not do that, we also don't need to always expand.

In particular, this avoids expanding potentially-huge SCEV's that we
would discard anyways because they are high-cost and we aren't
rewriting aggressively.
2021-08-30 12:28:24 +03:00
Anton Afanasyev b1b68b4c01 [CMake] Add --gdb-index option to linker if split dwarf compiling
The option `--gdb-index` should be passed to linker if compiler is invoked
with `-gsplit-dwarf` option. This allows debugger to locate the appropriate
units quickly. See "Invocation" section here: https://gcc.gnu.org/wiki/DebugFission

Suggested by @dblaikie here: https://reviews.llvm.org/D68556#1698442

Differential Revision: https://reviews.llvm.org/D108776
2021-08-30 12:23:21 +03:00
Alex Zinenko 9db95a67d1 Fix interface trait declaration in SymbolInterfaces.td
41d4aa7de6 introduced incorrect code in
extraTraitClassDeclaration: `this` refers to the trait class and not the
operation class so `->getContext()` is not valid. Use `$_op` instead.
2021-08-30 11:15:05 +02:00
Roman Lebedev 7b0d59da9a
[IndVars] Drop check for the validity of rewrite
`isValidRewrite()` checks that the both the original SCEV,
and the rewrite SCEV have the same base pointer.
I //believe//, after all the recent SCEV improvements,
this invariant is already enforced by SCEV itself.

I originally tried changing it into an assert in D108043,
but that showed that it triggers on e.g. https://reviews.llvm.org/D108043#2946621,
where SCEV manages to forward the store to load,
test added.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D108655
2021-08-30 12:06:58 +03:00
Roman Lebedev ada219b13a
[NFC][IndVars] Add test that caused D108043 to be reverted
We currently don't simplify anything here, but we can.
2021-08-30 12:06:58 +03:00
Michał Górny 0a1d80d56e [lldb] [gdb-remote client] Support minimal fork/vfork handling
Add a support for handling fork/vfork stops in LLGS client.  At this
point, it only sends a detach packet for the newly forked child
(and implicitly resumes the parent).

Differential Revision: https://reviews.llvm.org/D100206
2021-08-30 10:24:38 +02:00
“bhkumarn” 0a6fad754e [DebugInfo] Emit DW_TAG_namelist and DW_TAG_namelist_item
This patch emits DW_TAG_namelist and DW_TAG_namelist_item for fortran
namelist variables. DICompositeType is extended to support this fortran
feature.

Reviewed By: aprantl

Differential Revision: https://reviews.llvm.org/D108553
2021-08-30 13:40:39 +05:30
Diana Picus 4fae60c4b0 [flang] Add runtime interface for GET_COMMAND_ARGUMENT
GET_COMMAND_ARGUMENT takes a lot of optional arguments: VALUE, LENGTH,
STATUS and ERRMSG. This patch breaks up the interface into 2 different
functions:

* One for getting the LENGTH of an argument.

* One for getting the VALUE and the ERRMSG of an argument. This returns
the STATUS, which can be easily ignored by lowering if it is missing in
the invocation.

Differential Revision: https://reviews.llvm.org/D108688
2021-08-30 07:31:13 +00:00
Diana Picus cc4d28691b [flang] Add runtime interface for COMMAND_ARGUMENT_COUNT
Differential Revision: https://reviews.llvm.org/D108687
2021-08-30 07:31:13 +00:00
Florian Hahn abd36fe512
[VPlan] Introduce code to limit querying VPValues using IR references.
After applying VPlan-to-VPlan transformations, using IR references to
query VPlan values may be incorrect, as the IR is not in sync with the
VPlan any longer.

To better detect such mis-matches, this patch introduces a new flag to
VPlans to indicate whether it is safe to query VPValues using IR values.

getVPValue is updated to assert if it is called when the flag indicates
it is not safe any longer.

There is an escape hatch via an extra argument, because there are 3
places that need to be fixed first. Those are

1. truncateToMinimalBitwidths
2. clearReductionWrapFlags
3. fixLCSSAPHIs

As a first step, this flag will help preventing new code from violating
this property.

Any suggestions with respect to naming very welcome!

Reviewed By: Ayal

Differential Revision: https://reviews.llvm.org/D108573
2021-08-30 09:12:09 +02:00
Shivam Gupta 3a6b722db8 [docs] Add a new tutorial that talk about how to make a change to llvm
This tutorial will guide you through the process of making a change to LLVM, and contributing it back to the LLVM project.
We'll be making a change to Clang, but the steps for other parts of LLVM are the same. Even though the change we'll be making is simple,
we're going to cover steps like building LLVM, running the tests, and code review. This is good practice, and you'll be prepared for making larger changes.

Authors: @meikeb , @gribozavr
Commit: Zhiqian Xia

PS - This is a duplicate revision of https://reviews.llvm.org/D100714 which was actually used for patch review.

Reviewed By: kuhnel

Differential Revision: https://reviews.llvm.org/D108267
2021-08-30 07:01:04 +00:00
Jean Perier 31fb52f874 [flang] Apply double precision KindCode in specific proc interface
The double precision KindCode was ignored when building the interface
of specific intrinsic procedures leading to bad semantics checks.

Differential Revision: https://reviews.llvm.org/D108828
2021-08-30 08:59:58 +02:00
Wang, Pengfei ab40dbfe03 [X86] AVX512FP16 instructions enabling 6/6
Enable FP16 complex FMA instructions.

Ref.: https://software.intel.com/content/www/us/en/develop/download/intel-avx512-fp16-architecture-specification.html

Reviewed By: LuoYuanke

Differential Revision: https://reviews.llvm.org/D105269
2021-08-30 13:08:45 +08:00
Chris Lattner 41d4aa7de6 [SymbolRefAttr] Revise SymbolRefAttr to hold a StringAttr.
SymbolRefAttr is fundamentally a base string plus a sequence
of nested references.  Instead of storing the string data as
a copies StringRef, store it as an already-uniqued StringAttr.

This makes a lot of things simpler and more efficient because:
1) references to the symbol are already stored as StringAttr's:
   there is no need to copy the string data into MLIRContext
   multiple times.
2) This allows pointer comparisons instead of string
   comparisons (or redundant uniquing) within SymbolTable.cpp.
3) This allows SymbolTable to hold a DenseMap instead of a
   StringMap (which again copies the string data and slows
   lookup).

This is a moderately invasive patch, so I kept a lot of
compatibility APIs around.  It would be nice to explore changing
getName() to return a StringAttr for example (right now you have
to use getNameAttr()), and eliminate things like the StringRef
version of getSymbol.

Differential Revision: https://reviews.llvm.org/D108899
2021-08-29 21:54:47 -07:00
Siva Chandra Reddy 3383ec5fdd [libc] Ensure the result of the clone syscall is not on stack in thrd_create.
Also, added a call to munmap on error in thrd_create.
2021-08-30 04:35:40 +00:00
Qiu Chaofan 3bdd850d0c [PowerPC] Set branch/call instructions as no hasSideEffects
PowerPC can model these instructions, so we don't need this flag set.

Reviewed By: shchenz, jsji

Differential Revision: https://reviews.llvm.org/D71983
2021-08-30 12:23:35 +08:00
Siva Chandra Reddy f7e572b4f4 [libc][NFC] Add a check to catch mismatch in internal and public mutex types. 2021-08-30 04:08:35 +00:00
Xiang1 Zhang 80f7ce8993 [X86] Support __SSC_MARK(const int id)
Differential Revision: https://reviews.llvm.org/D108682
2021-08-30 09:55:35 +08:00
Xiang1 Zhang 4c29dc18cf Revert "[X86] Support __SSC_MARK(const int id)"
This reverts commit 78fbde5779.
2021-08-30 09:50:26 +08:00
Matthias Springer d18ffd61d4 [mlir][SCF] Canonicalize dim(x) where x is an iter_arg
* Add `DimOfIterArgFolder`.
* Move existing cross-dialect canonicalization patterns to `LoopCanonicalization.cpp`.
* Rename `SCFAffineOpCanonicalization` pass to `SCFForLoopCanonicalization`.
* Expand documentaton of scf.for: The type of loop-carried variables may not change with iterations. (Not even the dynamic type.)

Differential Revision: https://reviews.llvm.org/D108806
2021-08-30 01:39:56 +00:00
Steven Wan 71b170ccf3 [AIX] "aligned" attribute does not decrease alignment
The "aligned" attribute can only increase the alignment of a struct, or struct member, unless it's used together with the "packed" attribute, or used as a part of a typedef, in which case, the "aligned" attribute can both increase and decrease alignment.

That said, we expect:
1. "aligned" attribute alone: does not interfere with the alignment upgrade instrumented by the AIX "power" alignment rule,
2. "aligned" attribute + typedef: overrides any computed alignment,
3. "aligned" attribute + "packed" attribute: overrides any computed alignment.
The old implementation achieved 2 and 3, but didn't get 1 right, in that any field marked attribute "aligned" would not go through the alignment upgrade.

Reviewed By: rjmccall

Differential Revision: https://reviews.llvm.org/D107394
2021-08-29 21:33:05 -04:00
Xiang1 Zhang 78fbde5779 [X86] Support __SSC_MARK(const int id)
Differential Revision: https://reviews.llvm.org/D108682
2021-08-30 09:21:22 +08:00
Xiang1 Zhang fd88fac6ca Revert "[X86] Support __SSC_MARK(const int id)"
This reverts commit 83e82ff767.
2021-08-30 09:18:27 +08:00
Matthias Springer eedc997b7d [mlir][Analysis] Add batched version of FlatAffineConstraints::addId
* Add batched version of all `addId` variants, so that multiple IDs can be added at a time.
* Rename `addId` and variants to `insertId` and `appendId`. Most external users call `appendId`. Splitting `addId` into two functions also makes it possible to provide batched version for both. (Otherwise, the overloads are ambigious when calling `addId`.)

Differential Revision: https://reviews.llvm.org/D108532
2021-08-30 00:56:44 +00:00
Xiang1 Zhang 83e82ff767 [X86] Support __SSC_MARK(const int id)
Differential Revision: https://reviews.llvm.org/D108682
2021-08-30 08:51:20 +08:00
Arthur Eubanks 099e4bcd5d [InstCombine] Remove invariant group intrinsincs when comparing against null
We cannot leak any equivalency information by comparing against null
since null never has virtual metadata associated with it (when null is
not a valid dereferenceable pointer).

Instcombine seems to make sure that a null will be on the RHS, so we
don't have to check both operands.

This fixes a missed optimization in llvm-test-suite's MultiSource lambda
benchmark under -fstrict-vtable-pointers.

Reviewed By: Prazek

Differential Revision: https://reviews.llvm.org/D108734
2021-08-29 15:45:25 -07:00
owenca 4b1fde8a2b [clang-format] Add PackConstructorInitializers backward compat test
Add backward compatibility tests for mapping the deprecated
ConstructorInitializerAllOnOneLineOrOnePerLine and
AllowAllConstructorInitializersOnNextLine to
PackConstructorInitializers.

Differential Revision: https://reviews.llvm.org/D108882
2021-08-29 13:47:11 -07:00
Fangrui Song 3726039561 [ELF] Simplify addGotEntry. NFC 2021-08-29 13:40:08 -07:00
Fangrui Song d3fdc312b2 [ELF] Untangle TLS IE and regular GOT from addGotEntry for non-mips. NFC 2021-08-29 13:21:06 -07:00
Fangrui Song 1861160697 [ELF] Move handleTlsRelocations. NFC
Prepare for addGotEntry simplification.
2021-08-29 13:11:35 -07:00
Nikita Popov 9f7873784d [SCEVExpander] Reuse removePointerBase() for canonical addrecs
ExposePointerBase() in SCEVExpander implements basically the same
functionality as removePointerBase() in SCEV, so reuse it.

The SCEVExpander code assumes that the pointer operand on adds is
the last one -- I'm not sure that always holds. As such this might
not be strictly NFC.
2021-08-29 21:12:35 +02:00
Fangrui Song 204b2902d5 [ELF] Remove unused processRelocAux argument. NFC 2021-08-29 12:07:56 -07:00
Nikita Popov 0886fd5b3a [SCEVExpander] Remove unnecessary mul/udiv check (NFC)
Pointer-typed SCEV expressions can no longer be mul or udiv, so
we do not need to specially handle them here.
2021-08-29 20:47:00 +02:00
Nikita Popov 3f162e8e6d [SCEVExpander] Assert single pointer op in add (NFC)
There can only be one pointer operand in an add expression, and
we have sorted operands to guarantee that it is the first. As
such, the pointer check for other operands is dead code.
2021-08-29 20:30:56 +02:00
Nikita Popov e6a5dd60ff [SCEV] Assert unique pointer base (NFC)
Add expressions can contain at most one pointer operand nowadays,
assert that in getPointerBase() and removePointerBase().
2021-08-29 20:06:24 +02:00
Vince Bridgers 55ba1de7c5 [X86] Remove X86LowerAMXType::getRowFromCol from X86LowerAMXType.cpp
Remove method X86LowerAMXType::getRowFromCol since it's not used, and
it's causing a warning.

Reviewed By: LuoYuanke

Differential Revision: https://reviews.llvm.org/D108862
2021-08-29 12:27:34 -05:00
Kazu Hirata 96d3294555 [Support] Remove redundant calls to str() and c_str() (NFC)
Identified with readability-redundant-string-cstr.
2021-08-29 09:14:48 -07:00
Lei Zhang a5621e26db [mlir][spirv] Use type dyn_cast when scanning spv.GlobalVariable
This avoids crashes when there are spv.GlobalVariable without
pointer type.
2021-08-29 12:01:19 -04:00
Sylvestre Ledru c58c0993c9 test-release.sh: remove an unused reference to the old svn repo 2021-08-29 17:45:19 +02:00
Roman Podoliaka 54c496dad6 [lldb] Allow to register frame recognizers applied beyond the first instruction
It is currently possible to register a frame recognizer, but it will be applied if and only if the frame's PC points to the very first instruction of the specified function, which limits usability of this feature.

The implementation already supports changing this behaviour by passing an additional flag, but it's not possible to set it via the command interface. Fix that.

Reviewed By: jingham

Differential Revision: https://reviews.llvm.org/D108510
2021-08-29 17:28:46 +02:00
Nikita Popov b28c3b9d9f [NewPM] Add missing LTO ArgPromotion pass
This is a followup to D96780 to add one more pass missing from the
NewPM LTO pipeline. The missing ArgPromotion run is inserted at
the same position as in the LegacyPM, resolving the already
present FIXME:
16086d47c0/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp (L1096-L1098)

The compile-time impact is minimal with ~0.1% geomean regression
on CTMark.

Differential Revision: https://reviews.llvm.org/D108866
2021-08-29 12:40:29 +02:00