Jessica Paquette [Tue, 3 Nov 2020 22:59:29 +0000 (14:59 -0800)]
[AArch64][GlobalISel] Select G_SELECT cc, t, (G_SUB 0, x) -> CSNEG t, x, cc
When we see
```
%sub = G_SUB 0, %x
%select = G_SELECT %cc, %t, %sub
```
Fold away the G_SUB by producing
```
%select = CSNEG %t, %x, cc
```
Simple IR example: https://godbolt.org/z/K8TEnh
This is valid on both sides of the select, but for now, just handle one side.
It may make more sense to handle swapping sides during post-legalizer lowering.
Differential Revision: https://reviews.llvm.org/D90723
Nikita Popov [Fri, 13 Nov 2020 17:38:26 +0000 (18:38 +0100)]
[Local] Emit nsw for inbounds offset calculation
In line with D90708, we can use nsw for the inbounds offset
calculation -- the muls were already using nsw, but the adds were
not.
Jessica Paquette [Fri, 13 Nov 2020 17:28:37 +0000 (09:28 -0800)]
[AArch64][GlobalISel] NFC: Use CmpInst::isUnsigned instead of static helper
Reducing some code duplication.
We had a helper for checking if a predicate is unsigned. Remove that and use
the existing function in Instructions.cpp.
Differential Revision: https://reviews.llvm.org/D91288
Wouter van Oortmerssen [Thu, 12 Nov 2020 23:05:05 +0000 (15:05 -0800)]
[WebAssembly] Added R_WASM_FUNCTION_OFFSET_I64 for use with DWARF DW_AT_low_pc
Needed for wasm64, see discussion in https://reviews.llvm.org/D91203
Differential Revision: https://reviews.llvm.org/D91395
Simon Pilgrim [Fri, 13 Nov 2020 17:29:54 +0000 (17:29 +0000)]
[CostModel][X86] Remove unused CHECK prefixes
Allows us to remove the "CHECK: {{^}}" hack and help simplify D91275
Nikita Popov [Wed, 4 Nov 2020 21:13:40 +0000 (22:13 +0100)]
[Local] Clean up EmitGEPOffset
Handle the emission of the add in a single place, instead of three
different ones.
Don't emit an unnecessary add with zero to start with. It will get
dropped by InstCombine, but we may as well not create it in the
first place. This also means that InstCombine does not need to
specially handle this extra add.
This is conceptually NFC, but can affect worklist order etc.
Jonas Devlieghere [Fri, 13 Nov 2020 17:29:51 +0000 (09:29 -0800)]
[lldb] Fix SymbolFile/PDB/udt-layout.test
Update the test for
406ad187486b4277fc82a2c0714ae53396e47928
Yuanfang Chen [Fri, 13 Nov 2020 17:27:10 +0000 (09:27 -0800)]
[CGProfile] allows bitcast in metadata node storing function pointers
For example, during RAUW in IRMover, the `Function` ValueAsMetadata in "CG Profile" could become bitcast.
Reviewed By: tejohnson
Differential Revision: https://reviews.llvm.org/D88433
Jessica Paquette [Fri, 13 Nov 2020 00:42:32 +0000 (16:42 -0800)]
[GlobalISel] Add matchers for specific constants and a matcher for negations
It's fairly common to need matchers for a specific constant value, or for
common idioms like finding a negated register.
Add
- `m_SpecificICst`, which returns true when matching a specific value..
- `m_ZeroInt`, which returns true when an integer 0 is matched.
- `m_Neg`, which returns when a register is negated.
Also update a few places which use idioms related to the new matchers.
Differential Revision: https://reviews.llvm.org/D91397
Kadir Cetinkaya [Fri, 13 Nov 2020 17:19:52 +0000 (18:19 +0100)]
[clangd] Canonicalize LLVM_ENABLE_ZLIB
It is used in our lit test's configuration now.
Nikita Popov [Mon, 2 Nov 2020 20:40:08 +0000 (21:40 +0100)]
[SCEV] Fix nsw flags for GEP expressions
The SCEV code for constructing GEP expressions currently assumes
that the addition of the base and all the offsets is nsw if the GEP
is inbounds. While the addition of the offsets is indeed nsw, the
addition to the base address is not, as the base address is
interpreted as an unsigned value.
Fix the GEP expression code to not assume nsw for the base+offset
calculation. However, do assume nuw if we know that the offset is
non-negative. With this, we use the same behavior as the
construction of GEP addrecs does. (Modulo the fact that we
disregard SCEV unification, as the pre-existing FIXME points out).
Differential Revision: https://reviews.llvm.org/D90648
Arthur Eubanks [Fri, 13 Nov 2020 17:17:52 +0000 (09:17 -0800)]
Nikita Popov [Mon, 2 Nov 2020 18:08:37 +0000 (19:08 +0100)]
[ValueTracking] Don't set nsw flag for inbounds addition
When computing the known bits for a GEP, don't set the nsw flag
when adding an offset to an address. The nsw flag only applies to
pure offset additions (see also D90708).
The nsw flag is only used in a very minor way by the code, to the
point that I was not able to come up with a test case where it
makes a difference.
Differential Revision: https://reviews.llvm.org/D90637
Louis Dionne [Fri, 13 Nov 2020 16:41:11 +0000 (11:41 -0500)]
[libc++] Install GDB in the Docker images
This will allow running the GDB pretty printer tests.
Nikita Popov [Tue, 3 Nov 2020 19:39:50 +0000 (20:39 +0100)]
[LangRef] Clarify GEP inbounds wrapping semantics
Clarify the semantics of GEP inbounds, in particular with regard
to what it means for wrapping. This cleans up some confusion on
when it is legal to apply nuw/nsw flags to various parts of the
GEP calculation.
Differential Revision: https://reviews.llvm.org/D90708
Simon Pilgrim [Fri, 13 Nov 2020 16:25:44 +0000 (16:25 +0000)]
[KnownBits] Merge the minimum shift amount and leading/trailing shift value bits handling.
By starting with the source shift value minimum leading/trailing bits, we can then add the minimum known shift amount to more accurately predict the minimum leading/trailing bits of the result.
This is currently only covered by the exhaustive unit tests in KnownBitsTests.cpp, but will help with some of the regressions encountered in D90479 (PR44526).
Nico Weber [Mon, 2 Nov 2020 17:00:24 +0000 (12:00 -0500)]
clang: Don't assert on no_unique_address fields in @encode()
Just skip (non-bitfield) zero-sized fields, like we do with empty bases.
The class->struct conversion in the test is because -std=c++20 else deletes some default methods
due to non-accessible base dtors otherwise.
As a side-effect of writing the test, I discovered that D76801 did an ABI breaking change of sorts
for Objective-C's @encode. But it's been in for a while, so I'm not sure if we want to row back on
that or now.
Fixes PR48048.
Differential Revision: https://reviews.llvm.org/D90622
Scott Todd [Fri, 13 Nov 2020 16:30:36 +0000 (17:30 +0100)]
[MLIR] Allow setting "CodeView" flag in LLVMIR translation on MSVC.
Reviewed By: ftynse, mehdi_amini
Differential Revision: https://reviews.llvm.org/D91365
Matt Arsenault [Wed, 11 Nov 2020 17:11:17 +0000 (12:11 -0500)]
AMDGPU/GlobalISel: Regenerate some checks
Fixes indentation confusing diff in future patch.
Matt Arsenault [Thu, 12 Nov 2020 15:59:15 +0000 (10:59 -0500)]
AMDGPU: Factor out large flat offset splitting
Nico Weber [Fri, 13 Nov 2020 16:20:23 +0000 (11:20 -0500)]
[gn build] (semi-manually) Port
6a8099e0f61
Matt Arsenault [Wed, 11 Nov 2020 15:24:23 +0000 (10:24 -0500)]
GlobalISel: Directly expose getDefSrcRegIgnoringCopies utility
It's useful to get both the instruction and register at the same time.
Kadir Cetinkaya [Wed, 11 Nov 2020 10:08:14 +0000 (11:08 +0100)]
[clangd] Ensure we test for compatibility of serialized index format
Differential Revision: https://reviews.llvm.org/D91330
Kadir Cetinkaya [Fri, 13 Nov 2020 09:13:42 +0000 (10:13 +0100)]
[clangd] Assert on varint encoding
5th byte of a varint can't be bigger than 0x0f, fix a test and add an
assertion.
Differential Revision: https://reviews.llvm.org/D91405
Sam Clegg [Wed, 11 Nov 2020 01:46:52 +0000 (17:46 -0800)]
[WebAssembly] Add new relocation type for TLS data symbols
These relocations represent offsets from the __tls_base symbol.
Previously we were just using normal MEMORY_ADDR relocations and relying
on the linker to select a segment-offset rather and absolute value in
Symbol::getVirtualAddress(). Using an explicit relocation type allows
allow us to clearly distinguish absolute from relative relocations based
on the relocation information alone.
One place this is useful is being able to reject absolute relocation in
the PIC case, but still accept TLS relocations.
Differential Revision: https://reviews.llvm.org/D91276
Matt Arsenault [Wed, 11 Nov 2020 17:56:22 +0000 (12:56 -0500)]
AMDGPU: Refactor getBaseWithOffsetUsingSplitOR usage
Djordje Todorovic [Thu, 5 Nov 2020 15:17:40 +0000 (07:17 -0800)]
[NFC][IntrRefLDV] Remove dead code from transferSpillOrRestoreInst()
Differential Revision: https://reviews.llvm.org/D90852
David Zarzycki [Fri, 13 Nov 2020 15:50:44 +0000 (10:50 -0500)]
Revert "[NFC] Move code between functions as a preparation step for further improvement"
This reverts commit
08016ac32b746b27be43d92255bf22a12012e244.
A bunch of tests are failing my local two stage builder.
Sam Clegg [Wed, 11 Nov 2020 04:52:01 +0000 (20:52 -0800)]
[lld][WebAssembly] Add test for TLS BSS data. NFC.
Differential Revision: https://reviews.llvm.org/D91231
Louis Dionne [Thu, 12 Nov 2020 16:02:14 +0000 (11:02 -0500)]
[libc++] Only check for GCC's empty string storage on macOS and iOS
We don't need to do that on other Apple platforms, since they never
shipped libstdc++. I also added a comment extracted from the original
commit by Howard Hinnant (
e115af2777f6).
Differential Revision: https://reviews.llvm.org/D91359
Zbigniew Sarbinowski [Thu, 12 Nov 2020 18:38:52 +0000 (13:38 -0500)]
[libc++] Port the time functions to z/OS
This patch adds a shim for missing time functions on z/OS, and adds a
layer of indirection to account for differences in the timespec struct
on different systems.
This was originally committed as
173b51169b83 and reverted in
777ca48c9f08
because the original commit also checked-in unrelated changes.
Differential Revision: https://reviews.llvm.org/D87940
Joachim Protze [Wed, 4 Nov 2020 12:25:15 +0000 (13:25 +0100)]
[OpenMP][Tool] Update archer to accept new OpenMP 5.1 enum values
OpenMP 5.1 adds an extra enum entry for ompt_scope_t, which makes the related
switch statement incomplete.
Also adding cases for newly added barrier variants.
Differential Revision: https://reviews.llvm.org/D90758
Nico Weber [Fri, 13 Nov 2020 15:02:54 +0000 (10:02 -0500)]
[gn build] more hotfix after
17df195f70 to unbreak llvm-config tests
Paul C. Anagnostopoulos [Sun, 8 Nov 2020 16:52:30 +0000 (11:52 -0500)]
[TableGen] Enhance the six comparison bang operators.
Update the Programmer's Reference.
Differential Revision: https://reviews.llvm.org/D91036
serge-sans-paille [Fri, 13 Nov 2020 14:55:27 +0000 (15:55 +0100)]
llvmbuildectomy - remove conflict file
Nico Weber [Fri, 13 Nov 2020 14:55:08 +0000 (09:55 -0500)]
[gn build] Port
8bb6347939b
serge-sans-paille [Fri, 13 Nov 2020 14:49:27 +0000 (15:49 +0100)]
llvmbuildectomy - support disabled native target
Nico Weber [Fri, 13 Nov 2020 14:39:28 +0000 (09:39 -0500)]
[gn build] (manually) merge
1d0676b54c4e3
Nico Weber [Fri, 13 Nov 2020 14:26:43 +0000 (09:26 -0500)]
[gn build] Hotfix to unbreak build after
9218ff50f9308
Piotr Sobczak [Tue, 10 Nov 2020 16:17:24 +0000 (17:17 +0100)]
[DivergenceAnalysis] Use addRequiredTransitive
For querying divergence the chained analysis passes are required
to be alive, for instance LoopInfoWrapperPass.
Ensure that by using addRequiredTransitive.
Differential Revision: https://reviews.llvm.org/D91335
serge-sans-paille [Fri, 13 Nov 2020 13:04:19 +0000 (14:04 +0100)]
llvmbuildectomy - compatibility with ocaml bindings
Use exact component name in add_ocaml_library.
Make expand_topologically compatible with new architecture.
Fix quoting in is_llvm_target_library.
Fix LLVMipo component name.
Write release note.
Florian Hahn [Fri, 13 Nov 2020 09:46:55 +0000 (09:46 +0000)]
Add !annotation metadata and remarks pass.
This patch adds a new !annotation metadata kind which can be used to
attach annotation strings to instructions.
It also adds a new pass that emits summary remarks per function with the
counts for each annotation kind.
The intended uses cases for this new metadata is annotating
'interesting' instructions and the remarks should provide additional
insight into transformations applied to a program.
To motivate this, consider these specific questions we would like to get answered:
* How many stores added for automatic variable initialization remain after optimizations? Where are they?
* How many runtime checks inserted by a frontend could be eliminated? Where are the ones that did not get eliminated?
Discussed on llvm-dev as part of 'RFC: Combining Annotation Metadata and Remarks'
(http://lists.llvm.org/pipermail/llvm-dev/2020-November/146393.html)
Reviewed By: thegameg, jdoerfert
Differential Revision: https://reviews.llvm.org/D91188
Haojian Wu [Fri, 13 Nov 2020 13:00:57 +0000 (14:00 +0100)]
[clang] Fix an assertion crash in delayed access check.
`TD->getTemplatedDecl()` might not be a DeclContext variant, which can
trigger an assertion inside `isa<>`.
Differential Revision: https://reviews.llvm.org/D91380
Hans Wennborg [Fri, 13 Nov 2020 12:46:13 +0000 (13:46 +0100)]
Revert "[AsmPrinter] fix -disable-debug-info option"
The test fails on Mac, see comment on the code review.
> This option was in a rather convoluted place, causing global parameters
> to be set in awkward and undesirable ways to try to account for it
> indirectly. Add tests for the -disable-debug-info option and ensure we
> don't print unintended markers from unintended places.
>
> Reviewed By: dstenb
>
> Differential Revision: https://reviews.llvm.org/D91083
This reverts commit
9606ef03f03904cec213db031b5ea6fd6052dc5d.
Jan Svoboda [Wed, 11 Nov 2020 10:05:24 +0000 (11:05 +0100)]
Reland [clang][cli] Port ObjCMTAction to new option parsing system
Merge existing marhsalling info kinds and add some primitives to
express flag options that contribute to a bitfield.
Depends on D82574
Original patch by Daniel Grumberg.
Reviewed By: Bigcheese
Differential Revision: https://reviews.llvm.org/D82860
Eugene Zhulenev [Fri, 13 Nov 2020 11:01:52 +0000 (03:01 -0800)]
[mlir] Transform scf.parallel to scf.for + async.execute
Depends On D89958
1. Adds `async.group`/`async.awaitall` to group together multiple async tokens/values
2. Rewrite scf.parallel operation into multiple concurrent async.execute operations over non overlapping subranges of the original loop.
Example:
```
scf.for (%i, %j) = (%lbi, %lbj) to (%ubi, %ubj) step (%si, %sj) {
"do_some_compute"(%i, %j): () -> ()
}
```
Converted to:
```
%c0 = constant 0 : index
%c1 = constant 1 : index
// Compute blocks sizes for each induction variable.
%num_blocks_i = ... : index
%num_blocks_j = ... : index
%block_size_i = ... : index
%block_size_j = ... : index
// Create an async group to track async execute ops.
%group = async.create_group
scf.for %bi = %c0 to %num_blocks_i step %c1 {
%block_start_i = ... : index
%block_end_i = ... : index
scf.for %bj = %c0 t0 %num_blocks_j step %c1 {
%block_start_j = ... : index
%block_end_j = ... : index
// Execute the body of original parallel operation for the current
// block.
%token = async.execute {
scf.for %i = %block_start_i to %block_end_i step %si {
scf.for %j = %block_start_j to %block_end_j step %sj {
"do_some_compute"(%i, %j): () -> ()
}
}
}
// Add produced async token to the group.
async.add_to_group %token, %group
}
}
// Await completion of all async.execute operations.
async.await_all %group
```
In this example outer loop launches inner block level loops as separate async
execute operations which will be executed concurrently.
At the end it waits for the completiom of all async execute operations.
Reviewed By: ftynse, mehdi_amini
Differential Revision: https://reviews.llvm.org/D89963
Simon Atanasyan [Thu, 12 Nov 2020 21:24:11 +0000 (00:24 +0300)]
[MC][mips] Remove unused check prefixes. NFC
Simon Atanasyan [Thu, 5 Nov 2020 13:30:45 +0000 (16:30 +0300)]
[mips] Add tests to check disassembling of add.ps/mul.ps/sub.ps instructions
Kirill Bobyrev [Fri, 13 Nov 2020 11:27:36 +0000 (12:27 +0100)]
[clangd] Add missing tests to rename feature
This adds a couple of missed tests from existing clang-rename ones and
introduces several new ones (e.g. static class member). This patch is required
to ensure feature parity for migration off Clang-Rename API D71880.
Reviewed By: hokein
Differential Revision: https://reviews.llvm.org/D91337
Yvan Roux [Fri, 13 Nov 2020 11:20:56 +0000 (12:20 +0100)]
[UpdateTestChecks] Fix $ in function test for ARM.
Removes AArch64 target checking inside 32bit ARM test to bring back
buildbots to a green state. But $ are not well handled for ARM and it
still need to be fixed.
Kerry McLaughlin [Fri, 13 Nov 2020 10:51:17 +0000 (10:51 +0000)]
[SVE][CodeGen] Improve codegen of scalable masked scatters
If the scatter store is able to perform the sign/zero extend of
its index, this is folded into the instruction with refineIndexType().
Additionally, refineUniformBase() will return the base pointer and index
from an add + splat_vector.
Reviewed By: sdesmalen
Differential Revision: https://reviews.llvm.org/D90942
Max Kazantsev [Fri, 13 Nov 2020 10:45:42 +0000 (17:45 +0700)]
[NFC] Move code between functions as a preparation step for further improvement
Simon Pilgrim [Fri, 13 Nov 2020 10:47:56 +0000 (10:47 +0000)]
[ValueTracking] computeKnownBitsFromShiftOperator use KnownBits direct for constant shift amounts.
Let KnownBits shift handlers deal with out-of-range shift amounts.
Max Kazantsev [Fri, 13 Nov 2020 10:18:16 +0000 (17:18 +0700)]
[NFC] Refactor lambda into static function
Raphael Isemann [Fri, 13 Nov 2020 10:39:21 +0000 (11:39 +0100)]
[lldb][NFC] Fix flaky TestForwardDeclFromStdModule test
"[lldb/DataFormatters] Display null C++ pointers as nullptr" added an assumption
that the member we check for is always a nullptr, but it is actually never
initialized. That causes the test to randomly fail due to the pointer having
some random value that isn't 0.
Simon Pilgrim [Fri, 13 Nov 2020 10:20:28 +0000 (10:20 +0000)]
Fix MSVC signed/unsigned comparison warning. NFCI.
Kazushi (Jam) Marukawa [Fri, 13 Nov 2020 09:27:05 +0000 (18:27 +0900)]
[VE] Add vst intrinsic instructions
Add vst intrinsic instructions and a regression test.
Reviewed By: simoll
Differential Revision: https://reviews.llvm.org/D91406
Max Kazantsev [Fri, 13 Nov 2020 10:00:49 +0000 (17:00 +0700)]
[NFC] Move lambdae into static functions
Florian Hahn [Fri, 13 Nov 2020 09:42:36 +0000 (09:42 +0000)]
[docs] Fix undefined reference in ORCv2 design doc.
This fixes a typo introduced in
984e87923f1096c815cef900cda0926c68286ddf
which caused the docs build to fail.
Jay Foad [Fri, 13 Nov 2020 09:41:37 +0000 (09:41 +0000)]
[AMDGPU] One more use of the new export target names. NFC.
serge-sans-paille [Fri, 9 Oct 2020 16:41:21 +0000 (18:41 +0200)]
llvmbuildectomy - replace llvm-build by plain cmake
No longer rely on an external tool to build the llvm component layout.
Instead, leverage the existing `add_llvm_componentlibrary` cmake function and
introduce `add_llvm_component_group` to accurately describe component behavior.
These function store extra properties in the created targets. These properties
are processed once all components are defined to resolve library dependencies
and produce the header expected by llvm-config.
Differential Revision: https://reviews.llvm.org/D90848
serge-sans-paille [Tue, 10 Nov 2020 13:55:25 +0000 (14:55 +0100)]
[nfc] Fix missing include
Lang Hames [Fri, 13 Nov 2020 09:22:01 +0000 (20:22 +1100)]
[ORC][examples] Fix missing includes/dependencies in more examples.
Lang Hames [Fri, 13 Nov 2020 09:09:38 +0000 (20:09 +1100)]
[ORC] Make a narrowing conversion explicit.
Max Kazantsev [Fri, 13 Nov 2020 09:02:31 +0000 (16:02 +0700)]
[Test] One more IndVars test with inverted exit condition
Max Kazantsev [Fri, 13 Nov 2020 08:42:02 +0000 (15:42 +0700)]
[IndVars] Fix branches exiting by true with invariant conditions
Forgot to invert the condition for them.
Max Kazantsev [Fri, 13 Nov 2020 08:21:52 +0000 (15:21 +0700)]
[Test] Add test with inverted branch
Stephan Herhut [Thu, 12 Nov 2020 16:09:57 +0000 (17:09 +0100)]
[mlir][bufferize] Fix buffer promotion to stack for index types
The index type does not have a bitsize and hence the size of corresponding allocations cannot be computed. Instead, the promotion pass now has an explicit option to specify the size of index.
Differential Revision: https://reviews.llvm.org/D91360
Stephan Herhut [Thu, 12 Nov 2020 17:36:14 +0000 (18:36 +0100)]
[mlir][gpu] Only transform mapped parallel loops to GPU.
This exposes a hook to configure legality of operations such that only
`scf.parallel` operations that have mapping attributes are marked as
illegal. Consequently, the transformation can now also be applied to
mixed forms.
Differential Revision: https://reviews.llvm.org/D91340
Lang Hames [Fri, 13 Nov 2020 08:02:52 +0000 (19:02 +1100)]
[examples] Fix Kaleidoscope examples after OrcJIT break-up / remote TPC commit.
Fix the Kaleidoscope examples after
1d0676b54c4 by explicitly creating the
SymbolStringPool.
Kai Luo [Fri, 13 Nov 2020 08:05:08 +0000 (08:05 +0000)]
[PowerPC] Add test case for negated abs. NFC.
Max Kazantsev [Fri, 13 Nov 2020 07:39:19 +0000 (14:39 +0700)]
[NFC] Refactor loop-invariant getters to return Optional
River Riddle [Fri, 13 Nov 2020 07:45:07 +0000 (23:45 -0800)]
[mlir][Pass] Remove the verifierPass now that verification is run during normal pass execution
A recent refactoring removed the need to interleave verifier passes and instead opted to verify during the normal execution of passes instead. As such, the old verify pass is no longer necessary and can be removed.
Differential Revision: https://reviews.llvm.org/D91212
Lang Hames [Fri, 13 Nov 2020 07:40:40 +0000 (18:40 +1100)]
[examples] Fix Kaleidoscope examples after OrcJIT break-up / remote TPC commit.
Fix the Kaleidoscope examples after
1d0676b54c4 by explicitly creating the
SymbolStringPool.
River Riddle [Fri, 13 Nov 2020 07:33:43 +0000 (23:33 -0800)]
[mlir][Asm] Add support for resolving operation locations after parsing has finished
This revision adds support in the parser/printer for "deferrable" aliases, i.e. those that can be resolved after printing has finished. This allows for printing aliases for operation locations after the module instead of before, i.e. this is now supported:
```
"foo.op"() : () -> () loc(#loc)
#loc = loc("some_location")
```
Differential Revision: https://reviews.llvm.org/D91227
Jason Molenda [Fri, 13 Nov 2020 07:28:24 +0000 (23:28 -0800)]
debugserver should advance pc past builtin_debugtrap insn
On x86_64, when you hit a __builtin_debugtrap instruction, you
can continue past this in the debugger. This patch has debugserver
recognize the specific instruction used for __builtin_debugtrap
and advance the pc past it, so that the user can continue execution
once they've hit one of these.
In the patch discussion, we were in agreement that it would be better
to have this knowledge up in lldb instead of depending on each
stub rewriting the pc behind the debugger's back, but that's a
larger scale change for another day.
<rdar://problem/
65521634>
Differential revision: https://reviews.llvm.org/D91238
Lang Hames [Fri, 13 Nov 2020 07:11:14 +0000 (18:11 +1100)]
[ORC][examples] Fix include and library dependence for SpeculativeJIT example.
Serge Pavlov [Fri, 24 Apr 2020 10:53:05 +0000 (17:53 +0700)]
[Driver] Add option -fproc-stat-report
The new option `-fproc-stat-info=<file>` can be used to generate report
about used memory and execution tile of each stage of compilation.
Documentation for this option can be found in `UserManual.rst`. The
option can be used in parallel builds.
Differential Revision: https://reviews.llvm.org/D78903
Lang Hames [Fri, 13 Nov 2020 06:48:27 +0000 (17:48 +1100)]
[ORC] Add dependence of OrcJIT on OrcTargetProcess.
The SelfTargetProcessControl class depends on OrcTargetProcess.
River Riddle [Fri, 13 Nov 2020 07:02:25 +0000 (23:02 -0800)]
[mlir] Remove C++17 only use of inline on constexpr variable
River Riddle [Fri, 13 Nov 2020 06:55:28 +0000 (22:55 -0800)]
[mlir][Interfaces] Add implicit casts from concrete operation types to the interfaces they implement.
This removes the need to have an explicit `cast<>` given that we always know it `isa` instance of the interface.
Differential Revision: https://reviews.llvm.org/D91304
River Riddle [Fri, 13 Nov 2020 06:43:06 +0000 (22:43 -0800)]
[mlir][DenseElementsAttr] Allow for custom floating point types in `getValues`
Some users have native c++ data types that correspond to floating point values stored within a DenseElementsAttr that do not have a corresponding native C++ data type(e.g. bfloat16/half/etc). This revision allows for such users to use those native types directly, and removes the need to go through APFloat when the much faster native value path is available.
Differential Revision: https://reviews.llvm.org/D91402
Arthur Eubanks [Fri, 13 Nov 2020 06:20:39 +0000 (22:20 -0800)]
[NFC] Removed unused variable
Obsolete as of https://reviews.llvm.org/D91046.
Akira Hatanaka [Fri, 13 Nov 2020 02:33:29 +0000 (18:33 -0800)]
[ObjC][ARC] Clear the lists of basic blocks and instructions before
continuing the loop
This fixes a bug introduced in
c6f1713c46e61bbb8ece9ac5ac329d02e7f93228.
Lang Hames [Fri, 13 Nov 2020 06:15:13 +0000 (17:15 +1100)]
[ORC] Make WrapperFunctionResult::zeroInit static
Lang Hames [Fri, 13 Nov 2020 06:12:33 +0000 (17:12 +1100)]
[ORC] Remove designated initializer.
Lang Hames [Wed, 11 Nov 2020 00:55:24 +0000 (11:55 +1100)]
[ORC] Break up OrcJIT library, add Orc-RPC based remote TargetProcessControl
implementation.
This patch aims to improve support for out-of-process JITing using OrcV2. It
introduces two new class templates, OrcRPCTargetProcessControlBase and
OrcRPCTPCServer, which together implement the TargetProcessControl API by
forwarding operations to an execution process via an Orc-RPC Endpoint. These
utilities are used to implement out-of-process JITing from llvm-jitlink to
a new llvm-jitlink-executor tool.
This patch also breaks the OrcJIT library into three parts:
-- OrcTargetProcess: Contains code needed by the JIT execution process.
-- OrcShared: Contains code needed by the JIT execution and compiler
processes
-- OrcJIT: Everything else.
This break-up allows JIT executor processes to link against OrcTargetProcess
and OrcShared only, without having to link in all of OrcJIT. Clients executing
JIT'd code in-process should start linking against OrcTargetProcess as well as
OrcJIT.
In the near future these changes will enable:
-- Removal of the OrcRemoteTargetClient/OrcRemoteTargetServer class templates
which provided similar functionality in OrcV1.
-- Restoration of Chapter 5 of the Building-A-JIT tutorial series, which will
serve as a simple usage example for these APIs.
-- Implementation of lazy, cross-target compilation in lli's -jit-kind=orc-lazy
mode.
Jameson Nash [Fri, 13 Nov 2020 04:49:43 +0000 (23:49 -0500)]
[AsmPrinter] fix -disable-debug-info option
This option was in a rather convoluted place, causing global parameters
to be set in awkward and undesirable ways to try to account for it
indirectly. Add tests for the -disable-debug-info option and ensure we
don't print unintended markers from unintended places.
Reviewed By: dstenb
Differential Revision: https://reviews.llvm.org/D91083
Craig Topper [Fri, 13 Nov 2020 05:46:34 +0000 (21:46 -0800)]
[X86] Use EVT::getIntegerVT instead of MVT::getIntegerVT where the type can be i2 or i4.
This was a mistake introduced in D91294. I'm not sure how to
exercise this with the existing code, but I hit it while trying
some follow up experiments.
Craig Topper [Fri, 13 Nov 2020 04:18:50 +0000 (20:18 -0800)]
[X86] When storing v1i1/v2i1/v4i1 to memory, make sure we store zeros in the rest of the byte
We can't store garbage in the unused bits. It possible that something like zextload from i1/i2/i4 is created to read the memory. Those zextloads would be legalized assuming the extra bits are 0.
I'm not sure that the code in lowerStore is executed for the v1i1/v2i1/v4i1 case. It looks like the DAG combine in combineStore may have converted them to v8i1 first. And I think we're missing some cases to avoid going to the stack in the first place. But I don't have time to investigate those things at the moment so I wanted to focus on the correctness issue.
Should fix PR48147.
Reviewed By: RKSimon
Differential Revision: https://reviews.llvm.org/D91294
Max Kazantsev [Fri, 13 Nov 2020 05:05:14 +0000 (12:05 +0700)]
[IndVars] Replace checks with invariants if we cannot remove them
If we cannot prove that the check is trivially true, but can prove that it either
fails on the 1st iteration or never fails, we can replace it with first iteration check.
Differential Revision: https://reviews.llvm.org/D88527
Reviewed By: skatkov
Richard Smith [Fri, 13 Nov 2020 04:55:21 +0000 (20:55 -0800)]
Suppress trailing template arguments equivalent to default arguments
when printing the name of a member of a class template specialization.
Mehdi Amini [Fri, 13 Nov 2020 04:43:06 +0000 (04:43 +0000)]
Fix MLIR lit test configuration after cmake Python detection change
07f1047f41d changed the CMake detection to use find_package(Python3 ...
but didn't update the lit configuration to use the expected Python3_EXECUTABLE
cmake variable to point to the interpreter path.
This resulted in an empty path on MacOS.
Philip Reames [Fri, 13 Nov 2020 03:08:45 +0000 (19:08 -0800)]
[Tests][LoopVect] Exercise basic uniform memory operand logic
Shilei Tian [Fri, 13 Nov 2020 03:27:22 +0000 (22:27 -0500)]
[OpenMP] Fixed a bug when displaying affinity
Currently the affinity format string has initial value. When users set
the format via OMP_AFFINITY_FORMAT, it will overwrite the format string. However,
when copying the format, the tailing null is missing. As a result, if the user
format string is shorter than default value, the remaining part in the default
value still makes effort. This bug is not exposed because the test case doesn't
check the end of a string. It only checks whether given output "contains" the
check string.
Reviewed By: AndreyChurbanov
Differential Revision: https://reviews.llvm.org/D91309
Michael Liao [Tue, 10 Nov 2020 14:34:14 +0000 (09:34 -0500)]
[hip] Remove the coercion on aggregate kernel arguments.
- If an aggregate argument is indirectly accessed within kernels, direct
passing results in unpromotable `alloca`, which degrade performance
significantly. InferAddrSpace pass is enhanced in
[D91121](https://reviews.llvm.org/D91121) to take the assumption that
generic pointers loaded from the constant memory could be regarded
global ones. The need for the coercion on aggregate arguments is
mitigated.
Differential Revision: https://reviews.llvm.org/D89980
Michael Kruse [Fri, 13 Nov 2020 01:31:47 +0000 (19:31 -0600)]
[Polly] Fix memory leak.
Sanjay Patel [Fri, 13 Nov 2020 00:59:56 +0000 (19:59 -0500)]
[InstCombine] fold sub of low-bit masked value from offset of same value
There might be some demanded/known bits way to generalize this,
but I'm not seeing it right now.
This came up as a regression when I was looking at a different
demanded bits improvement.
https://rise4fun.com/Alive/5fl
Name: general
Pre: ((-1 << countTrailingZeros(C1)) & C2) == 0
%a1 = add i8 %x, C1
%a2 = and i8 %x, C2
%r = sub i8 %a1, %a2
=>
%r = and i8 %a1, ~C2
Name: test 1
%a1 = add i8 %x, 192
%a2 = and i8 %x, 10
%r = sub i8 %a1, %a2
=>
%r = and i8 %a1, -11
Name: test 2
%a1 = add i8 %x, -108
%a2 = and i8 %x, 3
%r = sub i8 %a1, %a2
=>
%r = and i8 %a1, -4
Sanjay Patel [Fri, 13 Nov 2020 00:44:13 +0000 (19:44 -0500)]
[InstCombine] add tests for sub with masked bits; NFC
Rahul Joshi [Thu, 12 Nov 2020 20:05:35 +0000 (12:05 -0800)]
[MLIR] Fix standard -> LLVM conversion to fail for unsupported memref element type.
- Move isSupportedMemRefType() to ConvertToLLVMPatterns and check if the
memref element type is supported there.
Differential Revision: https://reviews.llvm.org/D91374