Florian Hahn [Mon, 8 Feb 2021 12:28:52 +0000 (12:28 +0000)]
[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.
Jay Foad [Fri, 5 Feb 2021 15:03:04 +0000 (15:03 +0000)]
[AMDGPU] Generate test checks and add GFX10 test coverage
Differential Revision: https://reviews.llvm.org/D96143
Jeremy Morse [Mon, 8 Feb 2021 12:33:56 +0000 (12:33 +0000)]
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
8998f5843503773c2f51fd475e2c77c687a65ee6.
Jeremy Morse [Mon, 8 Feb 2021 11:37:53 +0000 (11:37 +0000)]
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
56fa34ae3570a34fd0f4c2cf1bfaf095da01a959.
einvbri [Mon, 8 Feb 2021 12:38:31 +0000 (06:38 -0600)]
Revert "[Sema] Fix -Warray-bounds false negative when casting an out-of-bounds array item"
This reverts commit
e48f444751cf781c42934b242b81f549da77bad0.
thakis noticed false reports, so reverting this change for now until
those can be sorted out.
See https://reviews.llvm.org/D71714
Kadir Cetinkaya [Wed, 3 Feb 2021 11:45:46 +0000 (12:45 +0100)]
[clang][CodeComplete] Fix crash on ParenListExprs
Fixes https://github.com/clangd/clangd/issues/676.
Differential Revision: https://reviews.llvm.org/D95935
Jan Svoboda [Mon, 8 Feb 2021 09:38:01 +0000 (10:38 +0100)]
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.
Tatyana Krasnukha [Wed, 3 Feb 2021 22:02:31 +0000 (01:02 +0300)]
[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.
Tatyana Krasnukha [Wed, 3 Feb 2021 20:35:35 +0000 (23:35 +0300)]
[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.
Tatyana Krasnukha [Fri, 18 Dec 2020 13:36:15 +0000 (16:36 +0300)]
Reland "[lldb] Make CommandInterpreter's execution context the same as debugger's one"
Tatyana Krasnukha [Mon, 1 Feb 2021 19:24:30 +0000 (22:24 +0300)]
[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.
Thomas Symalla [Tue, 2 Feb 2021 17:01:48 +0000 (18:01 +0100)]
[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
KareemErgawy-TomTom [Mon, 8 Feb 2021 11:22:01 +0000 (12:22 +0100)]
[MLIR][LangRef doc] Fix a small typo.
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D95937
David Green [Mon, 8 Feb 2021 11:34:55 +0000 (11:34 +0000)]
[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
Dmitry Preobrazhensky [Mon, 8 Feb 2021 11:31:08 +0000 (14:31 +0300)]
[AMDGPU][MC] Corrected error position for invalid dim modifiers
Fixed bug 49054.
Differential Revision: https://reviews.llvm.org/D96117
Jeremy Morse [Mon, 8 Feb 2021 11:30:55 +0000 (11:30 +0000)]
Follow up to
e05c10380ce7: add aarch64 to test XFails
David Green [Mon, 8 Feb 2021 11:12:39 +0000 (11:12 +0000)]
[ARM] Testing for stored extracted values. NFC
David Green [Mon, 8 Feb 2021 10:50:23 +0000 (10:50 +0000)]
[ARM] Add some float Biquad cases showing difficult shuffling. NFC
Dmitry Preobrazhensky [Mon, 8 Feb 2021 10:47:24 +0000 (13:47 +0300)]
[AMDGPU][MC][GFX10] Improved errors reporting for invalid MIMG NSA operands
Differential Revision: https://reviews.llvm.org/D96118
Sander de Smalen [Fri, 5 Feb 2021 20:44:46 +0000 (20:44 +0000)]
[ValueTypes] Fix size of nxv1f16 (32 -> 16).
Clearly seems like this was a typo.
Sven van Haastregt [Mon, 8 Feb 2021 10:56:39 +0000 (10:56 +0000)]
[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
Muhammad Omair Javaid [Mon, 8 Feb 2021 10:18:05 +0000 (15:18 +0500)]
[LLDB] Fix buildbot regression in symbol-binding.test
This patch fixes regression in symbol-binding.test due to change in
symbol order.
Jeremy Morse [Mon, 8 Feb 2021 09:54:01 +0000 (09:54 +0000)]
[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
93faeecd8fa 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.
Fraser Cormack [Tue, 2 Feb 2021 14:34:51 +0000 (14:34 +0000)]
[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
David Sherwood [Wed, 3 Feb 2021 11:15:17 +0000 (11:15 +0000)]
[Analysis] Remove unused functions from TargetLibraryInfo
A simple clean-up to remove dead code.
Differential Revision: https://reviews.llvm.org/D95934
Tres Popp [Mon, 8 Feb 2021 08:44:03 +0000 (09:44 +0100)]
Revert "Revert "Reorder MLIRContext location in BuiltinAttributes.h""
This reverts commit
511dd4f4383b1c2873beac4dbea2df302f1f9d0c 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
Simon Pilgrim [Mon, 8 Feb 2021 09:35:59 +0000 (09:35 +0000)]
[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
Jan Svoboda [Mon, 8 Feb 2021 09:18:15 +0000 (10:18 +0100)]
Revert "[clang][cli] Report result of ParseLangArgs"
This reverts commit
bff6d9bb
The change causes failure of Clang's Index/implicit-attrs.m test.
Jan Svoboda [Mon, 8 Feb 2021 09:02:08 +0000 (10:02 +0100)]
[clang][cli] NFC: Mirror CreateFromArgs order in generateCC1CommandLine
Muhammad Omair Javaid [Mon, 8 Feb 2021 09:08:19 +0000 (14:08 +0500)]
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
Muhammad Omair Javaid [Mon, 8 Feb 2021 09:05:31 +0000 (14:05 +0500)]
[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.
Jan Svoboda [Mon, 8 Feb 2021 08:44:11 +0000 (09:44 +0100)]
[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
Raphael Isemann [Mon, 8 Feb 2021 08:52:09 +0000 (09:52 +0100)]
[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.
Jan Svoboda [Mon, 8 Feb 2021 08:36:28 +0000 (09:36 +0100)]
[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
David Green [Mon, 8 Feb 2021 08:41:07 +0000 (08:41 +0000)]
[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
Jan Svoboda [Mon, 8 Feb 2021 08:27:17 +0000 (09:27 +0100)]
[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
Tres Popp [Mon, 8 Feb 2021 08:32:27 +0000 (09:32 +0100)]
Revert "Reorder MLIRContext location in BuiltinAttributes.h"
This reverts commit
7827753f9810e846fb702f3e8dcff0bfb37344e1.
Tres Popp [Fri, 5 Feb 2021 08:19:57 +0000 (09:19 +0100)]
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
Jan Svoboda [Mon, 8 Feb 2021 08:04:21 +0000 (09:04 +0100)]
[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
Djordje Todorovic [Wed, 30 Dec 2020 08:38:20 +0000 (00:38 -0800)]
[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
Vladislav Vinogradov [Fri, 5 Feb 2021 12:55:59 +0000 (15:55 +0300)]
[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
Max Kazantsev [Mon, 8 Feb 2021 06:18:22 +0000 (13:18 +0700)]
[Test] Add failing test for PR49087
Daniel Hwang [Mon, 8 Feb 2021 02:22:03 +0000 (18:22 -0800)]
[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
Fangrui Song [Mon, 8 Feb 2021 02:21:36 +0000 (18:21 -0800)]
ELFObjectWriter: Don't de-duplicate STT_FILE symbols
Fangrui Song [Mon, 8 Feb 2021 01:51:40 +0000 (17:51 -0800)]
ELFObjectWriter: Make STT_FILE precede associated local symbols
Fangrui Song [Mon, 8 Feb 2021 01:39:48 +0000 (17:39 -0800)]
[MC][test] Improve STT_FILE tests
Fangrui Song [Sun, 7 Feb 2021 23:47:10 +0000 (15:47 -0800)]
ELFObjectWriter: Don't sort local symbols
GNU as does not sort local symbols. This has several advantages:
* The .symtab order is roughly the symbol occurrence order.
* The closest preceding STT_SECTION symbol is the definition of a local symbol.
* The closest preceding STT_FILE symbol is the defining file of a local symbol, if there are multiple default-version .file directives. (Not implemented in MC.)
Florian Hahn [Sun, 7 Feb 2021 20:53:06 +0000 (20:53 +0000)]
[ConstraintElimination] Decompose zext for unsigned compares.
For unsigned compares, zext should be a no-op and we can add the
extended value to the constraint system.
Florian Hahn [Sun, 7 Feb 2021 17:53:47 +0000 (17:53 +0000)]
[LV] Replace some uses of VectorLoopValueMap with VPTransformState (NFC)
This patch updates some places where VectorLoopValueMap is accessed
directly to instead go through VPTransformState.
As we move towards managing created values exclusively in VPTransformState,
this ensures the use always can fetch the correct value.
This is in preparation for D92285, which switches to managing scalarized
values through VPValues.
In the future, the various fix* functions should be moved directly into
the VPlan codegen stage.
Reviewed By: gilr
Differential Revision: https://reviews.llvm.org/D95757
Florian Hahn [Sun, 7 Feb 2021 11:54:35 +0000 (11:54 +0000)]
[ConstraintElimination] Add additional tests.
Adds additional test cases with zexts, conditions that require temporary
indices.
Kazu Hirata [Sun, 7 Feb 2021 17:49:36 +0000 (09:49 -0800)]
[Transforms/Utils] Use range-based for loops (NFC)
Kazu Hirata [Sun, 7 Feb 2021 17:49:34 +0000 (09:49 -0800)]
[TableGen] Use ListSeparator (NFC)
Kazu Hirata [Sun, 7 Feb 2021 17:49:33 +0000 (09:49 -0800)]
[SelectionDAG] Drop unnecessary const from a return type (NFC)
Identified with const-return-type.
poelmanc [Sun, 7 Feb 2021 16:34:05 +0000 (16:34 +0000)]
[clang-tidy] fix modernize-loop-convert to retain needed array-like operator[]
`modernize-loop-convert` handles //array-like// objects like vectors fairly well, but strips slightly too much information from the iteration expression by converting:
```
Vector<Vector<int>> X;
for (int J = 0; J < X[5].size(); ++J)
copyArg(X[5][J]);
```
to
```
Vector<Vector<int>> X;
for (int J : X) // should be for (int J : X[5])
copyArg(J);
```
The `[5]` is a call to `operator[]` and gets stripped by `LoopConvertCheck::getContainerString`. This patch fixes that and adds several test cases.
Reviewed By: njames93
Differential Revision: https://reviews.llvm.org/D95771
Stephen Kelly [Sun, 7 Feb 2021 00:28:20 +0000 (00:28 +0000)]
Add code complete support for mapAnyOf
Stephen Kelly [Sat, 6 Feb 2021 23:39:48 +0000 (23:39 +0000)]
Add clang-query support for mapAnyOf
Differential Revision: https://reviews.llvm.org/D94880
Stephen Kelly [Sat, 6 Feb 2021 18:59:16 +0000 (18:59 +0000)]
[ASTMatchers] Extract parsing of bind token from the bind id
This will be extended to be able to parse "with" for mapAnyOf in
addition to "bind".
Stephen Kelly [Sat, 6 Feb 2021 23:14:19 +0000 (23:14 +0000)]
[ASTMatchers] Change internal method API
This will make it possible to parse matchers built dynamically.
Stephen Kelly [Sun, 7 Feb 2021 00:09:41 +0000 (00:09 +0000)]
[ASTMatchers] Make it possible to build mapAnyOf through the registry
Stephen Kelly [Sat, 6 Feb 2021 23:48:14 +0000 (23:48 +0000)]
[ASTMatchers ]Make MatcherDescriptors indicate the node type they match
Sanjay Patel [Sun, 7 Feb 2021 14:41:46 +0000 (09:41 -0500)]
[Reassociate] allow or->add with shl operands
As discussed in:
https://llvm.org/PR49055
We invert instcombine's add->or transform here
because it makes it easier to identify factorization
transforms like the mul in the motivating test.
This extends the logic added with:
https://reviews.llvm.org/rG70472f3
https://reviews.llvm.org/rG93f3d7f
(I intentionally kept the formatting fix in this patch
to provide more context about the calling logic.)
Stephen Kelly [Sat, 6 Feb 2021 23:28:50 +0000 (23:28 +0000)]
Make it possible to store NodeKinds in ArgKind
Stephen Kelly [Sat, 6 Feb 2021 16:23:30 +0000 (16:23 +0000)]
[ASTMatchers] Add static constructor for ArgKinds of Matchers
It will soon be possible to store a node kind in an ArgKind, which will
also be contructed with an ASTNodeKind. The desired Kind must be
expicit.
Simon Pilgrim [Sun, 7 Feb 2021 13:27:57 +0000 (13:27 +0000)]
[DAG] SelectionDAG::isSplatValue - handle OR/XOR cases
Add OR/XOR to the basic binops that we support when checking for a splat vector value
Simon Pilgrim [Sun, 7 Feb 2021 11:41:43 +0000 (11:41 +0000)]
[X86][AVX] Fold extract_subvector(splat, c) -> extract_subvector(splat, 0)
We already do this for VBROADCASTs, extend this for any splat that SelectionDAG::isSplatValue recognises as well.
Florian Hahn [Sun, 7 Feb 2021 11:07:49 +0000 (11:07 +0000)]
[ConstraintElimination] Require GEPs to be inbounds for decomposition.
During decomposition, we assume the no-wrap properties of inbound GEPs.
Make sure the decomposed GEP is actually inbounds.
Craig Topper [Sun, 7 Feb 2021 06:31:38 +0000 (22:31 -0800)]
[TableGen] Make all the fields in PatternToMatch private. NFCI
Add the few missing accessor methods. Use accessor methdods
everywhere.
Florian Hahn [Thu, 28 Jan 2021 16:34:09 +0000 (16:34 +0000)]
[ConstraintElimination] Extend test coverage.
This patch adds a lot of additional tests, focusing on loops and GEP
arithmetic. Some of the tests expose existing problems, which will be
fixed soon.
Fangrui Song [Sat, 6 Feb 2021 19:56:15 +0000 (11:56 -0800)]
[Polly] Fix build after AssumptionCache change (D96168)
Dave Lee [Wed, 3 Feb 2021 00:24:03 +0000 (16:24 -0800)]
[lldb] Use assertIn/NotIn over assertTrue/False (NFC)
For improved failure messages, use `assertIn` over `assertTrue`.
Differential Revision: https://reviews.llvm.org/D96095
Fangrui Song [Sat, 6 Feb 2021 19:50:57 +0000 (11:50 -0800)]
[ELF][test] Improve aarch64 tests
Kazu Hirata [Sat, 6 Feb 2021 19:17:09 +0000 (11:17 -0800)]
[Analysis] Use range-based for loops (NFC)
Kazu Hirata [Sat, 6 Feb 2021 19:17:08 +0000 (11:17 -0800)]
[TableGen] Use ListSeparator (NFC)
Kazu Hirata [Sat, 6 Feb 2021 19:17:06 +0000 (11:17 -0800)]
[IR] Drop unnecessary const from return types (NFC)
Identified with const-return-type.
Craig Topper [Sat, 6 Feb 2021 18:28:38 +0000 (10:28 -0800)]
[X86] Don't pass a 1 to the second argument of ISD::FP_ROUND in LowerFCOPYSIGN.
I don't think we have any reason to believe the FP_ROUND here doesn't change the value.
Found while trying to see if we still need the fp128 block in CanCombineFCOPYSIGN_EXTEND_ROUND.
Removing that check caused this FP_ROUND to fire for fp128 which introduced a libcall expansion that asserted for this being a 1.
Reviewed By: RKSimon, pengfei
Differential Revision: https://reviews.llvm.org/D96098
Johannes Doerfert [Fri, 5 Feb 2021 16:53:33 +0000 (10:53 -0600)]
[AssumptionCache] Avoid dangling llvm.assume calls in the cache
PR49043 exposed a problem when it comes to RAUW llvm.assumes. While
D96106 would fix it for GVNSink, it seems a more general concern. To
avoid future problems this patch moves away from the vector of weak
reference model used in the assumption cache. Instead, we track the
llvm.assume calls with a callback handle which will remove itself from
the cache if the call is deleted.
Fixes PR49043.
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D96168
Johannes Doerfert [Sat, 6 Feb 2021 17:42:02 +0000 (11:42 -0600)]
[AssumptionCache] Do not track llvm.assume calls (PR49043)
This fixes PR49043 by invalidating the handle on RAUW. This will work
fine assuming all existing RAUW users add the new assumption to the
cache. That means, if a new llvm.assume call replaces an old one, you
need to add the new one now as a RAUW is not enough anymore.
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D96208
Nikita Popov [Sat, 6 Feb 2021 17:14:21 +0000 (18:14 +0100)]
[LSR] Add test for multi-edge latch (NFC)
This is additional test coverage for D72519.
Teresa Johnson [Thu, 4 Feb 2021 22:53:17 +0000 (14:53 -0800)]
[LTT] Don't attempt to lower type tests used only by assumes
Type tests used only by assumes were original for devirtualization, but
are meant to be kept through the first invocation of LTT so that they
can be used for additional optimization. In the regular LTO case where
the IR is analyzed we may find a resolution for the type test and end up
rewriting the associated vtable global, which can have implications on
section splitting. Simply ignore these type tests.
Fixes PR48245.
Differential Revision: https://reviews.llvm.org/D96083
Heejin Ahn [Fri, 1 Jan 2021 09:03:21 +0000 (01:03 -0800)]
[WebAssembly] Update InstPrinter and AsmParser for new EH instructions
This updates InstPrinter and AsmParser for `delegate` and `catch_all`
instructions. Both will reject programs with multiple `catch_all`s per a
single `try`. And InstPrinter uses `EHInstStack` to figure out whether
to print catch label comments: It does not print catch label comments
for second `catch` or `catch_all` in a `try`.
Reviewed By: aardappel
Differential Revision: https://reviews.llvm.org/D94051
LLVM GN Syncbot [Sat, 6 Feb 2021 16:40:55 +0000 (16:40 +0000)]
[gn build] Port
be0efa1f2368
Heejin Ahn [Fri, 1 Jan 2021 09:02:52 +0000 (01:02 -0800)]
[WebAssembly] Handle EH terminate pads for cleanup
Terminate pads, cleanup pads with `__clang_call_terminate` call, have
`catch` instruction in them because `__clang_call_terminate` takes an
exception pointer. But these terminate pads should be reached also in
case of foreign exception. So this pass attaches an additional
`catch_all` BB after every terminate pad BB, with a call to
`std::terminate`.
Reviewed By: tlively
Differential Revision: https://reviews.llvm.org/D94050
Simon Pilgrim [Sat, 6 Feb 2021 15:58:02 +0000 (15:58 +0000)]
[X86][AVX] canonicalizeLaneShuffleWithRepeatedOps - merge VPERMILPD ops with different low/high masks.
Now that PR48908 has been dealt with, we can handle v4f64 permute cases by extracting the low/high lane VPERMILPD masks and creating a new mask based on which lanes are referenced by the VPERM2F128 mask.
Simon Pilgrim [Sat, 6 Feb 2021 15:39:26 +0000 (15:39 +0000)]
[PowerPC] Fix multiclass template parameter types. NFC.
Fixes TableGen parser errors reported by D95874.
Simon Pilgrim [Sat, 6 Feb 2021 15:33:09 +0000 (15:33 +0000)]
[Sparc] Fix multiclass template parameter types. NFC.
Fixes TableGen parser errors reported by D95874.
Simon Pilgrim [Sat, 6 Feb 2021 15:27:49 +0000 (15:27 +0000)]
[Hexagon] Fix multiclass template parameter types. NFC.
Fixes TableGen parser errors reported by D95874.
Heejin Ahn [Thu, 31 Dec 2020 06:29:38 +0000 (22:29 -0800)]
[WebAssembly] Fix catch unwind mismatches
This fixes unwind destination mismatches caused by 'catch'es, which
occur when a foreign exception is not caught by the nearest `catch` and
the next outer `catch` is not the catch it should unwind to, or the next
unwind destination should be the caller instead. This kind of mismatches
didn't exist in the previous version of the spec, because in the
previous spec `catch` was effectively `catch_all`, catching all
exceptions.
Reviewed By: tlively
Differential Revision: https://reviews.llvm.org/D94049
Heejin Ahn [Mon, 28 Dec 2020 13:10:22 +0000 (05:10 -0800)]
[WebAssembly] Fix call unwind mismatches
This adds `delegate` instruction and use it to fix unwind destination
mismatches created by marker placement in CFGStackify.
There are two kinds of unwind destination mismatches:
- Mismatches caused by throwing instructions (here we call it "call
unwind mismatches", even though `throw` and `rethrow` can also cause
mismatches)
- Mismatches caused by `catch`es, in case a foreign exception is not
caught by the nearest `catch` and the next outer `catch` is not the
catch it should unwind to. This kind of mismatches didn't exist in the
previous version of the spec, because in the previous spec `catch` was
effectively `catch_all`, catching all exceptions.
This implements routines to fix the first kind of unwind mismatches,
which we call "call unwind mismatches". The second mismatch (catch
unwind mismatches) will be fixed in a later CL.
This also reenables all previously disabled tests in cfg-stackify-eh.ll
and updates FileCheck lines to match the new spec. Two tests were
deleted because they specifically tested the way we fixed unwind
mismatches before using `exnref`s and branches, which we don't do
anymore.
Reviewed By: tlively
Differential Revision: https://reviews.llvm.org/D94048
Sander de Smalen [Thu, 21 Jan 2021 09:14:31 +0000 (09:14 +0000)]
NFC: Migrate LoopIdiomRecognize to work on InstructionCost
This patch migrates cost values and arithmetic to work on InstructionCost.
When the interfaces to TargetTransformInfo are changed, any InstructionCost
state will propagate naturally.
See this patch for the introduction of the type: https://reviews.llvm.org/D91174
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2020-November/146408.html
David Green [Sat, 6 Feb 2021 14:34:14 +0000 (14:34 +0000)]
[AArch64] Correct some tablegen operand types. NFC
Sander de Smalen [Fri, 5 Feb 2021 12:01:21 +0000 (12:01 +0000)]
NFC: Migrate LoopFlatten to work on InstructionCost.
This patch migrates cost values and arithmetic to work on InstructionCost.
When the interfaces to TargetTransformInfo are changed, any InstructionCost
state will propagate naturally.
See this patch for the introduction of the type: https://reviews.llvm.org/D91174
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2020-November/146408.html
Reviewed By: david-arm
Differential Revision: https://reviews.llvm.org/D96029
Tung D. Le [Sat, 6 Feb 2021 07:59:32 +0000 (13:29 +0530)]
[MLIR] [affine-loop-fusion] Fix a bug about non-result ops in affine-loop-fusion
This patch fixes the following bug when calling --affine-loop-fusion
Input program:
```mlir
func @should_not_fuse_since_top_level_non_affine_non_result_users(
%in0 : memref<32xf32>, %in1 : memref<32xf32>) {
%c0 = constant 0 : index
%cst_0 = constant 0.000000e+00 : f32
affine.for %d = 0 to 32 {
%lhs = affine.load %in0[%d] : memref<32xf32>
%rhs = affine.load %in1[%d] : memref<32xf32>
%add = addf %lhs, %rhs : f32
affine.store %add, %in0[%d] : memref<32xf32>
}
store %cst_0, %in0[%c0] : memref<32xf32>
affine.for %d = 0 to 32 {
%lhs = affine.load %in0[%d] : memref<32xf32>
%rhs = affine.load %in1[%d] : memref<32xf32>
%add = addf %lhs, %rhs: f32
affine.store %add, %in0[%d] : memref<32xf32>
}
return
}
```
call --affine-loop-fusion, we got an incorrect output:
```mlir
func @should_not_fuse_since_top_level_non_affine_non_result_users(%arg0: memref<32xf32>, %arg1: memref<32xf32>) {
%c0 = constant 0 : index
%cst = constant 0.000000e+00 : f32
store %cst, %arg0[%c0] : memref<32xf32>
affine.for %arg2 = 0 to 32 {
%0 = affine.load %arg0[%arg2] : memref<32xf32>
%1 = affine.load %arg1[%arg2] : memref<32xf32>
%2 = addf %0, %1 : f32
affine.store %2, %arg0[%arg2] : memref<32xf32>
%3 = affine.load %arg0[%arg2] : memref<32xf32>
%4 = affine.load %arg1[%arg2] : memref<32xf32>
%5 = addf %3, %4 : f32
affine.store %5, %arg0[%arg2] : memref<32xf32>
}
return
}
```
This happened because when analyzing the source and destination nodes,
affine loop fusion ignored non-result ops sandwitched between them. In
other words, the MemRefDependencyGraph in the affine loop fusion ignored
these non-result ops.
This patch solves the issue by adding these non-result ops to the
MemRefDependencyGraph.
Reviewed By: bondhugula
Differential Revision: https://reviews.llvm.org/D95668
Fangrui Song [Sat, 6 Feb 2021 05:45:21 +0000 (21:45 -0800)]
.gcc_except_table: Set SHF_LINK_ORDER if binutils>=2.36, and drop unneeded unique ID for -fno-unique-section-names
GNU ld>=2.36 supports mixed SHF_LINK_ORDER and non-SHF_LINK_ORDER sections in an
output section, so we can set SHF_LINK_ORDER if -fbinutils-version=2.36 or above.
If -fno-function-sections or older binutils, drop unique ID for -fno-unique-section-names.
The users can just specify -fbinutils-version=2.36 or above to allow GC with both GNU ld and LLD.
(LLD does not support garbage collection of non-group non-SHF_LINK_ORDER .gcc_except_table sections.)
Fangrui Song [Sat, 6 Feb 2021 05:35:27 +0000 (21:35 -0800)]
[ELF] --gc-sections: collect unused SHF_LINK_ORDER .gcc_except_table
A SHF_LINK_ORDER .gcc_except_table is similar to a .gcc_except_table in
a section group. The associated text section is responsible for retaining it.
LLD still does not support GC of non-group non-SHF_LINK_ORDER .gcc_except_table -
but that is not necessary because we can teach the compiler to set SHF_LINK_ORDER.
Kazu Hirata [Sat, 6 Feb 2021 05:02:07 +0000 (21:02 -0800)]
[Transforms/Instrumentation] Use range-based for loops (NFC)
Kazu Hirata [Sat, 6 Feb 2021 05:02:06 +0000 (21:02 -0800)]
[llvm] Fix header guards (NFC)
Identified with llvm-header-guard.
Kazu Hirata [Sat, 6 Feb 2021 05:02:04 +0000 (21:02 -0800)]
[AMDGPU] Drop unnecessary const from a return type (NFC)
Identified with const-return-type.
Fangrui Song [Sat, 6 Feb 2021 03:53:06 +0000 (19:53 -0800)]
[AsmPrinter] __patchable_function_entries: Set SHF_LINK_ORDER for binutils 2.36 and above
This matches GCC behavior when the configure-time binutils is new. GNU ld<2.36
did not support mixed SHF_LINK_ORDER and non-SHF_LINK_ORDER sections in an
output section, so we conservatively disable SHF_LINK_ORDER for <2.36.
Wenlei He [Wed, 3 Feb 2021 21:27:35 +0000 (13:27 -0800)]
[CSSPGO] Use merged base profile for hot threshold calculation
Context-sensitive profile effectively split a function profile into many copies each representing the CFG profile of a particular calling context. That makes the count distribution looks more flat as we now have more function profiles each with lower counts, which in turn leads to lower hot thresholds. Now we tells threshold computation to merge context profile first before calculating percentile based cutoffs to compensate for seemingly flat context profile. This can be controlled by swtich `sample-profile-contextless-threshold`.
Earlier measurement showed ~0.4% perf boost with this tuning on spec2k6 for CSSPGO (with pseudo-probe and new inliner).
Differential Revision: https://reviews.llvm.org/D95980
Mehdi Amini [Sat, 6 Feb 2021 01:32:40 +0000 (01:32 +0000)]
Rework ExecutionEngine::invoke() to make it more friendly to use from C++
This new invoke will pack a list of argument before calling the
`invokePacked` method. It accepts returned value as output argument
wrapped in `ExecutionEngine::Result<T>`, and delegate the packing of
arguments to a trait to allow for customization for some types.
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D95961