Commit Graph

435583 Commits

Author SHA1 Message Date
Simon Pilgrim a931dbfbd3 [CostModel][X86] Merge AVX512BW vXi8/vXi16 shifts into default AVX512BW cost table
We only need to handle the uniform cases early
2022-09-10 18:18:42 +01:00
Corentin Jabot 0e8afddaa1 [Clang] NFC: Remove duplicated variable def in CheckLValueConstantExpression 2022-09-10 19:10:23 +02:00
Simon Pilgrim 10edf88458 [CostModel][X86] Update CTPOP costs
With the bdver2 model updates, many of the AVX1 costs were far too high - it also helped expose some costs mismatches for Atom/Silvermont
2022-09-10 17:57:20 +01:00
Simon Pilgrim 4994f87ca1 [X86] Fix bdver2 128-bit shuffles throughputs
Noticed while trying to get vector ctpop/ctlz/cttz costs fixed using the script from D103695 - all of these are full-rate but the throughput costs were weirdly high for bdver2

Matches AMD 15h SoG, Agner and instlatx64
2022-09-10 17:34:40 +01:00
Simon Pilgrim 7785bd34e7 [X86] Fix bdver2 128-bit ALU/logic/shift throughputs
Noticed while trying to get vector shifts costs fixed using the script from D103695 - all of these are full-rate but the throughput costs were weirdly high for bdver2

Matches AMD 15h SoG, Agner and instlatx64
2022-09-10 16:23:29 +01:00
Manuel Brito b51c6130ef Use PoisonValue instead of UndefValue when RAUWing unreachable code [NFC]
Replacing the following instances of UndefValue with PoisonValue, where the UndefValue is used as an arbitrary value:

- llvm/lib/CodeGen/WinEHPrepare.cpp
`demotePHIsOnFunclets`: RAUW arbitrary value for lingering uses of removed PHI nodes

 - llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
`FoldSingleEntryPHINodes`: Removes a self-referential single entry phi node.

 - llvm/lib/Transforms/Utils/CallGraphUpdater.cpp
`finalize`: Remove all references to removed functions.

- llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
`cleanup`: the result is not used then the inserted instructions are removed.

 - llvm/tools/bugpoint/CrashDebugger.cpp
`TestInts`:  the program is cloned and instructions are removed to narrow down source of crash.

Differential Revision: https://reviews.llvm.org/D133640
2022-09-10 14:28:01 +01:00
Yi Kong bc0725a437 [Object] Improve ArchiveWriter diagnostics
Print out the archive member that failed, to make debugging easier.

Before:
  error: failed to build archive: Not an int attribute (Producer: 'LLVM15.0.1git' Reader: 'LLVM 14.0.5-rust-dev')
After:
  error: failed to build archive: 'fake_bt_keystore.o': Not an int attribute (Producer: 'LLVM15.0.1git' Reader: 'LLVM 14.0.5-rust-dev')

Differential Revision: https://reviews.llvm.org/D133607
2022-09-10 21:06:52 +08:00
Nikolas Klauser 860753934c [libc++] Bump _LIBCPP_STD_VER to the next expected C++ version
We've decided to use `_LIBCPP_STD_VER >= xy` while discussing to change the constexpr macros, so let's finally bump the version macro to match that.

Reviewed By: ldionne, Mordante, huixie90, #libc, avogelsgesang

Spies: avogelsgesang, libcxx-commits

Differential Revision: https://reviews.llvm.org/D133323
2022-09-10 09:53:20 +02:00
Rainer Orth 1e56821bac [Linux] Hack around Linux/sparc <bits/stdio-ldbl.h>
I've been using this hack to work around the Linux/sparc64 compile failure
described in Issue #47994
<https://github.com/llvm/llvm-project/issues/47994>, especially since the
underlying glibc PR build/27558
<https://sourceware.org/bugzilla/show_bug.cgi?id=27558> doesn't seem to be
making progress and some fix is required to have LLVM build on
`sparc64-unknown-linux-gnu` at all, as evidenced on the buildbot.

Tested on `sparc64-unknown-linux-gnu`.

Differential Revision: https://reviews.llvm.org/D133405
2022-09-10 09:37:35 +02:00
sunho e57ded44d4 [ORC] Remove moves. 2022-09-10 15:46:11 +09:00
sunho d1c4d96126 [ORC][ORC_RT][COFF] Remove public bootstrap method.
Removes public bootstrap method that is not really necessary and not consistent with other platform API.

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D132780
2022-09-10 15:25:50 +09:00
sunho 73c4033987 [ORC][ORC_RT][COFF] Support dynamic VC runtime.
Supports dynamic VC runtime. It implements atexits handling which is required to load msvcrt.lib successfully. (the object file containing atexit symbol somehow resolves to static vc runtim symbols) It also default to dynamic vc runtime which tends to be more robust.

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D132525
2022-09-10 15:25:49 +09:00
sunho bc24e6ab7c [JITLink][COFF] Use DLLImportDefinitionGenerator for creating PLT stubs.
Uses DLLImportDefinitionGenerator for creating PLT stubs. It removes previous approach for dllimport stub creation which can't deal with jump thunks.

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D132524
2022-09-10 15:25:44 +09:00
Craig Topper 545affbf79 [DAGCombiner] Use HandleSDNode to keep node alive across call to getNegatedExpression.
getNegatedExpression can delete nodes. If the first call to
getNegatedExpression produced a node that the second call also
manages to create, it might get deleted. Use a HandleSDNode to
ensure it has a use to prevent it from being deleted.

Fixes PR57658.

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D133602
2022-09-09 22:02:41 -07:00
Adrian Prantl 1f47352ce7 Document some of the clang-specific DWARF extensions supported by LLDB
This patch adds a new page to the LLDB documentation that documents,
among other things the -gmodules debug info format.

Differential Revision: https://reviews.llvm.org/D133519
2022-09-09 17:49:11 -07:00
Jason Molenda 30578c0856 dependency cycle fix in DynamicLoaderDarwinKernel
DynamicLoaderDarwinKernel calls in to PlatformDarwinKernel, and
with my changes in https://reviews.llvm.org/D133534, PlatformDarwinKernel
calls in to DynamicLoaderDarwinKernel.  This results in a cmake
dependency if accurately included in the link libraries list.

lldbPluginDynamicLoaderDarwinKernel is specfically for kernel
debugging and is uncommonly linked in to anything except a full
lldb.  lldbPluginPlatformMacOSX is any Darwin platform, including
PlatformDarwinKernel, and is referenced a number of time in shell
tests, for instance.

I believe anything linking the darwin kernel DynamicLoader plugin
will already have lldbPluginPlatformMacOSX in its dependency list,
so not explicitly expressing this dependency is safe.
2022-09-09 17:37:46 -07:00
Mohammed Keyvanzadeh 467bb47c84
[clang][cmake] Remove extra brace
Remove the extra trailing brace from the local variable accessor.

Differential Revision: https://reviews.llvm.org/D133613
2022-09-10 05:00:23 +04:30
Aart Bik 0078f7234e [mlir][sparse] fix some asan detected leaks in integration tests
One was an oversight, but the others seem something that regressed.
Matthias to have look later.

https://github.com/llvm/llvm-project/issues/57663

Reviewed By: Peiming

Differential Revision: https://reviews.llvm.org/D133624
2022-09-09 17:00:53 -07:00
Joe Loser 27731f0475 [llvm][lit] Respect GTEST_TOTAL_SHARDS and GTEST_SHARD_INDEX env vars
There are a variety of issues with using GTest sharding by default for users of
`lit` using the Google Test formatter as mentioned in
https://github.com/llvm/llvm-project/issues/56492 and
https://github.com/llvm/llvm-project/issues/56491.

Currently, there is no way for users to explicitly control the sharding
behavior, even with the environment variables that GTest provides. This patch
teaches the `googletest` formatter to actually respect `GTEST_TOTAL_SHARDS`
and `GTEST_SHARD_INDEX` environment variables if they are set.

In practice, we could go one step further and not do any of the post-processing
of the JSON files if `GTEST_TOTAL_SHARDS` is `1` for example, but that it left
as a follow-up if desired.  There may be preferred alternative approaches to
disabling sharding entirely through another mechanism, such as a lit config
variable.

Differential Revision: https://reviews.llvm.org/D133542
2022-09-09 17:47:21 -06:00
Joe Loser 62b8a61d6c [llvm] Remove includes of `llvm/Support/STLArrayExtras.h`
`llvm` and downstream internal callers no longer use `array_lengthof`, so drop
the include everywhere.

Differential Revision: https://reviews.llvm.org/D133600
2022-09-09 17:44:00 -06:00
Bruno Cardoso Lopes f4a13c9c0a [Clang][ScanDeps] Change multiple-commands.c test to use -fmodules-cache-path on implicit builds
The module cache escapes the test output dirs in this test. Since its default location maybe
composed of system and user related path this can cause problems in some builders (e.g. not
accessible paths inherited in a chroot environment).

Clean the test a bit by passing `-fmodules-cache-path` inside the test output dirs.

Differential Revision: https://reviews.llvm.org/D133617
2022-09-09 16:20:04 -07:00
Nico Weber 28890b7bab [gn build] port 1a608cfb5c 2022-09-09 19:18:05 -04:00
Nico Weber 27613a1038 [gn build] port 48506fbbbf (Mach-O-Fileset) 2022-09-09 19:18:05 -04:00
Greg Clayton 9af089f517 Add the ability to show when variables fails to be available when debug info is valid.
Many times when debugging variables might not be available even though a user can successfully set breakpoints and stops somewhere. Letting the user know will help users fix these kinds of issues and have a better debugging experience.

Examples of this include:
- enabling -gline-tables-only and being able to set file and line breakpoints and yet see no variables
- unable to open object file for DWARF in .o file debugging for darwin targets due to modification time mismatch or not being able to locate the N_OSO file.

This patch adds an new API to SBValueList:

  lldb::SBError lldb::SBValueList::GetError();

object so that if you request a stack frame's variables using SBValueList SBFrame::GetVariables(...), you can get an error the describes why the variables were not available.

This patch adds the ability to get an error back when requesting variables from a lldb_private::StackFrame when calling GetVariableList.

It also now shows an error in response to "frame variable" if we have debug info and are unable to get varialbes due to an error as mentioned above:

(lldb) frame variable
error: "a.o" object from the "/tmp/libfoo.a" archive: either the .o file doesn't exist in the archive or the modification time (0x63111541) of the .o file doesn't match

Differential Revision: https://reviews.llvm.org/D133164
2022-09-09 16:14:46 -07:00
Stanley Winata 8e484b522b [mlir][linalg] Add decomposition from conv_2d_nchw
Decompose conv_2d_nchw_fchw -> conv_1d_ncw_fcw

Reviewed By: hanchung

Differential Revision: https://reviews.llvm.org/D133551
2022-09-09 16:00:37 -07:00
Adrian Prantl 2f4a66eed6 Adapt LLDB dataformatters for libcxx change D129386
Differential Revision: https://reviews.llvm.org/D133618
2022-09-09 15:58:55 -07:00
Fangrui Song 058f17d3af [ADT] Move LLVM_DEPRECATED before type after D133502
`[[deprecated(...)]]` cannot appear between `inline size_t`.
2022-09-09 15:56:58 -07:00
Zequan Wu 6037936989 [LLDB][NativePDB] Replace blocks.cpp with blocks.s so the test won't be affected by codegen changes. 2022-09-09 15:47:27 -07:00
Fangrui Song 0845969a28 [Bazel] Port eb65327fe9 2022-09-09 15:35:52 -07:00
River Riddle af5d2df378 [mlir] Fix asan leak in BlockAndValueMapping test
Operations were being created without being erased.
2022-09-09 15:09:57 -07:00
River Riddle b6a32d9475 [mlir:SymbolTable] Add "remove" method that drops a symbol without erasing it
There are various use cases where we don't want to immediately erase
an operation when removing it from the symbol table. This commit adds
a "remove" method to support that.

Differential Revision: https://reviews.llvm.org/D133564
2022-09-09 15:09:57 -07:00
Xiang Li 71fae33f5e [NFC] Cleanup test for D132913 Preserve vec3 for HLSL
Support number for parameter test added in
https://reviews.llvm.org/D132913
2022-09-09 15:04:59 -07:00
Jason Molenda 1a608cfb5c Recognize a platform binary in ProcessGDBRemote which determines plugins
Complete support of the binary-addresses key in the qProcessInfo packet
in ProcessGDBRemote, for detecting if one of the binaries needs to be
handled by a Platform plugin, and can be used to set the Process'
DynamicLoader plugin and the Target's Platform plugin.

Implement this method in PlatformDarwinKernel to recognize a kernel
fileset at that address, find the actual kernel address in the
fileset, set DynamicLoaderDarwinKernel and PlatformDarwinKernel
in the Process/Target; register the kernel address with the dynamic
loader so it will be loaded later during attach.

This patch only addresses the live debug scenario with a gdb remote
serial protocol connection. I'll handle corefiles in a subsequent
patch that builds on this.

Differential Revision: https://reviews.llvm.org/D133534
rdar://98754861
2022-09-09 14:57:08 -07:00
Fangrui Song bd16ffb389 [ELF] Merge Symbol::needs* into uint16_t flags. NFC
Split off from D133003 ([ELF] Parallelize relocation scanning) to make its diff smaller.
2022-09-09 14:37:18 -07:00
Joe Loser 5758c824da [ADT] Mark `llvm::array_lengthof` as deprecated
As a follow-up of 5e96cea1db, mark
`llvm::array_lengthof` as deprecated in favor of using `std::size` function
directly.

Differential Revision: https://reviews.llvm.org/D133502
2022-09-09 15:31:00 -06:00
Joe Loser 1173ecf9fb [lld] Use std::size instead of llvm::array_lengthof
LLVM contains a helpful function for getting the size of a C-style
array: `llvm::array_lengthof`. This is useful prior to C++17, but not as
helpful for C++17 or later: `std::size` already has support for C-style
arrays.

Differential Revision: https://reviews.llvm.org/D133598
2022-09-09 15:28:30 -06:00
Jakub Kuderski bcd3445641 [mlir][arith] Fix unused variable warning. NFC. 2022-09-09 17:18:15 -04:00
Jordan Rupprecht 1b988ff092 [test] Use either `127.0.0.1` or `[::1]` to run in ipv6-only environments.
Test for both IPv4 and IPv6 support to determine if either `127.0.0.1` or `[::1]` are appropriate IP addresses to attempt to connect to. In an IPv6-only environment, `127.0.0.1` is not available.

Using `localhost` is problematic because we might not be able to get the same port on each IP flavor, and later try to connect to the wrong thing.

Reviewed By: labath

Differential Revision: https://reviews.llvm.org/D133393
2022-09-09 14:00:35 -07:00
Peiming Liu eb65327fe9 [mlir][sparse] Add new option (enable-runtime-library) to sparse compiler pipeline
Add new option (enable-runtime-library) to sparse compiler pipeline, it allows us to decide whether we need to rewrite operations (e.g., concatenate, reshape) within sparsification (when using codegen) or convert them after sparsification (when using runtime library).

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D133597
2022-09-09 20:54:47 +00:00
Jakub Kuderski c7f64616e9 [mlir][arith] Support wide integer addition emulation
I tested this implementation for all i16 input pairs, when emulating i16
operations with i8 operations.

Reviewed By: antiagainst, Mogball

Differential Revision: https://reviews.llvm.org/D133137
2022-09-09 16:49:38 -04:00
Lei Zhang 6329c7387f [mlir][spirv] Add support for fast math mode
This commit introduces a new option to SPIRVConversionOptions
to allow enabling fast math mode. With it, various patterns
would assume no NaN/infinity for floating point values and
avoid guards to check them. This is particularly useful for
CodeGen towards WebGPU environment, where fast math is assumed.

Along the way, fixed the conversion for arith.minf/maxf to
handle the NaN cases properly for Shader cases.

Part of https://github.com/llvm/llvm-project/issues/57584.

Reviewed By: ThomasRaoux, hanchung

Differential Revision: https://reviews.llvm.org/D133599
2022-09-09 16:27:07 -04:00
Joseph Huber c2acb1e5d3 [Libomptarget][NFC] Remove unused variable 2022-09-09 15:26:02 -05:00
Joseph Huber 86587f2891 [Libomptarget] Fix compiling with asserts using the bitcode library
Sumnmary:
A previous patch introduces an `exports` file which contains all the
symbol names that are not internalized in the bitcode library. This is
done to reduce the size of the bitcode library and only export needed
functions. This export file must contain all the functoins expected to
be called from the device. Since its introduction the `__assert_fail`
function used to be provided but was mistakenly not included. This patch
adds it.

Fixes #57656

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D133594
2022-09-09 15:25:24 -05:00
Lei Zhang dfaebd3d7b [mlir][spirv] NFC: move conversion options out of the type converter
This is a step for adding more options not directly related to type
conversion. Also with this we can now avoid the explicit constructor.

Reviewed By: kuhar

Differential Revision: https://reviews.llvm.org/D133596
2022-09-09 16:15:27 -04:00
Florian Hahn da734473fa
[LV] Remove now dead variable after 2a78890b7b (NFC). 2022-09-09 20:25:55 +01:00
Nico Weber 30c30d7fc1 [gn build] port 4d50a39240 (llvm-exegesis multi-target)
Also ports follow-up 5a425b0b2f (I'm getting linker errors without it).
2022-09-09 15:04:47 -04:00
Emilio Cota d8094d32ed [mlir] NFC: ConvertAsyncToLLVM: sort deps alphabetically 2022-09-09 15:00:07 -04:00
Hanhan Wang aac844a4b1 [mlir] Improve bitEnumContains methods.
839b436c93
changes the behavior. Based on the discussion, we also want to support
"and" behavior. The revision changes it into two functions, bitEnumContainsAny
and bitEnumContainsAll.

Reviewed By: krzysz00, antiagainst

Differential Revision: https://reviews.llvm.org/D133507
2022-09-09 11:56:36 -07:00
Nico Weber aee094fb8b [gn build] port 5e0464e38b (lld test zstd) 2022-09-09 14:48:26 -04:00
Markus Böck 82f86b862b [mlir][CallGraph] Add special call graph node for representing unknown callees
The callgraph currently contains a special external node that is used both as the quasi caller for any externally callable as well as callees that could not be resolved.
This has one negative side effect however, which is the motivation for this patch: It leads to every externally callable which contains a call that could not be resolved (eg. an indirect call), to be put into one giant SCC when iterating over the SCCs of the call graph.

This patch fixes that issue by creating a second special callgraph node that acts as the callee for any unresolved callable. This breaks the cycles produced in the callgraph, yielding proper SCCs for all direct calls.

Differential Revision: https://reviews.llvm.org/D133585
2022-09-09 20:22:59 +02:00