Pavel Labath [Fri, 16 Feb 2018 09:29:41 +0000 (09:29 +0000)]
[lldb][PPC64] Fixed vector and struct return value
Summary:
The PowerPC64 ABI plugin was modified to:
- properly handle vector type return values
- implement support for struct/class return values
A refactoring in the code that handles return values was also performed, to make it possible to handle structs without repeating (when possible) code that handles its fields.
There was also an issue with CreateInstance(), that only created an instance in the first time it was called and then cached it in a static var. When restarting a process under LLDB's control, the ABI's process weak pointer would become null, and using it would result in a segmentation fault. This issue became more evident after the latest changes to PPC64 plugin, that now uses the process pointer to get the target byte order, making LLDB to seg fault when restarting a program. This was fixed by making CreateInstance() to always create a new ABI instance.
All of LLDB's ReturnValue tests are passing for PPC64le now. It should work for PPC64be too, although this was not tested.
Reviewers: labath, clayborg
Reviewed By: labath
Subscribers: lbianc, anajuliapc, llvm-commits, alexandreyy, nemanjai, kbarton
Differential Revision: https://reviews.llvm.org/D42468
Patch by Leandro Lupori <leandro.lupori@gmail.com>.
llvm-svn: 325324
Roger Ferrer Ibanez [Fri, 16 Feb 2018 09:23:59 +0000 (09:23 +0000)]
[ARM] Materialise some boolean values to avoid a branch
This patch combines some cases of ARMISD::CMOV for integers that arise in comparisons of the form
a != b ? x : 0
a == b ? 0 : x
and that currently (e.g. in Thumb1) are emitted as branches.
Differential Revision: https://reviews.llvm.org/D34515
llvm-svn: 325323
Pavel Labath [Fri, 16 Feb 2018 09:21:11 +0000 (09:21 +0000)]
[dosep] Run tests in a more parallel fashion
Summary:
Due to in-tree builds, we were parallelizing the tests at the directory
level. Now that the tests are built out-of-tree, we can remove this
limitation and paralelize at file level instead.
This decreases test suite time by about 10% for me, which is not
world-shattering, but it makes the code slightly simpler and will also
allow us to merge tests which were artificially spread over multiple
folders (TestConcurrentEvents...) to work-around this limitation.
To make this work, I've also needed to include the test file name in the
build directory name, as just the test method name is not unique enough
(plenty of tests have a test method called "test" or similar).
While doing this, I've found a couple of tests that are taking waaay longer then
they ought to (TestBreakpointCaseSensitivity -- 90 seconds), which I plan to
look into in the future.
Reviewers: aprantl
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D43335
llvm-svn: 325322
Akira Hatanaka [Fri, 16 Feb 2018 08:47:37 +0000 (08:47 +0000)]
[Sema] Take into account the current context when checking the
accessibility of a class member.
This fixes PR32898.
rdar://problem/
33737747
Differential revision: https://reviews.llvm.org/D36918
llvm-svn: 325321
Eugene Leviant [Fri, 16 Feb 2018 08:11:04 +0000 (08:11 +0000)]
[ThinLTO] Import global variables
Differential revision: https://reviews.llvm.org/D43077
llvm-svn: 325320
Vedant Kumar [Fri, 16 Feb 2018 07:59:43 +0000 (07:59 +0000)]
[Coverage] Handle break/continue outside of loop bodies
Teach the coverage mapping logic to handle break or continue statements
within for loop increments.
Fixes llvm.org/PR36406.
llvm-svn: 325319
Craig Topper [Fri, 16 Feb 2018 07:16:15 +0000 (07:16 +0000)]
[X86] Allow CMOVs of constants to be sign extended from i32.
Sign extending i32 constants only requires a REX prefix as does widening the CMOV. This is cheaper than the explicit sign extend op.
llvm-svn: 325318
Craig Topper [Fri, 16 Feb 2018 06:52:43 +0000 (06:52 +0000)]
[X86] Don't zero_extend cmov up to i64, stop at i32.
Zero extend from i32 to i64 is free. So extend from i16 to i32, and then use a free zero extend to finish.
llvm-svn: 325317
Rui Ueyama [Fri, 16 Feb 2018 04:27:46 +0000 (04:27 +0000)]
Fix an issue that weak bit is dropped when there's a lazy object symbol.
Previously, we accidentally dropped STB_WEAK bit from an undefined symbol
if there is a lazy object symbol with the same name. That caused a
compatibility issue with GNU gold.
llvm-svn: 325316
Kamil Rytarowski [Fri, 16 Feb 2018 04:20:33 +0000 (04:20 +0000)]
Reintroduce FreeBSD support in test/xray
Tested by Douglas Yung.
The original patch from D43278 has been reverted.
New patch by myself.
llvm-svn: 325315
Igor Kudrin [Fri, 16 Feb 2018 03:26:53 +0000 (03:26 +0000)]
[ELF] Fix use after free in case of using --whole-archive.
Differential Revision: https://reviews.llvm.org/D34554
llvm-svn: 325313
Ekaterina Romanova [Fri, 16 Feb 2018 03:11:35 +0000 (03:11 +0000)]
[DOXYGEN] There was a request in the review D41507 to change the notation for hex numbers in doxygen documentation from <...>h to 0x<...>. Both of these notations were used in x86 intrinsics documentation. I promised to change them to 0x<...> for consistency.
Differential Revision: https://reviews.llvm.org/D41888
llvm-svn: 325312
Tim Shen [Fri, 16 Feb 2018 01:44:36 +0000 (01:44 +0000)]
[APInt] Fix extractBits to correctly handle Result.isSingleWord() case.
Summary: extractBits assumes that `!this->isSingleWord() implies !Result.isSingleWord()`, which may not necessarily be true. Handle both cases.
Reviewers: RKSimon
Subscribers: sanjoy, llvm-commits, hiraditya
Differential Revision: https://reviews.llvm.org/D43363
llvm-svn: 325311
Vedant Kumar [Fri, 16 Feb 2018 01:21:01 +0000 (01:21 +0000)]
Remove brittle check lines from a test, NFC
llvm-svn: 325310
Kamil Rytarowski [Fri, 16 Feb 2018 01:16:06 +0000 (01:16 +0000)]
Revert part of SVN r. 325240 in lit.cfg
The original change broke a llvm-clang-lld-x86_64-debian setup.
This change will be investigated and reintroduced in future.
Original commit:
"Add Xray instrumentation support to FreeBSD"
https://reviews.llvm.org/D43278
llvm-svn: 325309
Vedant Kumar [Fri, 16 Feb 2018 01:15:20 +0000 (01:15 +0000)]
[GVN] Partially revert debug info salvage change (r325063)
In r325063, we salvaged debug values from dying instructions in
GVN::processBlock() and GVN::performScalarPRE().
The change in performScalarPRE(), while correct, is unhelpful. It
introduced a call to salvageDebugInfo() which was immediately followed
by a RAUW, meaning it prevented the RAUW from efficiently updating
dbg.value intrinsics. This commit reverts the mistake and tightens up
the affected test case.
llvm-svn: 325308
Rui Ueyama [Fri, 16 Feb 2018 01:10:51 +0000 (01:10 +0000)]
Relax relocation type checking in a non-ALLOC section.
Even though it doesn't make sense, there seems to be multiple programs
in the wild that create PC-relative relocations in non-ALLOC sections.
I believe this is caused by the negligence of GNU linkers to not report
any errors for such relocations.
Currently, lld emits warnings against such relocations and exits.
So, you cannot link any program that contains wrong relocations until
you fix an issue in a program that generates wrong ELF files. It's often
impractical to fix a program because it's not always easy.
This patch relaxes the error checking and emit a warning instead.
Differential Revision: https://reviews.llvm.org/D43351
llvm-svn: 325307
Craig Topper [Fri, 16 Feb 2018 00:39:05 +0000 (00:39 +0000)]
[X86] Add the test cases that were supposed to go with r325287.
llvm-svn: 325306
Bruno Cardoso Lopes [Fri, 16 Feb 2018 00:12:57 +0000 (00:12 +0000)]
[Modules] Extend -fmodule-name semantic for frameworks with private modules
Assume Foo.framework with two module maps and two modules Foo and
Foo_Private.
Framework authors need to skip building both Foo and Foo_Private when
using -fmodule-name=Foo, since both are part of the framework and used
interchangeably during compilation.
rdar://problem/
37500098
llvm-svn: 325305
Alexey Bataev [Thu, 15 Feb 2018 23:39:43 +0000 (23:39 +0000)]
[OPENMP] Fix PR36399: Crash on C code with ordered doacross construct.
Codegen for ordered with doacross construct might produce incorrect code
because of missing cleanup scope for the construct. Without this scope
the final runtime function call could be emitted in the wrong order that
leads to incorrect codegen.
llvm-svn: 325304
Ekaterina Romanova [Thu, 15 Feb 2018 23:29:21 +0000 (23:29 +0000)]
Allow 0 to be a valid value pruning interval in C LTO API. Value 0 will cause garbage collector to run. This matches the behavior in C++ LTO API.
llvm-svn: 325303
Alexey Bataev [Thu, 15 Feb 2018 22:42:57 +0000 (22:42 +0000)]
[OPENMP] Fix PR38398: compiler crash on standalone pragma ordered with depend sink|source clause.
Patch fixes compiler crash on standalone #pragmas ordered with
depend(sink|source) clauses.
llvm-svn: 325302
Vedant Kumar [Thu, 15 Feb 2018 22:26:18 +0000 (22:26 +0000)]
[DCE] Salvage debug info from dead insts
This results in small increases in the size of the .debug_loc section
and the number of unique source variables in a stage2 build of opt.
llvm-svn: 325301
Kuba Mracek [Thu, 15 Feb 2018 22:14:36 +0000 (22:14 +0000)]
[asan] Add "arm64" into the list of 64-bit architectures
It looks like get_bits_for_arch doesn't recognize "arm64" as a 64-bit architecture, and it actually matches the "arm" regexp, which marks it as 32-bit. Let's fix that by matching the 64-bit list first and addin "arm64" into the list.
Differential Revision: https://reviews.llvm.org/D43155
llvm-svn: 325300
Stanislav Mekhanoshin [Thu, 15 Feb 2018 22:03:55 +0000 (22:03 +0000)]
[AMDGPU] Combine adjacent waitcounts in a single strongest wait
Differential Revision: https://reviews.llvm.org/D43350
llvm-svn: 325299
Benjamin Kramer [Thu, 15 Feb 2018 21:37:29 +0000 (21:37 +0000)]
[include-fixer] Add more debug headers to the STL header list
These are used for std::map/std::set in STL debug mode.
llvm-svn: 325298
Vedant Kumar [Thu, 15 Feb 2018 21:28:38 +0000 (21:28 +0000)]
[Debugify] Don't check functions which were skipped
If no debug info was applied to a function, its debug info shouldn't be
checked (it doesn't have any :).
llvm-svn: 325297
Reid Kleckner [Thu, 15 Feb 2018 21:25:23 +0000 (21:25 +0000)]
Don't make PDBs by default in Release mode
Introduce the LLVM_ENABLE_PDB option so that users can request them
explicitly instead.
Add /OPT:REF and /OPT:ICF back, which /DEBUG disables by default.
Differential Revision: https://reviews.llvm.org/D43156
llvm-svn: 325296
Rafael Auler [Thu, 15 Feb 2018 21:20:31 +0000 (21:20 +0000)]
[X86][3DNOW] Teach decoder about AMD 3DNow! instrs
Summary:
This patch makes the decoder understand old AMD 3DNow!
instructions that have never been properly supported in the X86
disassembler, despite being supported in other subsystems. Hopefully
this should make the X86 decoder more complete with respect to binaries
containing legacy code.
Reviewers: craig.topper
Reviewed By: craig.topper
Subscribers: llvm-commits, maksfb, bruno
Differential Revision: https://reviews.llvm.org/D43311
llvm-svn: 325295
Vedant Kumar [Thu, 15 Feb 2018 21:14:36 +0000 (21:14 +0000)]
[opt] Port the debugify passes to the new pass manager
llvm-svn: 325294
Aaron Ballman [Thu, 15 Feb 2018 21:03:39 +0000 (21:03 +0000)]
Silence a -Wparentheses warning; NFC.
llvm-svn: 325293
Aaron Ballman [Thu, 15 Feb 2018 20:56:19 +0000 (20:56 +0000)]
Silence some -Wunused-variable warnings; NFC.
llvm-svn: 325292
Brian Gesiak [Thu, 15 Feb 2018 20:37:22 +0000 (20:37 +0000)]
[Coroutines] Use allocator overload when available
Summary:
Depends on https://reviews.llvm.org/D42605.
An implementation of the behavior described in `[dcl.fct.def.coroutine]/7`:
when a promise type overloads `operator new` using a "placement new"
that takes the same argument types as the coroutine function, that
overload is used when allocating the coroutine frame.
Simply passing references to the coroutine function parameters directly
to `operator new` results in invariant violations in LLVM's coroutine
splitting pass, so this implementation modifies Clang codegen to
produce allocator-specific alloc/store/loads for each parameter being
forwarded to the allocator.
Test Plan: `check-clang`
Reviewers: rsmith, GorNishanov, eric_niebler
Reviewed By: GorNishanov
Subscribers: lewissbaker, EricWF, cfe-commits
Differential Revision: https://reviews.llvm.org/D42606
llvm-svn: 325291
Craig Topper [Thu, 15 Feb 2018 20:27:30 +0000 (20:27 +0000)]
[X86] Enable BT to be used in place of TEST for single bit checks under optsize
We already do this for 64-bit when it won't fit into a 64-bit AND/TEST's immediate field. This adds an additional qualifier to do it for any single bit constant larger than 8-bits under optsize
Differential Revision: https://reviews.llvm.org/D43346
llvm-svn: 325290
Craig Topper [Thu, 15 Feb 2018 20:20:32 +0000 (20:20 +0000)]
[DAGCombiner] Call ExtendUsesToFormExtLoad in (zext (and (load)))->(and (zextload)) even when the and does not have multiple uses
Same for the sign extend case.
Currently we check for multiple uses on the binop. Then we call ExtendUsesToFormExtLoad to capture SetCCs that use the load. So we only end up finding any setccs when the and has additional uses and the load is used by a setcc. I don't think the and having multiple uses is relevant here. I think we should only be checking for the load having multiple uses.
This changes an NVPTX test because we now find that the load has a second use by a truncate, but ExtendUsesToFormExtLoad only looks at setccs it can extend. All other operations just check isTruncateFree. Maybe we should allow widening of an existing truncate even if its not free?
Differential Revision: https://reviews.llvm.org/D43063
llvm-svn: 325289
Brian Gesiak [Thu, 15 Feb 2018 20:09:25 +0000 (20:09 +0000)]
[Sema] Toggle diags when finding allocators (NFCI)
Summary:
Many methods in Sema take a `bool Diagnose` parameter. Examples of such
methods include `Sema::FindDeallocationFunction` and
`Sema::SpecialMemberIsTrivial`. Calling these methods with
`Diagnose = false` allows callers to, for instance, check for the
existence of a deallocation function, without that check resulting in
error diagnostics being emitted if no matching deallocation function exists.
Add a similar `bool Diagnose` to the `Sema::FindAllocationFunctions`
method, so that checks for the existence of allocation functions can be
made without triggering error diagnostics.
This allows `SemaCoroutine.cpp`, in its implementation of the
Coroutines TS, to check for the existence of a particular `operator new`
overload, but then without error fall back to a default `operator new`
if no matching overload exists.
Test Plan: `check-clang`
Reviewers: rsmith, GorNishanov, eric_niebler
Reviewed By: GorNishanov
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D42605
llvm-svn: 325288
Craig Topper [Thu, 15 Feb 2018 19:57:35 +0000 (19:57 +0000)]
[X86] Use btc/btr/bts to implement xor/and/or that affects a single bit in the upper 32-bits of a 64-bit operation.
We can't fold a large immediate into a 64-bit operation. But if we know we're only operating on a single bit we can use the bit instructions.
For now only do this for optsize.
Differential Revision: https://reviews.llvm.org/D37418
llvm-svn: 325287
Artem Dergachev [Thu, 15 Feb 2018 19:34:19 +0000 (19:34 +0000)]
[analyzer] Suppress temporary destructors for temporary arrays.
Array destructors, like constructors, need to be called for each element of the
array separately. We do not have any mechanisms to do this in the analyzer,
so for now all we do is evaluate a single constructor or destructor
conservatively and give up. It automatically causes the necessary invalidation
and pointer escape for the whole array, because this is how RegionStore works.
Implement this conservative behavior for temporary destructors. This fixes the
crash on the provided test.
Differential Revision: https://reviews.llvm.org/D43149
llvm-svn: 325286
Brian Gesiak [Thu, 15 Feb 2018 19:31:45 +0000 (19:31 +0000)]
[Coroutines] Don't move stores for allocator args
Summary:
The behavior described in Coroutines TS `[dcl.fct.def.coroutine]/7`
allows coroutine parameters to be passed into allocator functions.
The instructions to store values into the alloca'd parameters must not
be moved past the frame allocation, otherwise uninitialized values are
passed to the allocator.
Test Plan: `check-llvm`
Reviewers: rsmith, GorNishanov, eric_niebler
Reviewed By: GorNishanov
Subscribers: compnerd, EricWF, llvm-commits
Differential Revision: https://reviews.llvm.org/D43000
llvm-svn: 325285
Artem Dergachev [Thu, 15 Feb 2018 19:28:21 +0000 (19:28 +0000)]
[analyzer] Implement path notes for temporary destructors.
Temporary destructors fire at the end of the full-expression. It is reasonable
to attach the path note for entering/leaving the temporary destructor to its
CXXBindTemporaryExpr. This would not affect lifetime-extended temporaries with
their automatic destructors which aren't temporary destructors.
The path note may be confusing in the case of destructors after elidable copy
constructors.
Differential Revision: https://reviews.llvm.org/D43144
llvm-svn: 325284
Pablo Barrio [Thu, 15 Feb 2018 19:17:55 +0000 (19:17 +0000)]
[ARM] Fix redirect in inline assembly test
Summary: Fix silly mistake in a test
Reviewers: gkistanova, apilipenko
Subscribers: javed.absar, eraman, kristof.beyls, llvm-commits
Differential Revision: https://reviews.llvm.org/D43342
llvm-svn: 325283
Artem Dergachev [Thu, 15 Feb 2018 19:17:44 +0000 (19:17 +0000)]
[analyzer] Compute the correct this-region for temporary destructors.
Inline them if possible - a separate flag is added to control this.
The whole thing is under the cfg-temporary-dtors flag, off by default so far.
Temporary destructors are called at the end of full-expression. If the
temporary is lifetime-extended, automatic destructors kick in instead,
which are not addressed in this patch, and normally already work well
modulo the overally broken support for lifetime extension.
The patch operates by attaching the this-region to the CXXBindTemporaryExpr in
the program state, and then recalling it during destruction that was triggered
by that CXXBindTemporaryExpr. It has become possible because
CXXBindTemporaryExpr is part of the construction context since r325210.
Differential revision: https://reviews.llvm.org/D43104
llvm-svn: 325282
Vedant Kumar [Thu, 15 Feb 2018 19:13:04 +0000 (19:13 +0000)]
[SCCP] Test that constant propagation updates debug info, NFC
This extends an existing test to check that SCCP updates the operands of
relevant dbg.value instructions as it does its work.
llvm-svn: 325281
Vedant Kumar [Thu, 15 Feb 2018 19:13:03 +0000 (19:13 +0000)]
[Utils] salvageDI: Add a comment and move a call earlier, NFC
llvm-svn: 325280
Yaxun Liu [Thu, 15 Feb 2018 19:12:41 +0000 (19:12 +0000)]
Clean up AMDGCN tests
Differential Revision: https://reviews.llvm.org/D43340
llvm-svn: 325279
Artem Dergachev [Thu, 15 Feb 2018 19:01:55 +0000 (19:01 +0000)]
[analyzer] NFC: Eliminate ParentMap lookup in mayInlineCallKind().
Don't look at the parent statement to figure out if the cxx-allocator-inlining
flag should kick in and prevent us from inlining the constructor within
a new-expression. We now have construction contexts for that purpose.
llvm-svn: 325278
Craig Topper [Thu, 15 Feb 2018 19:00:11 +0000 (19:00 +0000)]
[X86] Add test cases for opportunities for using BT instead of TEST under optsize.
llvm-svn: 325277
Alex Shlyapnikov [Thu, 15 Feb 2018 18:58:31 +0000 (18:58 +0000)]
[TSan] Fix static TLS boundaries calculations in __tls_get_addr interceptor.
Summary:
DTLS_on_tls_get_addr expects (tls_addr + tls_size) as the last
parameter, static_tls_end.
Reviewers: dvyukov
Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits
Differential Revision: https://reviews.llvm.org/D43325
llvm-svn: 325276
Zachary Turner [Thu, 15 Feb 2018 18:46:59 +0000 (18:46 +0000)]
Silence warning about unused private variable.
llvm-svn: 325275
Zachary Turner [Thu, 15 Feb 2018 18:36:10 +0000 (18:36 +0000)]
Call FlushFileBuffers on output files.
There is a latent Windows kernel bug, the exact trigger
conditions are not well understood, which can cause a file
to be correctly written, but unable to be correctly read.
The workaround appears to be simply calling FlushFileBuffers.
Differential Revision: https://reviews.llvm.org/D42925
llvm-svn: 325274
Dan Gohman [Thu, 15 Feb 2018 18:05:16 +0000 (18:05 +0000)]
[WebAssembly] Restore "*-wasm" tests.
Even though "...-wasm" is now the default for wasm, it's still
desirable to test this form.
llvm-svn: 325273
Fangrui Song [Thu, 15 Feb 2018 17:56:43 +0000 (17:56 +0000)]
[clang-tidy] Add `readability-simd-intrinsics` check.
Summary:
Many architectures provide SIMD operations (e.g. x86 SSE/AVX, Power AltiVec/VSX,
ARM NEON). It is common that SIMD code implementing the same algorithm, is
written in multiple target-dispatching pieces to optimize for different
architectures or micro-architectures.
The C++ standard proposal P0214 and its extensions cover many common SIMD
operations. By migrating from target-dependent intrinsics to P0214 operations,
the SIMD code can be simplified and pieces for different targets can be unified.
Refer to http://wg21.link/p0214 for introduction and motivation for the
data-parallel standard library.
Subscribers: klimek, aemerson, mgorny, xazax.hun, kristof.beyls, hintonda, cfe-commits
Differential Revision: https://reviews.llvm.org/D42983
llvm-svn: 325272
Matt Davis [Thu, 15 Feb 2018 17:55:52 +0000 (17:55 +0000)]
[Test] Remove mangled name from test.
This line is not needed in the test, and breaks Windows testing.
Fixes the test added in r325175.
llvm-svn: 325271
Simon Pilgrim [Thu, 15 Feb 2018 17:48:34 +0000 (17:48 +0000)]
[X86][SSE] Add saturated truncation tests for storing illegal v8i8 types
Tests showing missing opportunities to use PACK instructions in cases where we need to truncate to illegal types for stores
llvm-svn: 325270
Krzysztof Parzyszek [Thu, 15 Feb 2018 17:20:07 +0000 (17:20 +0000)]
Recommit [Hexagon] Make the vararg handling a bit more robust
Use the FunctionType of the callee when it's available. It may not be
available for synthetic calls to functions specified by external symbols.
llvm-svn: 325269
Alexey Bataev [Thu, 15 Feb 2018 17:11:50 +0000 (17:11 +0000)]
[SLP] Fix the test for the reversed stores, NFC.
llvm-svn: 325268
Yonghong Song [Thu, 15 Feb 2018 17:06:45 +0000 (17:06 +0000)]
bpf: fix a bug in dag2dag optimization for loads from readonly section
The reference '&' is missing in the function parameter. If there are
back-to-back optimizations in terms of dag node list like below:
t29: i64,ch = load<LD4[bitcast (%struct.test_t* @test.t to i8*)+12](dereferenceable), zext from i32> t3, t43, undef:i64
t34: i64,ch = load<LD4[bitcast (%struct.test_t* @test.t to i8*)](dereferenceable), zext from i32> t3, t41, undef:i64
The bug will trigger a segfault for the added test case remove_truncate_5.ll:
LLVMSymbolizer: error reading file: No such file or directory
#0 0x000000000241c4d9 (llc+0x241c4d9)
#1 0x000000000241c56a (llc+0x241c56a)
#2 0x000000000241aa50 (llc+0x241aa50)
...
#22 0x0000000000fd5edf (llc+0xfd5edf)
#23 0x00007f0fe03bec05 __libc_start_main (/lib64/libc.so.6+0x21c05)
#24 0x0000000000fd3e69 (llc+0xfd3e69)
...
Segmentation fault
Signed-off-by: Yonghong Song <yhs@fb.com>
llvm-svn: 325267
Krzysztof Parzyszek [Thu, 15 Feb 2018 16:57:44 +0000 (16:57 +0000)]
Revert "[Hexagon] Make the vararg handling a bit more robust"
This is breaking lit tests.
llvm-svn: 325266
Alexey Bataev [Thu, 15 Feb 2018 16:56:49 +0000 (16:56 +0000)]
[SLP] Added test for reversed stores, NFC.
llvm-svn: 325265
Yaxun Liu [Thu, 15 Feb 2018 16:39:19 +0000 (16:39 +0000)]
[OpenCL] Fix __enqueue_block for block with captures
The following test case causes issue with codegen of __enqueue_block
void (^block)(void) = ^{ callee(id, out); };
enqueue_kernel(queue, 0, ndrange, block);
Clang first does codegen for block expression in the first line and deletes its block info.
Clang then tries to do codegen for the same block expression again for the second line,
and fails because the block info is gone.
The fix is to do normal codegen for both lines. Introduce an API to OpenCL runtime to
record llvm block invoke function and llvm block literal emitted for each AST block
expression, and use the recorded information for generating the wrapper kernel.
The EmitBlockLiteral APIs are cleaned up to minimize changes to the normal codegen
of blocks.
Another minor issue is that some clean up AST expression is generated for block
with captures, which can be stripped by IgnoreImplicit.
Differential Revision: https://reviews.llvm.org/D43240
llvm-svn: 325264
Sanjay Patel [Thu, 15 Feb 2018 16:30:10 +0000 (16:30 +0000)]
[InstCombine] use m_OneUse to reduce code; NFC
llvm-svn: 325263
Sanjay Patel [Thu, 15 Feb 2018 16:28:15 +0000 (16:28 +0000)]
[InstCombine] test fdiv folds better; NFC
We had redundant tests, but no tests for extra uses or vectors.
'fast' is an overly conservative requirement for these folds.
llvm-svn: 325262
Aaron Ballman [Thu, 15 Feb 2018 16:28:10 +0000 (16:28 +0000)]
Amend r325256. This change was not properly merged locally before the commit happened.
llvm-svn: 325261
Ilya Biryukov [Thu, 15 Feb 2018 16:24:34 +0000 (16:24 +0000)]
[clangd] Create trace::Span when running ASTCallback
llvm-svn: 325260
Krzysztof Parzyszek [Thu, 15 Feb 2018 16:24:30 +0000 (16:24 +0000)]
[Hexagon] Make the vararg handling a bit more robust
The FunctionType of the callee is always available, even if the Function
of the callee is not. Use that to get the number of fixed parameters.
llvm-svn: 325259
Francis Visoiu Mistrih [Thu, 15 Feb 2018 16:23:59 +0000 (16:23 +0000)]
[CodeGen] Separate MBB metadata from instructions in -debug printing
Add an empty line after 'liveins:', 'successors:', or '; predecessors:',
the one that ends up to be the last one.
llvm-svn: 325258
Sam McCall [Thu, 15 Feb 2018 16:20:33 +0000 (16:20 +0000)]
[clangd] Use explicit env in test to make lit+windows happy. NFC
llvm-svn: 325257
Aaron Ballman [Thu, 15 Feb 2018 16:20:20 +0000 (16:20 +0000)]
NFC; clean up this file based on our coding standards. The impetus was considerable use of a type name as an identifier for an object.
Changed identifier names (especially function parameters) to not clash with type names and to follow the proper naming conventions. Use of explicit type names changed to use auto where appropriate. Removed unused parameters that should have never been added in the first place. Minor formatting cleanups.
The changes were mostly mechanical and should have no functional impact.
llvm-svn: 325256
Krzysztof Parzyszek [Thu, 15 Feb 2018 15:47:53 +0000 (15:47 +0000)]
[Hexagon] Fix lowering of formal arguments after r324737
Lowering of formal arguments needs to be aware of vararg functions.
llvm-svn: 325255
Ilya Biryukov [Thu, 15 Feb 2018 15:41:49 +0000 (15:41 +0000)]
[clangd] Fixed compilation with MVSC.
llvm-svn: 325254
Simon Pilgrim [Thu, 15 Feb 2018 15:31:00 +0000 (15:31 +0000)]
[SelectionDAG] Pull out repeated Op.getOpcode(). NFCI.
llvm-svn: 325253
Krasimir Georgiev [Thu, 15 Feb 2018 15:30:22 +0000 (15:30 +0000)]
[clang-format] Support repeated field lists in protos
Summary:
This patch adds support for list initialization of proto repeated fields:
```
keys: [1, 2, 3]
```
Reviewers: djasper
Reviewed By: djasper
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D43298
llvm-svn: 325252
Francis Visoiu Mistrih [Thu, 15 Feb 2018 15:27:34 +0000 (15:27 +0000)]
[CodeGen] Print irreducible loop header weight as a MIR comment
Prefix it with '; ' to make it more MIR-compatible.
llvm-svn: 325251
Pavel Labath [Thu, 15 Feb 2018 15:24:32 +0000 (15:24 +0000)]
@skipIfRemote TestTargetXMLArch
The test does not actually connect to any remote targets.
llvm-svn: 325250
Kamil Rytarowski [Thu, 15 Feb 2018 15:24:01 +0000 (15:24 +0000)]
Try to unbreak Darwin after XRay/FreeBSD commit
Add a fallback definition of getTSCFrequency().
llvm-svn: 325249
Kamil Rytarowski [Thu, 15 Feb 2018 15:15:45 +0000 (15:15 +0000)]
Implement a large part of NetBSD syscalls of netbsd_syscall_hooks.h
This is a follow up of:
r325206 - Add NetBSD syscall hooks skeleton in sanitizers
Sponsored by <The NetBSD Foundation>
llvm-svn: 325248
Sanjay Patel [Thu, 15 Feb 2018 15:07:12 +0000 (15:07 +0000)]
[InstCombine] allow sin/cos transforms with 'reassoc'
The variable name 'AllowReassociate' is a lie at this point because
it's set to 'isFast()' which is more than the 'reassoc' FMF after
rL317488.
In D41286, we showed that this transform may be valid even with strict
math by brute force checking every 32-bit float result.
There's a potential problem here because we're replacing with a tan()
libcall rather than a hypothetical LLVM tan intrinsic. So we might
set errno when we should be guaranteed not to do that. But that's
independent of this change.
llvm-svn: 325247
Kamil Rytarowski [Thu, 15 Feb 2018 14:59:59 +0000 (14:59 +0000)]
Enable test/asan for NetBSD
Sponsored by <The NetBSD Foundation>
llvm-svn: 325246
Kamil Rytarowski [Thu, 15 Feb 2018 14:58:15 +0000 (14:58 +0000)]
Enable syscall-specific functions in TSan/NetBSD
NetBSD ships now with netbsd_syscall_hooks.h and requires support
for TSan specific features to be enabled.
This is follow up of:
D42048: Add NetBSD syscall hooks skeleton in sanitizers
Sponsored by <The NetBSD Foundation>
llvm-svn: 325245
Pablo Barrio [Thu, 15 Feb 2018 14:44:22 +0000 (14:44 +0000)]
[ARM] Allow 64- and 128-bit types with 't' inline asm constraint
Summary:
In LLVM, 't' selects a floating-point/SIMD register and only supports
32-bit values. This is appropriately documented in the LLVM Language
Reference Manual. However, this behaviour diverges from that of GCC, where
't' selects the s0-s31 registers and its qX and dX variants depending on
additional operand modifiers (q/P).
For example, the following C code:
#include <arm_neon.h>
float32x4_t a, b, x;
asm("vadd.f32 %0, %1, %2" : "=t" (x) : "t" (a), "t" (b))
results in the following assembly if compiled with GCC:
vadd.f32 s0, s0, s1
whereas LLVM will show "error: couldn't allocate output register for
constraint 't'", since a, b, x are 128-bit variables, not 32-bit.
This patch extends the use of 't' to mean that of GCC, thus allowing
selection of the lower Q vector regs and their D/S variants. For example,
the earlier code will now compile as:
vadd.f32 q0, q0, q1
This behaviour still differs from that of GCC but I think it is actually
more correct, since LLVM picks up the right register type based on the
datatype of x, while GCC would need an extra operand modifier to achieve
the same result, as follows:
asm("vadd.f32 %q0, %q1, %q2" : "=t" (x) : "t" (a), "t" (b))
Since this is only an extension of functionality, existing code should not
be affected by this change. Note that operand modifiers q/P are already
supported by LLVM, so this patch should suffice to support inline
assembly with constraint 't' originally built for GCC.
Reviewers: grosbach, rengolin
Reviewed By: rengolin
Subscribers: rogfer01, efriedma, olista01, aemerson, javed.absar, eraman, kristof.beyls, llvm-commits
Differential Revision: https://reviews.llvm.org/D42962
llvm-svn: 325244
Simon Pilgrim [Thu, 15 Feb 2018 14:37:59 +0000 (14:37 +0000)]
[X86][SSE] combineTruncateWithSat - use truncateVectorWithPACK to chain PACKUS vXi32-vXi8 saturated truncation
We can use PACKSS/PACKUS to saturate each stage of the chain: PACKSSDW down to [-32768,32767] and then PACKUSWB to [0,255].
llvm-svn: 325243
Ilya Biryukov [Thu, 15 Feb 2018 14:32:57 +0000 (14:32 +0000)]
[clangd] Enable snippet completion based on client capabilities.
Summary: And remove -enable-snippets flag.
Reviewers: hokein, ioeric, sammccall
Reviewed By: ioeric
Subscribers: klimek, jkorous-apple, cfe-commits
Differential Revision: https://reviews.llvm.org/D43229
llvm-svn: 325242
Kamil Rytarowski [Thu, 15 Feb 2018 14:19:23 +0000 (14:19 +0000)]
Adding msan support for FreeBSD
Summary: Enabling memory sanitiser for X86_64 arch only. To match the sanitiser counterpart.
Patch by: David CARLIER
Reviewers: krytarowski
Reviewed By: krytarowski
Subscribers: dim, emaste, cfe-commits
Differential Revision: https://reviews.llvm.org/D43148
llvm-svn: 325241
Kamil Rytarowski [Thu, 15 Feb 2018 14:17:15 +0000 (14:17 +0000)]
Add Xray instrumentation support to FreeBSD
Summary:
- Enabling the build.
- Using assembly for the cpuid parts.
- Using thr_self FreeBSD call to get the thread id
Patch by: David CARLIER
Reviewers: dberris, rnk, krytarowski
Reviewed By: dberris, krytarowski
Subscribers: emaste, stevecheckoway, nglevin, srhines, kubamracek, dberris, mgorny, krytarowski, llvm-commits, #sanitizers
Differential Revision: https://reviews.llvm.org/D43278
llvm-svn: 325240
Sam McCall [Thu, 15 Feb 2018 14:16:17 +0000 (14:16 +0000)]
[clangd] Fix make_unique ambiguity, NFC
llvm-svn: 325239
Kamil Rytarowski [Thu, 15 Feb 2018 14:12:21 +0000 (14:12 +0000)]
Add Xray instrumentation compile-time/link-time support to FreeBSD
Summary: Similarly to the GNU driver version, adding proper compile and linker flags.
Patch by: David CARLIER
Reviewers: vitalybuka, krytarowski, dberris
Reviewed By: krytarowski, dberris
Subscribers: emaste, dberris, cfe-commits
Differential Revision: https://reviews.llvm.org/D43279
llvm-svn: 325238
Sanjay Patel [Thu, 15 Feb 2018 13:55:52 +0000 (13:55 +0000)]
[InstCombine] allow X / C -> X * (1.0/C) for vector splat FP constants
llvm-svn: 325237
Martin Bohme [Thu, 15 Feb 2018 13:50:07 +0000 (13:50 +0000)]
Add -no-canonical-prefixes to allow different build modes.
llvm-svn: 325236
Simon Pilgrim [Thu, 15 Feb 2018 13:33:15 +0000 (13:33 +0000)]
[X86][SSE] combineTruncateWithSat - use truncateVectorWithPACK to chain PACKSS vXi32-vXi8 saturated truncation
We can use PACKSS to saturate each stage of the chain: PACKSSDW down to [-32768,32767] and then PACKSSWB to [-128,127].
PACKUS is a little trickier and will be handled in a separate patch.
llvm-svn: 325235
Momchil Velikov [Thu, 15 Feb 2018 13:29:33 +0000 (13:29 +0000)]
[DebugInfo] Accept enumeration types without underlying integer type present in
debug info metadata
... when generating DWARF.
Differential Revision: https://reviews.llvm.org/D43304
llvm-svn: 325234
Ilya Biryukov [Thu, 15 Feb 2018 13:15:47 +0000 (13:15 +0000)]
[clangd] Make functions of ClangdServer callback-based
Summary:
As a consequence, all LSP operations are now handled asynchronously,
i.e. they never block the main processing thread. However, if
-run-synchronously flag is specified, clangd still runs everything on
the main thread.
Reviewers: sammccall, ioeric, hokein
Reviewed By: sammccall, ioeric
Subscribers: klimek, jkorous-apple, cfe-commits
Differential Revision: https://reviews.llvm.org/D43227
llvm-svn: 325233
Simon Pilgrim [Thu, 15 Feb 2018 12:14:15 +0000 (12:14 +0000)]
[SelectionDAG] Add initial implementation of TargetLowering::SimplifyDemandedVectorElts
This is mainly a move of simplifyShuffleOperands from DAGCombiner::visitVECTOR_SHUFFLE to create a more general purpose TargetLowering::SimplifyDemandedVectorElts implementation.
Further features can be moved/added in future patches.
Differential Revision: https://reviews.llvm.org/D42896
llvm-svn: 325232
Sjoerd Meijer [Thu, 15 Feb 2018 10:33:07 +0000 (10:33 +0000)]
[ARM] f16 vcmp fixes
This adds f16 VCMP match rules and fixes the test cases.
Differential Revision: https://reviews.llvm.org/D43291
llvm-svn: 325228
Serge Pavlov [Thu, 15 Feb 2018 09:45:59 +0000 (09:45 +0000)]
Revert r325224 "Report fatal error in the case of out of memory"
It caused fails on some buildbots.
llvm-svn: 325227
Serge Pavlov [Thu, 15 Feb 2018 09:35:36 +0000 (09:35 +0000)]
Specify namespace for realloc
llvm-svn: 325226
Gabor Horvath [Thu, 15 Feb 2018 09:24:55 +0000 (09:24 +0000)]
[clang-tidy] Make a test pass on platforms where exceptions disabled by default.
llvm-svn: 325225
Serge Pavlov [Thu, 15 Feb 2018 09:20:26 +0000 (09:20 +0000)]
Report fatal error in the case of out of memory
Analysis of fails in the case of out of memory errors can be tricky on
Windows. Such error emerges at the point where memory allocation function
fails, but manifests itself when null pointer is used. These two points
may be distant from each other. Besides, next runs may not exhibit
allocation error.
Usual programming practice does not require checking result of 'operator
new' because it throws 'std::bad_alloc' in the case of allocation error.
However, LLVM is usually built with exceptions turned off, so 'new' can
return null pointer. This change installs custom new handler, which causes
fatal error in the case of out of memory. The handler is installed
automatically prior to call to 'main' during construction of a static
object defined in 'lib/Support/ErrorHandling.cpp'. If the application does
not use this file, the handler may be installed manually by a call to
'llvm::install_out_of_memory_new_handler', declared in
'include/llvm/Support/ErrorHandling.h".
There are calls to C allocation functions, malloc, calloc and realloc.
They are used for interoperability with C code, when allocated object has
variable size and when it is necessary to avoid call of constructors. In
many calls the result is not checked against null pointer. To simplify
checks, new functions are defined in the namespace 'llvm' with the
same names as these C function. These functions produce fatal error if
allocation fails. User should use 'llvm::malloc' instead of 'std::malloc'
in order to use the safe variant. This change replaces 'std::malloc'
in the cases when the result of allocation function is not checked against
null pointer.
Finally, there are plain C code, that uses malloc and similar functions. If
the result is not checked, assert statements are added.
Differential Revision: https://reviews.llvm.org/D43010
llvm-svn: 325224
Gabor Horvath [Thu, 15 Feb 2018 09:19:23 +0000 (09:19 +0000)]
[clang-tidy] Minor documentation fix
llvm-svn: 325223
Gabor Horvath [Thu, 15 Feb 2018 09:08:51 +0000 (09:08 +0000)]
[clang-tidy] New checker for exceptions that are created but not thrown
Patch by: Kristof Umann
Differential Revision: https://reviews.llvm.org/D43120
llvm-svn: 325222
Jacek Olesiak [Thu, 15 Feb 2018 08:47:56 +0000 (08:47 +0000)]
[clang-format] Improve ObjC headers detection
Summary: Detect ObjC characteristic types when they start a line and add additional keywords.
Reviewers: benhamilton
Reviewed By: benhamilton
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D43124
llvm-svn: 325221