Alexander Polyakov [Mon, 25 Jun 2018 23:29:52 +0000 (23:29 +0000)]
Fix windows build for r335541.
I didn't include <functional> header and used std::function.
llvm-svn: 335552
Craig Topper [Mon, 25 Jun 2018 23:29:47 +0000 (23:29 +0000)]
[X86] Update fpclass intrinsic tests to chain their calls to the intrinsic rather than joining them with add.
The test cases try to test masked and unmasked isntructions at the same time. Previously the masked version relies on an extra fucntion parameter. Then the two results were combined with 'add'.
This patch gets rid of the second parameter and just passes the result of the first intrinsic into the mask argument of the second call. Then there's no need for an 'add'.
This configuration works a lot better with an upcoming patch to redefine the intrinsics to use vXi1 types for the output and mask argument.
llvm-svn: 335551
Jessica Paquette [Mon, 25 Jun 2018 23:20:18 +0000 (23:20 +0000)]
[MachineOutliner] NFC - simplify -moutline/-mno-outline logic
It's a bit cleaner to use `hasFlag` instead of nested ifs. This
just refactors the -moutline/-mno-outline logic to use that.
llvm-svn: 335549
Francis Visoiu Mistrih [Mon, 25 Jun 2018 23:14:08 +0000 (23:14 +0000)]
[OrcMCJIT] Fix test after r335508 causing it to fail on green dragon
http://green.lab.llvm.org/green/job/clang-stage1-configure-RA/46572/console
LLVM ERROR: unsupported relocation with subtraction expression, symbol
'__GLOBAL_OFFSET_TABLE_' can not be undefined in a subtraction
expression
Do the same thing as MCJIT/eh-lg-pic.ll.
llvm-svn: 335548
Eric Christopher [Mon, 25 Jun 2018 23:12:04 +0000 (23:12 +0000)]
Fix unsigned/signed comparison failure in unittest.
llvm-svn: 335547
Yunlian Jiang [Mon, 25 Jun 2018 23:05:27 +0000 (23:05 +0000)]
Add an option to support debug fission on implicit ThinLTO.
Summary:
This adds an option -gsplit-dwarf=<arg>. LLVM can create .dwo files in the given directory
during the implicit ThinLTO link stage.
Reviewers: tejohnson, dblaikie, pcc
Reviewed By: pcc
Subscribers: steven_wu, aprantl, JDevlieghere, yunlian, probinson, mehdi_amini, inglorion, cfe-commits
Differential Revision: https://reviews.llvm.org/D44788
llvm-svn: 335546
Sanjay Patel [Mon, 25 Jun 2018 22:50:26 +0000 (22:50 +0000)]
[InstCombine] cleanup udiv folds; NFCI
This removes a "UDivFoldAction" in favor of a simple constant
matcher. In theory, the existing code could do more matching,
but I don't see any evidence or need for it. I've left a TODO
about using ValueTracking in case we see any regressions.
llvm-svn: 335545
Sanjay Patel [Mon, 25 Jun 2018 22:27:36 +0000 (22:27 +0000)]
[InstCombine] add/move tests for udiv; NFC
llvm-svn: 335544
Bruno Cardoso Lopes [Mon, 25 Jun 2018 22:25:48 +0000 (22:25 +0000)]
Fix tests from r335542 to use %hmaptool
llvm-svn: 335543
Bruno Cardoso Lopes [Mon, 25 Jun 2018 22:24:17 +0000 (22:24 +0000)]
Warning for framework include violation from Headers to PrivateHeaders
Framework vendors usually layout their framework headers in the
following way:
Foo.framework/Headers -> "public" headers
Foo.framework/PrivateHeader -> "private" headers
Since both headers in both directories can be found with #import
<Foo/some-header.h>, it's easy to make mistakes and include headers in
Foo.framework/PrivateHeader from headers in Foo.framework/Headers, which
usually configures a layering violation on Darwin ecosystems. One of the
problem this causes is dep cycles when modules are used, since it's very
common for "private" modules to include from the "public" ones; adding
an edge the other way around will trigger cycles.
Add a warning to catch those cases such that:
./A.framework/Headers/A.h:1:10: warning: public framework header includes private framework header 'A/APriv.h'
#include <A/APriv.h>
^
rdar://problem/
38712182
llvm-svn: 335542
Alexander Polyakov [Mon, 25 Jun 2018 22:01:44 +0000 (22:01 +0000)]
Implement new methods for handling an error in MI commands.
Summary:
The new methods take SBError object and call handler,
specified by user, depending on SBError status.
Reviewers: aprantl, clayborg, labath
Reviewed By: aprantl, clayborg
Subscribers: ki.stfu, lldb-commits
Differential Revision: https://reviews.llvm.org/D48295
llvm-svn: 335541
Benjamin Kramer [Mon, 25 Jun 2018 21:43:09 +0000 (21:43 +0000)]
[Instrumentation] Remove unused include
It's also a layering violation.
llvm-svn: 335528
Sanjay Patel [Mon, 25 Jun 2018 21:39:41 +0000 (21:39 +0000)]
[InstCombine] fold sdiv with sext bool divisor
llvm-svn: 335527
Sanjay Patel [Mon, 25 Jun 2018 21:36:09 +0000 (21:36 +0000)]
[InstCombine] add tests for sdiv with sext bool divisor; NFC
llvm-svn: 335526
Vlad Tsyrklevich [Mon, 25 Jun 2018 21:28:35 +0000 (21:28 +0000)]
UBSan blacklist workaround for bot timeouts
Summary: Workaround for PR37929
Reviewers: eugenis, vitalybuka
Reviewed By: eugenis
Subscribers: llvm-commits, kcc
Differential Revision: https://reviews.llvm.org/D48566
llvm-svn: 335525
David Carlier [Mon, 25 Jun 2018 21:10:25 +0000 (21:10 +0000)]
[UBsan] Enable ubsan minimal unit tests on OpenBSD
OpenBSD needs lld linker for sanitisers.
Disabling lint checking as some symbols cannot be defined and block the proper unit tests launch.
Reviewers: lebedev.ri, vitalybuka
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D48528
llvm-svn: 335524
Vedant Kumar [Mon, 25 Jun 2018 20:56:23 +0000 (20:56 +0000)]
[ubsan] Mark a test case as unsupported on Windows
__ubsan_on_report isn't defined as weak, and redefining it in a test is
not supported on Windows.
See the error message here: https://reviews.llvm.org/D48446
llvm-svn: 335523
Florian Hahn [Mon, 25 Jun 2018 20:55:26 +0000 (20:55 +0000)]
Revert r335513: [SCEVExp] Advance found insertion point
llvm-svn: 335522
Craig Topper [Mon, 25 Jun 2018 20:45:45 +0000 (20:45 +0000)]
[LoopIdiomRecognize] Fix a couple places where it appears we were unintenionally making copies of DebugLoc.
llvm-svn: 335521
Florian Hahn [Mon, 25 Jun 2018 20:40:50 +0000 (20:40 +0000)]
Force vector width for scev-expander-debug.ll test
llvm-svn: 335520
Matt Morehouse [Mon, 25 Jun 2018 20:30:03 +0000 (20:30 +0000)]
[CMake] Run libFuzzer tests with check-all.
Reviewers: kcc
Reviewed By: kcc
Subscribers: llvm-commits, mgorny
Differential Revision: https://reviews.llvm.org/D48200
llvm-svn: 335519
Craig Topper [Mon, 25 Jun 2018 20:27:46 +0000 (20:27 +0000)]
[X86] Simplify intrinsic table binary search to not require a temporary struct.
std::lower_bound doesn't require the thing to search for to be the same type as the table entries. We just need to define an appropriate comparison function that can take an table entry and an intrinsic number.
llvm-svn: 335518
Craig Topper [Mon, 25 Jun 2018 20:11:16 +0000 (20:11 +0000)]
[X86] Add comment about the sorting of the memory folding tables added in r335501.
llvm-svn: 335517
Michael Kruse [Mon, 25 Jun 2018 20:06:13 +0000 (20:06 +0000)]
Revert "Append new attributes to the end of an AttributeList."
This reverts commit r335084 as requested by David Jones and
Eric Christopher because of differences of emitted warnings.
llvm-svn: 335516
Fangrui Song [Mon, 25 Jun 2018 19:40:08 +0000 (19:40 +0000)]
[docs] Update doc after split of -gen-intrinsic in r335407
llvm-svn: 335515
Lei Huang [Mon, 25 Jun 2018 19:28:27 +0000 (19:28 +0000)]
[PowerPC] Fix incorrectly encoded wait instruction
Encoding for the wait instruction was wrong. Fix according to ISA 3.0.
Differential Revision: https://reviews.llvm.org/D48550
llvm-svn: 335514
Florian Hahn [Mon, 25 Jun 2018 19:17:29 +0000 (19:17 +0000)]
[SCEVExp] Advance found insertion point until we find a non-dbg instruction.
This avoids creating unnecessary casts if the IP used to be a dbg info
intrinsic. Fixes PR37727.
Reviewers: vsk, aprantl, sanjoy, efriedma
Reviewed By: vsk, efriedma
Differential Revision: https://reviews.llvm.org/D47874
llvm-svn: 335513
Sanjay Patel [Mon, 25 Jun 2018 18:51:21 +0000 (18:51 +0000)]
[InstSimplify] fold div/rem of zexted bool
I was looking at an unrelated fold and noticed that
we don't have this simplification (because the other
fold would break existing tests).
Name: zext udiv
%z = zext i1 %x to i32
%r = udiv i32 %y, %z
=>
%r = %y
Name: zext urem
%z = zext i1 %x to i32
%r = urem i32 %y, %z
=>
%r = 0
Name: zext sdiv
%z = zext i1 %x to i32
%r = sdiv i32 %y, %z
=>
%r = %y
Name: zext srem
%z = zext i1 %x to i32
%r = srem i32 %y, %z
=>
%r = 0
https://rise4fun.com/Alive/LZ9
llvm-svn: 335512
Kamil Rytarowski [Mon, 25 Jun 2018 18:49:13 +0000 (18:49 +0000)]
Handle NetBSD specific path in findDebugBinary()
Summary:
The NetBSD Operating System installs debuginfo
files into /usr/libdata/debug, rather than other path
like in some other popular distribution.
This change makes llvm-symbolizer functional with
the basesystem executables.
Reviewers: joerg, vitalybuka
Reviewed By: vitalybuka
Subscribers: JDevlieghere, llvm-commits
Differential Revision: https://reviews.llvm.org/D48525
llvm-svn: 335511
Sam Clegg [Mon, 25 Jun 2018 18:47:32 +0000 (18:47 +0000)]
[WebAssembly] Add no-prototype attribute to prototype-less C functions
The WebAssembly backend in particular benefits from being
able to distinguish between varargs functions (...) and prototype-less
C functions.
Differential Revision: https://reviews.llvm.org/D48443
llvm-svn: 335510
Sanjay Patel [Mon, 25 Jun 2018 18:27:14 +0000 (18:27 +0000)]
[InstSimplify] add tests for div/rem with bool divisor; NFC
llvm-svn: 335509
Reid Kleckner [Mon, 25 Jun 2018 18:16:27 +0000 (18:16 +0000)]
Re-land r335297 "[X86] Implement more of x86-64 large and medium PIC code models"
The large code model allows code and data segments to exceed 2GB, which
means that some symbol references may require a displacement that cannot
be encoded as a displacement from RIP. The large PIC model even relaxes
the assumption that the GOT itself is within 2GB of all code. Therefore,
we need a special code sequence to materialize it:
.LtmpN:
leaq .LtmpN(%rip), %rbx
movabsq $_GLOBAL_OFFSET_TABLE_-.LtmpN, %rax # Scratch
addq %rax, %rbx # GOT base reg
From that, non-local references go through the GOT base register instead
of being PC-relative loads. Local references typically use GOTOFF
symbols, like this:
movq extern_gv@GOT(%rbx), %rax
movq local_gv@GOTOFF(%rbx), %rax
All calls end up being indirect:
movabsq $local_fn@GOTOFF, %rax
addq %rbx, %rax
callq *%rax
The medium code model retains the assumption that the code segment is
less than 2GB, so calls are once again direct, and the RIP-relative
loads can be used to access the GOT. Materializing the GOT is easy:
leaq _GLOBAL_OFFSET_TABLE_(%rip), %rbx # GOT base reg
DSO local data accesses will use it:
movq local_gv@GOTOFF(%rbx), %rax
Non-local data accesses will use RIP-relative addressing, which means we
may not always need to materialize the GOT base:
movq extern_gv@GOTPCREL(%rip), %rax
Direct calls are basically the same as they are in the small code model:
They use direct, PC-relative addressing, and the PLT is used for calls
to non-local functions.
This patch adds reasonably comprehensive testing of LEA, but there are
lots of interesting folding opportunities that are unimplemented.
I restricted the MCJIT/eh-lg-pic.ll test to Linux, since the large PIC
code model is not implemented for MachO yet.
Differential Revision: https://reviews.llvm.org/D47211
llvm-svn: 335508
Matt Morehouse [Mon, 25 Jun 2018 18:01:51 +0000 (18:01 +0000)]
[CMake] Fix install-cxx target.
Was broken by r334477.
llvm-svn: 335507
Sanjay Patel [Mon, 25 Jun 2018 17:52:10 +0000 (17:52 +0000)]
[InstCombine] add tests for add-of-sext-bool; NFC
We canonicalize to select with a zext-add and either zext-sub or sext-sub,
so this shows a pattern that's not conforming to the general trend.
llvm-svn: 335506
Aditya Nandakumar [Mon, 25 Jun 2018 17:48:48 +0000 (17:48 +0000)]
[GISel]: Update the end of GISel Opcode namespace.
G_ADDRSPACE_CAST was added at the end, but PRE_ISEL_GENERIC_OPCODE_END
is still pointing incorrectly.
llvm-svn: 335505
Jessica Paquette [Mon, 25 Jun 2018 17:36:05 +0000 (17:36 +0000)]
[MachineOutliner] Outline from linkonceodrs by default in LTO when -moutline is passed
Pass -enable-linkonceodr-outlining by default when LTO is enabled.
The outliner shouldn't compete with any sort of linker deduplication
on linkonceodr functions when LTO is enabled. Therefore, this behaviour
should be the default.
llvm-svn: 335504
Jessica Paquette [Mon, 25 Jun 2018 17:27:51 +0000 (17:27 +0000)]
[MachineOutliner] Make last of -moutline/-mno-outline win
The expected behaviour of command-line flags to clang is to have
the last of -m(whatever) and -mno-(whatever) win. The outliner
didn't do that. This fixes that and updates the test.
llvm-svn: 335503
Alex Shlyapnikov [Mon, 25 Jun 2018 17:27:13 +0000 (17:27 +0000)]
[HWASan] Initalize shadow earler.
Summary:
Initialize shadow memory before calling more libc functions to allow
for HWASan-instrumented libc.
Reviewers: eugenis
Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits
Differential Revision: https://reviews.llvm.org/D48551
llvm-svn: 335502
Craig Topper [Mon, 25 Jun 2018 17:26:56 +0000 (17:26 +0000)]
[X86] Sort the static memory folding tables by reg opcode. Remove the reg->mem DenseMaps in favor of binary search.
With the static tables sorted we can binary search them directly for reg->mem lookups. This removes 6 DenseMaps that had to be created when X86InstrInfo is constructed.
We still have one Mem->Reg DenseMap for the reverse direction. This is created just as before by walking the reg->mem arrays to populate it.
Differential Revision: https://reviews.llvm.org/D48527
llvm-svn: 335501
Craig Topper [Mon, 25 Jun 2018 17:26:51 +0000 (17:26 +0000)]
[X86] Allow base and index for gather instructions to appear in other order for Intel syntax.
llvm-svn: 335500
Fangrui Song [Mon, 25 Jun 2018 17:16:01 +0000 (17:16 +0000)]
[ELF] Fix sort-non-script.s
llvm-svn: 335499
Fangrui Song [Mon, 25 Jun 2018 17:07:40 +0000 (17:07 +0000)]
[ELF] Change test files for style consistency. NFC
* Move `REQUIRES:` line to the top
* llvm-mc ... -o %t -> llvm-mc ... -o %t.o
* Don't check "TEXT" "DATA" columns (they are bfd-style names that do
not fit into llvm well) in llvm-objdump output
llvm-svn: 335498
Vedant Kumar [Mon, 25 Jun 2018 17:06:18 +0000 (17:06 +0000)]
[SelectionDAG] Remove debug locations from ConstantSD(FP)Nodes
This removes debug locations from ConstantSDNode and ConstantSDFPNode.
When this kind of node is materialized we no longer create a line table
entry which jumps back to the constant's first point of use. This makes
single-stepping behavior smoother, and it matches the model used by IR,
where Constants have no locations. See this thread for more context:
http://lists.llvm.org/pipermail/llvm-dev/2018-June/124164.html
I'd like to handle constant BuildVectorSDNodes and to try to eliminate
passing SDLocs to SelectionDAG::getConstant*() in follow-up commits.
Differential Revision: https://reviews.llvm.org/D48468
llvm-svn: 335497
Matt Davis [Mon, 25 Jun 2018 16:53:00 +0000 (16:53 +0000)]
[llvm-mca] Rename Backend to Pipeline. NFC.
Summary:
This change renames the Backend and BackendPrinter to Pipeline and PipelinePrinter respectively.
Variables and comments have also been updated to reflect this change.
The reason for this rename, is to be slightly more correct about what MCA is modeling. MCA models a Pipeline, which implies some logical sequence of stages.
Reviewers: andreadb, courbet, RKSimon
Reviewed By: andreadb, courbet
Subscribers: mgorny, javed.absar, tschuett, gbedwell, llvm-commits
Differential Revision: https://reviews.llvm.org/D48496
llvm-svn: 335496
Alexander Richardson [Mon, 25 Jun 2018 16:49:52 +0000 (16:49 +0000)]
Use Triple::isMIPS() instead of enumerating all Triples. NFC
Reviewed By: atanasyan
Differential Revision: https://reviews.llvm.org/D48549
llvm-svn: 335495
Fangrui Song [Mon, 25 Jun 2018 16:49:52 +0000 (16:49 +0000)]
[ELF] readobj -elf-output-style=GNU -> readelf
Style change for consistency. NFC
llvm-svn: 335494
Alexander Richardson [Mon, 25 Jun 2018 16:49:20 +0000 (16:49 +0000)]
Add Triple::isMIPS()/isMIPS32()/isMIPS64(). NFC
There are quite a few if statements that enumerate all these cases. It gets
even worse in our fork of LLVM where we also have a Triple::cheri (which
is mips64 + CHERI instructions) and we had to update all if statements that
check for Triple::mips64 to also handle Triple::cheri. This patch helps to
reduce our diff to upstream and should also make some checks more readable.
Reviewed By: atanasyan
Differential Revision: https://reviews.llvm.org/D48548
llvm-svn: 335493
Eric Liu [Mon, 25 Jun 2018 16:29:19 +0000 (16:29 +0000)]
[clang-format] Add a default format style that can be used by users of `getStyle`
Summary:
Tools that reformat code often call `getStyle` to decide the format style
to use on a certain source file. In practice, "file" style is widely used. As a
result, many tools hardcode "file" when calling `getStyle`, which makes it hard
to control the default style in tools across a codebase when needed. This change
introduces a `DefaultFormatStyle` constant (default to "file" in upstream), which
can be modified downstream if wanted, so that all users/tools built from the same
source tree can have a consistent default format style.
This also adds an DefaultFallbackStyle that is recommended to be used by tools and can be modified downstream.
Reviewers: sammccall, djasper
Reviewed By: sammccall
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D48492
llvm-svn: 335492
Gabor Marton [Mon, 25 Jun 2018 16:25:30 +0000 (16:25 +0000)]
Revert "[ASTImporter] Import the whole redecl chain of functions"
This reverts commit r335480.
llvm-svn: 335491
Matt Arsenault [Mon, 25 Jun 2018 16:17:48 +0000 (16:17 +0000)]
AMDGPU/GlobalISel: Add support for llvm.amdgcn.kernarg.segment.ptr
Note a normal select test is not currently possible because this
relies on input registers tracked in SIMachineFunctionInfo which
are not currently serializable in MIR, but this does work end-to-end
from the IR.
llvm-svn: 335490
David Carlier [Mon, 25 Jun 2018 16:10:20 +0000 (16:10 +0000)]
[LLDB] Select helper sign comparison fix
The constant could be unsigned thus explicit cast to silent compilation warnings
Reviewers: aprantl
Reviewed By: aprantl
Differential Revision: https://reviews.llvm.org/D48540
llvm-svn: 335489
Matt Arsenault [Mon, 25 Jun 2018 16:05:55 +0000 (16:05 +0000)]
StackSlotColoring: Decide colors per stack ID
I thought I fixed this in r308673, but that fix was
very broken. The assumption that any frame index can be used
in place of another was more widespread than I realized.
Even when stack slot sharing was disabled, this was still
replacing frame index uses with a different ID with a different
stack slot.
Really fix this by doing the coloring per-stack ID, so all of
the coloring logically done in a separate namespace. This is a lot
simpler than trying to figure out how to change the color if
the stack ID is different.
llvm-svn: 335488
Matt Morehouse [Mon, 25 Jun 2018 15:59:24 +0000 (15:59 +0000)]
[libFuzzer] Use Vector rather than std::vector.
llvm-svn: 335487
Matt Arsenault [Mon, 25 Jun 2018 15:42:20 +0000 (15:42 +0000)]
AMDGPU: Remove commented out code
llvm-svn: 335486
Matt Arsenault [Mon, 25 Jun 2018 15:42:12 +0000 (15:42 +0000)]
AMDGPU/GlobalISel: Fix G_IMPLICIT_DEF for pointers
llvm-svn: 335485
Wei Mi [Mon, 25 Jun 2018 15:40:31 +0000 (15:40 +0000)]
[SampleFDO] Add an option to turn on/off warning about samples unused.
If a function has sample to use, but cannot use them because of no debug
information, currently a warning will be issued to inform the missing
opportunity.
This warning assumes the binary generating the profile and the binary using
the profile are similar enough. It is not always the case. Sometimes even
if the binaries are not quite similar, we may still get some benefit by
using sampleFDO. In those cases, we may still want to apply sampleFDO but
not want to see a lot of such warnings pop up.
The patch adds an option for the warning.
Differential Revision: https://reviews.llvm.org/D48510
llvm-svn: 335484
Alexey Bataev [Mon, 25 Jun 2018 15:32:05 +0000 (15:32 +0000)]
[OPENMP] Do not consider address constant vars as possibly
threadprivate.
Do not delay emission of the address constant variables in OpenMP mode
as they cannot be defined as threadprivate.
llvm-svn: 335483
George Rimar [Mon, 25 Jun 2018 15:27:09 +0000 (15:27 +0000)]
[ELF] - ICF: add one more test case #3.
ICF is able to merge sections which relocations referring regular input sections
or mergeable sections, so it handles InputSection and MergeInputSection cases.
The following "return false" line which is executed in case of another type
of the sections is uncovered by our test cases:
https://github.com/llvm-mirror/lld/blob/master/ELF/ICF.cpp#L285
Patch fixes code coverage for this place.
llvm-svn: 335482
David Green [Mon, 25 Jun 2018 15:13:26 +0000 (15:13 +0000)]
[DA] Delinearise AddRecs if we can prove they don't wrap
We can prove that some delinearized subscripts do not wrap around to become
negative by the fact that they are from inbound geps of load/store locations.
This helps improve the delinearisation in cases where we can't prove that they
are non-negative from SCEV alone.
Differential Revision: https://reviews.llvm.org/D48481
llvm-svn: 335481
Gabor Marton [Mon, 25 Jun 2018 14:41:58 +0000 (14:41 +0000)]
[ASTImporter] Import the whole redecl chain of functions
Summary:
With this patch when any `FunctionDecl` of a redeclaration chain is imported
then we bring in the whole declaration chain. This involves functions and
function template specializations. Also friend functions are affected. The
chain is imported as it is in the "from" tu, the order of the redeclarations
are kept. I also changed the lookup logic in order to find friends, but first
making them visible in their declaration context. We may have long
redeclaration chains if all TU contains the same prototype, but our
measurements shows no degradation in time of CTU analysis (Tmux, Xerces,
Bitcoin, Protobuf). Also, as further work we could squash redundant
prototypes, but first ensure that functionality is working properly; then
should we optimize.
This may seem like a huge patch, sorry about that. But, most of the changes are
new tests, changes in the production code is not that much. I also tried to
create a smaller patch which does not affect specializations, but that patch
failed to pass some of the `clang-import-test`s because there we import
function specializations. Also very importantly, we can't just change the
import of `FunctionDecl`s without changing the import of function template
specializations because they are handled as `FunctionDecl`s.
Reviewers: a.sidorin, r.stahl, xazax.hun, balazske
Subscribers: rnkovacs, dkrupp, cfe-commits
Differential Revision: https://reviews.llvm.org/D47532
llvm-svn: 335480
George Rimar [Mon, 25 Jun 2018 14:35:47 +0000 (14:35 +0000)]
[ELF] - Rewrote comment. NFC.
llvm-svn: 335479
Matt Arsenault [Mon, 25 Jun 2018 14:29:04 +0000 (14:29 +0000)]
AMDGPU: Respect align argument parameter
This should avoid relying on the pointee type
to get the alignment, particularly since pointee
types are supposed to be removed at some point.
Also fixes not getting the alignment for unsized types.
llvm-svn: 335478
George Rimar [Mon, 25 Jun 2018 14:28:40 +0000 (14:28 +0000)]
[ELF] - ICF: add one more test case #2.
Check that ICF does not merge sections which relocations
have equal addends, but different target values.
This covers the following line, which was uncovered:
https://github.com/llvm-mirror/lld/blob/master/ELF/ICF.cpp#L278
llvm-svn: 335477
Pavel Labath [Mon, 25 Jun 2018 14:28:38 +0000 (14:28 +0000)]
Fix TestThreadExit for gcc&libc++ combo
pseudo_barrier_wait() begins by decrementing an atomic variable. Since
these are always_inline in libc++, there is no line table anchor to
break on before we decrement it. This meant that on gcc we stopped after
the variable has been decremented, which meant that thread2 could have
exited, violating the test setup. On clang this wasn't a problem
because it generated some line table entries for the do{}while(0) loop
in the macro, so we still ended up stopping, before we touched the
variable.
I fix this by adding a dummy statement before the pseudo_barrier_wait()
command and setting the breakpoint there.
llvm-svn: 335476
George Rimar [Mon, 25 Jun 2018 14:00:05 +0000 (14:00 +0000)]
[ELF] - ICF: add one more test case.
This test case check that ICF does not merge 2 sections which relocations
efer to symbols that live in sections of the different types
(regular input section and mergeable input sections in this case).
It covers the following line of code, which was uncovered previously:
https://github.com/llvm-mirror/lld/blob/master/ELF/ICF.cpp#L271
llvm-svn: 335475
Artur Pilipenko [Mon, 25 Jun 2018 13:51:11 +0000 (13:51 +0000)]
SafepointIRVerifier should ignore dead blocks and dead edges
Not only should SafepointIRVerifier ignore unreachable blocks (as suggested in https://reviews.llvm.org/D47011) but it also has to ignore dead blocks.
In @test2 (see the new tests):
br i1 true, label %right, label %left
left:
...
right:
...
merge:
%val = phi i8 addrspace(1)* [ ..., %left ], [ ..., %right ]
use %val
both left and right branches are reachable.
If they collide then SafepointIRVerifier reports an error.
Because of the foldable branch condition GVN finds the left branch dead and removes the phi node entry that merges values from right and left. Then the use comes from the right branch. This results in no collision.
So, SafepointIRVerifier ends up in different results depending on either GVN is run or not.
To solve this issue this patch adds Dead Block detection to SafepointIRVerifier which can ignore dead blocks while validating IR. The Dead Block detection algorithm is taken from GVN but modified to not split critical edges. That is needed to keep CFG unchanged by SafepointIRVerifier.
Patch by Yevgeny Rouban.
Reviewed By: anna, apilipenko, DaniilSuchkov
Differential Revision: https://reviews.llvm.org/D47441
llvm-svn: 335473
Krzysztof Parzyszek [Mon, 25 Jun 2018 13:46:41 +0000 (13:46 +0000)]
Improve handling of COPY instructions with identical value numbers
Testcases provided by Tim Renouf.
Differential Revision: https://reviews.llvm.org/D48102
llvm-svn: 335472
George Rimar [Mon, 25 Jun 2018 13:46:39 +0000 (13:46 +0000)]
Revert r335460 "[ELF] - ICF: Remove dead code. NFC."
My mistake, it was not NFC.
llvm-svn: 335471
Clement Courbet [Mon, 25 Jun 2018 13:44:27 +0000 (13:44 +0000)]
[llvm-exegesis][NFC] Remove unnecessary member variables.
llvm-svn: 335470
Alexey Bataev [Mon, 25 Jun 2018 13:43:35 +0000 (13:43 +0000)]
[OPENMP, NVPTX] Fixes for NVPTX RTL
Summary:
Patch fixes several problems in the implementation of NVPTX RTL.
1. Detection of the last iteration for loops with static scheduling, no chunks.
2. Fixes reductions for the serialized parallel constructs.
3. Fixes handling of the barriers.
Reviewers: grokos
Reviewed By: grokos
Subscribers: Hahnfeld, guansong, openmp-commits
Differential Revision: https://reviews.llvm.org/D48480
llvm-svn: 335469
Sanjay Patel [Mon, 25 Jun 2018 13:40:54 +0000 (13:40 +0000)]
[IR] avoid -Wdocumentation spew about HTML tags
There's probably a better solution, but adding spaces
in the IR vector examples sidesteps the problem without
uglifying the plain text.
llvm-svn: 335468
Clement Courbet [Mon, 25 Jun 2018 13:39:50 +0000 (13:39 +0000)]
[llvm-exegesis] Fix warning in r22752: Initialize IsSnippetSetupComplete.
llvm-svn: 335467
Hans Wennborg [Mon, 25 Jun 2018 13:23:49 +0000 (13:23 +0000)]
[clang-cl] Don't emit dllexport inline functions etc. from pch files (PR37801)
With MSVC, PCH files are created along with an object file that needs to
be linked into the final library or executable. That object file
contains the code generated when building the headers. In particular, it
will include definitions of inline dllexport functions, and because they
are emitted in this object file, other files using the PCH do not need
to emit them. See the bug for an example.
This patch makes clang-cl match MSVC's behaviour in this regard, causing
significant compile-time savings when building dlls using precompiled
headers.
For example, in a 64-bit optimized shared library build of Chromium with
PCH, it reduces the binary size and compile time of
stroke_opacity_custom.obj from 9315564 bytes to 3659629 bytes and 14.6
to 6.63 s. The wall-clock time of building blink_core.dll goes from
38m41s to 22m33s. ("user" time goes from 1979m to 1142m).
Differential Revision: https://reviews.llvm.org/D48426
llvm-svn: 335466
Clement Courbet [Mon, 25 Jun 2018 13:12:02 +0000 (13:12 +0000)]
[llvm-exegesis] Generate snippet setup code.
Summary:
This ensures that the snippet always sees the same values for registers,
making measurements reproducible.
This will also allow exploring different values.
Reviewers: gchatelet
Subscribers: tschuett, llvm-commits
Differential Revision: https://reviews.llvm.org/D48542
llvm-svn: 335465
Gabor Marton [Mon, 25 Jun 2018 13:04:37 +0000 (13:04 +0000)]
[ASTImporter] Add ms compatibility to tests which use the TestBase
Summary:
In order to avoid build failures on MS, we use -fms-compatibility too in
the tests which use the TestBase. Moved the family of `testImport`
functions under a test fixture class, so we can use parameterized tests.
Refactored `testImport` and `testImportSequence`, because `for` loops over
the different compiler options is no longer needed, that is handeld by
the test framework via parameters from now on.
Reviewers: a.sidorin, r.stahl, xazax.hun
Subscribers: rnkovacs, dkrupp, cfe-commits
Differential Revision: https://reviews.llvm.org/D47367
llvm-svn: 335464
Artur Pilipenko [Mon, 25 Jun 2018 12:58:13 +0000 (12:58 +0000)]
Revert change 335077 "[InlineSpiller] Fix a crash due to lack of forward progress from remat specifically for STATEPOINT"
This change caused widespread assertion failures in our downstream testing:
lib/CodeGen/LiveInterval.cpp:409: bool llvm::LiveRange::overlapsFrom(const llvm::LiveRange&, llvm::LiveRange::const_iterator) const: Assertion `!empty() && "empty range"' failed.
llvm-svn: 335462
Artur Pilipenko [Mon, 25 Jun 2018 12:55:58 +0000 (12:55 +0000)]
Revert change 335091.
It adds extra test for the change 335077, which is also to be reverted as it causes test failures in downstream testing.
llvm-svn: 335461
George Rimar [Mon, 25 Jun 2018 12:51:55 +0000 (12:51 +0000)]
[ELF] - ICF: Remove dead code. NFC.
Code is dead. We use only InputSections when building the list of
sections elegible for the ICF:
https://github.com/llvm-mirror/lld/blob/master/ELF/ICF.cpp#L439
And 'isEligible' filters out SyntheticSections as well for us.
That way the only Kind we have in the Sections vector is SectionBase::Regular,
so we do not need to check sections kind at all, it is always the same.
llvm-svn: 335460
Krasimir Georgiev [Mon, 25 Jun 2018 12:43:12 +0000 (12:43 +0000)]
[clang-format] Keep @message together in text protos
Summary:
In C++ code snippets of the form `@field` are common. This makes clang-format
keep them together in text protos, whereas before it would break them.
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D48543
llvm-svn: 335459
Eric Liu [Mon, 25 Jun 2018 11:50:11 +0000 (11:50 +0000)]
[clangd] Always remove dots before converting paths to URIs in symbol collector.
llvm-svn: 335458
Simon Pilgrim [Mon, 25 Jun 2018 11:46:24 +0000 (11:46 +0000)]
Use APInt[] bit access to avoid "32-bit shift implicitly converted to 64 bits" MSVC warning (again). NFCI.
llvm-svn: 335457
Clement Courbet [Mon, 25 Jun 2018 11:44:29 +0000 (11:44 +0000)]
[llvm-exegesis][NFC] Simplify BenchmarkRunner ctor.
llvm-svn: 335456
Gabor Marton [Mon, 25 Jun 2018 11:38:43 +0000 (11:38 +0000)]
[ASTImporter] Add new tests about templated-described swing
Summary:
Add a new test about importing a partial specialization (of a class). Also,
this patch adds new tests about the templated-described swing, some of these
fail ATM, but subsequent patches will fix them.
Reviewers: a.sidorin, r.stahl, xazax.hun
Subscribers: rnkovacs, dkrupp, cfe-commits
Differential Revision: https://reviews.llvm.org/D47534
llvm-svn: 335455
Simon Pilgrim [Mon, 25 Jun 2018 11:38:27 +0000 (11:38 +0000)]
Use APInt[] bit access to avoid "32-bit shift implicitly converted to 64 bits" MSVC warning. NFCI.
llvm-svn: 335454
George Rimar [Mon, 25 Jun 2018 11:37:27 +0000 (11:37 +0000)]
[ELF] - ICF: test we do not merge sectinons which relocations points to symbols of the different types.
This test case covers the following line of code:
https://github.com/llvm-mirror/lld/blob/master/ELF/ICF.cpp#L261
Previously it was uncovered.
llvm-svn: 335453
Clement Courbet [Mon, 25 Jun 2018 11:22:23 +0000 (11:22 +0000)]
[llvm-exegesis][NFC] clang-format
llvm-svn: 335452
Simon Pilgrim [Mon, 25 Jun 2018 11:19:05 +0000 (11:19 +0000)]
Fix -Wparentheses gcc warning. NFCI.
llvm-svn: 335451
Clement Courbet [Mon, 25 Jun 2018 11:12:30 +0000 (11:12 +0000)]
[llvm-exegesis][NFC] Fix `Operand` class comments.
llvm-svn: 335450
Krasimir Georgiev [Mon, 25 Jun 2018 11:08:24 +0000 (11:08 +0000)]
[clang-format] Fix end-of-file comments text proto formatting
Summary:
The case of end-of-file comments was formatted badly:
```
key: value
# end-of-file comment
```
This patch fixes that formatting:
```
key: value
# end-of-file comment
```
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D48539
llvm-svn: 335449
Jonas Devlieghere [Mon, 25 Jun 2018 10:11:53 +0000 (10:11 +0000)]
Revert "[FileSpec] Always normalize"
This reverts r335432 because remove_dots() is expensive and measuring
its impact showed an observable performance regression
(https://reviews.llvm.org/D45977#1078510).
llvm-svn: 335448
George Rimar [Mon, 25 Jun 2018 09:30:39 +0000 (09:30 +0000)]
[ELF] - Replace llvm::find_if with the loop. NFC.
Requested during post commit review.
llvm-svn: 335447
Craig Topper [Mon, 25 Jun 2018 06:05:37 +0000 (06:05 +0000)]
[X86] Block commuting operand 1 of FMA*_Int instructions in findThreeSrcCommutedOpIndices. Remove uncommutable returns from getThreeSrcCommuteCase/getFMA3OpcodeToCommuteOperands.
We should be blocking the operand while we are in the routine that tries to find commutable operand indices. Doing it later means we might have missed out on another valid set of operands we could have commuted.
The intrinsic case was the only case that could really prevent commuting in getFMA3OpcodeToCommuteOperands. All the other cases in getThreeSrcCommuteCase were not reachable conditions as they were protected by findThreeSrcCommutedOpIndices.
With that abort case pushed earlier, we can remove all the abort checks and replace with asserts.
llvm-svn: 335446
Igor Kudrin [Mon, 25 Jun 2018 05:48:04 +0000 (05:48 +0000)]
[CodeGen] Provide source locations for UBSan type checks when emitting constructor calls.
Differential Revision: https://reviews.llvm.org/D48531
llvm-svn: 335445
George Burgess IV [Mon, 25 Jun 2018 05:30:36 +0000 (05:30 +0000)]
[MSSA] Add domination number verifier; NFC
It's easy for domination numbers to get out-of-date, and this is no more
costly than any of the other verifiers we already have, so it seems nice
to have.
A stage3 build with this Works On My Machine, so this hasn't caught any
bugs... yet. :)
llvm-svn: 335444
Zachary Turner [Mon, 25 Jun 2018 04:38:03 +0000 (04:38 +0000)]
One more build fix for non MSVC compilers.
llvm-svn: 335443
Zachary Turner [Mon, 25 Jun 2018 04:35:35 +0000 (04:35 +0000)]
Try to fix build error on non MSVC compilers.
llvm-svn: 335442
Zachary Turner [Mon, 25 Jun 2018 03:13:27 +0000 (03:13 +0000)]
Fix CRLF line endings.
llvm-svn: 335441
Zachary Turner [Mon, 25 Jun 2018 03:13:09 +0000 (03:13 +0000)]
Add a TaskQueue that can serialize work on a ThreadPool.
We have ThreadPool, which can execute work asynchronously on N
background threads, but sometimes you need to make sure the work
is executed asynchronously but also serially. That is, if task
B is enqueued after task A, then task B should not begin until
task A has completed. This patch adds such a class.
Differential Revision: https://reviews.llvm.org/D48240
llvm-svn: 335440
Heejin Ahn [Mon, 25 Jun 2018 01:20:21 +0000 (01:20 +0000)]
[WebAssembly] Add WebAssemblyException information analysis
Summary:
A WebAssemblyException object contains BBs that belong to a 'catch' part
of the try-catch-end structure. Because CFGSort requires all the BBs
within a catch part to be sorted together as it does for loops, this
pass calculates the nesting structure of catch part of exceptions in a
function. Now this assumes the use of Windows EH instructions.
Reviewers: dschuff, majnemer
Subscribers: jfb, mgorny, sbc100, jgravelle-google, sunfish, llvm-commits
Differential Revision: https://reviews.llvm.org/D44134
llvm-svn: 335439
Heejin Ahn [Mon, 25 Jun 2018 01:07:11 +0000 (01:07 +0000)]
[WebAssembly] Add WebAssemblyLateEHPrepare pass
Summary:
Add WebAssemblyLateEHPrepare pass that does several small jobs for
exception handling. This runs before CFGSort, and is different from
WasmEHPrepare pass that runs before ISel, even though the names are
similar.
Reviewers: dschuff, majnemer
Subscribers: sbc100, jgravelle-google, sunfish, mgorny, llvm-commits
Differential Revision: https://reviews.llvm.org/D46803
llvm-svn: 335438