Commit Graph

385640 Commits

Author SHA1 Message Date
Mehdi Amini 90ae4d9030 Change add_mlir_doc CMake macro to take the tablegen command as last argument to allow extra flags
This is useful for expressing specific table-gen options, like selecting
a particular dialect to print.
Use it to fix the documentation for the `pdl_interp` dialect which is now
generating the first dialect it finds in its input which is `pdl`.

Differential Revision: https://reviews.llvm.org/D100517
2021-04-15 02:59:40 +00:00
Christopher Di Bella 2e3a78b8ca [libcxx][NFC] adjusts formatting rules
This will reduce the amount of noisy feedback during reviews.

Differential Revision: https://reviews.llvm.org/D99691
2021-04-15 02:46:44 +00:00
Nico Weber d5e8dca1b6 fix comment typos to cycle bots 2021-04-14 22:12:56 -04:00
LLVM GN Syncbot 730c0b6ea3 [gn build] Port b7459a10da 2021-04-15 01:52:03 +00:00
Jonas Devlieghere 6ce1067f2d [lldb] Simplify output for skipped categories in dotest.py
Print a single line listing all the categories that are being skipped,
rather than relying on the check.*Support() functions specifying why a
particular category will be skipped. If we know why a category got
skipped, still print that in verbose mode.

The motivation for this change is that sometimes engineers misidentify
the output of these messages as the cause for a test failure (e.g. not
being able to build libc++ or libstdc++).

Differential revision: https://reviews.llvm.org/D100508
2021-04-14 18:50:48 -07:00
Alexander Yermolovich b7459a10da [DWARF] Fix crash for DWARFDie::dump.
When DIE is extracted manually, the DieArray is empty. When dump is invoked on aforementioned DIE it tries to extract child, even if Dump options say otherwise. Resulting in crash.

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D99698
2021-04-14 18:46:34 -07:00
Sterling Augustine 8f9477b067 Revert "Simplify BitVector code"
This reverts commit 82f0e3d3ea.

The change breaks the asan buildbots.

https://lab.llvm.org/buildbot/#/builders/99/builds/2835
2021-04-14 18:06:51 -07:00
Nico Weber 5a625e5303 [llvm-objdump] try to fix section-filter.test in full builds after 51aa61e74b 2021-04-14 20:58:51 -04:00
Nico Weber ca897a1abb [llvm-objdump] try to fix hexagon tests more after 51aa61e74b 2021-04-14 20:50:03 -04:00
Nico Weber e80f9cab0a [llvm-objdump] try to fix hexagon and riscv tests after 1035123ac5 2021-04-14 20:40:38 -04:00
Evgenii Stepanov 51aa61e74b [hwasan] Fix lock contention on thread creation.
Do not hold the free/live thread list lock longer than necessary.
This change speeds up the following benchmark 10x.

constexpr int kTopThreads = 50;
constexpr int kChildThreads = 20;
constexpr int kChildIterations = 8;

void Thread() {
  for (int i = 0; i < kChildIterations; ++i) {
    std::vector<std::thread> threads;
    for (int i = 0; i < kChildThreads; ++i)
      threads.emplace_back([](){});
    for (auto& t : threads)
      t.join();
  }
}

int main() {
  std::vector<std::thread> threads;
  for (int i = 0; i < kTopThreads; ++i)
    threads.emplace_back(Thread);
  for (auto& t : threads)
    t.join();
}

Differential Revision: https://reviews.llvm.org/D100348
2021-04-14 17:13:15 -07:00
Nico Weber 1035123ac5 [llvm-objdump] Switch command-line parsing from llvm::cl to OptTable
This is similar to D83530, but for llvm-objdump.

The motivation is the desire to add an `llvm-otool` symlink to
llvm-objdump that behaves like macOS's `otool`, using the same
technique the at llvm-objcopy uses to behave like `strip` (etc).

This change for the most part preserves behavior. In some cases,
it increases compatibility with GNU objdump a bit. For example,
the long options now require two dashes, and the long options
taking arguments for the most part now require a `=` in front
of the value. Exceptions are flags where tests passed the
value separately, for these the separate form is kept as
an alias to the = form.

The one-letter short form args are now joined or separate
and long longer accept a =, which also matches GNU objdump.

cl::opt<>s in libraries now have to be explicitly plumbed
through. This patch does that for --x86-asm-syntax=, but
there's hope that we can remove that again.

Differential Revision: https://reviews.llvm.org/D100433
2021-04-14 20:12:24 -04:00
Eli Friedman dc1ab590a0 [Sema] Fold VLA types in compound literals to constant arrays.
Similar to variables with an initializer, this is never valid in
standard C, so we can safely constant-fold as an extension.  I ran into
this construct in a couple proprietary codebases.

While I'm here, drive-by fix for 090dd647: we should only fold variables
with VLA types, not arbitrary variably modified types.

Differential Revision: https://reviews.llvm.org/D98363
2021-04-14 17:09:59 -07:00
Philip Reames dd985551c2 Reapply "[InferAttributes] Materialize all infered attributes for declaration"" and follow on patches.
This reverts commit ab98f2c712 and 98eea392cd.

It includes a fix for the clang test which triggered the revert.  I failed to notice this one because there was another AMDGPU llvm test with a similiar name and the exact same text in the error message.  Odd.  Since only one build bot reported the clang test, I didn't notice that one.
2021-04-14 16:38:07 -07:00
Shafik Yaghmour ebee457131 [LLLDB] Adding additional check LibCppStdFunctionCallableInfo based on crash reports
We have seen several crashes in LibCppStdFunctionCallableInfo(...) but we don't have a
reproducer. The last crash pointed to last call to line_entry_helper(...) and symbol
was a nullptr. So adding a check for this case.
2021-04-14 16:28:38 -07:00
Nathan James 6890f302f5
[AST][Introspection] Fix args not being set.
This field isn't set in the constructor.
Tweak its accessor to return an ArrayRef.
2021-04-15 00:19:40 +01:00
Nathan James bfb6c2874b
[AST][NFC] Remove temporary ASTTU file from Introspection generation.
We can use the Preprocessor to remap this file, cleaning up the cmake code.

Reviewed By: steveire

Differential Revision: https://reviews.llvm.org/D100343
2021-04-15 00:14:55 +01:00
Nathan James b23abbeab1
[AST] Use IntrusiveRefCntPtr for Introspection LocationCall.
Reviewed By: steveire

Differential Revision: https://reviews.llvm.org/D100378
2021-04-15 00:12:22 +01:00
zoecarver b12f3ce47f [libcxx][nfc] Assign [ranges.primitives] in "RangesStatus." 2021-04-14 16:09:45 -07:00
Nico Weber 98eea392cd Revert "Fix buildbots after 61a85da"
This reverts commit c609d53363.
61a85da was reverted in ab98f2c7
2021-04-14 18:47:46 -04:00
Nico Weber ab98f2c712 Revert "[InferAttributes] Materialize all infered attributes for declaration"
Breaks check-clang, see comments on D100400

Also revert follow-up "[NFC] Move a recently added utility into a location to enable reuse"

This reverts commit 3ce61fb6d6.
This reverts commit 61a85da882.
2021-04-14 18:41:20 -04:00
Stephen Kelly c960c3836c NFC: Remove condition to simplify code
The run method is only called if there is a match with a binding.
2021-04-14 23:38:04 +01:00
Philip Reames c609d53363 Fix buildbots after 61a85da 2021-04-14 15:16:05 -07:00
peter klausler e51939eca6 [flang] Fix typo caught by clang build
An inadvertent ! operator was (fortunately) flagged as a
warning by clang; remove it.

Differential Review: https://reviews.llvm.org/D100513
2021-04-14 15:10:40 -07:00
Philip Reames 3ce61fb6d6 [NFC] Move a recently added utility into a location to enable reuse
About to refresh a patch that uses this in FunctionAtrrs, doing the move seperately to control build times.
2021-04-14 15:05:16 -07:00
Philip Reames 61a85da882 [InferAttributes] Materialize all infered attributes for declaration
We have some cases today where attributes can be inferred from another on access, but the result is not explicitly materialized in IR. This change is a step towards changing that.

Why? Two main reasons:

* Human clarity. It's really confusing trying to figure out why a transform is triggering when the IR doesn't appear to have the required attributes.
* This avoids the need to special case declarations in e.g. functionattrs. Since we can assume the attribute is present, we can work directly from attributes (and only attributes) without also needing to query accessors on Function to avoid missing cases due to unannotated (but infered on use) declarations. (This piece will appear must easier to follow once D100226 also lands.)

Differential Revision: https://reviews.llvm.org/D100400
2021-04-14 14:45:24 -07:00
Chia-hung Duan 61500016a5 [mlir] Fix passArg of ViewOpGraphPass
Reviewed By: jpienaar

Differential Revision: https://reviews.llvm.org/D100156
2021-04-14 14:42:16 -07:00
Chia-hung Duan 222d30d32c Use PassPipelineCLParser in mlir-reduce
We are able to config the reducer pass pipeline through command-line.

Reviewed By: jpienaar, rriddle

Differential Revision: https://reviews.llvm.org/D100155
2021-04-14 14:35:55 -07:00
Jonas Devlieghere a749bd7639 [lldb] Add addressing_bits to KNOWN_HOST_INFO_KEYS and sort the list
This fixes TestGdbRemoteHostInfo on Apple Silicon.
2021-04-14 14:15:17 -07:00
Thomas Lively 6a18cc23ef [WebAssembly] Codegen for i64x2.extend_{low,high}_i32x4_{s,u}
Removes the builtins and intrinsics used to opt in to using these instructions
and replaces them with normal ISel patterns now that they are no longer
prototypes.

Differential Revision: https://reviews.llvm.org/D100402
2021-04-14 13:43:09 -07:00
Chia-hung Duan 6b0cef3e02 Refactor the architecture of mlir-reduce
Add iterator for ReductionNode traversal and use range to indicate the
region we would like to keep. Refactor the interaction between
Pass/Tester/ReductionNode.
Now it'll be easier to add new traversal type and OpReducer

Reviewed By: jpienaar, rriddle

Differential Revision: https://reviews.llvm.org/D99713
2021-04-14 13:40:44 -07:00
Stephen Kelly f347f0e0b8 [AST] Add introspection support for more base nodes
Fix the logic of detecting pseudo-virtual getBeginLoc etc on Stmt and
Decl subclasses.

Adjust the test infrastructure to filter out invalid source locations.
This makes the tests more clear about which nodes have which locations.

Differential Revision: https://reviews.llvm.org/D99231
2021-04-14 21:31:23 +01:00
Sterling Augustine d2bb3cbbf8 Make test runnable on read-only file systems. 2021-04-14 13:29:51 -07:00
Stephen Kelly 6559ebd91b [AST] Replace asserts with a condition
As was done for other locations in commit 54272e5b (NFC:
Replace asserts with if() in SourceLocation accessors, 2019-01-07).

Extracted from  https://reviews.llvm.org/D99231
2021-04-14 21:14:05 +01:00
Walter Erquinigo cc88d301a0 [lldb-vscode] Reduce chattiness of progress events
Progress events internally have a completed count and a total count, which can mean that for a job with 20000 total counts, then there will be 20000 events fired. Sending all these events to the IDE can break it. For example, debugging a huge binary resulted in around 50 million messages, which rendered the IDE useless, as it was spending all of its resources simply parsing messages and updating the UI.

A way to fix this is to send unique percentage updates, which are at most 100 per job, which is not much. I was able to debug that big target and confirm that only unique percentage notifications are sent. I can't write a test for this because the current test is flaky. I'll figure out later how to make the test reliable, but fixing this will unblock us from deploy a new version of lldb-vscode.

Differential Revision: https://reviews.llvm.org/D100443
2021-04-14 13:00:01 -07:00
Emilio Cota cf20286bcc [mlir] Use default lli JIT in Integration tests
Now that 9b8e7a9d ("[lli] Honor the --entry-function flag in orc and
orc-lazy modes") fixed https://llvm.org/PR49906.

Reviewed By: mehdi_amini, aartbik

Differential Revision: https://reviews.llvm.org/D100407
2021-04-14 12:55:00 -07:00
serge-sans-paille 82f0e3d3ea Simplify BitVector code
Instead of managing memory by hand, delegate it to std::vector. This makes the
code much simpler, and also avoids repeatedly computing the storage size.

According to valgrind --tool=callgrind, this also slightly decreases the
instruction count, but by a small margin.

Differential Revision: https://reviews.llvm.org/D100387
2021-04-14 21:28:08 +02:00
Mehdi Amini a33b647100 Revert "Refactor the architecture of mlir-reduce"
This reverts commit a32846b1d0.

The build is broken with -DBUILD_SHARED_LIBS=ON:

tools/mlir/lib/Reducer/CMakeFiles/obj.MLIRReduce.dir/Tester.cpp.o: In function `mlir::Tester::isInteresting(mlir::ModuleOp) const':
Tester.cpp:(.text._ZNK4mlir6Tester13isInterestingENS_8ModuleOpE+0xa8): undefined reference to `mlir::OpPrintingFlags::OpPrintingFlags()'
Tester.cpp:(.text._ZNK4mlir6Tester13isInterestingENS_8ModuleOpE+0xc6): undefined reference to `mlir::Operation::print(llvm::raw_ostream&, mlir::OpPrintingFlags)'
2021-04-14 19:25:43 +00:00
Mehdi Amini 543cd763a4 Update OpBase.td AttrDef class to define default value for returnType and convertFromStorage (NFC)
Differential Revision: https://reviews.llvm.org/D100356
2021-04-14 19:22:07 +00:00
Fred Riss 87183b1a75 [lldb] Only override target arch if it is compatible
It looks like the goal of this code is to provide a more precise
architecture definition for the target when attaching to a process. When
attaching to a foreign debugserver, you might get into a situation where
the active (host) platform will give you bogus information on the target
process.

This change allows the platform to override the target arch only with a
compatible architecture. This fixes TestTargetXMLArch.py on Apple
Silicon. Another alternative would be to just fail in this scenario and
update the test(s).
2021-04-14 12:14:25 -07:00
Pavel Labath ded660495f [lldb/test] Remove the "expect_captures" feature of lldb-server tests
This functionality is used exactly once, and it is trivial to implement
it differently (capture into two distinct variables, and compare for
equality afterwards).
2021-04-14 21:08:55 +02:00
Pavel Labath 2494243ed3 [lldb] Move QThreadSuffixSupported and QListThreadsInStopReply into llgs
These were in the shared llgs+platform code, but they only make sense
for llgs (as they deal with how the server reports information about
debugged processes).
2021-04-14 21:08:55 +02:00
Nico Weber da0ef5ad5b fix typo to cycle bots 2021-04-14 14:59:18 -04:00
Mehrnoosh Heidarpour 29f189f90d [InstCombine] Conditionally emit nowrap flags when combining two adds
Currently, the InstCombineCompare is combining two add operations
into a single add operation which always has a nsw flag, without
checking the conditions to see if this flag should be present
according to the original two add operations or not.

This patch will change the InstCombineCompare to emit the nsw or
nuw only when these flags are allowed to be generated according to
the original add operations and remove the possibility of applying
wrong optimization with passes that will perform on the IR later
in the pipeline.

To confirm that the current results are buggy and the results after
proposed patch are the correct IR the following examples from Alive2
are attached; the same results can be seen in the case of nuw flag
and nsw is just used as an example. The following link shows that
the generated IR with current LLVM is a buggy IR when none of the
original add operations have nsw flag.
https://alive2.llvm.org/ce/z/WGaDrm
The following link proves that the generated IR after the patch in
the former case is the correct IR.
https://alive2.llvm.org/ce/z/wQ7G_e

Differential Revision: https://reviews.llvm.org/D100095
2021-04-14 20:53:06 +02:00
Nico Weber 1e89f08f59 fix typo to cycle bots 2021-04-14 14:52:53 -04:00
LLVM GN Syncbot c0fa3fe4aa [gn build] Port f992cfba71 2021-04-14 18:37:22 +00:00
LLVM GN Syncbot 89dc4e3312 [gn build] Port e98060fa72 2021-04-14 18:37:21 +00:00
Nico Weber e200690381 [gn build] try to make sync_source_lists_from_cmake.py py3-compatible 2021-04-14 14:36:29 -04:00
William S. Moses d3e2b4c0a2 [SROA][TBAA] Handle shift of regular TBAA nodes
SROA shifts TBAA nodes in a way that may present a problem for !tbaa but not !tbaa.struct nodes.

Differential Revision: https://reviews.llvm.org/D99851
2021-04-14 14:35:20 -04:00
peter klausler cfc12a2120 [flang] Correct the interpretation of BIND(C,NAME='')
An empty NAME= should mean that there is no C binding, not the
binding that would result from BIND(C) without a NAME=.
See 18.10.2p2.

Differential Revision: https://reviews.llvm.org/D100494
2021-04-14 11:33:31 -07:00