Commit Graph

401119 Commits

Author SHA1 Message Date
luxufan 50a278c2ae [JITLink][NFC] Add TableManager to replace PerGraph...Builder pass
This patch add a TableManager which reponsible for fixing edges that need entries to reference the target symbol and constructing such entries.

In the past, the PerGraphGOTAndPLTStubsBuilder pass was used to build GOT and PLT entry, and the PerGraphTLSInfoEntryBuilder pass was used to build TLSInfo entry. By generalizing the behavior of building entry, I added a TableManager which could be reused when built GOT, PLT and TLSInfo entries.

If this patch makes sense and can be accepted, I will apply the TableManager to other targets(MachO_x86_64, MachO_arm64, ELF_riscv), and delete the file PerGraphGOTAndPLTStubsBuilder.h

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D110383
2021-10-06 21:24:34 +08:00
Raphael Isemann f98df8a38b [lldb] Make 'this' substituton error more verbose. 2021-10-06 15:07:19 +02:00
Raphael Isemann 7862728cab [lldb] Rewrite and extend TestConstThis 2021-10-06 14:51:00 +02:00
Simon Pilgrim f1be391bed [polly] Replace report_fatal_error(std::string) uses with report_fatal_error(Twine)
As described on D111049, we're trying to remove the <string> dependency from error handling and replace uses of report_fatal_error(const std::string&) with the Twine() variant which can be forward declared.
2021-10-06 13:32:57 +01:00
Jaroslav Sevcik fd185cfc51 Reland "[lldb] Refactor variable parsing"
Separates the methods for recursive variable parsing in function
context and non-recursive parsing of global variables.

Original patch: https://reviews.llvm.org/rG601168e42037ac4433e74b920bb22f76d59ba420
Revert patch: https://reviews.llvm.org/rGca5be065c4c612554acdcae3ead01a1474eff296
Diff from the original patch: avoid using nullptr deref/ref.

Differential Revision: https://reviews.llvm.org/D110570
2021-10-06 14:25:47 +02:00
Sanjay Patel db231ebdb0 [InstCombine] fold fake vector extract to shift+trunc
We already handle more complicated cases like:
extelt (bitcast (inselt poison, X, 0)) --> trunc (lshr X)

But we missed this simpler pattern:
https://alive2.llvm.org/ce/z/D55h64 / https://alive2.llvm.org/ce/z/GKzzRq

This is part of solving:
https://llvm.org/PR52057

I made the transform depend on legal/desirable int type to avoid creating
a shift of an illegal type (for example i128). I'm not sure if that
restriction is actually necessary, but we can change that as a follow-up
if the backend can deal with integer ops on too-wide illegal types.

The pile of AVX512 test changes are all neutral AFAICT - the x86 backend
seems to know how to turn that into the expected "kmov" instructions.

Differential Revision: https://reviews.llvm.org/D111082
2021-10-06 08:12:05 -04:00
Michał Górny 02e690ba0b [lldb] [FreeBSD] Fix building on systems without PT_COREDUMP
PT_COREDUMP is a relatively recent addition.  Use an #ifdef to skip it
if the underlying system does not support it.

Differential Revision: https://reviews.llvm.org/D111214
2021-10-06 14:05:07 +02:00
Max Kazantsev 576ab15b90 [Test] Few more symmetrical test for D110517 2021-10-06 19:02:28 +07:00
LLVM GN Syncbot 1e013f112e [gn build] Port a30a36f66a 2021-10-06 11:59:40 +00:00
Michał Górny a30a36f66a [lldb] [ABI/X86] Split base x86 and i386 classes
Split the ABIX86 class into two classes: base ABIX86 class that is
common to 32-bit and 64-bit ABIs, and ABIX86_i386 class that is the base
for 32-bit ABIs.  This removes the confusing concept that ABIX86
initializes 64-bit ABIs but is only the base for 32-bit ABIs.

Differential Revision: https://reviews.llvm.org/D111216
2021-10-06 13:59:21 +02:00
Simon Pilgrim e244a6fec7 [mlir] Replace report_fatal_error(std::string) uses with report_fatal_error(Twine)
As described on D111049, we're trying to remove the <string> dependency from error handling and replace uses of report_fatal_error(const std::string&) with the Twine() variant which can be forward declared.
2021-10-06 12:57:20 +01:00
Pavel Labath 00e704bf08 [lldb] Remove "dwarf dynamic register size expressions" from RegisterInfo
These were added to support some mips registers on linux, but linux mips
support has now been removed due.

They are still referenced in the freebds mips implementation, but the
completeness of that implementation is also unknown. All other
architectures just set these fields to zero, which is a cause of
significant bloat in our register info definitions.

Arm also has registers with variable sizes, but they were implemented in
a more gdb-compatible fashion and don't use this feature.

Differential Revision: https://reviews.llvm.org/D110914
2021-10-06 13:22:38 +02:00
Amara Emerson 79d13bf22c Revert "Revert "[GlobalISel][IRTranslator] Emit trap intrinsic for "unreachable"""
This reverts commit d95cd81141.

Re-land the original patch now that the bug this exposed in selection has been
fixed by 6bc64e24c3
2021-10-06 04:16:19 -07:00
Simon Pilgrim e9f4fa75ed [llvm] Unix.h - Replace report_fatal_error(std::string) with report_fatal_error(Twine)
As described on D111049, we're trying to remove the <string> dependency from error handling and replace uses of report_fatal_error(const std::string&) with the Twine() variant which can be forward declared.
2021-10-06 12:13:40 +01:00
Simon Pilgrim 21661607ca [llvm] Replace report_fatal_error(std::string) uses with report_fatal_error(Twine)
As described on D111049, we're trying to remove the <string> dependency from error handling and replace uses of report_fatal_error(const std::string&) with the Twine() variant which can be forward declared.
2021-10-06 12:04:30 +01:00
Simon Pilgrim b9b90bb542 [clang] Replace report_fatal_error(std::string) uses with report_fatal_error(Twine)
As described on D111049, we're trying to remove the <string> dependency from error handling and replace uses of report_fatal_error(const std::string&) with the Twine() variant which can be forward declared.
2021-10-06 11:43:19 +01:00
Max Kazantsev 78873840ff [Test] Add some more symmetrical test cases for D110517
More similar cases to see that the opt we are trying to make is generic enough.
2021-10-06 17:38:48 +07:00
Vince Bridgers b29186c08a [analyzer] canonicalize special case of structure/pointer deref
This simple change addresses a special case of structure/pointer
aliasing that produced different symbolvals, leading to false positives
during analysis.

The reproducer is as simple as this.

```lang=C++
struct s {
  int v;
};

void foo(struct s *ps) {
  struct s ss = *ps;
  clang_analyzer_dump(ss.v); // reg_$1<int Element{SymRegion{reg_$0<struct s *ps>},0 S64b,struct s}.v>
  clang_analyzer_dump(ps->v); //reg_$3<int SymRegion{reg_$0<struct s *ps>}.v>
  clang_analyzer_eval(ss.v == ps->v); // UNKNOWN
}
```

Acks: Many thanks to @steakhal and @martong for the group debug session.

Reviewed By: steakhal, martong

Differential Revision: https://reviews.llvm.org/D110625
2021-10-06 05:18:27 -05:00
Nathan Sidwell c11e7b59d2 [X86][NFC] structure-return simplificiation
The X86 backend only needs to know whether structure return is via an
sret pointer.  This removes the categorization enumeration and
adjusts, templatizes and renames the related functions.

Differential Revision: https://reviews.llvm.org/D109966
2021-10-06 03:12:48 -07:00
Nicolas Vasilache 26b3e92981 [mlir][Linalg] Don't return early from inPlaceAnalysis
Instead just emit a warning that analysis failed and the result will be treated conservatively.

Differential Revision: https://reviews.llvm.org/D111217
2021-10-06 10:03:25 +00:00
David Green a84b78198c [AArch64] Regenerate some more tests
This updates the check lines in some extra tests, to make them more
maintainable going forward.
2021-10-06 10:38:22 +01:00
Simon Pilgrim 0776924a17 [CostModel][X86] getCmpSelInstrCost - treat BAD_PREDICATEs the same as the worst case cost predicates for ICMP/FCMP instructions
As suggested on D111024, we should treat getCmpSelInstrCost calls without a specific predicate as matching the worst case predicate cost.

These regressions will be addressed with a mixture of D111024 and fixing other specific getCmpSelInstrCost calls to have realistic predicates.
2021-10-06 10:14:56 +01:00
Jonas Paulsson 3562076dfc [SystemZ] Temporarily revert memcmp and memcpy patches
Seem to cause test failures in compiler-rt.

Revert "[SystemZ] Implement memcmp of variable length with CLC."
This reverts commit 7a4e9a0c73.

Revert "[SystemZ] Implement memcpy of variable length with MVC."
This reverts commit c6c13c58ee.
2021-10-06 11:05:18 +02:00
Muhammad Omair Javaid d2b9d0fdda Round XML register bitsize to byte boundary
This patch allows LLDB to accept register sizes which are not aligned
to 8 bits bitsize boundary. This fixes a crash in LLDB when connecting
to OpenOCD stub. GDB xml description allows for non-aligned bit lengths
but they are rounded off to nearest byte during transfer. In case of
OpenOCD some of SOC specific system registers were less than a single
byte in length and were causing LLDB to crash.

Reviewed By: labath

Differential Revision: https://reviews.llvm.org/D111131
2021-10-06 14:03:49 +05:00
David Spickett f8f1bb7462 [compiler-rt][lsan] Add backup AArch64 register for use_registers test
On Ubuntu Focal x13 is used by something in the process of calling
sched_yield. Causing the test to fail depending on when the thread
is stopped.

Adding x14 works around this and the test passes consistently.

Not switching to only x14 because that could make other platforms
fail. With both we'll always find at least one and even if both
values are present we'll only get one report.

Reviewed By: oontvoo, vitalybuka

Differential Revision: https://reviews.llvm.org/D110931
2021-10-06 09:45:53 +01:00
LLVM GN Syncbot a67b1220f5 [gn build] Port fc36fb4d23 2021-10-06 08:40:14 +00:00
David Spickett fc36fb4d23 Revert "Second Recommit "[AArch64] Split bitmask immediate of bitwise AND operation""
This reverts commit 13f3c39f36.

Due to test failures in stage 2 clang tests on AArch64 bots.
2021-10-06 08:39:48 +00:00
Kinuko Yasuda bafdf2b1ef [docs] Fix typo and minor text changes in MyFirstTypoFix
Reviewed By: kuhnel

Differential Revision: https://reviews.llvm.org/D111211
2021-10-06 08:31:56 +00:00
David Green 94bdc0cf61 [AArch64] Regenerate some fast-isel tests
This updates the check lines in some fast isel test, to make them more
maintainable going forward.
2021-10-06 09:30:48 +01:00
David Sherwood 37edb7d3e2 [SVE] Fix incorrect DAG combines when extracting fixed-width from scalable vectors
We were previously silently generating incorrect code when extracting a
fixed-width vector from a scalable vector. This is worse than crashing,
since the user will have no indication that this is currently unsupported
behaviour. I have fixed the code to only perform DAG combines when safe
to do so, i.e. the input and output vectors are both fixed-width or
both scalable.

Test added here:

  CodeGen/AArch64/sve-extract-scalable-vector.ll

Differential revision: https://reviews.llvm.org/D110624
2021-10-06 09:27:44 +01:00
Paulo Matos 0c7495848a [WebAssembly] Fix call_indirect on funcrefs
The currently implementation of funcrefs is broken since it is putting
the funcref itself on the stack before the call_indirect. Instead what
should be on the stack is the constant 0, which is the index at which
we store the funcref in __funcref_call_table.

Reviewed By: tlively

Differential Revision: https://reviews.llvm.org/D111152
2021-10-06 10:11:53 +02:00
Paulo Matos 91fe069c35 [WebAssembly] De-duplicate WasmAddressSpace and refactor reftype predicates
This is a non-functional change to remove the duplicate
WasmAddressSpace enum and refactor reftype predicates by moving them
to the Utilities source file.

Reviewed By: tlively

Differential Revision: https://reviews.llvm.org/D111144
2021-10-06 09:56:23 +02:00
Albion Fung 13d3cd37e2 [PowerPC] Implement vector float and vector double version for vec_orc builtin
The builtin for vec_orc has support for the following two signatures,
but currently the compiler marks it ambiguous:
vector float vec_orc(vector float, vector float)
vector double vec_orc(vector double, vector double)

This patch implements these two builtins.

Differential revision: https://reviews.llvm.org/D110858
2021-10-06 02:47:42 -05:00
Markus Lavin 91d15aa0b8 [NPM] Automatic 'opt' pipeline reducer script.
Script for automatic 'opt' pipeline reduction for when using the new
pass-manager (NPM). Based around the '-print-pipeline-passes' option.

The reduction algorithm consists of several phases (steps).

Step #0: Verify that input fails with the given pipeline and make note of the
error code.

Step #1: Split pipeline in two starting from front and move forward as long as
first pipeline exits normally and the second pipeline fails with the expected
error code. Move on to step #2 with the IR from the split point and the
pipeline from the second invocation.

Step #2: Remove passes from end of the pipeline as long as the pipeline fails
with the expected error code.

Step #3: Make several sweeps over the remaining pipeline trying to remove one
pass at a time. Repeat sweeps until unable to remove any more passes.

Usage example:
./utils/reduce_pipeline.py --opt-binary=./build-all-Debug/bin/opt --input=input.ll --output=output.ll --passes=PIPELINE [EXTRA-OPT-ARGS ...]

Differential Revision: https://reviews.llvm.org/D110908
2021-10-06 09:09:33 +02:00
Tobias Gysi a744c7e962 [mlir][linalg] Update OpDSL to use the newly introduced min and max ops.
Implement min and max using the newly introduced std operations instead of relying on compare and select.

Reviewed By: dcaballe

Differential Revision: https://reviews.llvm.org/D111170
2021-10-06 06:45:53 +00:00
Dmitry Vyukov 24af1ba605 tsan: don't instrument runtime callbacks in tests
These runtime callbacks are supposed to be non-instrumented,
we can't handle runtime recursion well, nor can we afford
explicit recursion checks in the hot functions (memory access,
function entry/exit).
It used to work (not crash), but it won't work with the new runtime.
Mark all runtime callbacks as non-instrumented.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D111157
2021-10-06 08:44:04 +02:00
Amara Emerson 6bc64e24c3 [GlobalISel] Clear unreachable blocks' contents after selection.
If these blocks are unreachable, then we can discard all of the instructions.
However, keep the block around because it may have an address taken or the
block may have a stale reference from a PHI somewhere. Instead of finding
those PHIs and fixing them up, just leave the block empty.

Differential Revision: https://reviews.llvm.org/D111201
2021-10-05 23:06:22 -07:00
Arthur Eubanks cb89d3739d Revert "[clang] Allow printing 64 bit ints in diagnostics"
This reverts commit edfff2f8b0.

Breaks clang-tidy.
2021-10-05 22:24:16 -07:00
Arthur Eubanks 0f37081f98 Mark PassBuilder::addPass() as minsize
PassBuilder.cpp is the slowest LLVM file to compile (if only building X86).
This makes PassBuilder.o a little faster to compile and a little smaller
as well.

These methods are not performance critical at all but are instantiated many times.

83M -> 72M instructions according to perf stat.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D110782
2021-10-05 22:09:59 -07:00
Arthur Eubanks edfff2f8b0 [clang] Allow printing 64 bit ints in diagnostics
Currently we're limited to 32 bit ints in diagnostics.
With support for 4GB alignments coming soon, we need to report 4GB as the max alignment allowed.
I've tested that this does indeed properly print 2^32.

Reviewed By: rsmith

Differential Revision: https://reviews.llvm.org/D111184
2021-10-05 22:07:16 -07:00
David Carlier 18a7ebda99 [Sanitizers] intercept md5 and sha* apis on FreeBSD.
Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D110989
2021-10-06 06:01:50 +01:00
Vitaly Buka 3129aa5caf [NFC][sanitizers] Add StackDepotBase Node::hash_type
Depends on D111177.

Differential Revision: https://reviews.llvm.org/D111182
2021-10-05 20:54:06 -07:00
Vitaly Buka 5ae9a3e4bf [NFC][sanitizer] Add MurMur2Hash64Builder
Depends on D111176.

Differential Revision: https://reviews.llvm.org/D111177
2021-10-05 20:54:06 -07:00
Vitaly Buka dc603b0e53 [NFC][sanitizer] Add basic hash test
Differential Revision: https://reviews.llvm.org/D111176
2021-10-05 20:54:06 -07:00
Michael Forster 02c018394e (test commit) Fix capitalization in README.md
This commit primarily checks that my newly acquired commit access works.
But this is also a real spelling fix.
2021-10-06 05:34:31 +02:00
Lang Hames 2167bc1b05 [JITLink][MachO][arm64] Make testcase less brittle.
The operand value is sign extended, so the test broke when sections were
re-ordered. The new test should be robust to reorderings.
2021-10-05 19:58:34 -07:00
Mehdi Amini 00b7d95182 Stop stripping the `std.` prefix when printing operations in a region with a defined default dialect
This fixes round-trip / ambiguity when an operation in the standard dialect would
have the same name as an operation in the default dialect.

Differential Revision: https://reviews.llvm.org/D111204
2021-10-06 02:36:14 +00:00
Philip Reames d60bfa6f19 Address a rst format error caught by buildbot 2021-10-05 18:58:08 -07:00
Philip Reames e64ed3c8df [test] autogen a couple of additional tests 2021-10-05 18:58:08 -07:00
kpyzhov 7e390dfea7 [AMDGPU] Correction to 095c48fdf3.
Differential Revision: https://reviews.llvm.org/D110337
2021-10-05 21:47:25 -04:00