435563 Commits

Author SHA1 Message Date
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 1a608cfb5ca8 2022-09-09 19:18:05 -04:00
Nico Weber
27613a1038 [gn build] port 48506fbbbf2732d (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 eb65327fe9d8b1a6824937e2b76f759101cd6416 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 5e96cea1db0623a833d5376c9ea2ce4528771f97, 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 2a78890b7b7f08 (NFC). 2022-09-09 20:25:55 +01:00
Nico Weber
30c30d7fc1 [gn build] port 4d50a392401c (llvm-exegesis multi-target)
Also ports follow-up 5a425b0b2f855c (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 5e0464e38bcb (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
Florian Hahn
2a78890b7b
[VPlan] Move SCEV expansion for pointer induction to VPExpandSCEV (NFC).
Use VPExpandSCEVRecipe to expand the step of pointer inductions. This
cleanup addresses a corresponding FIXME.

It should be NFC, as steps for pointer induction must be constants,
which makes expansion trivial.
2022-09-09 19:20:13 +01:00
Philip Reames
5a425b0b2f Speculative bot fix after 4d50a392
https://lab.llvm.org/buildbot#builders/56/builds/3201 failed with a link error being unable to initialize the disassembler.  Oddly, this bot is the *only* bot which appears to have failed in this way.  (A bunch sent warnings, but that appears to be spurious due to cmake rebuilds on incremental bots.)  Why only polly would witness this is an excercise for the reader - because I have no clue.
2022-09-09 11:19:02 -07:00
Augie Fackler
4fea8ee540 OpenMP: mark allocptr attribute on __kmpc_free_shared
Differential Revision: https://reviews.llvm.org/D124491
2022-09-09 14:09:18 -04:00
Peiming Liu
938f419cf1 [mlir][sparse] Avoid generating DimOp in conversion passes.
Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D133592
2022-09-09 18:08:05 +00:00
Xiang Li
c9d2b6b92d [HLSL] Preserve vec3 for HLSL.
Preserve vec3 for HLSL by set -fpreserve-vec3-type.

Reviewed By: beanz

Differential Revision: https://reviews.llvm.org/D132913
2022-09-09 10:55:45 -07:00
Jamie Schmeiser
5e3ac79690 Loop names used in reporting can grow very large
Summary:
The code for generating a name for loops for various reporting scenarios
created a name by serializing the loop into a string.  This may result in
a very large name for a loop containing many blocks.  Use the getName()
function on the loop instead.

Author: Jamie Schmeiser <schmeise@ca.ibm.com>
Reviewed By: Whitney (Whitney Tsang), aeubanks (Arthur Eubanks)
Differential Revision: https://reviews.llvm.org/D133587
2022-09-09 13:45:14 -04:00
Adrian Prantl
c988965efb Temporarily XFAIL libcxx tests.
These tests started failing on green dragon after a configuration change that compiles tests using the just-built libcxx. We may need to force the system libcxx here, or change LLDB to import the std module from the just-built libcxx, too.
2022-09-09 10:43:03 -07:00
Fangrui Song
449f2ca146 [ELF] Add --compress-debug-sections=zstd
`clang -gz=zstd a.o` passes this option to the linker. This option compresses output
debug sections with zstd and sets ch_type to ELFCOMPRESS_ZSTD. As of today, very
few DWARF consumers recognize ELFCOMPRESS_ZSTD.

Use the llvm::zstd::compress API with level llvm::zstd::DefaultCompression (5),
which we may tune after we have more experience with zstd output.
zstd has built-in parallel compression support (so we don't need to do D117853
for zlib), which is not leveraged yet.

Reviewed By: peter.smith

Differential Revision: https://reviews.llvm.org/D133548
2022-09-09 10:30:18 -07:00
Dylan Fleming
ddc0465369 [Flang][OpenMP] Add support for logical and reduction in worksharing-loop
Adds support for .and. reductions with logical types.

Because arith.addi doesn'to work with fir.logical<4> types
logical<4> must be converted to i1 prior to the operation.

This means that the pattern matched by integer reductions
(load -> op -> store) will not match logical reductions.
Instead, the pattern being searched for here is
load -> convert(logical<4> to i1) -> op -> convert(i1 to logical<4>) -> store

Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D132228
2022-09-09 17:29:49 +00:00
Fangrui Song
5e0464e38b [ELF] Support ELFCOMPRESS_ZSTD input
so that lld accepts relocatable object files produced by `clang -c -g -gz=zstd`.

We don't want to increase the size of InputSection, so do redundant but cheap
ch_type checks instead.

Differential Revision: https://reviews.llvm.org/D129406
2022-09-09 10:25:37 -07:00
Fangrui Song
c682c26942 [ELF] Rename InputSectionBase::uncompress to decompress. NFC
The canonical verb is "decompress" (also used in llvm-objcopy). "uncompressed"
describes the state.
2022-09-09 10:18:46 -07:00
Yitzhak Mandelbaum
abc16c7a5b [NFC] Remove a FIXME fixed by an earlier patch.
Commit 28bd7945eabdbde2b1fc071ab2f9b78e6e754a1a incidentally fixed the
associated FIXME, but didn't delete it.

Differential Revision: https://reviews.llvm.org/D133588
2022-09-09 17:13:52 +00:00
Mingming Liu
8aa800614b [AArch64][CostModel] Detects that {extract,insert}-element at lane 0 has the same cost as the other lane for vector instructions in the IR.
Currently, {extract,insert}-element has zero cost at lane 0 [1]. However, there is a cost (by fmov instruction [2], or ext/ins instruction) to move values from SIMD registers to GPR registers, when the element is used explicitly as integers.

See https://godbolt.org/z/faPE1nTn8, when fmov is generated for d* register -> x* register conversion.

Implementation-wise, add a private method `AArch64TTIImpl::getVectorInstrCostHelper` as a helper function. This way, instruction-based method could share the core logic (e.g.,
returning zero cost if type is legalized to scalar).

[1] 2cf320d41e/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp (L1853)
[2] 2cf320d41e/llvm/lib/Target/AArch64/AArch64InstrInfo.td (L8150-L8157)

Differential Revision: https://reviews.llvm.org/D128302
2022-09-09 09:47:30 -07:00
Philip Reames
4d50a39240 [llvm-exegesis] Cross compile all enabled targets
llvm-exegesis is rather odd in the LLVM ecosystem in code is selectively compiled based on the native machine. LLVM is cross compiler by default, so this stands out as odd. It's also less then helpful when working on code for a target other than your native dev environment.

This change only changes the build setup. A later change will enable -march support to allow actual benchmarking under e.g. simulators in a cross compilation environment.

Differential Revision: https://reviews.llvm.org/D133150
2022-09-09 09:04:55 -07:00
Thomas Raoux
9e7c97d8ce [mlir][vector] Fix bug in transfer op flattening
The logic to figure out if a transfer op can be flattened wasn't
considering the shape being loaded therefore it was incorrectly assuming
some transfer ops were reading contigous data.

Differential Revision: https://reviews.llvm.org/D133544
2022-09-09 16:02:52 +00:00
Steven Wu
493766e068 Frontend: Respect -working-directory when checking if output files can be written
Call `FixupRelativePath` when opening output files to ensure that
`-working-directory` is used when checking up front for write failures,
not just when finalizing the files at the end. This also moves the
temporary file into the same directory as the output file.

Reviewed By: benlangmuir

Differential Revision: https://reviews.llvm.org/D95497
2022-09-09 08:57:12 -07:00
Tyker
fa40fd40e0 [MLIR] Improve interaction of TypedValue with BlockAndValueMapping 2022-09-09 08:55:05 -07:00
Blue Gaston
d1fe5cf522 [ASAN][DARWIN] Remove getpwnam(NULL) test for undefined behavior
Reverting a patch that was added to test for getpwnam(NULL) -- it was noted at the time the behavior might have been a bug, however the patch was added for binary compatibility. Because of the change in the expected behavior, we are reverting this commit, as the test added is no longer passing.

Update: Rather than reverting the original commit, updating this to only remove the unnecessary test.

Original Patch: https://reviews.llvm.org/D40052

rdar://98592334
2022-09-09 08:54:13 -07:00
zhongyunde
7a81782585 [AArch64][CodeGen]Fold the mov and lsl into ubfiz
Fix the issue exposed by D132322, depand on D132939
Reviewed By: efriedma, paulwalker-arm
Differential Revision: https://reviews.llvm.org/D132325
2022-09-09 23:50:29 +08:00
Sanjay Patel
6113e6738d [InstCombine] move/adjust comments about demanded bits; NFC
The code has been moved/copied around, but the comments were not updated to match.
2022-09-09 11:48:20 -04:00