Jake Merdich [Wed, 20 May 2020 16:17:55 +0000 (12:17 -0400)]
[clang-format][docfix] Update predefined styles in docs
Summary:
The predefined styles that clang-format supports are listed in two
places, and neither is up-to-date. GNU style isn't mentioned at all!
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D80309
Kirstóf Umann [Wed, 20 May 2020 23:54:11 +0000 (01:54 +0200)]
[analyzer] Make buildbots happy
Eli Friedman [Tue, 19 May 2020 20:24:53 +0000 (13:24 -0700)]
[AArch64] Fix unwind info generated by outliner.
The offsets were wrong. The result is now the same as what the compiler
would generate for a function that spills lr normally.
Differential Revision: https://reviews.llvm.org/D80238
Eli Friedman [Sun, 17 May 2020 00:55:18 +0000 (17:55 -0700)]
Make Value::getPointerAlignment() return an Align, not a MaybeAlign.
If we don't know anything about the alignment of a pointer, Align(1) is
still correct: all pointers are at least 1-byte aligned.
Included in this patch is a bugfix for an issue discovered during this
cleanup: pointers with "dereferenceable" attributes/metadata were
assumed to be aligned according to the type of the pointer. This
wasn't intentional, as far as I can tell, so Loads.cpp was fixed to
stop making this assumption. Frontends may need to be updated. I
updated clang's handling of C++ references, and added a release note for
this.
Differential Revision: https://reviews.llvm.org/D80072
Francis Visoiu Mistrih [Wed, 20 May 2020 23:26:37 +0000 (16:26 -0700)]
[AArch64] Fix GlobalISel tests on non-darwin platforms
http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-debian/builds/6998
Reid Kleckner [Wed, 20 May 2020 14:50:19 +0000 (07:50 -0700)]
[LLD] Make scoped timers thread safe
Summary:
This is a pre-requisite to parallelizing PDB symbol and type merging.
Currently this timer usage would not be thread safe.
Reviewers: aganea, MaskRay
Subscribers: jfb, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D80298
Kirstóf Umann [Wed, 20 May 2020 23:03:31 +0000 (01:03 +0200)]
[analyzer] Fix a null FunctionDecl dereference bug after D75432
Francis Visoiu Mistrih [Fri, 31 Jan 2020 21:20:57 +0000 (13:20 -0800)]
[AArch64] Provide Darwin variants of most calling conventions
With the new SVE stack layout, we now need to provide a Darwin variant
for all the calling conventions based on the main AAPCS CSR save order.
This also changes APCS_SwiftError to have a Darwin and a non-Darwin
version, assuming it could be used on other platforms these days, and
restricts the AArch64_CXX_TLS calling convention to Darwin.
Differential Revision: https://reviews.llvm.org/D73805
Stanislav Mekhanoshin [Fri, 15 May 2020 17:43:18 +0000 (10:43 -0700)]
[AMDGPU] Always expand ext/insertelement with divergent idx
Even though series of cmd/cndmask can produce quite a lot of
code that is still better than a loop. In case of doubles we
would even produce two loops.
Differential Revision: https://reviews.llvm.org/D80032
Craig Topper [Wed, 20 May 2020 22:06:36 +0000 (15:06 -0700)]
[LegalizeVectorTypes] Create correct memoperands in SplitVecRes_INSERT_SUBVECTOR.
Previously this code just used a default constructed
MachinePointerInfo. But we know the accesses are to a fixed stack
object or at least somewhere on the stack.
While there fix the alignment passed to the full vector load/stores.
I don't think this function is currently exercised in tree so I
don't know how to test it. I just noticed it when I removed
non-constant index support in this function.
Differential Revision: https://reviews.llvm.org/D80058
Nicolas Vasilache [Wed, 20 May 2020 21:58:10 +0000 (17:58 -0400)]
[mlir] NFC - Appease GCC 5 again..
Wen-Heng (Jack) Chung [Wed, 6 May 2020 17:45:58 +0000 (12:45 -0500)]
[mlir][gpu] Refactor functions for workgroup and private buffer attributions.
Summary:
Consolidate interfaces adding workgroup and private buffer attributions in GPU
dialect.
Note all private buffer attributions must follow workgroup buffer attributions.
Reviewers: herhut
Subscribers: mehdi_amini, rriddle, jpienaar, shauheen, antiagainst, nicolasvasilache, csigg, arpith-jacob, mgester, lucyrfox, liufengdb, stephenneuendorffer, Joonsoo, grosul1, frgossen, Kayjukh, llvm-commits
Tags: #llvm, #mlir
Differential Revision: https://reviews.llvm.org/D79508
Wen-Heng (Jack) Chung [Mon, 18 May 2020 18:01:54 +0000 (13:01 -0500)]
[mlir][gpu] Refactor ConvertGpuLaunchFuncToCudaCalls pass.
Due to similar APIs between CUDA and ROCm (HIP),
ConvertGpuLaunchFuncToCudaCalls pass could be used on both platforms with some
refactoring.
In this commit:
- Migrate ConvertLaunchFuncToCudaCalls from GPUToCUDA to GPUCommon, and rename.
- Rename runtime wrapper APIs be platform-neutral.
- Let GPU binary annotation attribute be specifiable as a PassOption.
- Naming changes within the implementation and tests.
Subsequent patches would introduce ROCm-specific tests and runtime wrapper
APIs.
Differential Revision: https://reviews.llvm.org/D80167
Jonas Devlieghere [Wed, 20 May 2020 21:08:55 +0000 (14:08 -0700)]
[lldb/Test] Support arbitrary file extensions in TestPositionalArgs.test
On Windows the line must match:
Use 'lldb.exe --help' for a complete list of options.
Nicolas Vasilache [Wed, 20 May 2020 20:41:41 +0000 (16:41 -0400)]
[mlir] NFC - Appease GCC 5 again..
Stephen Neuendorffer [Mon, 18 May 2020 00:41:39 +0000 (17:41 -0700)]
[lit] GoogleTest framework should report failures if test binary crashes
lit runs a gtest executable multiple times. First it runs it to
discover tests, then later it runs the executable again for each test.
However, if the discovery fails (perhaps because of a broken
executable), then no tests were previously run and no failures were
reported. This patch creates a dummy test if discovery fails, which
will later fail when test are run and be reported as a failure.
Differential Revision: https://reviews.llvm.org/D80096
mydeveloperday [Wed, 20 May 2020 20:25:18 +0000 (21:25 +0100)]
[clang-format] Added new option IndentExternBlock
Reviewers: MyDeveloperDay, krasimir, klimek, mitchell-stellar, Abpostelnicu
Patch By: MarcusJohnson91
Reviewed By: MyDeveloperDay, Abpostelnicu
Subscribers: sylvestre.ledru, Abpostelnicu, cfe-commits
Tags: #clang, #clang-format, #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D75791
Nico Weber [Mon, 18 May 2020 23:57:30 +0000 (19:57 -0400)]
Give microsoftDemangle() an outparam for how many input bytes were consumed.
Demangling Itanium symbols either consumes the whole input or fails,
but Microsoft symbols can be successfully demangled with just some
of the input.
Add an outparam that enables clients to know how much of the input was
consumed, and use this flag to give llvm-undname an opt-in warning
on partially consumed symbols.
Differential Revision: https://reviews.llvm.org/D80173
mydeveloperday [Wed, 20 May 2020 20:11:10 +0000 (21:11 +0100)]
[clang-format] Set of unit test to begin to validate that we don't change defaults
Summary:
This revision is to complement {D75791} so we can be sure that we don't change any default behavior.
For now just add rules to cover AfterExternBlock, but in the future we should add cases to cover the other BraceWrapping rules for each style. This will help guard us when we change code inside of the various getXXXStyle() functions to ensure we are not breaking everyone.
Reviewed By: MarcusJohnson91
Subscribers: cfe-commits
Tags: #clang, #clang-format
Differential Revision: https:
Jonas Devlieghere [Wed, 20 May 2020 19:59:51 +0000 (12:59 -0700)]
[lldb/Reproducers] Add instrumentation to SBEnvironment
This class should've been instrumented when it landed. Whether the class
is "highly mutable" or not doesn't affect that.
With this patch TestSBEnvironment.py now passes when replayed.
Matt Morehouse [Wed, 20 May 2020 19:39:40 +0000 (12:39 -0700)]
[sanitizer_symbolizer] Add __isinf to symbols list.
Jonas Devlieghere [Wed, 20 May 2020 19:32:41 +0000 (12:32 -0700)]
[lldb/Driver] Print snippet before exiting with unknown argument.
Print a little snippet before exiting when passed unrecognized
arguments. The goal is twofold:
- Point users to lldb --help.
- Make it clear that we exited the debugger.
Haibo Huang [Tue, 19 May 2020 22:23:35 +0000 (15:23 -0700)]
[lldb] Cleans up system_libs
Summary:
Long long ago system_libs was appended to LLDB_SYSTEM_LIBS in
cmake/LLDBDependencies.cmake. After that file was removed, system_libs
is orphaned.
Currently the only user is source/Utility. Move the logic there and
remove system_libs.
Subscribers: mgorny, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D80253
Haibo Huang [Tue, 19 May 2020 23:00:54 +0000 (16:00 -0700)]
[lldb] Allows customizing libxml2 for darwin
Summary:
This changes allows to disable or use customized libxml2 for lldb.
1. Removes redundant include_directories. The one in LLDBConfig.cmake should be enough.
2. Link to ${LIBXML2_LIBRARIES} if xml2 is enabled.
Subscribers: mgorny, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D80257
Alexey Bataev [Thu, 14 May 2020 20:37:30 +0000 (16:37 -0400)]
[OPENMP]Fix PR45911: Data sharing and lambda capture.
Summary:
No need to generate inlined OpenMP region for variables captured in
lambdas or block decls, only for implicitly captured variables in the
OpenMP region.
Reviewers: jdoerfert
Subscribers: yaxunl, guansong, cfe-commits, caomhin
Tags: #clang
Differential Revision: https://reviews.llvm.org/D79966
MaheshRavishankar [Wed, 20 May 2020 18:48:22 +0000 (11:48 -0700)]
[mlir][spirv] Adapt subview legalization to the updated op semantics.
The subview semantics changes recently to allow for more natural
representation of constant offsets and strides. The legalization of
subview op for lowering to SPIR-V needs to account for this.
Also change the linearization to use the strides from the affine map
of a memref.
Differential Revision: https://reviews.llvm.org/D80270
Roman Lebedev [Wed, 20 May 2020 18:37:02 +0000 (21:37 +0300)]
[InstCombine] `insertelement` is negatible if both sources are negatible
----------------------------------------
define <2 x i4> @negate_insertelement(<2 x i4> %src, i4 %a, i32 %x, <2 x i4> %b) {
%0:
%t0 = sub <2 x i4> { 0, 0 }, %src
%t1 = sub i4 0, %a
%t2 = insertelement <2 x i4> %t0, i4 %t1, i32 %x
%t3 = sub <2 x i4> %b, %t2
ret <2 x i4> %t3
}
=>
define <2 x i4> @negate_insertelement(<2 x i4> %src, i4 %a, i32 %x, <2 x i4> %b) {
%0:
%t2.neg = insertelement <2 x i4> %src, i4 %a, i32 %x
%t3 = add <2 x i4> %t2.neg, %b
ret <2 x i4> %t3
}
Transformation seems to be correct!
Roman Lebedev [Wed, 20 May 2020 18:16:57 +0000 (21:16 +0300)]
[NFC][InstCombine] Negator: tests for insertelement negation
Roman Lebedev [Wed, 20 May 2020 18:01:28 +0000 (21:01 +0300)]
[InstCombine] Negator: `extractelement` is negatible if src is negatible
----------------------------------------
define i4 @negate_extractelement(<2 x i4> %x, i32 %y, i4 %z) {
%0:
%t0 = sub <2 x i4> { 0, 0 }, %x
call void @use_v2i4(<2 x i4> %t0)
%t1 = extractelement <2 x i4> %t0, i32 %y
%t2 = sub i4 %z, %t1
ret i4 %t2
}
=>
define i4 @negate_extractelement(<2 x i4> %x, i32 %y, i4 %z) {
%0:
%t0 = sub <2 x i4> { 0, 0 }, %x
call void @use_v2i4(<2 x i4> %t0)
%t1.neg = extractelement <2 x i4> %x, i32 %y
%t2 = add i4 %t1.neg, %z
ret i4 %t2
}
Transformation seems to be correct!
Roman Lebedev [Wed, 20 May 2020 17:54:06 +0000 (20:54 +0300)]
[NFC][InstCombine] Negator: tests for extractelement negation
Louis Dionne [Thu, 14 May 2020 13:37:46 +0000 (09:37 -0400)]
[libcxx][test] Portability fix for some locale-dependent tests.
Tests for `std::system_error` constructor marked as slightly non-portable.
One (but not the only one) reason for such non-portability is that these
tests assume the default locale to be set to "C" (or "POSIX").
However, the default locale for the process depends on OS and
environment. This patch adds explicit setting of the correct
locale expected by the tests.
Thanks to Andrey Maksimov for the patch.
Differential Revision: https://reviews.llvm.org/D72456
aartbik [Wed, 20 May 2020 02:49:01 +0000 (19:49 -0700)]
[llvm] [CodeGen] [X86] Fix issues with v4i1 instruction selection
Summary:
Fixes issue
https://bugs.llvm.org/show_bug.cgi?id=45995
Reviewers: mehdi_amini, nicolasvasilache, reidtatge, craig.topper, ftynse, bkramer
Reviewed By: craig.topper
Subscribers: RKSimon, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D80231
Jan Wilken Dörrie [Wed, 20 May 2020 16:28:27 +0000 (12:28 -0400)]
[libcxx] Remove swap for std::span
This change removes both the member function swap and the free function
overload of swap for std::span. While swap is a member and overloaded
for every other container in the standard library [1], it is neither a
member function nor a free function overload for std::span [2].
Thus the corresponding implementation should be removed.
[1] https://eel.is/c++draft/libraryindex#:swap
[2] https://eel.is/c++draft/span.overview
Differential Revision: https://reviews.llvm.org/D69827
Arthur Eubanks [Mon, 16 Mar 2020 19:32:36 +0000 (12:32 -0700)]
Reland [X86] Codegen for preallocated
See https://reviews.llvm.org/D74651 for the preallocated IR constructs
and LangRef changes.
In X86TargetLowering::LowerCall(), if a call is preallocated, record
each argument's offset from the stack pointer and the total stack
adjustment. Associate the call Value with an integer index. Store the
info in X86MachineFunctionInfo with the integer index as the key.
This adds two new target independent ISDOpcodes and two new target
dependent Opcodes corresponding to @llvm.call.preallocated.{setup,arg}.
The setup ISelDAG node takes in a chain and outputs a chain and a
SrcValue of the preallocated call Value. It is lowered to a target
dependent node with the SrcValue replaced with the integer index key by
looking in X86MachineFunctionInfo. In
X86TargetLowering::EmitInstrWithCustomInserter() this is lowered to an
%esp adjustment, the exact amount determined by looking in
X86MachineFunctionInfo with the integer index key.
The arg ISelDAG node takes in a chain, a SrcValue of the preallocated
call Value, and the arg index int constant. It produces a chain and the
pointer fo the arg. It is lowered to a target dependent node with the
SrcValue replaced with the integer index key by looking in
X86MachineFunctionInfo. In
X86TargetLowering::EmitInstrWithCustomInserter() this is lowered to a
lea of the stack pointer plus an offset determined by looking in
X86MachineFunctionInfo with the integer index key.
Force any function containing a preallocated call to use the frame
pointer.
Does not yet handle a setup without a call, or a conditional call.
Does not yet handle musttail. That requires a LangRef change first.
Tried to look at all references to inalloca and see if they apply to
preallocated. I've made preallocated versions of tests testing inalloca
whenever possible and when they make sense (e.g. not alloca related,
inalloca edge cases).
Aside from the tests added here, I checked that this codegen produces
correct code for something like
```
struct A {
A();
A(A&&);
~A();
};
void bar() {
foo(foo(foo(foo(foo(A(), 4), 5), 6), 7), 8);
}
```
by replacing the inalloca version of the .ll file with the appropriate
preallocated code. Running the executable produces the same results as
using the current inalloca implementation.
Reverted due to unexpectedly passing tests, added REQUIRES: asserts for reland.
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77689
Jonas Devlieghere [Wed, 20 May 2020 17:32:51 +0000 (10:32 -0700)]
[lldb/Reproducers] Make SBStream::Print an API instead of a SWIG extension
This makes it possible to instrument the call for the reproducers. This
fixes TestStructuredDataAPI.py with reproducer replay.
Differential revision: https://reviews.llvm.org/D80312
Arthur Eubanks [Wed, 20 May 2020 17:04:55 +0000 (10:04 -0700)]
Revert "[X86] Codegen for preallocated"
This reverts commit
810567dc691a57c8c13fef06368d7549f7d9c064.
Some tests are unexpectedly passing
Amy Huang [Wed, 20 May 2020 17:01:17 +0000 (10:01 -0700)]
Add some dependencies to the compiler-rt symbolizer build
Jonas Devlieghere [Wed, 20 May 2020 16:49:28 +0000 (09:49 -0700)]
[lldb/Reproducers] Skip another test that uses lldb::FileSP under the hood
Zola Bridges [Mon, 11 May 2020 20:23:54 +0000 (13:23 -0700)]
[clang][asm goto][slh] Warn if asm goto + SLH
Summary:
Asm goto is not supported by SLH. Warn if an instance of asm goto is detected
while SLH is enabled.
Test included.
Reviewed By: jyu2
Differential Revision: https://reviews.llvm.org/D79743
Sanjay Patel [Wed, 20 May 2020 16:44:35 +0000 (12:44 -0400)]
[InstCombine] add tests for reassociative fsub/fadd expressions; NFC
Hiroshi Yamauchi [Tue, 19 May 2020 19:12:26 +0000 (12:12 -0700)]
[ProfileSummary] Refactor getFromMD to prepare for another optional field. NFC.
Summary:
Rename 'i' to 'I'.
Factor out the optional field handling to getOptionalVal().
Split out of D79951.
Reviewers: davidxl
Subscribers: eraman, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D80230
Jonas Devlieghere [Wed, 20 May 2020 16:21:45 +0000 (09:21 -0700)]
[lldb/Driver] Error out when encountering unknown arguments
There appears to be consensus in D80165 that this is the desired
behavior and I personally agree.
Differential revision: https://reviews.llvm.org/D80226
Simon Pilgrim [Wed, 20 May 2020 16:29:39 +0000 (17:29 +0100)]
FormatAdapters.h - remove unused SmallString.h include. NFC.
Simon Pilgrim [Wed, 20 May 2020 15:59:37 +0000 (16:59 +0100)]
GenericError.h - remove unused StringRef.h include. NFC.
Arthur Eubanks [Mon, 16 Mar 2020 19:32:36 +0000 (12:32 -0700)]
[X86] Codegen for preallocated
See https://reviews.llvm.org/D74651 for the preallocated IR constructs
and LangRef changes.
In X86TargetLowering::LowerCall(), if a call is preallocated, record
each argument's offset from the stack pointer and the total stack
adjustment. Associate the call Value with an integer index. Store the
info in X86MachineFunctionInfo with the integer index as the key.
This adds two new target independent ISDOpcodes and two new target
dependent Opcodes corresponding to @llvm.call.preallocated.{setup,arg}.
The setup ISelDAG node takes in a chain and outputs a chain and a
SrcValue of the preallocated call Value. It is lowered to a target
dependent node with the SrcValue replaced with the integer index key by
looking in X86MachineFunctionInfo. In
X86TargetLowering::EmitInstrWithCustomInserter() this is lowered to an
%esp adjustment, the exact amount determined by looking in
X86MachineFunctionInfo with the integer index key.
The arg ISelDAG node takes in a chain, a SrcValue of the preallocated
call Value, and the arg index int constant. It produces a chain and the
pointer fo the arg. It is lowered to a target dependent node with the
SrcValue replaced with the integer index key by looking in
X86MachineFunctionInfo. In
X86TargetLowering::EmitInstrWithCustomInserter() this is lowered to a
lea of the stack pointer plus an offset determined by looking in
X86MachineFunctionInfo with the integer index key.
Force any function containing a preallocated call to use the frame
pointer.
Does not yet handle a setup without a call, or a conditional call.
Does not yet handle musttail. That requires a LangRef change first.
Tried to look at all references to inalloca and see if they apply to
preallocated. I've made preallocated versions of tests testing inalloca
whenever possible and when they make sense (e.g. not alloca related,
inalloca edge cases).
Aside from the tests added here, I checked that this codegen produces
correct code for something like
```
struct A {
A();
A(A&&);
~A();
};
void bar() {
foo(foo(foo(foo(foo(A(), 4), 5), 6), 7), 8);
}
```
by replacing the inalloca version of the .ll file with the appropriate
preallocated code. Running the executable produces the same results as
using the current inalloca implementation.
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77689
Jonas Devlieghere [Wed, 20 May 2020 16:10:20 +0000 (09:10 -0700)]
[lldb/Reproducers] Support reproducers for PlatformRemoteGDBServer
Add reproducer support to PlatformRemoteGDBServer. The logic is
essentially the same as for ProcessGDBRemote. During capture we record
the GDB packets and during replay we connect to a replay server.
This fixes TestPlatformClient.py when run form a reproducer.
Differential Revision: https://reviews.llvm.org/D80224
MaheshRavishankar [Wed, 20 May 2020 15:57:32 +0000 (08:57 -0700)]
[mlir][Linalg] Add producer-consumer fusion when producer is a ConstantOp
and Consumer is a GenericOp.
Differential Revision: https://reviews.llvm.org/D79838
Jonas Devlieghere [Tue, 19 May 2020 21:01:23 +0000 (14:01 -0700)]
[lldb/Reproducers] Update macosx remote tests for passive replay
Skip tests or part thereof that are not supposed to work with replay.
Matt Arsenault [Mon, 18 May 2020 17:47:49 +0000 (13:47 -0400)]
AMDGPU/GlobalISel: Fix splitting 64-bit extensions
This was replicating the low bits into the high bits for G_ZEXT,
rather than using 0.
Nicolas Vasilache [Wed, 20 May 2020 13:52:55 +0000 (09:52 -0400)]
[mlir][Vector] Add option to fully unroll for VectorTransfer to SCF lowering
Summary:
Previously, the only support partial lowering from vector transfers to SCF was
going through loops. This requires a dedicated allocation and extra memory
roundtrips because LLVM aggregates cannot be indexed dynamically (for more
details see the [deep-dive](https://mlir.llvm.org/docs/Dialects/Vector/#deeperdive)).
This revision allows specifying full unrolling which removes this additional roundtrip.
This should be used carefully though because full unrolling will spill, negating the
benefits of removing the interim alloc in the first place.
Proper heuristics are left for a later time.
Differential Revision: https://reviews.llvm.org/D80100
Alexey Bataev [Wed, 20 May 2020 14:54:53 +0000 (10:54 -0400)]
[OPENMP][DOCS]Update status of implemented features, NFC.
Alex Zinenko [Wed, 20 May 2020 14:00:57 +0000 (16:00 +0200)]
[mlir] ensureRegionTerminator: take OpBuilder
The SingleBlockImplicitTerminator op trait provides a function
`ensureRegionTerminator` that injects an appropriate terminator into the block
if necessary, which is used during operation constructing and parsing.
Currently, this function directly modifies the IR using low-level APIs on
Operation and Block. If this function is called from a conversion pattern,
these manipulations are not reflected in the ConversionPatternRewriter and thus
cannot be undone or, worse, lead to tricky memory errors and malformed IR.
Change `ensureRegionTerminator` to take an instance of `OpBuilder` instead of
`Builder`, and use it to construct the block and the terminator when required.
Maintain overloads taking an instance of `Builder` and creating a simple
`OpBuilder` to use in parsers, which don't have an `OpBuilder` and cannot
interact with the dialect conversion mechanism. This change was one of the
reasons to make `<OpTy>::build` accept an `OpBuilder`.
Differential Revision: https://reviews.llvm.org/D80138
Alex Zinenko [Wed, 20 May 2020 14:00:47 +0000 (16:00 +0200)]
[mlir] SCFToStandard: support any ops in and around the control flow ops
Originally, the SCFToStandard conversion only declared Ops from the Standard
dialect as legal after conversion. This is undesirable as it would fail the
conversion if the SCF ops contained ops from any other dialect. Furthermore,
this would be problematic for progressive lowering of `scf.parallel` to
`scf.for` after `ensureRegionTerminator` is made aware of the pattern rewriting
infrastructure because it creates temporary `scf.yield` operations declared
illegal. Change the legalization target to declare any op other than `scf.for`,
`scf.if` and `scf.parallel` legal.
Differential Revision: https://reviews.llvm.org/D80137
Alex Zinenko [Wed, 20 May 2020 14:00:37 +0000 (16:00 +0200)]
[mlir] Erase or clear blocks through ConversionPatternRewriter when applicable
Multiple places in the code base were erasing Blocks or operations in them
using in-place modifications (`Block::erase` or `Block::clear`) unknown to
ConversionPatternRewriter. These operations could not be undone if the pattern
failed and could lead to inconsistent in-memory state of the IR with dangling
pointers. Use `ConversionPatternRewriter::eraseOp` and `::eraseBlock` instead.
Differential Revision: https://reviews.llvm.org/D80136
Alex Zinenko [Wed, 20 May 2020 14:00:27 +0000 (16:00 +0200)]
[mlir] DialectConversion: support erasing blocks
PatternRewriter has support for erasing a Block from its parent region, but
this feature has not been implemented for ConversionPatternRewriter that needs
to keep track of and be able to undo block actions. Introduce support for
undoing block erasure in the ConversionPatternRewriter by marking all the ops
it contains for erasure and by detaching the block from its parent region. The
detached block is stored in the action description and is not actually deleted
until the rewrites are applied.
Differential Revision: https://reviews.llvm.org/D80135
Alex Zinenko [Wed, 20 May 2020 13:59:54 +0000 (15:59 +0200)]
[mlir] DialectConversion: avoid double-free when rolling back op creation
Dialect conversion infrastructure may roll back op creation by erasing the
operations in the reverse order of their creation. While this guarantees uses
of values will be deleted before their definitions, this does not guarantee
that a parent operation will not be deleted before its child. (This may happen
in case of block inlining or if child operations, such as terminators, are
created in the parent's `build` function before the parent itself.) Handle the
parent/child relationship between ops by removing all child ops from the blocks
before erasing the parent. The child ops remain live, detached from a block,
and will be safely destroyed in their turn, which may come later than that of
the parent.
Differential Revision: https://reviews.llvm.org/D80134
Alex Zinenko [Wed, 20 May 2020 13:59:44 +0000 (15:59 +0200)]
[mlir] Toy tutorial: insert terminators at the end of the loop during rewrite
When creating temporary `scf.for` loops in `toy.print` lowering, the block
insertion point was erronously set up to the beginning of the block rather than
to its end, contradicting the comment just above the insertion point change.
The code was nevertheless operational because `scf.for` was setting up its
`scf.yield` terminator in an opaque to the pattern rewriting infrastructure
way. Now that it is about to change, the problem would have been exposed and
lead to conversion failures.
Differential Revision: https://reviews.llvm.org/D80133
Nicolas Vasilache [Wed, 20 May 2020 13:43:58 +0000 (09:43 -0400)]
[mlir][Linalg] NFC - Simplify GenericNestLoop builder
Summary: This revision trims unnecessary complexity.
Differential Revision: https://reviews.llvm.org/D80290
Nicolas Vasilache [Wed, 20 May 2020 13:10:21 +0000 (09:10 -0400)]
[mlir][Linalg] Refactor linalg tiling
Summary:
This revision refactors the Linalg tiling pass to be written as pattern applications and retires the use of the folder in Linalg tiling.
In the early days, tiling was written as a pass that would create (partially) folded and canonicalized operations on the fly for better composability.
As this evolves towards composition of patterns, the pass-specific folder is counter-productive and is retired.
The tiling options struct evolves to take a tile size creation function which allows materializing tile sizes on the fly (in particular constant tile sizes). This plays better with folding and DCE.
With the folder going away in Tiling, the check on whether subviews are the same in linalg fusion needs to be more robust. This revision also implements such a check.
In the current form, there are still some canonicalizations missing due to AffineMin/Max ops fed by scf::ForOp. These will be improved at a later time.
Differential Revision: https://reviews.llvm.org/D80267
Simon Pilgrim [Wed, 20 May 2020 13:38:25 +0000 (14:38 +0100)]
MachineMemOperand.h - replace Type.h with full GlobalValue.h include to fix -Wundefined-inline warnings.
Simon Pilgrim [Wed, 20 May 2020 13:31:01 +0000 (14:31 +0100)]
DIPrinter.h - reduce unnecessary includes to forward declarations. NFC.
Jay Foad [Wed, 20 May 2020 13:29:55 +0000 (14:29 +0100)]
[AMDGPU] Add the test from D49097.
Raphael Isemann [Wed, 20 May 2020 13:02:16 +0000 (15:02 +0200)]
[lldb][NFC] Minor NamespaceMap refactor
Melanie Blower [Fri, 15 May 2020 14:30:49 +0000 (07:30 -0700)]
[clang] FastMathFlags.allowContract should be initialized only from FPFeatures.allowFPContractAcrossStatement
Summary: Fix bug introduced in D72841 adding support for pragma float_control
Reviewers: rjmccall, Anastasia
Differential Revision: https://reviews.llvm.org/D79903
Alex Zinenko [Tue, 19 May 2020 14:43:54 +0000 (16:43 +0200)]
[mlir] NFC: rename tests related to SCF dialect from Loops to SCF
The dialect and conversions from/to it were renamed in previous commits.
Differential Revision: https://reviews.llvm.org/D80216
Simon Pilgrim [Wed, 20 May 2020 13:00:52 +0000 (14:00 +0100)]
GenericDomTreeConstruction.h - reorder includes. NFC.
Simon Pilgrim [Wed, 20 May 2020 12:52:22 +0000 (13:52 +0100)]
PseudoSourceValue.h - reduce GlobalValue.h include to forward declaration. NFC.
Exposes an implicit dependency on Type.h in MachineMemOperand.h
Simon Pilgrim [Wed, 20 May 2020 09:11:06 +0000 (10:11 +0100)]
PseudoSourceValue.h - remove unused operator declaration. NFC.
MSVC was warning that the definition for the MachineMemOperand stream handler doesn't exist.
Artem Dergachev [Wed, 20 May 2020 11:31:06 +0000 (14:31 +0300)]
[analyzer] Get scan-view executable from environment.
Fixes "Use of uninitialized value $ScanView in exec" error on systems
with scan-view executable not located in the expected place.
Patch by Oliver Tušla!
Differential Revision: https://reviews.llvm.org/D77880
Raphael Isemann [Wed, 20 May 2020 11:29:04 +0000 (13:29 +0200)]
Revert "[lldb-server] Reset stop reason of all threads when resuming"
This reverts commit
56de738d18e11c86169f0248b97b2854c37e35ce.
This broke the aarch64 bot. Reverting on behalf of jarin.
Tres Popp [Tue, 19 May 2020 04:21:00 +0000 (06:21 +0200)]
[mlir] Add custom assembly formats to shape.witness ops.
The assembly formats are essentially the generic forms without
quotations and type information.
Differential Revision: https://reviews.llvm.org/D80180
Pierre-vh [Wed, 8 Apr 2020 13:31:21 +0000 (14:31 +0100)]
[Target][ARM] Make Low Overhead Loops coexist with VPT blocks.
Previously, the LowOverheadLoops pass couldn't handle VPT blocks
with conditions, or with multiple VCTPs. This patch improves the
LowOverheadLoops pass so it can handle those cases.
It also adds support for VCMPs before the VCTP.
Differential Revision: https://reviews.llvm.org/D78206
Florian Hahn [Wed, 20 May 2020 11:21:06 +0000 (12:21 +0100)]
[Polly] Update ScalarEvolutionExpander.h include.
Sam Parker [Wed, 20 May 2020 08:18:42 +0000 (09:18 +0100)]
[NFCI][CostModel] Refactor getIntrinsicInstrCost
Combine the two API calls into one by introducing a structure to hold
the relevant data. This has the added benefit of moving the boiler
plate code for arguments and flags, into the constructors. This is
intended to be a non-functional change, but the complicated web of
logic involved here makes it very hard to guarantee.
Differential Revision: https://reviews.llvm.org/D79941
Dmitri Gribenko [Wed, 20 May 2020 09:59:47 +0000 (11:59 +0200)]
Revert "[lldb/DataFormatter] Check for overflow when finding NSDate epoch"
This reverts commit
b783f70a42575a5d9147bea1ac97e872370fe55b. This
change had multiple issues which required post-commit fixups, and not
all issues are fixed yet. In particular, the LLDB build bot for ARM is
still broken. There is also an ongoing conversation in the original
phabricator review about whether there is undefined behavior in the
code.
Dmitri Gribenko [Wed, 20 May 2020 09:59:27 +0000 (11:59 +0200)]
Revert "[lldb/test] Relax NSDate mock test for non-Apple platforms"
This reverts commit
fff3a8464d4d518c7086c928fba967908eb294d7. It is a
follow-up to
b783f70a42575a5d9147bea1ac97e872370fe55b, which I'm
reverting -- see the explanation in that revert.
Dmitri Gribenko [Wed, 20 May 2020 09:58:59 +0000 (11:58 +0200)]
Revert "[lldb/test] Disable NSDate format check under _WIN32"
This reverts commit
e3aa4cd9dbcee6441f51102e3958c35321698c67. It is a
follow-up to
b783f70a42575a5d9147bea1ac97e872370fe55b, which I'm
reverting -- see the explanation in that revert.
Dmitri Gribenko [Wed, 20 May 2020 09:56:16 +0000 (11:56 +0200)]
Revert "Silence warnings around int/float conversions."
This reverts commit
15ee8a3a58223b48afbe33cb60084f864ef20889. It is a
follow-up to
b783f70a42575a5d9147bea1ac97e872370fe55b, which I'm
reverting -- see the explanation in that revert.
Dmitri Gribenko [Wed, 20 May 2020 09:55:36 +0000 (11:55 +0200)]
Revert "[lldb/test] Move "DataFormatters/Mock.h" to "Plugins/Language/ObjC/Utilities.h""
This reverts commit
82dbf4aca84ec889d0dc390674ff44e30441bcfd. It is a
follow-up to
b783f70a42575a5d9147bea1ac97e872370fe55b, which I'm
reverting -- see the explanation in that revert.
Georgii Rymar [Mon, 18 May 2020 17:46:28 +0000 (20:46 +0300)]
[yaml2obj] - Implement the "Offset" property for the Fill Chunk.
Similar to a regular section chunk, a Fill should have this property.
This patch implements it.
Differential revision: https://reviews.llvm.org/D80190
Raphael Isemann [Wed, 20 May 2020 09:57:52 +0000 (11:57 +0200)]
[lldb][NFC] Modernize TestCPPStaticMethods
Now with LLVM code style and expect_expr for checking. Also some minor changes
to be more similar to the structure we use in other tests.
LLVM GN Syncbot [Wed, 20 May 2020 09:58:47 +0000 (09:58 +0000)]
[gn build] Port
bcbd26bfe61
Benjamin Kramer [Wed, 20 May 2020 09:55:37 +0000 (11:55 +0200)]
Florian Hahn [Wed, 20 May 2020 09:08:08 +0000 (10:08 +0100)]
[SCEV] Move ScalarEvolutionExpander.cpp to Transforms/Utils (NFC).
SCEVExpander modifies the underlying function so it is more suitable in
Transforms/Utils, rather than Analysis. This allows using other
transform utils in SCEVExpander.
This patch was originally committed as
b8a3c34eee06, but broke the
modules build, as LoopAccessAnalysis was using the Expander.
The code-gen part of LAA was moved to lib/Transforms recently, so this
patch can be landed again.
Reviewers: sanjoy.google, efriedma, reames
Reviewed By: sanjoy.google
Differential Revision: https://reviews.llvm.org/D71537
Kang Zhang [Wed, 20 May 2020 09:40:25 +0000 (09:40 +0000)]
[PowerPC] Enable machine verification for 3 passes
Summary:
For PowerPC, there are 3 passes has disabled the machine verification.
```
PPCTargetMachine.cpp: addPass(&LiveVariablesID, false);
PPCTargetMachine.cpp: addPass(createPPCEarlyReturnPass(), false);
PPCTargetMachine.cpp: addPass(createPPCBranchSelectionPass(), false);
```
This patch is to enable machine verification for above three passes.
Reviewed By: steven.zhang
Differential Revision: https://reviews.llvm.org/D79840
Georgii Rymar [Tue, 19 May 2020 09:44:26 +0000 (12:44 +0300)]
[llvm-readobj][test] - Deduplicate YAMLs in gnuhash.test and hash-table.test. NFCI.
We can use `-D` to generalize inputs. This patch does it.
Differential revision: https://reviews.llvm.org/D80199
Emre Kultursay [Wed, 20 May 2020 09:11:12 +0000 (11:11 +0200)]
Use IPv4 for Android connections
Summary:
When adb client connects to adb server, or when lldb connects to
lldb server on Android device, IPv6 does not work (at least on
Windows it does not work).
For Android on Windows, each IPv6 failure (fallback-to-IPv4) wastes
2 seconds, and since this is called 5 times when attaching, LLDB
is wasting 10 seconds. This CL brings a big improvement to attach latency.
Reviewers: labath
Reviewed By: labath
Subscribers: aadsm, clayborg, mgrang, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D79757
Jaroslav Sevcik [Wed, 20 May 2020 08:59:57 +0000 (10:59 +0200)]
[lldb-server] Reset stop reason of all threads when resuming
Summary:
This patch makes the stop reason reset logic similar to MacOS' debugserver, where exceptions are reset for all threads when resuming process for stepping or continuing (see [[ https://github.com/llvm/llvm-project/blob/
96f3ea0d21b48ca088355db10d4d1a2e9bc9f884/lldb/tools/debugserver/source/MacOSX/MachThreadList.cpp#L433 | MachThreadList::ProcessWillResume ]] and [[ https://github.com/llvm/llvm-project/blob/
96f3ea0d21b48ca088355db10d4d1a2e9bc9f884/lldb/tools/debugserver/source/MacOSX/MachThread.cpp#L363 | MachThread::ThreadWillResume ]]).
Resetting stop reasons on resume fixes problems where LLDB spuriously reports SIGTRAP signal stop reason for deleted breakpoints (both internal and public) and where LLDB stops on an internal breakpoint while stepping over while a breakpoint is hit in another thread. See [[ https://bugs.llvm.org/show_bug.cgi?id=45642 | PR45642 ]] for details.
Reviewed By: jingham, labath
Differential Revision: https://reviews.llvm.org/D79308
Simon Pilgrim [Wed, 20 May 2020 08:51:52 +0000 (09:51 +0100)]
SLPVectorizer.h - remove unused CommandLine.h include. NFC
Simon Pilgrim [Tue, 19 May 2020 16:12:32 +0000 (17:12 +0100)]
CommandFlags.h - remove unnecessary includes. NFC.
Replace with forward declarations and move necessary includes down to source files.
Exposes an implicit dependency on TargetMachine.h in llvm-opt-fuzzer.cpp
Jay Foad [Mon, 18 May 2020 15:24:18 +0000 (16:24 +0100)]
[IR] Simplify BasicBlock::removePredecessor. NFCI.
This is the second attempt at landing this patch, after fixing the
KeepOneInputPHIs behaviour to also keep zero input PHIs.
Differential Revision: https://reviews.llvm.org/D80141
Ying Yi [Fri, 15 May 2020 13:11:18 +0000 (14:11 +0100)]
Github access test: remove unnecessary whitespaces.
Pavel Labath [Wed, 20 May 2020 08:08:09 +0000 (10:08 +0200)]
Revert "Add terminateCommands to lldb-vscode protocol"
This reverts commit
a3609b0ec68522cb417ffe36ce9eb2e25ca61578, because it
makes a number of lldb-vscode tests flaky.
Tres Popp [Tue, 19 May 2020 07:05:09 +0000 (09:05 +0200)]
[mlir] Custom printing/parsing for Shape::AssumingOp
Summary:
Additionally, this adds traits and builder methods to AssumingYieldOp
and names the input witness to the AssumingOp.
Differential Revision: https://reviews.llvm.org/D80187
Tres Popp [Tue, 19 May 2020 04:24:41 +0000 (06:24 +0200)]
[mlir] Mark witness related Shape dialect ops as NoSideEffect.
Differential Revision: https://reviews.llvm.org/D80179
Balázs Kéri [Wed, 20 May 2020 06:58:17 +0000 (08:58 +0200)]
[Analyzer][StreamChecker] Added support for 'fread' and 'fwrite'.
Summary:
Stream functions `fread` and `fwrite` are evaluated
and preconditions checked.
A new bug type is added for a (non fatal) warning if `fread`
is called in EOF state.
Reviewers: Szelethus, NoQ, dcoughlin, baloghadamsoftware, martong, xazax.hun
Reviewed By: Szelethus
Subscribers: rnkovacs, xazax.hun, baloghadamsoftware, szepet, a.sidorin, mikhail.ramalho, Szelethus, donat.nagy, dkrupp, gamesh411, Charusso, martong, ASDenysPetrov, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D80015
Jay Foad [Wed, 20 May 2020 07:01:43 +0000 (08:01 +0100)]
Revert "[IR] Simplify BasicBlock::removePredecessor. NFCI."
This reverts commit
59f49f7ee7f3397e000f7e11facb4a5605cd1cab.
It was causing buildbot failures.
mydeveloperday [Wed, 20 May 2020 06:48:45 +0000 (07:48 +0100)]
[clang-format] [PR42164] Add Option to Break before While
Summary:
Its currently not possible to recreate the GNU style using the `BreakBeforeBraces: Custom` style due to a lack of missing `BeforeWhile` in the `BraceWrappingFlags`
The following request was raised to add `BeforeWhile` in a `do..while` context like `BeforeElse` and `BeforeCatch` to give greater control over the positioning of the `while`
https://bugs.llvm.org/show_bug.cgi?id=42164
Reviewers: krasimir, mitchell-stellar, sammccall
Reviewed By: krasimir
Subscribers: cfe-commits
Tags: #clang, #clang-format
Differential Revision: https://reviews.llvm.org/D79325
mydeveloperday [Wed, 20 May 2020 06:44:36 +0000 (07:44 +0100)]
[clang-format] [PR33890] Add support for Microsoft C++/CLI non standard for each looping extension
Summary:
https://bugs.llvm.org/show_bug.cgi?id=33890
This revision allow the microsoft `for each(.... in ...` nonstandard C++ extension which can be used in C++/CLI to be handled as a ForEach macro.
This prevents the breaking between the for and each onto a new line
Reviewed By: JakeMerdichAMD
Subscribers: cfe-commits
Tags: #clang, #clang-format
Differential Revision: https://reviews.llvm.org/D80228
mydeveloperday [Wed, 20 May 2020 06:42:07 +0000 (07:42 +0100)]
[clang-format][PR45816] Add AlignConsecutiveBitFields
Summary:
The following revision follows D80115 since @MyDeveloperDay and I apparently both had the same idea at the same time, for https://bugs.llvm.org/show_bug.cgi?id=45816 and my efforts on tooling support for AMDVLK, respectively.
This option aligns adjacent bitfield separators across lines, in a manner similar to AlignConsecutiveAssignments and friends.
Example:
```
struct RawFloat {
uint32_t sign : 1;
uint32_t exponent : 8;
uint32_t mantissa : 23;
};
```
would become
```
struct RawFloat {
uint32_t sign : 1;
uint32_t exponent : 8;
uint32_t mantissa : 23;
};
```
This also handles c++2a style bitfield-initializers with AlignConsecutiveAssignments.
```
struct RawFloat {
uint32_t sign : 1 = 0;
uint32_t exponent : 8 = 127;
uint32_t mantissa : 23 = 0;
}; // defaults to 1.0f
```
Things this change does not do:
- Align multiple comma-chained bitfield variables. None of the other
AlignConsecutive* options seem to implement that either.
- Detect bitfields that have a width specified with something other
than a numeric literal (ie, `int a : SOME_MACRO;`). That'd be fairly
difficult to parse and is rare.
Patch By: JakeMerdichAMD
Reviewed By: MyDeveloperDay
Subscribers: cfe-commits, MyDeveloperDay
Tags: #clang, #clang-format
Differential Revision: https://reviews.llvm.org/D80176