Fedor Sergeev [Sun, 17 May 2020 19:17:56 +0000 (02:17 +0700)]
Add missing include Host.h in llvm-mc-* fuzzers. NFC.
Fixes build failure in these fuzzers.
Nathan James [Sat, 16 May 2020 01:00:33 +0000 (02:00 +0100)]
[ASTMatchers] Added BinaryOperator hasOperands matcher
Summary: Adds a matcher called `hasOperands` for `BinaryOperator`'s when you need to match both sides but the order isn't important, usually on commutative operators.
Reviewers: klimek, aaron.ballman, gribozavr2, alexfh
Reviewed By: aaron.ballman
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D80054
JinGu Kang [Sun, 17 May 2020 18:49:37 +0000 (19:49 +0100)]
test commit
Simon Pilgrim [Sun, 17 May 2020 17:51:21 +0000 (18:51 +0100)]
Revert rGca18ce1a00cd8b7cb7ce0e130440f5ae1ffe86ee "GlobPattern.h - remove unnecessary BitVector.h/StringRef.h includes. NFC"
Causes lld build errors
Simon Pilgrim [Sun, 17 May 2020 17:29:27 +0000 (18:29 +0100)]
GlobPattern.h - remove unnecessary BitVector.h/StringRef.h includes. NFC
Use forward declarations (BitVector already had one) and an headers to source file that were implicitly using them.
Simon Pilgrim [Sun, 17 May 2020 17:03:15 +0000 (18:03 +0100)]
ImmutableGraph.h - remove unused raw_ostream.h include. NFC
Fangrui Song [Sun, 17 May 2020 16:31:09 +0000 (09:31 -0700)]
[XRay] Migrate xray_naive_log=true tests to xray_mode=xray-basic
Sanjay Patel [Sun, 17 May 2020 15:56:26 +0000 (11:56 -0400)]
[x86] favor vector constant load to avoid GPR to XMM transfer
This build vector lowering pattern came up in D79886.
I've tried to limit the improvement to cases where it looks
clearly better to load, but we could remove the 'TODO'
predicates already if we are willing to overlook some
corner cases.
Differential Revision: https://reviews.llvm.org/D80013
Sanjay Patel [Sun, 17 May 2020 15:40:27 +0000 (11:40 -0400)]
[InstCombine] add tests for FP cast of cast; NFC
A fold of casts is proposed as a backend transform in D79187,
but we can also do that in IR (and that may obsolete the need
for a backend transform).
Xing GUO [Sun, 17 May 2020 14:48:40 +0000 (22:48 +0800)]
[ObjectYAML][DWARF] Take into account other debug sections in DWARFYAML::Data::isEmpty().
Dylan McKay [Sun, 17 May 2020 14:18:54 +0000 (02:18 +1200)]
[AVR] Explicitly set the address of the data section when invoking the linker
This is required to get avr-gdb correctly showing values at the right
addresses. This problem was discovered by using debug symbols in an
external program to lookup values in an AVR simulator.
Nicolas Vasilache [Sun, 17 May 2020 14:15:58 +0000 (10:15 -0400)]
[mlir] NFC - VectorTransforms use OpBuilder where relevant
Summary: This will allow using unrolling outside of only rewrite patterns.
Differential Revision: https://reviews.llvm.org/D80083
Simon Pilgrim [Sun, 17 May 2020 13:58:17 +0000 (14:58 +0100)]
[X86] Add getTargetConstantFromBasePtr helper. NFC.
Allows us to share code from LoadSDNode and MemIntrinsicSDNode constant pool loads.
Simon Pilgrim [Sun, 17 May 2020 13:39:51 +0000 (14:39 +0100)]
[X86] getTargetConstantBitsFromNode - remove unnecessary X86ISD::VBROADCAST handling.
We create X86ISD::VBROADCAST_LOAD for constant pool folds now.
Sanjay Patel [Sun, 17 May 2020 12:43:40 +0000 (08:43 -0400)]
[InstCombine] improve analysis of FP->int->FP to eliminate fpextend
This was originally in D79116.
Converting from a narrow-enough FP source value to integer and
back to FP guarantees that the conversion to FP is exact because
of UB/poison-on-overflow.
This was suggested in PR36617:
https://bugs.llvm.org/show_bug.cgi?id=36617#c19
Florian Hahn [Sun, 17 May 2020 12:55:11 +0000 (13:55 +0100)]
[LoopUnroll] Extend test case with additional loop with larger TC.
Florian Hahn [Sun, 17 May 2020 12:26:51 +0000 (13:26 +0100)]
[LoopUnroll] Precommit test for PR459393.
Christudasan Devadasan [Tue, 21 Apr 2020 09:34:33 +0000 (15:04 +0530)]
[AMDGPU] Enable base pointer.
When the callee requires a dynamic stack realignment,
it is not possible to correcty access the incoming
stack arguments using the stack pointer. We reserve a
base pointer in such cases to access the function arguments
inside the callee. The base pointer will hold the incoming
stack pointer value before any kind of delta added to it.
Reviewed By: arsenm, scott.linder
Differential Revision: https://reviews.llvm.org/D78811
Joachim Protze [Sun, 17 May 2020 10:25:02 +0000 (12:25 +0200)]
[OpenMP] Fix race condition in the completion/freeing of detached tasks
Spurious assertion failures are symptoms of a race condition for the handling
of detached tasks:
Assertion failure at kmp_tasking.cpp(3744): taskdata->td_flags.complete == 1.
Assertion failure at kmp_tasking.cpp(710): taskdata->td_flags.executing == 0.
in the case of detach=true, all accesses to taskdata in __kmp_task_finish need
to happen before (~line 873):
taskdata->td_flags.proxy = TASK_PROXY;
This assignment signals to __kmp_fulfill_event, that the task will need to be
freed there. So, conceptionally the ownership of taskdata is moved.
Reviewed By: AndreyChurbanov
Differential Revision: https://reviews.llvm.org/D79702
Fedor Sergeev [Sun, 17 May 2020 09:31:33 +0000 (16:31 +0700)]
[Inliner][NFC] silence gcc 'overloaded-virtual' warning on hiding of Pass::doInitialization
When compiling with -Werror=overloaded-virtual, gcc emits this:
====
llvm/include/llvm/Pass.h:102:16: error: ‘virtual bool llvm::Pass::doInitialization(llvm::Module&)’ was hidden [-Werror=overloaded-virtual]
virtual bool doInitialization(Module &) { return false; }
^~~~~~~~~~~~~~~~
In file included from llvm/lib/Transforms/IPO/Inliner.cpp:20:0:
llvm/include/llvm/Transforms/IPO/Inliner.h:38:8: error: by ‘virtual bool llvm::LegacyInlinerBase::doInitialization(llvm::CallGraph&)’ [-Werror=overloaded-virtual]
bool doInitialization(CallGraph &CG) override;
^~~~~~~~~~~~~~~~
====
This is an old issue which has just started biting our downstream after
a slight rearrangement of includes around Inliner.
Fixing it similar to how doFinalization was done years ago.
Dylan McKay [Sun, 17 May 2020 04:46:32 +0000 (16:46 +1200)]
[LLVM][AVR] Support for R_AVR_6 fixup
Summary: Handle the emission of `R_AVR_6` ELF relocation type.
Reviewers: dylanmckay
Reviewed By: dylanmckay
Subscribers: hiraditya, Jim, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78721
Patch by @LemonBoy https://reviews.llvm.org/p/LemonBoy/
Dylan McKay [Sun, 17 May 2020 04:25:12 +0000 (16:25 +1200)]
[AVR] Fix I/O instructions on XMEGA
Summary:
On XMEGA, I/O address space is same as data address space - there is no 0x20 offset,
because CPU General Purpose Registers are not mapped in data address space.
From https://en.wikipedia.org/wiki/AVR_microcontrollers
> In the XMEGA variant, the working register file is not mapped into the data address space; as such, it is not possible to treat any of the XMEGA's working registers as though they were SRAM. Instead, the I/O registers are mapped into the data address space starting at the very beginning of the address space.
Reviewers: dylanmckay
Reviewed By: dylanmckay
Subscribers: hiraditya, Jim, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77207
Patch by Vlastimil Labsky.
Fangrui Song [Sun, 17 May 2020 06:32:28 +0000 (23:32 -0700)]
[Driver] Render -T for Gnu.cpp
clang -T a.lds a.c currently does not render -T.
Stephen Neuendorffer [Sun, 17 May 2020 05:42:32 +0000 (22:42 -0700)]
[MLIR][cmake] use LINK_LIBS PUBLIC for MLIRStandardOpsTransforms
Without this LLVM_LINK_LLVM_DYLIB is broken
Differential Revision: https://reviews.llvm.org/D80074
Fangrui Song [Sun, 17 May 2020 05:42:52 +0000 (22:42 -0700)]
[llvm-xray] consumeError when trying big-endian
Follow-up of rL341226.
Fixes "Expected<T> must be checked before access or destruction"
Arthur Eubanks [Fri, 15 May 2020 23:31:17 +0000 (16:31 -0700)]
[NFC] Run clang-format on ISDOpcodes.h
Subscribers: jfb, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D80050
Yi Kong [Sat, 16 May 2020 03:59:21 +0000 (11:59 +0800)]
[Compiler-rt] Emit error if builtins library cannot be found
Since setting COMPILER_RT_USE_BUILTINS_LIBRARY would remove -z,defs
flag, missing builtins library would continue to build unnoticed.
Explicitly emit an error in such case.
Differential Revision: https://reviews.llvm.org/D79470
Nico Weber [Sun, 17 May 2020 00:38:28 +0000 (20:38 -0400)]
Fix a few doc typos to cycle bots.
Nico Weber [Sun, 17 May 2020 00:32:58 +0000 (20:32 -0400)]
Try to heal bots after https://reviews.llvm.org/D79655
Craig Topper [Sat, 16 May 2020 22:48:08 +0000 (15:48 -0700)]
[LegalizeDAG] Use MachinePointerInfo::getUnknownStack in place of MachinePointerInfo() in a couple places. NFC
We know the pointer somewhere on the stack, we just don't know
exactly where since the index may be variable.
Differential Revision: https://reviews.llvm.org/D80060
Eli Friedman [Fri, 15 May 2020 20:23:14 +0000 (13:23 -0700)]
AllocaInst should store Align instead of MaybeAlign.
Along the lines of D77454 and D79968. Unlike loads and stores, the
default alignment is getPrefTypeAlign, to match the existing handling in
various places, including SelectionDAG and InstCombine.
Differential Revision: https://reviews.llvm.org/D80044
Craig Topper [Sat, 16 May 2020 19:38:34 +0000 (12:38 -0700)]
[X86] Replace selectScalarSSELoad ComplexPattern with PatFrags to handle the 3 types of loads we currently match.
This ensures we create mem operands for these instructions fixing PR45949.
Unfortunately, it increases the size of X86GenDAGISel.inc, but some dag
combine canonicalization could reduce the types of load we need to match.
Eli Friedman [Sat, 16 May 2020 21:01:54 +0000 (14:01 -0700)]
Harden IR and bitcode parsers against infinite size types.
If isSized is passed a SmallPtrSet, it uses that set to catch infinitely
recursive types (for example, a struct that has itself as a member).
Otherwise, it just crashes on such types.
faisal vali [Sat, 16 May 2020 20:12:04 +0000 (15:12 -0500)]
Revert "[nfc] test commit"
This reverts commit
0ee46e857d81ea815e5b11d266c0c118a2c2e714.
faisal vali [Sat, 16 May 2020 20:08:30 +0000 (15:08 -0500)]
[nfc] test commit
John McCall [Sat, 16 May 2020 18:44:54 +0000 (14:44 -0400)]
Expose IRGen API to add the default IR attributes to a function definition.
I've also made a stab at imposing some more order on where and how we add
attributes; this part should be NFC. I wasn't sure whether the CUDA use
case for libdevice should propagate CPU/features attributes, so there's a
bit of unnecessary duplication.
mydeveloperday [Sat, 16 May 2020 17:48:13 +0000 (18:48 +0100)]
The release notes for ObjCBreakBeforeNestedBlockParam was placed between the release note for IndentCaseBlocks and its example code
Remove other whitespace and line limit issues and double blank line issues
Sanjay Patel [Sat, 16 May 2020 17:08:01 +0000 (13:08 -0400)]
[VectorCombine] forward walk through instructions to improve chaining of transforms
This is split off from D79799 - where I was proposing to fully iterate
over a function until there are no more transforms. I suspect we are
still going to want to do something like that eventually.
But we can achieve the same gains much more efficiently on the current
set of regression tests just by reversing the order that we visit the
instructions.
This may also reduce the motivation for D79078, but we are still not
getting the optimal pattern for a reduction.
Sanjay Patel [Sat, 16 May 2020 16:50:16 +0000 (12:50 -0400)]
[PhaseOrdering] add vector reduction tests; NFC
These are based on tests originally included in:
D79078
Nikita Popov [Sat, 16 May 2020 16:46:03 +0000 (18:46 +0200)]
[InstCombine] Clean up alignment handling (NFC)
Now that load/store alignment is required, we can simplify code
in some places.
David Green [Sat, 16 May 2020 14:27:20 +0000 (15:27 +0100)]
[ARM] Patterns for VQSHRN
Given a VQMOVN(VSHR), we can fold that into a VQSHRN simply enough using
a few tablegen patterns.
Differential Revision: https://reviews.llvm.org/D77720
Sanjay Patel [Sat, 16 May 2020 16:44:00 +0000 (12:44 -0400)]
[VectorCombine] add reduction-like patterns; NFC
These are based on tests originally included in:
D79078
Jay Foad [Sat, 16 May 2020 15:00:02 +0000 (16:00 +0100)]
[AArch64] Precommit tests for D77316
Sanjay Patel [Fri, 15 May 2020 19:22:30 +0000 (15:22 -0400)]
[x86][CGP] try to hoist funnel shift above select-of-splats
This is basically the same patch as D63233, but converted to
funnel shifts rather than regular shifts. I did not see a
way to effectively share code for these 2 cases though.
This follows D79718 and D79827 to re-fix PR37426 because
that gets canonicalized to funnel shift intrinsics in IR.
I did draft an alternative patch as an enhancement to
"shouldSinkOperands()", but that was awkward because
we have to key the transform from the select, but then
look at both its users and its operands.
David Green [Sat, 16 May 2020 14:12:41 +0000 (15:12 +0100)]
[ARM] Combines for VMOVN
This adds two combines for VMOVN, one to fold
VMOVN[tb](c, VQMOVNb(a, b)) => VQMOVN[tb](c, b)
The other to perform demand bits analysis on the lanes of a VMOVN. We
know that only the bottom lanes of the second operand and the top or
bottom lanes of the Qd operand are needed in the result, depending on if
the VMOVN is bottom or top.
Differential Revision: https://reviews.llvm.org/D77718
David Green [Sat, 16 May 2020 13:54:33 +0000 (14:54 +0100)]
[ARM] MVE saturating truncates
This adds some custom lowering for VQMOVN, an instruction that can be
used to perform saturating truncates from a pair of min(max(X, -0x8000),
0x7fff), providing those constants are correct. This leaves a VQMOVNBs
which saturates the value and inserts that into the bottom lanes of an
existing vector. We then need to do something with the other lanes,
extending the value using a vmovlb.
Ideally, as will often be the case, only the bottom lane of what remains
will be demanded, allowing the vmovlb to be removed. Which should mean
the instruction is either equal or a win most of the time, and allows
some extra follow-up folding to happen.
Differential Revision: https://reviews.llvm.org/D77590
Simon Pilgrim [Sat, 16 May 2020 13:40:00 +0000 (14:40 +0100)]
DIEHash.cpp - remove headers explicitly included in DIEHash.h. NFC.
Don't duplicate module header includes.
Simon Pilgrim [Sat, 16 May 2020 13:39:21 +0000 (14:39 +0100)]
AggressiveAntiDepBreaker.cpp - remove headers explicitly included in AggressiveAntiDepBreaker.h. NFC.
Don't duplicate module header includes.
Simon Pilgrim [Sat, 16 May 2020 13:38:40 +0000 (14:38 +0100)]
LLParser.cpp - remove headers explicitly included in LLParser.h. NFC.
Don't duplicate module header includes.
Simon Pilgrim [Sat, 16 May 2020 12:28:59 +0000 (13:28 +0100)]
Fix -Wdocumentation warning. NFC.
Remove non-existant DataLayoutCallback param comment.
David Green [Sat, 16 May 2020 13:23:26 +0000 (14:23 +0100)]
[ARM] Extra VQMOVN/VQSHRN tests. NFC
Denis Khalikov [Sat, 16 May 2020 07:56:58 +0000 (10:56 +0300)]
[mlir][spirv] Handle debuginfo for control flow ops.
Summary:
Handle debuginfo for control flow operations: spv.Selection,
spv.Loop, spv.BranchOp, spv.BranchConditional.
Differential Revision: https://reviews.llvm.org/D79931
Nikita Popov [Fri, 1 May 2020 13:19:41 +0000 (15:19 +0200)]
[ValueTracking] Fix computeKnownBits() with bitwidth-changing ptrtoint
computeKnownBitsFromAssume() currently asserts if m_V matches a
ptrtoint that changes the bitwidth. Because InstCombine
canonicalizes ptrtoint instructions to use explicit zext/trunc,
we never ran into the issue in practice. I'm adding unit tests,
as I don't know if this can be triggered via IR anywhere.
Fix this by calling anyextOrTrunc(BitWidth) on the computed
KnownBits. Note that we are going from the KnownBits of the
ptrtoint result to the KnownBits of the ptrtoint operand,
so we need to truncate if the ptrtoint zexted and anyext if
the ptrtoint truncated.
Differential Revision: https://reviews.llvm.org/D79234
David Zarzycki [Sat, 16 May 2020 11:08:42 +0000 (07:08 -0400)]
[libcxx testing] Remove ALLOW_RETRIES from last futures test
Like other uses of ALLOW_RETRIES, this test tried to verify that an API
returned "quickly" but quick is not safe to define given slow and/or
busy machines.
Instead, we now verify that these "wait" APIs actually wait, which the
old test did not.
Craig Topper [Sat, 16 May 2020 08:02:06 +0000 (01:02 -0700)]
[LegalizeDAG] Use getMemBasePlusOffset to simplify some code. Use other signature of getMemBasePlusOffset in another location. NFCI
The code was calculating an offset from a stack pointer SDValue.
This is exactly what getMemBasePlusOffset does. I also replaced
sizeof(int) with a hardcoded 4. We know the type we're operating
on is 4 bytes. But the size of int that the source code is being
compiled with isn't guaranteed to be 4 bytes.
While here replace another use of getMemBasePlusOffset that was
proceeded with a call to getConstant with the other signature
that call getConstant internally.
Craig Topper [Fri, 15 May 2020 19:44:52 +0000 (12:44 -0700)]
[LegalizeVectorTypes] Remove non-constnat INSERT_SUBVECTOR handling. NFC
Now that D79814 has landed, we can assume that subvector ops use constant, in-range indices.
Ten Tzen [Sat, 16 May 2020 05:03:43 +0000 (22:03 -0700)]
[Windows EH] Fix the order of Nested try-catches in $tryMap$ table
This bug is exposed by Test7 of ehthrow.cxx in MSVC EH suite where
a rethrow occurs in a try-catch inside a catch (i.e., a nested Catch
handlers). See the test code in
https://github.com/microsoft/compiler-tests/blob/master/eh/ehthrow.cxx#L346
When an object is rethrown in a Catch handler, the copy-ctor of this
object must be executed after the destructions of live objects, but
BEFORE the dtors of live objects in parent handlers.
Today Windows 64-bit runtime (__CxxFrameHandler3 & 4) expects nested Catch
handers
are stored in pre-order (outer first, inner next) in $tryMap$ table, so
that given a State, its Catch's beginning State can be properly
retrieved. The Catch beginning state (which is also the ending State) is
the State where rethrown object's copy-ctor must take place.
LLVM currently stores nested catch handlers in post-ordering because
it's the natural way to compute the highest State in Catch.
The fix is to simply store TryCatch handler in pre-order, but update
Catch's highest State after child Catches are all processed.
Differential Revision: https://reviews.llvm.org/D79474?id=263919
Heejin Ahn [Sat, 16 May 2020 04:33:44 +0000 (21:33 -0700)]
Revert "[WebAssembly] Handle exception specifications"
This reverts commit
bca347508c86647f9d44992275c9a364fbd9fb0d.
This broke clang/test/Misc/warning-flags.c, because the newly added
warning option in this commit didn't have a matching flag.
Heejin Ahn [Fri, 8 May 2020 23:19:46 +0000 (16:19 -0700)]
[WebAssembly] Handle exception specifications
Summary:
Wasm currently does not fully handle exception specifications. Rather
than crashing, this treats `throw()` in the same way as `noexcept`, and
ignores and prints a warning for `throw(type, ..)`, for a temporary
measure.
Reviewers: dschuff
Subscribers: sbc100, jgravelle-google, sunfish, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D79655
Carl Ritson [Sat, 16 May 2020 02:54:31 +0000 (11:54 +0900)]
[AMDGPU] Allow use of StackPtrOffsetReg when building spills
Summary:
When spilling in the entry function we should be able to borrow
StackPtrOffsetReg as a last resort. This restores behaviour
removed in D75138, and fixes failures when shaders use all
SGPRs, VGPRs and spill in the entry function.
Reviewers: scott.linder, arsenm, tpr
Reviewed By: scott.linder, arsenm
Subscribers: qcolombet, foad, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D79776
Pete Steinfeld [Tue, 12 May 2020 16:53:58 +0000 (09:53 -0700)]
[flang] Constraint checks C751 to C760
Summary:
Many of these were already implemented, and I just annotated the tests and/or
the code.
C752 was a simple check to verify that CONTIGUOUS components are arrays with
C754 proved to be virtually identical to C750 that I implemented previously.
This caused me to remove the distinction between specification expressions for
type parameters and bounds expressions that I'd previously created.
the POINTER attribute.
I also changed the error messages to specify that errors in specification
expressions could arise from either bad derived type components or type
parameters.
In cases where we detect a type param that was not declared, I created a symbol
marked as erroneous. That avoids subsequent semantic process for expressions
containing the symbol. This change caused me to adjust tests resolve33.f90 and
resolve34.f90. Also, I avoided putting out error messages for erroneous type
param symbols in `OkToAddComponent()` in resolve-names.cpp and in
`EvaluateParameters()`, type.cpp.
C756 checks that procedure components have the POINTER attribute.
Reviewers: tskeith, klausler, DavidTruby
Subscribers: llvm-commits
Tags: #llvm, #flang
Differential Revision: https://reviews.llvm.org/D79798
Nathan James [Sat, 16 May 2020 00:14:55 +0000 (01:14 +0100)]
[clang-tidy] Transformer checks now store IncludeStyle option
Eric Christopher [Fri, 15 May 2020 23:30:11 +0000 (16:30 -0700)]
Fix go bindings after FixedVectorType -> VectorType change.
Diogo Sampaio [Fri, 15 May 2020 21:21:13 +0000 (22:21 +0100)]
Prevent register coalescing in functions whith setjmp
Summary:
In the the given example, a stack slot pointer is merged
between a setjmp and longjmp. This pointer is spilled,
so it does not get correctly restored, addinga undefined
behaviour where it shouldn't.
Change-Id: I60ec010844f2a24ce01ceccf12eb5eba5ab94abb
Reviewers: eli.friedman, thanm, efriedma
Reviewed By: efriedma
Subscribers: MatzeB, qcolombet, tpr, rnk, efriedma, hiraditya, llvm-commits, chill
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77767
Thomas Preud'homme [Tue, 12 May 2020 22:39:45 +0000 (23:39 +0100)]
[test] Improve FileCheck's numeric-expression.txt
Summary:
Various improvement for FileCheck's numeric-expression.txt test:
- remove unused values in USE DEF FMT IMPL MATCH section
- replace 14 literal for 0xe and 0xE to have example of hex literals
- rename variable to be more self-descriptive
- move CHECK as comment of the values being matched to help readability
- add conversion tests
- simplify test for use of several numeric variables by using existing
variable
- adjust position of error message check to match the alignment of the
error message wrt. the output matched by the previous check
Reviewed By: jhenderson, jdenny
Differential Revision: https://reviews.llvm.org/D79820
Eric Christopher [Fri, 15 May 2020 22:50:28 +0000 (15:50 -0700)]
Fix flang build after mlir SideEffects.h -> SideEffectInterfaces.h change.
Casey Carter [Fri, 15 May 2020 22:14:57 +0000 (15:14 -0700)]
Cleanup some test issues:
* improve coverage in `span`'s "conversion from `std::array`" test, while eliminating MSVC diagnostics about `testConstructorArray<T>() && testConstructorArray<const T, T>()` being redundant when `T` is already `const`.
* Remove use of `is_assignable` that triggers UB due to an insufficiently-complete type argument in `std::function`'s assignment operator test.
* Don't test that `shared_ptr` initialization from an rvalue triggers the lvalue aliasing constructor on non-libc++; this is not the case for Standard Libraries that implement LWG-2996. (Ditto, I'd simply remove this but it's your library ;).)
Differential Revision: https://reviews.llvm.org/D80030
Eli Friedman [Fri, 15 May 2020 22:15:09 +0000 (15:15 -0700)]
Fix polly tests after D79968.
David Green [Fri, 15 May 2020 20:55:15 +0000 (21:55 +0100)]
[ARM] Change more triples to arm-none-none-eabi. NFC
Saleem Abdulrasool [Fri, 15 May 2020 21:43:19 +0000 (14:43 -0700)]
unwind: fix unwind build without heap
Add a missing guard for `_LIBUNWIND_NO_HEAP` around code dealing with the
`.cfi_remember_state` and `.cfi_restore_state` instructions.
Patch by Amanieu d'Antras!
Stephen Neuendorffer [Wed, 13 May 2020 19:01:40 +0000 (12:01 -0700)]
[MLIR] Move JitRunner to live with ExecutionEngine
The JitRunner library is logically very close to the execution engine,
and shares similar dependencies.
find -name "*.cpp" -exec sed -i "s/Support\/JitRunner/ExecutionEngine\/JitRunner/" "{}" \;
Differential Revision: https://reviews.llvm.org/D79899
Stephen Neuendorffer [Wed, 13 May 2020 18:46:06 +0000 (11:46 -0700)]
[MLIR][cmake] refactor lib/Interfaces/CMakeLists.txt
Reduce the boilerplate here
Differential Revision: https://reviews.llvm.org/D79896
Stephen Neuendorffer [Wed, 13 May 2020 17:27:19 +0000 (10:27 -0700)]
[MLIR] Continue renaming of "SideEffects"
MLIRSideEffects -> MLIRSideEffectInterfaces
SideEffects.h -> SideEffectInterfaces.h
SideEffects.cpp -> SideEffectInterface.cpp
Note that I haven't renamed TableGen/SideEffects.h or TableGen/SideEffects.cpp
find -name "*.h" -exec sed -i "s/SideEffects.h/SideEffectInterfaces.h/" "{}" \;
find -name "CMakeLists.txt" -exec sed -i "s/MLIRSideEffects/MLIRSideEffectInterfaces/" "{}" \;
Differential Revision: https://reviews.llvm.org/D79890
Stephen Neuendorffer [Fri, 15 May 2020 21:32:58 +0000 (14:32 -0700)]
[MLIR] Update intrinsic test, because ptrmask changed.
See
adda9c0a4f63.
Differential Revision: https://reviews.llvm.org/D80036
Hubert Tong [Fri, 15 May 2020 21:15:04 +0000 (17:15 -0400)]
[CMake][AIX] Add `-bcdtors:mbr` option when building with IBM XL
Summary:
The `-bcdtors:mbr` option causes processing for constructors and
destructors to omit otherwise-unreferenced members of static libraries,
matching the processing done on Linux, where `--whole-archive` is not
the default. Applying this option is desirable for reducing the
footprint of an installation.
Reviewed By: daltenty
Differential Revision: https://reviews.llvm.org/D79749
Hubert Tong [Fri, 15 May 2020 21:12:38 +0000 (17:12 -0400)]
[test][ARM][CMSE] Use clang_cc1 in arm_cmse.h tests
Summary:
The `arm_cmse.h` header includes standard headers, but some tests that
include this header explicitly specify a target. The standard headers
found via the standard include paths need not be compatible with the
explicitly-specified target from the tests. In order to avoid test
failures caused by such incompatibility, this patch uses `%clang_cc1`,
which doesn't pick up the host system headers.
Reviewed By: chill
Differential Revision: https://reviews.llvm.org/D79693
Hubert Tong [Fri, 15 May 2020 21:09:08 +0000 (17:09 -0400)]
[tests][Driver] Set `--sysroot=""` to allow `DEFAULT_SYSROOT` build
Summary:
If `DEFAULT_SYSROOT` is configured to some path, some tests would fail.
This patch overrides `sysroot` to be the empty string in the style of
D66834 so that the tests will pass even when the build is configured
with a `DEFAULT_SYSROOT`.
Reviewed By: mstorsjo
Differential Revision: https://reviews.llvm.org/D79694
Stephen Neuendorffer [Fri, 15 May 2020 21:22:35 +0000 (14:22 -0700)]
[MLIR] LinalgToStandard: use LINK_LIBS rather than target_link_libraries.
Also, missing MLIRTransforms as a dependency. This breaks BUILD_SHARED_LIBS=on
Differential Revision: https://reviews.llvm.org/D80035
Fangrui Song [Sun, 26 Apr 2020 19:12:43 +0000 (12:12 -0700)]
[CMake] -gen-dag-isel: add -omit-comments if neither Debug nor RelWithDebInfo
Omitting comments can make the output much smaller. Size/time impact on
my machine:
* lib/Target/AArch64/AArch64GenDAGISel.inc, 10MiB (8.89s) -> 5MiB (3.20s)
* lib/Target/X86/X86GenDAGISel.inc, 20MiB (6.48s) -> 8.5MiB (4.18s)
In total, this change decreases lib/Target/*/*GenDAGISel.inc from
71.4MiB to 30.1MiB.
As rnk suggested, we can consider an option next to LLVM_OPTIMIZED_TABLEGEN
once we have more needs like this.
Reviewed By: thakis
Differential Revision: https://reviews.llvm.org/D78884
Vitaly Buka [Fri, 15 May 2020 20:24:08 +0000 (13:24 -0700)]
[NFC,StackSafety] Rename local function
Nico Weber [Fri, 15 May 2020 20:15:40 +0000 (16:15 -0400)]
[gn build] Put HAVE_LIBZ and HAVE_ZLIB_H behind llvm_enable_zlib too.
In the CMake build, the HAVE_ vars are set based on system inspection,
and LLVM_ENABLE_ZLIB is set to false if neither's found. The GN build
doesn't do autodetection like this.
With this change, people can set llvm_enable_zlib=true on Windows
and as long as they provide a zlib.lib things should actually work.
(https://reviews.llvm.org/D79219 will remove 2 of the 3 config.h
values, hopefully soon. This change here just makes things a tiny
bit easier until that change is in.)
Med Ismail Bennani [Sat, 9 May 2020 08:10:35 +0000 (10:10 +0200)]
[lldb/Commands] Add ability to run shell command on the host.
This patch introduces the `(-h|--host)` option to the `platform shell`
command. It allows the user to run shell commands from the host platform
(always available) without putting lldb in the background.
Since the default behaviour of `platform shell` is to run the command of
the selected platform, having such a choice can be quite handy when
debugging remote targets, for instances.
This patch also introduces a `shell` alias, to improve the command
discoverability and make it more convenient to use for the user.
rdar://
62856024
Differential Revision: https://reviews.llvm.org/D79659
Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
Med Ismail Bennani [Thu, 7 May 2020 05:28:19 +0000 (07:28 +0200)]
[lldb/Dataformatter] Add support to CF{Dictionary,Set}Ref types
This patch improves data formatting for CFDictionaryRef and CFSetRef.
It uses the same data-formatter as NSCFDictionaries and NSCFSets introduced
previously but did require some adjustments in Core::ValueObject.
Since the "Ref" types are opaque pointers to the actual CF containers, if the
value object has a synthetic value, lldb will use the opaque pointer's pointee
type to create the new ValueObjectChild needed to dereference the ValueObject.
This allows the "Ref" types to behaves the same as CF containers when used with
the `frame variable` command, the SBAPI or in Xcode's variable inspector.
This patch also adds support for incomplete types in ValueObject.
rdar://
53104287
Differential Revision: https://reviews.llvm.org/D79554
Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
mydeveloperday [Fri, 15 May 2020 19:51:08 +0000 (20:51 +0100)]
[clang-format] [PR44345] Long namespace closing comment is duplicated endlessly
Summary:
https://bugs.llvm.org/show_bug.cgi?id=44345
When namespaces get long the namespace end comment wraps onto the next line
```
namespace would::it::save::you::a::lot::of::time::if_::i::just::gave::up::and_::
went::mad::now {
void foo();
void bar();
} // namespace
// would::it::save::you::a::lot::of::time::if_::i::just::gave::up::and_::went::mad::now
```
If clang-format it applied successively it will duplicate the end comment
```
namespace would::it::save::you::a::lot::of::time::if_::i::just::gave::up::and_::
went::mad::now {
void foo();
void bar();
} // namespace
// would::it::save::you::a::lot::of::time::if_::i::just::gave::up::and_::went::mad::now
// would::it::save::you::a::lot::of::time::if_::i::just::gave::up::and_::went::mad::now
```
This revision checks to ensure the end comment is not on the next line before adding yet another comment
Reviewed By: krasimir
Subscribers: cfe-commits
Tags: #clang, #clang-format
Differential Revision: https://reviews.llvm.org/D79935
Christopher Tetreault [Fri, 15 May 2020 19:32:24 +0000 (12:32 -0700)]
[SVE] Remove usages of VectorType::getNumElements() from ARM
Reviewers: efriedma, fpetrogalli, kmclaughlin, grosbach, dmgreen
Reviewed By: dmgreen
Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, dmgreen, danielkiss, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D79816
Siva Chandra Reddy [Mon, 27 Apr 2020 18:32:11 +0000 (11:32 -0700)]
[libc] Move implementations of expf and exp2f from the AOR to src/math.
Reviewers: phosek
Differential Revision: https://reviews.llvm.org/D79149
Christopher Tetreault [Fri, 15 May 2020 19:18:37 +0000 (12:18 -0700)]
[SVE] Remove usages of VectorType::getNumElements() from PowerPC
Reviewers: efriedma, sdesmalen, c-rhodes, hfinkel
Reviewed By: c-rhodes
Subscribers: wuzish, nemanjai, tschuett, hiraditya, kbarton, rkruppe, psnobl, shchenz, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D79821
Mircea Trofin [Fri, 15 May 2020 05:38:41 +0000 (22:38 -0700)]
Revert "Revert "[llvm][NFC] Cleanup uses of std::function in Inlining-related APIs""
This reverts commit
454de99a6fec705e76ed7743bf538f7a77296f59.
The problem was that one of the ctor arguments of CallAnalyzer was left
to be const std::function<>&. A function_ref was passed for it, and then
the ctor stored the value in a function_ref field. So a std::function<>
would be created as a temporary, and not survive past the ctor
invocation, while the field would.
Tested locally by following https://github.com/google/sanitizers/wiki/SanitizerBotReproduceBuild
Original Differential Revision: https://reviews.llvm.org/D79917
Eli Friedman [Thu, 14 May 2020 21:48:10 +0000 (14:48 -0700)]
StoreInst should store Align, not MaybeAlign
This is D77454, except for stores. All the infrastructure work was done
for loads, so the remaining changes necessary are relatively small.
Differential Revision: https://reviews.llvm.org/D79968
Zola Bridges [Wed, 13 May 2020 18:43:15 +0000 (11:43 -0700)]
[clang][slh] Add test for SLH feature checking macro
Summary:
I forgot to include a test in this commit:
https://reviews.llvm.org/rG379e68a763097bed55556c6dc7453e4b732e3d68
Here's the test. It passes after that commit and fails before that commit.
Reviewed By: mattdr
Differential Revision: https://reviews.llvm.org/D79894
Scott Linder [Fri, 15 May 2020 18:54:02 +0000 (14:54 -0400)]
[NFC] Deduplicate comment in PromoteMemoryToRegister.cpp
This has been duplicated since before
2372a193ba904fdc85de3cc559e0bc162f14f144, but that commit has it
appearing twice in the space of 10 lines of the same function body. It
could also be hoisted up to the point just after where the last
special-case is considered, but I want to keep the intent of the
original authors.
Committed as obvious without a review.
Thomas Lively [Fri, 15 May 2020 19:12:20 +0000 (12:12 -0700)]
[WebAssembly] Optimize splats of bitcasted vectors
Summary:
This new custom DAG combine fixes a codegen issue with the
wasm_simd128.h intrinsics. Clang lowers the
return (v128_t)(__f32x4){__a, __a, __a, __a};
body of f32x4_splat to a splat shuffle of a bitcasted vector, as seen
in the new simd-shuffle-bitcast.ll test. The bitcast interfered with
the target-independent DAG combine that combines splat shuffles into
BUILD_VECTOR nodes, so this patch introduces a new custom DAG combine
to hoist the bitcast out of the shuffle, allowing the
target-independent combine to work as intended.
Reviewers: aheejin, dschuff
Subscribers: sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D80021
Hongtao Yu [Tue, 12 May 2020 05:39:59 +0000 (22:39 -0700)]
[LLD][ELF] Use offset in thin archives to disambiguate thinLTO members
This is fixing a thinLTO module collision issue for thin archives. The problem is that we always use a zero offset to name members in a thin archive and that causes the following build error:
ld.lld: error: Expected at most one ThinLTO module per bitcode file
which happens to a thin archive that has two members with the same object file name (whose paths will be ignored by thinLTO driver)
The fix here is to use real member offset instead as is done for non-thin archives.
Differential Revision: https://reviews.llvm.org/D79880
Eli Friedman [Fri, 15 May 2020 00:29:55 +0000 (17:29 -0700)]
[AArch64][SVE] Implement AArch64ISD::SETCC_PRED
This unifies SETCC operations along the lines of other operations.
Differential Revision: https://reviews.llvm.org/D79975
Christopher Tetreault [Fri, 15 May 2020 17:45:42 +0000 (10:45 -0700)]
[SVE] Restore broken LLVM-C ABI compatability
Reviewers: deadalnix, efriedma, rengolin, jyknight, joerg
Reviewed By: joerg
Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D79915
Matt Arsenault [Fri, 15 May 2020 17:33:56 +0000 (13:33 -0400)]
IR: Remove extra name mangling from llvm.ptrmask
This should not be allowed to change the address space of the source
and result, so the pointer types should match. The only emitter of
this seems to be a disable clang change, so no tests to update.
Daniel Grumberg [Fri, 15 May 2020 18:26:07 +0000 (11:26 -0700)]
[NFC] Whitespace fix inside OptParserEmitter
Jinsong Ji [Fri, 15 May 2020 15:21:49 +0000 (15:21 +0000)]
[compiler-rt][CMAKE] Only add cmake link flags in standalone build
Only add CMAKE_EXE_LINKER_FLAGS when in a standalone bulid.
Or else CMAKE_EXE_LINKER_FLAGS contains flags for build compiler of Clang/llvm.
This might not be the same as what the COMPILER_RT_TEST_COMPILER supports.
eg: the build compiler use lld linker and we use it to build clang with
default ld linker then to be tested clang will complain about lld
options like --color-diagnostics.
Reviewed By: phosek
Differential Revision: https://reviews.llvm.org/D78373
Louis Dionne [Fri, 15 May 2020 18:20:59 +0000 (14:20 -0400)]
[libc++] Remove -ftemplate-depth when running tests
It doesn't appear to be needed anymore with the Clang on our build bots.
Siva Chandra Reddy [Sat, 9 May 2020 06:19:17 +0000 (23:19 -0700)]
[libc] Add implementation of fabs and fabsf.
Reviewers: phosek
Differential Revision: https://reviews.llvm.org/D79725