Commit Graph

379456 Commits

Author SHA1 Message Date
Tim Northover c93d50dd71 AArch64: use a constpool for blockaddress(...) on MachO
More MachO madness for everyone. MachO relocations are only 32-bits, which
means the ARM64_RELOC_ADDEND one only actually has 24 (signed) bits for the
actual addend. This is a problem when calculating the address of a basic block;
because it has no symbol of its own, the sequence

	adrp x0, Ltmp0@PAGE
	add x0, x0, x0 Ltmp0@PAGEOFF

is represented by relocation with an addend that contains the offset from the
function start to Ltmp, and so the largest function where this is guaranteed to
work is 8MB. That's not quite big enough that we can call it user error (IMO).

So this patch puts the any blockaddress into a constant-pool, where the addend
is instead stored in the (x)word being relocated, which is obviously big enough
for any function.
2021-02-08 15:13:29 +00:00
Jamie Schmeiser 4b661b4059 Introduce -print-changed=[diff | diff-quiet] which show changes in patch-like format
Summary:
Introduce base classes that hold a textual represent of the IR
based on basic blocks and a base class for comparing this
representation.  A new change printer is introduced that uses these
classes to save and compare representations of the IR before and after
each pass.  It only reports when changes are made by a pass (similar to
-print-changed) except that the changes are shown in a patch-like format
with those lines that are removed shown in red prefixed with '-' and those
added shown in green with '+'.  This functionality was introduced in my
tutorial at the 2020 virtual developer's meeting.

Author: Jamie Schmeiser <schmeise@ca.ibm.com>
Reviewed By: aeubanks (Arthur Eubanks)
Differential Revision: https://reviews.llvm.org/D91890
2021-02-08 10:11:22 -05:00
Simon Pilgrim c5c690a835 [DAG] visitVECTOR_SHUFFLE - move shuffle legality check into MergeInnerShuffle lamda. NFCI.
This is going to be necessary for a future reuse of MergeInnerShuffle
2021-02-08 14:25:16 +00:00
Mikael Holmen eb8c27c60c [RISCV] Use std::make_tuple to make some toolchains happy again
My toolchain (LLVM 8.0, libstdc++ 5.4.0) complained with:

12:38:19 ../lib/Target/RISCV/RISCVISelLowering.cpp:1717:12: error: chosen constructor is explicit in copy-initialization
12:38:19     return {RISCVISD::VECREDUCE_FADD, Op.getOperand(0),
12:38:19            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
12:38:19 /proj/flexasic/app/llvm/8.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.4.0/../../../../include/c++/5.4.0/tuple:479:19: note: explicit constructor declared here
12:38:19         constexpr tuple(_UElements&&... __elements)
12:38:19                   ^
12:38:19 ../lib/Target/RISCV/RISCVISelLowering.cpp:1720:12: error: chosen constructor is explicit in copy-initialization
12:38:19     return {RISCVISD::VECREDUCE_SEQ_FADD, Op.getOperand(1), Op.getOperand(0)};
12:38:19            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
12:38:19 /proj/flexasic/app/llvm/8.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.4.0/../../../../include/c++/5.4.0/tuple:479:19: note: explicit constructor declared here
12:38:19         constexpr tuple(_UElements&&... __elements)
12:38:19                   ^
12:38:19 2 errors generated.

This commit adds explicit calls to std::make_tuple to work around
the problem.
2021-02-08 14:37:25 +01:00
Nicholas Guy cd880442ae [CodeGen][AArch64] Add TargetInstrInfo hook to modify the TailDuplicateSize default threshold
Different targets might handle branch performance differently, so this patch allows for
targets to specify the TailDuplicateSize threshold. Said threshold defines how small a branch
can be and still be duplicated to generate straight-line code instead.
This patch also specifies said override values for the AArch64 subtarget.

Differential Revision: https://reviews.llvm.org/D95631
2021-02-08 13:28:00 +00:00
KareemErgawy-TomTom 88d5c4c2ee [MLIR][SPIRV] NFC: Split serialization code among multiple files.
Following up on https://reviews.llvm.org/D94360, this patch splits the
serialization code into multiple source files to provide a better
structure and allow parallel compilation.

Reviewed By: antiagainst

Differential Revision: https://reviews.llvm.org/D95855
2021-02-08 14:15:31 +01:00
Florian Hahn 1f1f037ed3
[ConstraintElimination] Improve index handing during constraint building.
This patch improves the index management during constraint building.
Previously, the code rejected constraints which used values that were not
part of Value2Index, but after combining the coefficients of the new
indices were 0 (if ShouldAdd was 0).

In those cases, no new indices need to be added. Instead of adding to
Value2Index directly, add new indices to the NewIndices map. The caller
can then check if it needs to add any new indices.

This enables checking constraints like `a + x <= a + n` to `x <= n`,
even if there is no constraint for `a` directly.
2021-02-08 13:05:13 +00:00
Jay Foad d8323b1a86 [AMDGPU] Generate test checks and add GFX10 test coverage
Differential Revision: https://reviews.llvm.org/D96143
2021-02-08 12:57:51 +00:00
Jeremy Morse c1d45abda5 Revert "Re-land D94976 after revert in e29552c5aff6"
Maskray has reported a fault with .debug_gnu_pubnames in the comments on
D94976, caused by this patch, reverting to investigate.

This reverts commit 8998f58435.
2021-02-08 12:41:12 +00:00
Jeremy Morse 6ade2dea7b Revert "DebugInfo: Temporarily work around -gsplit-dwarf + LTO .debug_gnu_pubnames regression after D94976"
Backing out this workaround to focus on fixing whatever's wrong with
.debug_gnu_pubnames, I'll revert the cause, (8998f584) in the next commit.

This reverts commit 56fa34ae35.
2021-02-08 12:41:01 +00:00
einvbri 9083d0a40d Revert "[Sema] Fix -Warray-bounds false negative when casting an out-of-bounds array item"
This reverts commit e48f444751.

thakis noticed false reports, so reverting this change for now until
those can be sorted out.

See https://reviews.llvm.org/D71714
2021-02-08 06:38:31 -06:00
Kadir Cetinkaya f743184911
[clang][CodeComplete] Fix crash on ParenListExprs
Fixes https://github.com/clangd/clangd/issues/676.

Differential Revision: https://reviews.llvm.org/D95935
2021-02-08 13:16:49 +01:00
Jan Svoboda e22677bbdb Reapply "[clang][cli] Report result of ParseLangArgs"
This reverts commit 6039f821 and reapplies bff6d9bb.

Clang's Index/implicit-attrs.m test invokes c-index-test with -fobjc-arc. This flag is not compatible with -fobjc-runtime=gcc, which gets implied on Linux.

The original commit uncovered this by correctly reporting issues when parsing -cc1 command line.

This commit fixes the test to explicitly provide ObjectiveC runtime compatible with ARC.
2021-02-08 13:14:43 +01:00
Tatyana Krasnukha 05d7d6949c [lldb/tests] Removed add_test_categories decorator for python API tests, NFC
There is a .categories file in the python_api directory that makes all nested tests
belong to the category "pyapi". The decorator is unnecessary for these tests.
2021-02-08 15:10:48 +03:00
Tatyana Krasnukha f9c5e1664e [lldb/tests] Un-skip TestGuiBasicDebug.py on Arm and AArch64
The test was timing out because of https://reviews.llvm.org/D92164, it should pass now.
2021-02-08 15:09:09 +03:00
Tatyana Krasnukha 36de94cf54 Reland "[lldb] Make CommandInterpreter's execution context the same as debugger's one" 2021-02-08 15:09:09 +03:00
Tatyana Krasnukha a39bcbca92 [lldb] Debugger: reuse ExecutionContextRef to create ExecutionContext from Target
The Debugger didn't take the Process's run lock, that causes deadlocks and races
after applying https://reviews.llvm.org/D92164 revision. Since ExecutionContextRef
does the same job correctly, Debugger::GetSelectedExecutionContext just can use it
to build execution context upon the selected target.
2021-02-08 15:09:08 +03:00
Thomas Symalla f89f6d1e5d [AMDGPU]: Fixes an invalid clamp selection pattern.
When running the tests on PowerPC and x86, the lit test GlobalISel/trunc.ll fails at the memory sanitize step. This seems to be due to wrong invalid logic (which matches even if it shouldn't) and likely missing variable initialisation."

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D95878
2021-02-08 13:06:30 +01:00
KareemErgawy-TomTom 86bde76b29 [MLIR][LangRef doc] Fix a small typo.
Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D95937
2021-02-08 12:44:02 +01:00
David Green 11e415dc90 [ARM] Make v2f64 scalar_to_vector legal
Because we mark all operations as expand for v2f64, scalar_to_vector
would end up lowering through a stack store/reload. But it is pretty
simple to implement, only inserting a D reg into an undef vector. This
helps clear up some inefficient codegen from soft calling conventions.

Differential Revision: https://reviews.llvm.org/D96153
2021-02-08 11:34:55 +00:00
Dmitry Preobrazhensky 05433a8d03 [AMDGPU][MC] Corrected error position for invalid dim modifiers
Fixed bug 49054.

Differential Revision: https://reviews.llvm.org/D96117
2021-02-08 14:32:28 +03:00
Jeremy Morse 4fd29e4fd3 Follow up to e05c10380ce7: add aarch64 to test XFails 2021-02-08 11:30:55 +00:00
David Green f953b3cce6 [ARM] Testing for stored extracted values. NFC 2021-02-08 11:12:39 +00:00
David Green 183fe9ddf2 [ARM] Add some float Biquad cases showing difficult shuffling. NFC 2021-02-08 11:12:39 +00:00
Dmitry Preobrazhensky 168ccc8ecb [AMDGPU][MC][GFX10] Improved errors reporting for invalid MIMG NSA operands
Differential Revision: https://reviews.llvm.org/D96118
2021-02-08 14:04:28 +03:00
Sander de Smalen ba8637ca84 [ValueTypes] Fix size of nxv1f16 (32 -> 16).
Clearly seems like this was a typo.
2021-02-08 11:00:47 +00:00
Sven van Haastregt a016374d07 [OpenCL] Do not enforce ASTContext for OCL2Qual
Do not enforce that the expression to obtain the QualType for an
OpenCL type starts with an ASTContext.  This adds the required
flexibility for handling the remaining missing argument types such as
enums.

Differential Revision: https://reviews.llvm.org/D96050
2021-02-08 10:56:39 +00:00
Muhammad Omair Javaid d813c37fc7 [LLDB] Fix buildbot regression in symbol-binding.test
This patch fixes regression in symbol-binding.test due to change in
symbol order.
2021-02-08 15:20:39 +05:00
Jeremy Morse e05c10380c [DebugInfo] Re-engineer a test to be stricter, add XFails
In the LLVM-IR for this test, the inlined argument "b" in the "a" function
is optimized out on certain architectures, not on others. This hasn't been
reported as a test failure since 93faeecd8f and ff2073a51 because we would
create a variable that looks like this:

  DW_TAG_formal_parameter
    DW_AT_abstract_origin

With no further information (and no location). With D95617 however, we
stop emitting such variables.

Prior to landing D95617: make this test stricter by checking that the
variable mentioned above has a location. We have to accept that on certain
architectures this goes missing, so add those to the XFail list.

I've run a few experiments, and right now it looks likely only powerpc64
still drops the variable location.
2021-02-08 10:12:33 +00:00
Fraser Cormack b46aac125d [RISCV] Support the scalable-vector fadd reduction intrinsic
This patch adds support for both the fadd reduction intrinsic, in both
the ordered and unordered modes.

The fmin and fmax intrinsics are not currently supported due to a
discrepancy between the LLVM semantics and the RVV ISA behaviour with
regards to signaling NaNs. This behaviour is likely fixed in version 2.3
of the RISC-V F/D/Q extension, but until then the intrinsics can be left
unsupported.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D95870
2021-02-08 09:52:27 +00:00
David Sherwood 3bbaece5a0 [Analysis] Remove unused functions from TargetLibraryInfo
A simple clean-up to remove dead code.

Differential Revision: https://reviews.llvm.org/D95934
2021-02-08 09:50:36 +00:00
Tres Popp c2c83e97c3 Revert "Revert "Reorder MLIRContext location in BuiltinAttributes.h""
This reverts commit 511dd4f438 along with
a couple fixes.

Original message:
Now the context is the first, rather than the last input.

This better matches the rest of the infrastructure and makes
it easier to move these types to being declaratively specified.

Phabricator: https://reviews.llvm.org/D96111
2021-02-08 10:39:58 +01:00
Simon Pilgrim db5abfbbb4 [WebAssembly] Fix multiclass template parameter types. NFC.
Fixes TableGen parser errors reported by D95874 due to incompatible types being used on multiclass templates.

Differential Revision: https://reviews.llvm.org/D96205
2021-02-08 09:36:56 +00:00
Jan Svoboda 6039f82145 Revert "[clang][cli] Report result of ParseLangArgs"
This reverts commit bff6d9bb

The change causes failure of Clang's Index/implicit-attrs.m test.
2021-02-08 10:18:15 +01:00
Jan Svoboda 63623982e1 [clang][cli] NFC: Mirror CreateFromArgs order in generateCC1CommandLine 2021-02-08 10:12:51 +01:00
Muhammad Omair Javaid 8561ad9296 Use remote regnums in expedited list, value regs and invalidate regs
Native register descriptions in LLDB specify lldb register numbers in
value_regs and invalidate_regs lists. These register numbers may not
match with Process gdb-remote register numbers which are generated by
native process after counting all registers in its register sets.

It was coincidentally not causing any problems as we never came across
a native target with dynamically changing register sets and register
numbers generated by counter matched with LLDB native register numbers.
This came up while testing target AArch64 SVE which can choose register
sets based on underlying hardware.

This patch fixes this behavior and always tries to use remote register
numbers while reading/writing registers over gdb-remote protocol.

Reviewed By: labath

Differential Revision: https://reviews.llvm.org/D77043
2021-02-08 14:09:15 +05:00
Muhammad Omair Javaid bec6b5e3ce [LLDB] Disable TestExprsChar.py, still fails on Arm/Linux
TestExprsChar.py was enabled on Arm as it passes on apple silicon but
still fails on Arm/Linux.
2021-02-08 14:05:36 +05:00
Jan Svoboda bff6d9bb0f [clang][cli] Report result of ParseLangArgs
This patch correctly reports success/failure of `ParseLangArgs`. Besides being consistent with  other `Parse` functions, this is required to make round-tripping of `LangOptions` work.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D95792
2021-02-08 09:56:33 +01:00
Raphael Isemann 0ebf904baf [modules] Put Frontend/OpenMP headers into a Clang module to fix the module build
These headers can be in a Clang module like the rest. This also fixes the
modules build that is currently struggling with these headers being textually
included in several other modules.
2021-02-08 09:54:45 +01:00
Jan Svoboda c1b482e726 [clang][index] Mark file as C++ in parse-all-comments test
`CompilerInvocation::CreateFromArgs` doesn't always report command line parsing failures through the return value. Sometimes, errors are only reported via diagnostics.

Some clients like `c-index-test` only check the return value and don't check the state of `DiagnosticsEngine`.

If we were to start returning the correct return value from `CreateFromArgs`, this index test starts to fail, because it specifies `-std=c++11` for a C input, which is invalid.

This patch fixes that issue by adding forgotten `-x c++` argument.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D95879
2021-02-08 09:42:44 +01:00
David Green 1b435eb8f3 [ARM] i16 insert-of-extract to VINS pattern
This adds another tablegen fold that converts an i16 odd-lane-insert of
an even-lane-extract into a VINS. We extract the existing f32 value from
the destination register and VINS the new value into it. The rest of the
backend then is able to optimize the INSERT_SUBREG / COPY_TO_REGCLASS /
EXTRACT_SUBREG.

Differential Revision: https://reviews.llvm.org/D95456
2021-02-08 08:41:07 +00:00
Jan Svoboda 0c42d87ea8 [clang][cli] Generate and round-trip preprocessor options
This patch implements generation of remaining preprocessor options and tests it by performing parse-generate-parse round trip.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D95366
2021-02-08 09:34:55 +01:00
Tres Popp 511dd4f438 Revert "Reorder MLIRContext location in BuiltinAttributes.h"
This reverts commit 7827753f98.
2021-02-08 09:32:42 +01:00
Tres Popp 7827753f98 Reorder MLIRContext location in BuiltinAttributes.h
Now the context is the first, rather than the last input.

This better matches the rest of the infrastructure and makes
it easier to move these types to being declaratively specified.

Differential Revision: https://reviews.llvm.org/D96111
2021-02-08 09:28:09 +01:00
Jan Svoboda 0e07383433 [clang][cli] Generate and round-trip analyzer options
This patch implements generation of remaining analyzer options and tests it by performing parse-generate-parse round trip.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D95369
2021-02-08 09:26:01 +01:00
Djordje Todorovic 9abd8c1a4c [elf-core] Improve reading memory from core file
This patch tries to improve memory-read from core files
(in order to improve disassembly functionality).

I am using RHEL 7.7 (linux kernel 3.10) and for a lot of cases,
I was not able to disassemble some functions from backtrace when
debugging crashes from core files. It outputs some dummy code.

The cause of the problem was the fact we are returning all the zeros
from ProcessElfCore::ReadMemory() that is being called within
Disassembler::ParseInstructions() and it disassembles some dummy
opcodes from the buffer returned. Therefore, we are removing zero
bytes filling (padding) completely.

Differential Revision: https://reviews.llvm.org/D93939
2021-02-08 00:14:32 -08:00
Vladislav Vinogradov 035abe30c9 [mlir][ODS] Allow to specify custom namespace for `NativeOpTrait`
This will allow to use `NativeOpTrait` and Operations
declared outside of `mlir` namespace.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D96128
2021-02-08 10:25:45 +03:00
Max Kazantsev 0fc1738eb7 [Test] Add failing test for PR49087 2021-02-08 13:18:22 +07:00
Daniel Hwang d72859ffa2 [scan-build-py] Update scan-build-py to allow outputing as SARIF
clang static analysis reports can be generated in html, plist, or sarif
format. This updates scan-build-py to be able to specify SARIF as the
desired output format, as previously it only support plist and html
formats.

Differential Revision: https://reviews.llvm.org/D94251
2021-02-07 18:25:50 -08:00
Fangrui Song d3e13b58cd ELFObjectWriter: Don't de-duplicate STT_FILE symbols 2021-02-07 18:21:36 -08:00