Commit Graph

402195 Commits

Author SHA1 Message Date
Michał Górny ee11612ee1 Revert "[lldb] [ABI/X86] Support combining xmm* and ymm*h regs into ymm*"
This reverts commit 5352ea4a72.  It seems
to have broken the arm buildbot.
2021-10-19 12:31:25 +02:00
Jeremy Morse 849b17949f [DebugInfo][InstrRef] Avoid un-necessary densemap copies and comparisons
This is purely a performance patch: InstrRefBasedLDV used to use three
DenseMaps to store variable values, two for long term storage and one as a
working set. This patch eliminates the working set, and updates the long
term storage in place, thus avoiding two DenseMap comparisons and two
DenseMap assignments, which can be expensive.

Differential Revision: https://reviews.llvm.org/D111716
2021-10-19 11:10:14 +01:00
Pavel Labath 8bac18be0e [lldb] Reduce code duplication around inferior building
We had two sets of build<flavour> methods, whose bodies were largely
identical. This makes any kind of modification in their vicinity
repetitive and error-prone.

Replace each set with a single method taking an optional debug_info
parameter.

Differential Revision: https://reviews.llvm.org/D111989
2021-10-19 12:09:41 +02:00
Raphael Isemann 9a57d1e526 [lldb] Allow dumping the state of all scratch TypeSystems
This adds the `target dump typesystem'`command which dumps the TypeSystem of the
target itself (aka the 'scratch TypeSystem'). This is similar to `target modules
dump ast` which dumps the AST of lldb::Modules associated with a selected
target.

Unlike `target modules dump ast`, the new command is not a subcommand of `target
modules dump` as it's not touching the modules of a target at all. Also unlike
`target modules dump ast` I tried to keep the implementation language-neutral,
so this patch moves our Clang `Dump` to the `TypeSystem` interface so it will
also dump the state of any future/downstream scratch TypeSystems (e.g., Swift).
That's also why the command just refers to a 'typesystem' instead of an 'ast'
(which is only how Clang is necessarily modelling the internal TypeSystem
state).

The main motivation for this patch is that I need to write some tests that check
for duplicates in the ScratchTypeSystemClang of a target. There is currently no
way to check for this at the moment (beside measuring memory consumption of
course). It's probably also useful for debugging LLDB itself.

Reviewed By: labath

Differential Revision: https://reviews.llvm.org/D111936
2021-10-19 12:05:14 +02:00
Lasse Folger 134e1817f6 [lldb] change name demangling to be consistent between windows and linx
When printing names in lldb on windows these names contain the full type information while on linux only the name is contained.

This change introduces a flag in the Microsoft demangler to control if the type information should be included.
With the flag enabled demangled name contains only the qualified name, e.g:
without flag -> with flag
int (*array2d)[10] -> array2d
int (*abc::array2d)[10] -> abc::array2d
const int *x -> x

For globals there is a second inconsistency which is not yet addressed by this change. On linux globals (in global namespace) are prefixed with :: while on windows they are not.

Reviewed By: teemperor, rnk

Differential Revision: https://reviews.llvm.org/D111715
2021-10-19 12:04:37 +02:00
Raphael Isemann cfaa5c344d [lldb] Filter duplicates in Target::GetScratchTypeSystems
`Target::GetScratchTypeSystems` returns the list of scratch TypeSystems. The
current implementation is iterating over all LanguageType values and retrieves
the respective TypeSystem for each LanguageType.

All C/C++/Obj-C LanguageTypes are however mapped to the same
ScratchTypeSystemClang instance, so the current implementation adds this single
TypeSystem instance several times to the list of TypeSystems (once for every
LanguageType that we support).

The only observable effect of this is that `SBTarget.FindTypes` for builtin
types currently queries the ScratchTypeSystemClang several times (and also adds
the same result several times).

Reviewed By: bulbazord, labath

Differential Revision: https://reviews.llvm.org/D111931
2021-10-19 11:49:47 +02:00
Vladislav Vinogradov e41ebbecf9 [mlir][RFC] Refactor layout representation in MemRefType
The change is based on the proposal from the following discussion:
https://llvm.discourse.group/t/rfc-memreftype-affine-maps-list-vs-single-item/3968

* Introduce `MemRefLayoutAttr` interface to get `AffineMap` from an `Attribute`
  (`AffineMapAttr` implements this interface).
* Store layout as a single generic `MemRefLayoutAttr`.

This change removes the affine map composition feature and related API.
Actually, while the `MemRefType` itself supported it, almost none of the upstream
can work with more than 1 affine map in `MemRefType`.

The introduced `MemRefLayoutAttr` allows to re-implement this feature
in a more stable way - via separate attribute class.

Also the interface allows to use different layout representations rather than affine maps.
For example, the described "stride + offset" form, which is currently supported in ASM parser only,
can now be expressed as separate attribute.

Reviewed By: ftynse, bondhugula

Differential Revision: https://reviews.llvm.org/D111553
2021-10-19 12:31:15 +03:00
Jeremy Morse cf033bb2d3 [DebugInfo][NFC] Zero-initialize a class field
This field gets assigned when the relevant object starts being used; but it
remains uninitialized beforehand. This risks introducing hard-to-detect
bugs if something changes, so zero-initialize the field.
2021-10-19 10:24:12 +01:00
Luke Benes 9da51402f4 [DebugInfo][InstrRef] Fix Wdangling-else warning in InstrRefLDVTest
Fix a dangling else that gcc-11 warned about. The EXPECT_EQ macro
expands to an if-else, so the whole construction contains a hidden
dangling else.

Differential Revision: https://reviews.llvm.org/D112044
2021-10-19 10:17:57 +01:00
Michał Górny 5352ea4a72 [lldb] [ABI/X86] Support combining xmm* and ymm*h regs into ymm*
gdbserver does not expose combined ymm* registers but rather XSAVE-style
split xmm* and ymm*h portions.  Extend value_regs to support combining
multiple registers and use it to create user-friendly ymm* registers
that are combined from split xmm* and ymm*h portions.

Differential Revision: https://reviews.llvm.org/D108937
2021-10-19 10:31:07 +02:00
Qiaojin.Bao cf65271e46 [llvm-shlib] Fix windows build failed while llvm non-standalone building.
While build llvm-project as a sub-project on windows, met a build error: 
libllvm-c.exports /llvm/bin\llvm-nm.exe: error: ...builds/rel64ninja/./lib/LLVMDemangle.lib: no such file or directory
The libllvm-c.exports, libllvm-c.args, and lib/*.lib should under LLVM_BINARY_DIR, using CMAKE_BINARY_DIR will cause 'no such file' error while llvm-project built as a sub-project.
2021-10-19 09:10:11 +01:00
Fangrui Song 408e6de8c0 [Driver][Gnu] Support -shared -static: pass -shared to ld and use crtbeginS.o
This mode never works (mismatching crtbeginT.o and crtendS.o) and probably
unsupported by GCC on glibc based Linux distro (incorrect crtbeginT.o causes
linker error) but makes sense (-shared means building a shared object, -static
means avoid shared object dependencies) and can be used on musl based Linux
distro.

mingw supports this mode as well.
2021-10-19 01:09:41 -07:00
Christian Kühnel dcc91dd2a7 first draft of a written policy around git repos
This is a frist draft of a set of policies around new git repos and how we grant write access to our GitHub organisation.

This proposal is based on the discussions in:
https://github.com/llvm/llvm-iwg/issues/40
https://github.com/llvm/llvm-iwg/issues/51

Differential Revision: https://reviews.llvm.org/D111723
2021-10-19 08:05:37 +00:00
Jon Chesterfield 7272982e1d [libomptarget] Refactor DeviceRTL prior to AMDGPU bringup
Subset of D111993. Fix typos, rename read to load.

Reviewed By: tianshilei1992

Differential Revision: https://reviews.llvm.org/D111999
2021-10-19 08:05:06 +01:00
Jonas Devlieghere 957a5e9874 [lldb] Fix nullptr dereference in AppleObjCRuntimeV2
Fix a potential nullptr dereference in AppleObjCRuntimeV2 by checking
the result of GetClassInfoUtilityFunction and returning a failure if
it's null.

The DynamicClassInfoExtractor was already doign the right thing, but the
SharedCacheClassInfoExtractor was missing this check.
2021-10-18 23:30:31 -07:00
Fangrui Song 8189c4eee7 [tools] Delete redundant 'static' from namespace scope 'static const'. NFC 2021-10-18 22:38:42 -07:00
Fangrui Song b68bf98c0a [llvm-readobj] Delete redundant 'static' from namespace scope 'static const'. NFC
By default, such a non-template variable of non-volatile const-qualified type
having namespace-scope has internal linkage ([basic.link]), so no need for `static`.
2021-10-18 22:21:54 -07:00
Lang Hames cc3115cd1d [JITLink][x86-64] Lift GOT, PLT table managers into x86_64.h; reuse for MachO.
This lifts the global offset table and procedure linkage table builders out of
ELF_x86_64.h and into x86_64.h, renaming them with generic names
x86_64::GOTTableBuilder and x86_64::PLTTableBuilder. MachO_x86_64.cpp is updated
to use these classes instead of the older PerGraphGOTAndStubsBuilder tool.
2021-10-18 21:47:24 -07:00
Craig Topper 39a1fcb9cf [RISCV] Remove the HasSideEffects property from riscv_vector.td
It was being used to control the nothrow attribute on the builtins. The
nothrow attribute is for C++ exceptions. Even if the vector builtins
have side effects in IR, that's different than the nothrow attribute.

Reviewed By: HsiangKai

Differential Revision: https://reviews.llvm.org/D112028
2021-10-18 21:35:13 -07:00
Craig Topper 34173330bb [RISCV] Split RISCV vector builtins into their own file and namespace.
Similar to SVE, this separates the RVV builtlins into their own
region of builtin IDs. Only those IDs are allowed to be used by
the builtin_alias attribute now.

Reviewed By: HsiangKai

Differential Revision: https://reviews.llvm.org/D111923
2021-10-18 21:26:18 -07:00
Dave MacLachlan a94bc9d81b Fix small typo in Block ABI docs
I think the C++ code example had the wrong name for the block copy function.

Reviewed By: rjmccall

Differential Revision: https://reviews.llvm.org/D91815
2021-10-19 09:33:35 +05:30
Lang Hames c531d3805d [JITLink] Use DEBUG_WITH_TYPE, rather than defining DEBUG_TYPE.
This avoids defining DEBUG_TYPE in a public header.
2021-10-18 20:41:49 -07:00
Noah Shutty e678c51177 [Support][ThinLTO] Move ThinLTO caching to LLVM Support library
We would like to move ThinLTO’s battle-tested file caching mechanism to
the LLVM Support library so that we can use it elsewhere in LLVM.

Patch By: noajshu

Differential Revision: https://reviews.llvm.org/D111371
2021-10-18 18:57:25 -07:00
Hsiangkai Wang facff468b6 [RISCV] Reorder the vector register allocation order.
GPR uses argument registers as the first group of registers to allocate.
This patch uses vector argument registers, v8 to v23, as the first group
to allocate.

Differential Revision: https://reviews.llvm.org/D111304
2021-10-19 09:30:13 +08:00
Mogball 21bb463e96 [mlir] fix bugs with NamedAttrList
- `assign` with ArrayRef was calling `append`
- `assign` with empty ArrayRef was not clearing storage

Reviewed By: jpienaar

Differential Revision: https://reviews.llvm.org/D112043
2021-10-19 01:30:00 +00:00
Lang Hames bc03a9c066 Simplify the TableManager class and move it into a public header.
Moves visitEdge into the TableManager derivatives, replacing the fixEdgeKind
methods in those classes. The visitEdge method takes on responsibility for
updating the edge target, as well as its kind.
2021-10-18 18:20:33 -07:00
Matthias Springer fd26ca4e75 [mlir][scf] Add insideMutuallyExclusiveBranches helper
This helper function checks if two given ops are in mutually exclusive branches of the same scf::IfOp.

Differential Revision: https://reviews.llvm.org/D111957
2021-10-19 09:09:07 +09:00
Matthias Springer 252386ac81 [mlir] Add enclosingOpOk parameter to properlyDominates
Differential Revision: https://reviews.llvm.org/D111959
2021-10-19 08:59:56 +09:00
Jim Ingham f24532ae91 Follow-on to fix a test from c5011aed9c.
I need to set a fake default platform for the UnitTest test to run on other
systems.
2021-10-18 16:53:32 -07:00
Arthur Eubanks 15fefcb9eb [opt] Directly translate -O# to -passes='default<O#>'
Right now when we see -O# we add the corresponding 'default<O#>' into
the list of passes to run when translating legacy -pass-name. This has
the side effect of not using the default AA pipeline.

Instead, treat -O# as -passes='default<O#>', but don't allow any other
-passes or -pass-name. I think we can keep `opt -O#` as shorthand for
`opt -passes='default<O#>` but disallow anything more than just -O#.

Tests need to be updated to not use `opt -O# -pass-name`.

Reviewed By: asbirlea

Differential Revision: https://reviews.llvm.org/D112036
2021-10-18 16:48:10 -07:00
Arthur Eubanks cb5a10199b [test] Remove tests pinned to the legacy PM
Now that the legacy PM is deprecated for the optimization pipeline, we
can start deleting legacy PM tests.

For tests that test both PMs, merge the RUN lines.
Delete tests specific to the legacy PM.
2021-10-18 16:40:46 -07:00
not-jenni 4ada6c2aaf [mlir][tosa] Adds a canonicalization to the transpose op if the perms are a no op
Reviewed By: rsuderman

Differential Revision: https://reviews.llvm.org/D112037
2021-10-18 16:30:53 -07:00
Michael Jones 87c016078a [libc] add atof, strtof and strtod
Add the string to floating point conversion functions.
Long doubles aren't supported yet, but floats and doubles are. The
primary algorithm used is the Eisel-Lemire ParseNumberF64 algorithm,
with the Simple Decimal Conversion algorithm as backup.

Links for more information on the algorithms:

Number Parsing at a Gigabyte per Second, Software: Practice and
Experience 51 (8), 2021 (https://arxiv.org/abs/2101.11408)
https://nigeltao.github.io/blog/2020/eisel-lemire.html
https://nigeltao.github.io/blog/2020/parse-number-f64-simple.html

Differential Revision: https://reviews.llvm.org/D109261
2021-10-18 16:10:03 -07:00
Craig Topper 684b6265b3 [RISCV][TableGen] Remove HasMaskedOffOperand as a member of RVVIntrinsic. NFC
This value is only used by the RVVIntrinsic constructor. We don't
need it to be a member.
2021-10-18 15:56:37 -07:00
Anshil Gandhi 0567f03331 [HIP] [AlwaysInliner] Disable AlwaysInliner to eliminate undefined symbols
By default clang emits complete contructors as alias of base constructors if they are the same.
The backend is supposed to emit symbols for the alias, otherwise it causes undefined symbols.
@yaxunl observed that this issue is related to the llvm options `-amdgpu-early-inline-all=true`
and `-amdgpu-function-calls=false`. This issue is resolved by only inlining global values
with internal linkage. The `getCalleeFunction()` in AMDGPUResourceUsageAnalysis also had
to be extended to support aliases to functions. inline-calls.ll was corrected appropriately.

Reviewed By: yaxunl, #amdgpu

Differential Revision: https://reviews.llvm.org/D109707
2021-10-18 16:53:15 -06:00
Craig Topper b477b92774 [RISCV] Fix typo in comment. NFC 2021-10-18 15:45:35 -07:00
Jim Ingham c5011aed9c Add a "command container" hierarchy to allow users to add container nodes.
The point is to allow users with a related set of script based commands
to organize their commands in a hierarchy in the command set, rather than
having to have only top-level commands.

Differential Revision: https://reviews.llvm.org/D110298
2021-10-18 15:29:24 -07:00
modimo 41f814589f [InlineAdvisor][NFC] Fix tests added in D110658 V2
On Windows there's an *.exe suffix to opt that isn't present in Linux.
Remove the check for opt in the string
2021-10-18 15:27:33 -07:00
wren romano bd0cae6d16 [mlir][sparse] Renaming variables for consistency/clarity
Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D112029
2021-10-18 15:12:03 -07:00
Petr Hosek 0eed292fba [CMake] Cache the compiler-rt library search results
There's a lot of duplicated calls to find various compiler-rt libraries
from build of runtime libraries like libunwind, libc++, libc++abi and
compiler-rt. The compiler-rt helper module already implemented caching
for results avoid repeated Clang invocations.

This change moves the compiler-rt implementation into a shared location
and reuses it from other runtimes to reduce duplication and speed up
the build.

Differential Revision: https://reviews.llvm.org/D88458
2021-10-18 14:44:07 -07:00
Tom Stellard 3be1f4b8fd repo-lockdown: Add pr comment and fix typo 2021-10-18 14:31:44 -07:00
Tom Stellard 20d397f853 workflows: Migrate repo-lockdown to GitHub Actions
https://github.com/dessant/repo-lockdown/issues/6
2021-10-18 14:22:49 -07:00
modimo 2786dc1096 [InlineAdvisor][NFC] Fix tests added in D110658 on
Windows which outputs "is a directory" rather than "Is a directory" on error compared to linux
2021-10-18 14:21:01 -07:00
Simon Pilgrim a83384498b [X86] combineMulToPMADDWD - replace ASHR(X,16) -> LSHR(X,16)
If we're using an ashr to sign-extend the entire upper 16 bits of the i32 element, then we can replace with a lshr. The sign bit will be correctly shifted for PMADDWD's implicit sign-extension and the upper 16 bits are zero so the upper i16 sext-multiply is guaranteed to be zero.

The lshr also has a better chance of folding with shuffles etc.
2021-10-18 22:12:56 +01:00
David Blaikie 7cf1fef45f Suppress some bitwise-or-of-bool warnings with explicit int cast
These look like they have intentional side effects that would break from
shortcircuiting.
2021-10-18 14:10:30 -07:00
Arthur Eubanks ecd25edfc5 [InlineCost] Add empty line between call sites when printing inline costs 2021-10-18 13:56:48 -07:00
Aart Bik 9d1db3d4a1 [mlir][sparse] generalize sparse_tensor.convert on static/dynamic dimension sizes
This revison lifts the artificial restriction on having exact matches between
source and destination type shapes. A static size may become dynamic. We still
reject changing a dynamic size into a static size to avoid the need for a
runtime "assert" on the conversion. This revision also refactors some of the
conversion code to share same-content buffers.

Reviewed By: bixia

Differential Revision: https://reviews.llvm.org/D111915
2021-10-18 13:54:03 -07:00
Simon Pilgrim cdf9df65f4 [X86] Regenerate testb-je-fusion.ll with common NOFUSION/FUSION prefixes 2021-10-18 21:52:10 +01:00
peter klausler 2f80b73e0c [flang] Fold BTEST
Implements constant folding for BTEST intrinsic function.

Differential Revision: https://reviews.llvm.org/D111849
2021-10-18 13:46:46 -07:00
Craig Topper 1053e0b27c [RISCV] Use a lambda to avoid having the Support library depend on Option library.
RISCVISAInfo::toFeatures needs to allocate strings using
ArgList::MakeArgString, but toFeatures lives in Support and
MakeArgString lives in Option.

toFeature only has one caller, so the simple fix is to have that
caller pass a lamdba that wraps MakeArgString to break the
dependency.

Differential Revision: https://reviews.llvm.org/D112032
2021-10-18 13:39:37 -07:00