Commit Graph

428137 Commits

Author SHA1 Message Date
Craig Topper ea1b861278 [RISCV] Fix misleading formatting and remove a dead getNode call. NFC 2022-06-27 18:49:57 -07:00
David Blaikie 9f94d63a6a Add missing (void) for function declarations in C 2022-06-28 00:45:17 +00:00
Matt Arsenault 261075590b llvm-reduce: Handle reducing FP values to nan
Prefer 0/1 over NaN, but it may make more sense to invert this as FP
operations with nan inputs can universally be folded into something
else.
2022-06-27 19:55:38 -04:00
Brad Smith 84b2e04aea [docs] Remove outdated status update for FreeBSD
Reviewed By: emaste, MaskRay

Differential Revision: https://reviews.llvm.org/D128592
2022-06-27 19:41:53 -04:00
Fangrui Song efd90ffbfc [test] Add -fsanitize=array-bounds test for pseudo flexible array member
This behavior (from commit 539e4a77bb in 2013) was untested.
The test can help detect regression introduced by 886715af96
2022-06-27 16:40:52 -07:00
Jonas Devlieghere e06a88cbe9
[lldb] Use assertState in TestIgnoredExceptions 2022-06-27 16:30:47 -07:00
Wolfgang Pieb a630ea3003 Reland [Metadata] Add a resize capability to MDNodes and add a push_back interface to MDNode
Fixed a bug with double destruction of operands and corrected a test issue.

Note that this patch leads to a slight increase in compile time (I measured
about .3%) and a slight increase in memory usage. The increased memory usage
should be offset once resizing is used to a larger extent.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D125998
2022-06-27 16:23:11 -07:00
Yuanfang Chen 14d3021c10 [lit][test] relaxed GTEST_TOTAL_SHARDS checking for some googletests
For machines with a small number of cores, GTEST_TOTAL_SHARDS may be
lower than 6.
2022-06-27 16:17:08 -07:00
Mitch Phillips ca479dac51 Mark ASan global-location-nodebug test as unspported on win.
Windows linkers don't have the easy reachable `-Wl,-S` option to strip
the binary. Disable the test for now.
2022-06-27 16:03:32 -07:00
Mogball 92bdc5c3e5 [mlir][ods] Add convertFromStorage field to parameters
This patch adds a `convertFromStorage` field to attribute or type parameters that can implement more complex logic for converting from the parameter's C++ storage type (e.g. `Optional<SmallVector<T>>`) to its C++ type (e.g. `Optional<ArrayRef<T>>`).

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D128293
2022-06-27 15:57:21 -07:00
Mitch Phillips 7b23552779 Fix-forward ASan on Windows.
D127911 deleted llvm.asan.globals. This had a side effect that we no
longer generated the `name` field for the `__asan_global` descriptor
from clang's decscription of the name, but the demangled name from the
LLVM IR. On Linux, this is the same as the clang-provided name. On
Windows, this includes the type, as the name in the IR is the mangled
name.

Attempt #1 to fix-forward the Windows bots by making the tests glob both
sides of the global name, thereby allowing types in the descriptor name.
2022-06-27 15:53:30 -07:00
Sam Clegg 53217ecb88 [lld][WebAssembly] Don't apply data relocations at static constructor time
Instead, export `__wasm_apply_data_relocs` and `__wasm_call_ctors`
separately.

This is required since user code in a shared library (such as static
constructors) should not be run until relocations have been applied to
all loaded libraries.

See: https://github.com/emscripten-core/emscripten/issues/17295

Differential Revision: https://reviews.llvm.org/D128515
2022-06-27 15:50:02 -07:00
Joel E. Denny 0103d4da74 [Clang][OpenMP] Don't overload "extension" in status doc
In Clang's OpenMPSupport.rst, "extension" is currently overloaded to
describe both:

1. Standard OpenMP features that appear only in recent versions of the
   OpenMP spec.
2. Non-standard features supported by Clang.  This usage appears in
   the final table on the page.

Last fall, we discussed this issue in the OpenMP in LLVM call and
agreed it should be corrected.  This patch takes the simple approach
of dropping the word "extension" for all occurrences of the first
usage.  The result seems to read well.

Reviewed By: ABataev

Differential Revision: https://reviews.llvm.org/D126549
2022-06-27 18:41:17 -04:00
Michael Jones 6ec465ab8f [libc] add printf oct conversion
The oct converter handles the %o conversion.

Reviewed By: lntue

Differential Revision: https://reviews.llvm.org/D127985
2022-06-27 15:36:50 -07:00
Sam McCall 85eaecbe8e [pseudo] Check follow-sets instead of tying reduce actions to lookahead tokens.
Previously, the action table stores a reduce action for each lookahead
token it should allow. These tokens are the followSet(action.rule.target).

In practice, the follow sets are large, so we spend a bunch of time binary
searching around all these essentially-duplicates to check whether our lookahead
token is there.
However the number of reduces for a given state is very small, so we're
much better off linear scanning over them and performing a fast check for each.

D128318 was an attempt at this, storing a bitmap for each reduce.
However it's even more compact just to use the follow sets directly, as
there are fewer nonterminals than (state, rule) pairs. It's also faster.

This specialized approach means unbundling Reduce from other actions in
LRTable, so it's no longer useful to support it in Action. I suspect
Action will soon go away, as we store each kind of action separately.

This improves glrParse speed by 42% (3.30 -> 4.69 MB/s).
It also reduces LR table size by 59% (343 -> 142kB).

Differential Revision: https://reviews.llvm.org/D128472
2022-06-28 00:36:16 +02:00
Jim Ingham c1b07d6177 Have CommandObjectParsed check for "commands that take no arguments".
This is currently being done in an ad hoc way, and so for some
commands it isn't being checked.  We have the info to make this check,
since commands are supposed to add their arguments to the m_arguments
field of the CommandObject.  This change uses that info to check whether
the command received arguments in error.

A handful of commands weren't defining their argument types, I also had
to fix them.  And a bunch of commands were checking for arguments by
hand, so I removed those checks in favor of the CommandObject one.  That
also meant I had to change some tests that were checking for the ad hoc
error outputs.

Differential Revision: https://reviews.llvm.org/D128453
2022-06-27 15:14:41 -07:00
Vitaly Buka 6824eee942 [asan] Add missing dependency on Demangle
Follow up to D127911.
2022-06-27 15:10:02 -07:00
Mitch Phillips dacfa24f75 Delete 'llvm.asan.globals' for global metadata.
Now that we have the sanitizer metadata that is actually on the global
variable, and now that we use debuginfo in order to do symbolization of
globals, we can delete the 'llvm.asan.globals' IR synthesis.

This patch deletes the 'location' part of the __asan_global that's
embedded in the binary as well, because it's unnecessary. This saves
about ~1.7% of the optimised non-debug with-asserts clang binary.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D127911
2022-06-27 14:40:40 -07:00
Vitaly Buka df18167ac5 [docs] Restore missing blank line
Lost in resolving conflicts for cdfa15da94.
2022-06-27 14:21:08 -07:00
Julian Lettner 62a71cc5ef [Sanitizer][Darwin] Mark test UNSUPPORTED instead of XFAIL
This is test is failing/passing depending on the host OS version.  Need
to investigate/fix before re-enabling.

rdar://95982696
2022-06-27 14:18:36 -07:00
Vitaly Buka cdfa15da94 Revert "[clang] Introduce -fstrict-flex-arrays=<n> for stricter handling of flexible arrays"
This reverts D126864 and related fixes.

This reverts commit 572b08790a.
This reverts commit 886715af96.
2022-06-27 14:03:09 -07:00
Julian Lettner 1bdbf13746 [Sanitizer][Darwin] atos does not show line numbers for globals
atos does not show line numbers for globals and will probably not
support this anytime soon.  Mark test UNSUPPORTED instead of XFAIL.
2022-06-27 13:58:12 -07:00
Craig Topper 87077c7eb5 [RISCV] Remove repeated calls to getSExtValue. NFC 2022-06-27 13:42:58 -07:00
Craig Topper 9afa5b8da2 [RISCV] Add tests for (load (add X, [2048,4094])). NFC
Offsets in the range [-4095,-2049] or [2048, 4094] are split into
two ADDIs. One of the ADDIs will be folded into the load/store
immediate through an post-isel peephole.
2022-06-27 13:42:57 -07:00
Philip Reames 20dd3297b1 [LV] Allow scalable vectorization with vscale = 1
This change is a bit subtle. If we have a type like <vscale x 1 x i64>, the vectorizer will currently reject vectorization. The reason is that a type like <1 x i64> is likely to get simply rescalarized, and the vectorizer doesn't want to be in the game of simple unrolling.

(I've given the example in terms of 1 x types which use a single register, but the same issue exists for any N x types which use N registers. e.g. RISCV LMULs.)

This change distinguishes scalable types from fixed types under the reasoning that converting to a scalable type isn't unrolling. Because the actual vscale isn't known until runtime, using a vscale type is potentially very profitable.

This makes an important, but unchecked, assumption. Specifically, the scalable type is assumed to only be legal per the cost model if there's actually a scalable register class which is distinct from the scalar domain. This is, to my knowledge, true for all targets which return non-invalid costs for scalable vector ops today, but in theory, we could have a target decide to lower scalable to fixed length vector or even scalar registers. If that ever happens, we'd need to revisit this code.

In practice, this patch unblocks scalable vectorization for ELEN types on RISCV.

Let me sketch one alternate implementation I considered. We could have restricted this to when we know a minimum value for vscale. Specifically, for the default +v extension for RISCV, we actually know that vscale >= 2 for ELEN types. However, doing it this way means we can't generate scalable vectors when using the various embedded vector extensions which have a minimum vscale of 1.

Differential Revision: https://reviews.llvm.org/D128542
2022-06-27 13:38:57 -07:00
Roy Sundahl d2dad6287c Add wait for child processe(s) to exit. (amended+clang-formatted)
It was possible for the parent process to exit before the
forked child process had finished. In some shells, this
causes the pipe to close and FileCheck misses some output
from the child. Waiting for the child process to exit before
exiting the parent, assures that all output from stdout and
stderr is combined and forwarded through the pipe to FileCheck.

rdar://95241490

Differential Revision: https://reviews.llvm.org/D128565
2022-06-27 13:09:34 -07:00
Xing Xue 339e824bca [libc++][lit][AIX] Port tests for getting time to AIX
Summary:
This patch ports libc++ LIT test cases for getting time in various locales to AIX.

Reviewed by: philnik, Mordante, libc++

Differential Revision: https://reviews.llvm.org/D128087
2022-06-27 16:07:27 -04:00
Xing Xue 80baa56c46 [libc++][lit][AIX] Port tests for money format to AIX
Summary:
This patch ports libc++ LIT test cases for money formats to AIX. On AIX, the money format of locale zh_CN.UTF-8 is the similar to that of en_US.UTF-8, i.e., sign, symbol, none, value.

Reviewed by: Mordante, DiggerLin, libc++

Differential Revision: https://reviews.llvm.org/D128220
2022-06-27 15:57:54 -04:00
Philip Reames 0533b6e2f6 [RISCV] Remove a use of getMinVLen in favor of getRealMinVLen
The later is possibly greater than the former, and thus the assert was overly strong when a wider VLEN was set at the command line.
2022-06-27 12:52:24 -07:00
Philip Reames aadc9d26a3 [RISCV] Cost model for scalable reductions
This extends the existing cost model for reductions for scalable vectors.

The existing cost model assumes that reductions are roughly logarithmic in cost for unordered variants and linear for ordered ones. This change keeps that same basic model, and extends it out to the maximum number of elements a scalable vector could possibly have.

This results in costs which aren't terribly high for unordered reductions, but are for ordered ones. This seems about right; we want to strongly bias away from using scalable ordered reductions if the cost might be linear in VL.

Differential Revision: https://reviews.llvm.org/D127447
2022-06-27 12:44:38 -07:00
Vitaly Buka 8f7cca90af Revert "[X86] Support `_Float16` on SSE2 and up"
Breaks buildbot
https://lab.llvm.org/buildbot/#/builders/37/builds/14334

This reverts commit f5d781d627.
2022-06-27 12:43:29 -07:00
Matthias Springer cb47124179 [mlir][bufferize] Improve to_tensor/to_memref folding
Differential Revision: https://reviews.llvm.org/D128615
2022-06-27 21:42:39 +02:00
Vitaly Buka 11b414463d [test] Add workaround for flaky error we see on Windows bots 2022-06-27 12:37:44 -07:00
Alex Langford ef5510d81b [NFC][lldb] Correct Module::FindFunctions documentation
Looks like a copy/paste from ModuleList::FindCompileUnits.
2022-06-27 12:33:05 -07:00
Yuanfang Chen 6e2b3cc6ca Fix sphinx docs build
Fix "Title underline too short."
2022-06-27 12:22:04 -07:00
Yuanfang Chen e2e9e708e5 [Coroutine] Remove the '!func_sanitize' metadata for split functions
There is no proper RTTI for these split functions. So just delete the
metadata.

Fixes https://github.com/llvm/llvm-project/issues/49689.

Reviewed By: rjmccall

Differential Revision: https://reviews.llvm.org/D116130
2022-06-27 12:09:13 -07:00
Yuanfang Chen 6678f8e505 [ubsan] Using metadata instead of prologue data for function sanitizer
Information in the function `Prologue Data` is intentionally opaque.
When a function with `Prologue Data` is duplicated. The self (global
value) references inside `Prologue Data` is still pointing to the
original function. This may cause errors like `fatal error: error in backend: Cannot represent a difference across sections`.

This patch detaches the information from function `Prologue Data`
and attaches it to a function metadata node.

This and D116130 fix https://github.com/llvm/llvm-project/issues/49689.

Reviewed By: pcc

Differential Revision: https://reviews.llvm.org/D115844
2022-06-27 12:09:13 -07:00
Wei Yi Tee ae90bc8467 [clang][dataflow] Add `buildAndSubstituteFlowCondition` to `DataflowEnvironment`
Depends On D128658

Reviewed By: gribozavr2, xazax.hun

Differential Revision: https://reviews.llvm.org/D128659
2022-06-27 21:09:05 +02:00
Wei Yi Tee fa34210fa6 [clang][dataflow] Do not allow substitution of true/false boolean literals in `buildAndSubstituteFlowCondition`
Reviewed By: gribozavr2, xazax.hun

Differential Revision: https://reviews.llvm.org/D128658
2022-06-27 21:04:52 +02:00
Aart Bik 4db52450c1 [mlir][sparse] remove redundant whitespace
Reviewed By: Peiming

Differential Revision: https://reviews.llvm.org/D128673
2022-06-27 11:57:08 -07:00
Groverkss aab7e2fa05 [MLIR][Parser] Fix AffineParser colliding bare identifiers with primitive types
The parser currently can't parse bare identifiers like 'i0' in affine
maps and sets, and similarly ids like f16/f32. But these bare ids are
part of the grammar - although they are primitive types.

```
error: expected bare identifier
set = affine_set<(i0, i1) : ()>
                   ^
```

This patch allows the parser for AffineMap/IntegerSet to parse bare
identifiers as defined by the grammer.

Reviewed By: bondhugula, rriddle

Differential Revision: https://reviews.llvm.org/D127076
2022-06-27 19:35:25 +01:00
Peiming Liu 15d1cb4520 [mlir][sparse]more integration test cases for sparse_tensor.BinaryOp
Adding more test cases for sparse_tensor.BinaryOp, including different cases when overlap/left/right region is implemented/empty/identity

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D128383
2022-06-27 11:29:27 -07:00
Daniel Thornburgh d3ff32720d [Symbolize] Fix MarkupFilter tests for Windows.
The tests use in-band ANSI color codes, while the Windows cmd console
uses an out-of-band interface for color.
2022-06-27 11:18:41 -07:00
Daniel Thornburgh 7598a42e2a [Symbolize] Fix llvm-symbolizer --filter-markup test on Windows.
The tests use in-band ANSI color codes, while the Windows cmd console
uses an out-of-band interface for color.
2022-06-27 11:16:15 -07:00
Amir Ayupov d58b5a0614 [BOLT] Restrict icp-inline to callsites
ICP peel for inline mode only makes sense for calls, not jump tables.
Plus, add a check that the Target BinaryFunction is found.

Reviewed By: rafauler

Differential Revision: https://reviews.llvm.org/D128404
2022-06-27 11:08:55 -07:00
Peiming Liu 057e33ef36 [mlir][sparse]Add more integration tests for sparse_tensor.unary
Previously, the sparse_tensor.unary integration test does not contain cases with the use of `linalg.index` (previoulsy unsupported), this commit adds test cases that use `linalg.index` operators.

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D128460
2022-06-27 10:58:47 -07:00
LLVM GN Syncbot 03859994b3 [gn build] Port eb5af0acf0 2022-06-27 17:44:48 +00:00
Daniel Thornburgh eb5af0acf0 [Symbolize] Add log markup --filter to llvm-symbolizer.
This adds a --filter option to llvm-symbolizer. This takes log-bearing
symbolizer markup from stdin and writes a human-readable version to
stdout.

For now, this only implements the "symbol" markup tag; all others are
passed through unaltered. This is a proof-of-concept bit of
functionalty; implement the various tags is more-or-less just a matter
of hooking up various parts of the Symbolize library to the architecture
established here.

Reviewed By: peter.smith

Differential Revision: https://reviews.llvm.org/D126980
2022-06-27 10:44:15 -07:00
Chris Bieneman ee0dd2ec11 [Docs] Update clang & llvm release notes for HLSL
Adding release note entries for LLVM & Clang to introduce the HLSL &
DirectX support that is being added.

Reviewed By: aaron.ballman, MaskRay

Differential Revision: https://reviews.llvm.org/D127890
2022-06-27 12:41:14 -05:00
Joseph Huber c7243f21d3 [OpenMP] Only strip runtime attributes if needed
Summary:
Currently in OpenMPOpt we strip `noinline` attributes from runtime
functions. This is here because the device bitcode library that we link
has problems with needed definitions getting prematurely optimized out.
This is only necessary for OpenMP offloading to GPUs so we should narrow
the scope for where we spend time doing this. In the future this
shouldn't be necessary as we move to using a linked library rather than
pulling in a bitcode library in Clang.
2022-06-27 13:35:41 -04:00