Commit Graph

285008 Commits

Author SHA1 Message Date
George Rimar b9f4b70f20 [ELF} - Fix build bots.
llvm-svn: 327419
2018-03-13 16:23:48 +00:00
Craig Topper 7e711a6822 [X86] Remove SplitBinaryOpsAndApply and use SplitOpsAndApply by adding curly braces around the ops.
Summary: Unless you were intentionally avoiding this syntax? I saw you mentioned makeArrayRef in your commit that added SplitOpsAndApply.

Reviewers: RKSimon

Reviewed By: RKSimon

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D44403

llvm-svn: 327418
2018-03-13 16:23:27 +00:00
George Rimar b7288836ca [ELF] - Fix mistype in comment. NFC.
llvm-svn: 327417
2018-03-13 16:11:02 +00:00
George Rimar f95e7c6f7a [ELF] - Rename test cases to *.test.
This is a follow-up for r327410.

llvm-svn: 327416
2018-03-13 16:02:45 +00:00
Andrea Di Biagio c95a130105 [llvm-mca] Simplify code that computes the latency of an instruction in
InstrBuilder. NFCI

This was possible because of r327406, which added function`computeInstrLatency`
to MCSchedModel.

llvm-svn: 327415
2018-03-13 15:59:59 +00:00
Brock Wyma f52e192293 Revert r327397 [CodeView] Omit forward references for unnamed structs and ...
This reverts commit r327397 to investigate a buildbot failure.

llvm-svn: 327414
2018-03-13 15:56:20 +00:00
Pavel Labath f9841cec26 include locale.h in IOHandler.cpp
This is needed for the setlocale() call, and it seems that it is not
transitively pulled in for some build configurations.

llvm-svn: 327413
2018-03-13 15:55:00 +00:00
Zaara Syeda df28fb6ac2 test commit: fix formatting of a comment
This is  a simple change to do the test commit.

llvm-svn: 327412
2018-03-13 15:49:05 +00:00
Jonas Devlieghere bc35a631b3 [dsymutil] Unify error handling outside DwarfLinker.
This is a follow-up to r327137 where we unified error handling for the
DwarfLinker. This replaces calls to errs() and outs() with the
appropriate ostream wrapper everywhere in dsymutil.

llvm-svn: 327411
2018-03-13 15:47:38 +00:00
George Rimar cfd2c97008 [ELF] - Represent tests as linker scripts instead of asm.
This follows recently started direction and sometimes
allows to fully get rid from `echo` calls.

I'll rename changed files to *.test in a follow-up.

llvm-svn: 327410
2018-03-13 15:47:14 +00:00
Simon Dardis d5ae61d49d [mips] Guard traps for microMIPS correctly
This is part of fixing the instruction predicates for MIPS.

Reviewers: atanasyan, abeserminji

Differential Revision: https://reviews.llvm.org/D44212

llvm-svn: 327409
2018-03-13 15:46:58 +00:00
Rafael Espindola f5220fb68f [ThinLTO] Clear dllimport when setting dso_local.
This is PR36686.

If a user of a library is LTOed with that library we take the
opportunity to set dso_local, but we don't clear dllimport, which
creates an invalid IR.

llvm-svn: 327408
2018-03-13 15:24:51 +00:00
Simon Pilgrim 3d4c86d399 [X86][Btver2] Split i8/i16/i32/i64 div/idiv costs
We were assuming a mixture of 32/64 division costs.

llvm-svn: 327407
2018-03-13 15:22:24 +00:00
Andrea Di Biagio 30c1ba4834 [MC] Move the instruction latency computation from TargetSchedModel to MCSchedModel.
The goal is to make the latency information accessible through the MCSchedModel
interface. This is particularly important for tools like llvm-mca that only have
access to the MCSchedModel API.

This partially fixes PR36676.
No functional change intended.

Differential Revision: https://reviews.llvm.org/D44383

llvm-svn: 327406
2018-03-13 15:22:13 +00:00
Joel E. Denny 8150810556 Reland "[Attr] Fix parameter indexing for several attributes"
Relands r326602 (reverted in r326862) with new test and fix for
PR36620.

Differential Revision: https://reviews.llvm.org/D43248

llvm-svn: 327405
2018-03-13 14:51:22 +00:00
Sanjay Patel 204edeca56 [InstCombine] fix fmul reassociation to avoid creating an extra fdiv
This was supposed to be an NFC refactoring that will eventually allow
eliminating the isFast() predicate, but there's a rare possibility
that we would pessimize the code as shown in the test case because
we failed to check 'hasOneUse()' properly. This version also removes
an inefficiency of the old code; we would look for: 
(X * C) * C1 --> X * (C * C1)
...but that pattern is always handled by 
SimplifyAssociativeOrCommutative().

llvm-svn: 327404
2018-03-13 14:46:32 +00:00
Simon Dardis 476ed8f26e [mips] Fix the definitions of the EVA instructions
Correct their availability to their respective ISAs.

Reviewers: atanasyan

Differential Revision: https://reviews.llvm.org/D44209

llvm-svn: 327403
2018-03-13 14:39:44 +00:00
Sylvestre Ledru d9a8b6a745 fix some user facing typos / in the comments
llvm-svn: 327402
2018-03-13 14:35:10 +00:00
Haojian Wu 0259e7d872 [clangd] Use the macro name range as the definition range.
Summary: This also aligns with the behavior of declarations.

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: klimek, ilya-biryukov, jkorous-apple, ioeric, cfe-commits

Differential Revision: https://reviews.llvm.org/D44423

llvm-svn: 327401
2018-03-13 14:31:31 +00:00
Jonas Devlieghere de18d3eeb5 [dsymutil] Remove old error/warn functions. NFC.
This removes the old error and warn functions that were still present in
the dwarf linker.

llvm-svn: 327400
2018-03-13 14:28:07 +00:00
Jonas Devlieghere e1f0e22fcd [dsymutil] Perform analyzeContextInfo and CloneDIEs in parallel
This patch makes dsymutil perform analyzeContextInfo and CloneDIEs in
parallel. For the same object file, there is a dependency between the
two. However, we can do analyzeContextInfo for the next object file
while cloning DIEs for the current. This is exactly the approach taken
in this patch.

For WebCore, this leads to a performance improvement of 29% and for
clang we see similar results with at 32% improvement.

A big thanks to Pete Cooper who came up with the original idea and
the PoC.

Differential revision: https://reviews.llvm.org/D43945

llvm-svn: 327399
2018-03-13 14:27:15 +00:00
Daniel Neilson 41e781d5f1 [SROA] Take advantage of separate alignments for memcpy source and destination
Summary:
This change is part of step five in the series of changes to remove alignment argument from
memcpy/memmove/memset in favour of alignment attributes. In particular, this changes the
SROA pass to cease using the old getAlignment() & setAlignment() APIs of MemoryIntrinsic in
favour of getting source & dest specific alignments through the new API. This allows us
to enhance visitMemTransferInst to be more aggressive setting the alignment in memcpy
calls that it creates, as well as to only change the alignment of a memcpy/memmove
argument that it replaces.

Steps:
Step 1) Remove alignment parameter and create alignment parameter attributes for
memcpy/memmove/memset. ( rL322965, rC322964, rL322963 )
Step 2) Expand the IRBuilder API to allow creation of memcpy/memmove with differing
source and dest alignments. ( rL323597 )
Step 3) Update Clang to use the new IRBuilder API. ( rC323617 )
Step 4) Update Polly to use the new IRBuilder API. ( rL323618 )
Step 5) Update LLVM passes that create memcpy/memmove calls to use the new IRBuilder API,
and those that use use MemIntrinsicInst::[get|set]Alignment() to use [get|set]DestAlignment()
and [get|set]SourceAlignment() instead. ( rL323886, rL323891, rL324148, rL324273, rL324278,
rL324384, rL324395, rL324402, rL324626, rL324642, rL324653, rL324654, rL324773, rL324774,
rL324781, rL324784, rL324955, rL324960, rL325816 )
Step 6) Remove the single-alignment IRBuilder API for memcpy/memmove, and the
MemIntrinsicInst::[get|set]Alignment() methods.

Reference
   http://lists.llvm.org/pipermail/llvm-dev/2015-August/089384.html
   http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20151109/312083.html

Reviewers: chandlerc, bollu, efriedma

Reviewed By: efriedma

Subscribers: efriedma, eraman, llvm-commits

Differential Revision: https://reviews.llvm.org/D42974

llvm-svn: 327398
2018-03-13 14:25:33 +00:00
Brock Wyma 4fb9184558 [CodeView] Omit forward references for unnamed structs and unions
Codeview references to unnamed structs and unions are expected to refer to the
complete type definition instead of a forward reference so Visual Studio can
resolve the type properly.

Differential Revision: https://reviews.llvm.org/D32498

llvm-svn: 327397
2018-03-13 14:14:16 +00:00
Andrea Di Biagio e1a1da1126 [llvm-mca] Use a const ArrayRef in a few places. NFC
llvm-svn: 327396
2018-03-13 13:58:02 +00:00
Haicheng Wu 07c9e83faa [TTI] Fix a typo in the comment
llvm-svn: 327395
2018-03-13 13:52:47 +00:00
Clement Courbet 7efbea19be [llvm-mca] Fix unused variable warning in opt mode.
llvm-svn: 327394
2018-03-13 13:44:18 +00:00
Krzysztof Parzyszek 06507fd283 [Hexagon] Clang side of r327302 in LLVM
Add option -m[no-]packets to control generation of instruction packets
(enabled by default).

llvm-svn: 327393
2018-03-13 13:30:43 +00:00
Nicholas Wilson 531769b9f9 [WebAssembly] Demangle symbol names for use by the browser debugger
Differential Revision: https://reviews.llvm.org/D44316

llvm-svn: 327392
2018-03-13 13:30:04 +00:00
Nicholas Wilson 88d9ffc973 [WebAssembly] Use helper macro from ELF/Options.td to tidy. NFC
Differential Revision: https://reviews.llvm.org/D44394

llvm-svn: 327391
2018-03-13 13:16:15 +00:00
Nicholas Wilson 08cff61572 [WebAssembly] Add missing --demangle arg
Previously, Config->Demangle was uninitialised (not hooked up to
commandline handling)

Differential Revision: https://reviews.llvm.org/D44301

llvm-svn: 327390
2018-03-13 13:12:03 +00:00
Clement Courbet 844f22d3c3 [llvm-mca] Refactor event listeners to make the backend agnostic to event types.
Summary: This is a first step towards making the pipeline configurable.

Subscribers: llvm-commits, andreadb

Differential Revision: https://reviews.llvm.org/D44309

llvm-svn: 327389
2018-03-13 13:11:01 +00:00
Simon Dardis 9d7e9032f1 [mips] Don't create nested CALLSEQ_START..CALLSEQ_END nodes.
For the MIPS O32 ABI, the current call lowering logic naively lowers each
call, creating the reserved argument area to hold the argument spill areas for
$a0..$a3 and the outgoing parameter area if one is required at each call site.

In the case of a sufficently large byval argument, a call to memcpy is used
to write the start+16..end of the argument into the outgoing parameter area.
This is done within the CALLSEQ_START..CALLSEQ_END of the callee. The CALLSEQ
nodes are responsible for performing the necessary stack adjustments.

Since the O32/N32/N64 MIPS ABIs do not have a red-zone and writing below the
stack pointer and reading the values back is unpredictable, the call to memcpy
cannot be hoisted out of the callee's CALLSEQ nodes.

However, for the O32 ABI requires the reserved argument area for functions
which have parameters. The naive lowering of calls will then create nested
CALLSEQ sequences. For N32 and N64 these nodes are also created, but with
zero stack adjustments as those ABIs do not have a reserved argument area.

This patch addresses the correctness issue by recognizing the special case
of lowering a byval argument that uses memcpy. By recognizing that the
incoming chain already has a CALLSEQ_START node on it when calling memcpy,
the CALLSEQ nodes are not created. For the N32 and N64 ABIs, this is not an
issue, as no stack adjustment has to be performed.

For the O32 ABI, the correctness reasoning is different. In the case of a
sufficently large byval argument, registers a0..a3 are going to be used for
the callee's arguments, mandating the creation of the reserved argument area.
The call to memcpy in the naive case will also create its own reserved
argument area. However, since the reserved argument area consists of undefined
values, both calls can use the same reserved argument area.

Reviewers: abeserminji, atanasyan

Differential Revision: https://reviews.llvm.org/D44296

llvm-svn: 327388
2018-03-13 12:50:03 +00:00
Haojian Wu 2658cb65bd [clangd] Fix irrelevant declaratations in goto definition (on macros).
Summary:
DeclrationAndMacrosFinder will find some declarations (not macro!) that are
referened inside the macro somehow, isSearchedLocation() is not sufficient, we
don't know whether the searched source location is macro or not.

Reviewers: ilya-biryukov

Subscribers: klimek, jkorous-apple, ioeric, cfe-commits

Differential Revision: https://reviews.llvm.org/D44293

llvm-svn: 327387
2018-03-13 12:30:59 +00:00
Haojian Wu 797f32e084 [clangd] Remove extra ";", NFC.
llvm-svn: 327386
2018-03-13 12:26:28 +00:00
Simon Pilgrim 93bd7187f4 [X86][SSE41] createVariablePermute v2X64 - PCMPEQQ can test for index 0/1 and select between them.
llvm-svn: 327385
2018-03-13 12:22:58 +00:00
Jonas Devlieghere 8e6adf581b [dsymutil] Unbreak non-Darwin bots.
BinaryHolder -> BinHolder

llvm-svn: 327384
2018-03-13 11:32:19 +00:00
Pavel Labath 034c0f24a0 clang-import-test: fix build with clang-3.8
clang-3.8 complains that constructor for '...' must explicitly
initialize the const object. Newer clangs and gcc seem to be fine with
this, but explicitly initializing the variable does not hurt.

llvm-svn: 327383
2018-03-13 11:28:27 +00:00
Jonas Devlieghere 991b66f304 [dsymutil] Introduce LinkContext. NFC.
This patch introduces the LinkContext which is necessary to have
dsymutil perform analysis and cloning of DIEs in parallel. As requested
in D43945, I'm landing this as two separate commits.

llvm-svn: 327382
2018-03-13 10:52:49 +00:00
Eugene Leviant 6f42a2cd91 [Evaluator] Evaluate load/store with bitcast
Differential revision: https://reviews.llvm.org/D43457

llvm-svn: 327381
2018-03-13 10:19:50 +00:00
Pavel Labath cd3cbd4c1f Fix clang-3.8 build
clang-3.8 complains that constructor for '...' must explicitly
initialize the const member. Newer clangs and gcc seem to be fine with
this, but explicitly initializing the member does not hurt.

llvm-svn: 327380
2018-03-13 09:46:10 +00:00
Pavel Labath 01961c4b1a Fix linux s390x build (pr36694)
llvm-svn: 327379
2018-03-13 09:46:00 +00:00
George Rimar 796684b451 [ELF] - Implement INSERT BEFORE.
This finishes PR35877.

INSERT BEFORE used similar to INSERT AFTER,
it inserts sections before the given target section.

Differential revision: https://reviews.llvm.org/D44380

llvm-svn: 327378
2018-03-13 09:18:11 +00:00
George Rimar ebc1d1fdde [ELF] - Fix wrong "REQUIRES" in test.
Its a follow up for r327374 to fix BB.

llvm-svn: 327377
2018-03-13 08:50:36 +00:00
George Rimar 2313086726 [ELF] - Restrict section offsets that exceeds file size.
This is part of PR36515.

With some linkerscripts it is possible to get file offset overlaps
and overflows. Currently LLD checks overlaps in checkNoOverlappingSections().
And also we allow broken output with --no-inhibit-exec.
Problem is that sometimes final offset of sections is completely broken
and we calculate output file size wrong and might crash.

Patch implements check to verify that there is no output section
which offset exceeds file size.

Differential revision: https://reviews.llvm.org/D43819

llvm-svn: 327376
2018-03-13 08:47:17 +00:00
Jonas Paulsson 5612bb292c [CodeGenPrepare] Respect endianness in splitMergedValStore.
splitMergedValStore will split a store into two if target prefers this, or if
-force-split-store is passed.

This patch adds the missing handling for endianness in this function along
with a test case.

Review: Eli Friedman
https://reviews.llvm.org/D44396

llvm-svn: 327375
2018-03-13 08:36:20 +00:00
George Rimar afbf90aef9 [ELF] - Drop special flags for empty output sections.
This fixes PR36598.

LLD currently crashes when we have empty output section
with SHF_LINK_ORDER flag. This might happen if we place an 
empty synthetic section in the linker script, but keep output
section alive with the use of additional symbol, for example.

The patch fixes the issue by dropping all special flags
for empty sections.

Differential revision: https://reviews.llvm.org/D44376

llvm-svn: 327374
2018-03-13 08:32:56 +00:00
Max Kazantsev 2371e0a1c8 [SCEV][NFC] Smarter implementation of isAvailableAtLoopEntry
isAvailableAtLoopEntry duplicates logic of `properlyDominates` after checking invariance.
This patch replaces this logic with invocation of this method which is more profitable
because it supports caching.

Differential Revision: https://reviews.llvm.org/D43997

llvm-svn: 327373
2018-03-13 07:46:06 +00:00
Clement Courbet 9f0b3170bc [MergeICmps] Make sure that the comparison only has one use.
Summary: Fixes PR36557.

Reviewers: trentxintong, spatel

Subscribers: mstorsjo, llvm-commits

Differential Revision: https://reviews.llvm.org/D44083

llvm-svn: 327372
2018-03-13 07:05:55 +00:00
Yonghong Song 82bf8bcb4f bpf: Enhance debug information for peephole optimization passes
Add more debug information for peephole optimization passes.

These would only be enabled for debug version binary and could help
analyzing why some optimization opportunities were missed.

Signed-off-by: Jiong Wang <jiong.wang@netronome.com>
Signed-off-by: Yonghong Song <yhs@fb.com>
llvm-svn: 327371
2018-03-13 06:47:07 +00:00
Yonghong Song e91802f336 bpf: New post-RA peephole optimization pass to eliminate bad RA codegen
This new pass eliminate identical move:

  MOV rA, rA

This is particularly possible to happen when sub-register support
enabled. The special type cast insn MOV_32_64 involves different
register class on src (i32) and dst (i64), RA could generate useless
instruction due to this.

This pass also could serve as the bast for further post-RA optimization.

Signed-off-by: Jiong Wang <jiong.wang@netronome.com>
Signed-off-by: Yonghong Song <yhs@fb.com>
llvm-svn: 327370
2018-03-13 06:47:06 +00:00