Commit Graph

296258 Commits

Author SHA1 Message Date
Stephen Kelly a6e4358f07 Port getStartLoc -> getBeginLoc
Reviewers: teemperor!

Subscribers: cfe-commits

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

llvm-svn: 339384
2018-08-09 21:05:56 +00:00
Erich Keane f8a4c7775f [NFC] Complete the rule-of-5 for ParsedAttr
Add move assign/construct as 'deleted' to ParsedAttr
to complete the rule-of-5.

llvm-svn: 339383
2018-08-09 21:04:34 +00:00
Erich Keane 99428d7689 [NFC] Simplify 'friend' declaration in ParsedAttr
As suggested in the post-commit review for D50531,
change from the templatized TrailingObjects friend declaration
to a version referring to the base.

llvm-svn: 339382
2018-08-09 21:03:39 +00:00
Ana Pazos 10de234905 [RISC-V] Fixed alias for addi x2, x2, 0
A missing check for non-zero immediate in MCOperandPredicate
caused c.addi16sp sp, 0 to be selected which is not a valid
instruction.

llvm-svn: 339381
2018-08-09 20:51:53 +00:00
Erich Keane 03406c50fa [NFC] Convert ParsedAttr to use llvm::TrailingObjects
ParsedAttr is using a hand-rolled trailing-objects
implementation that gets cleaned up quite a bit by
just using llvm::TrailingObjects. This is a large
TrailingObjects list, but most things are length '0'.

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

llvm-svn: 339380
2018-08-09 20:25:12 +00:00
Stephen Kelly 94d33c04ab Fix build
llvm-svn: 339379
2018-08-09 20:21:09 +00:00
Philip Reames ca256d93fb [LICM] hoist fences out of loops w/o memory operations
The motivating case is an otherwise dead loop with a fence in it. At the moment, this goes all the way through the optimizer and we end up emitting an entirely pointless loop on x86. This case may seem a bit contrived, but we've seen it in real code as the result of otherwise reasonable lowering strategies combined w/thread local memory optimizations (such as escape analysis).

To handle this simple case, we can teach LICM to hoist must execute fences when there is no other memory operation within the loop.

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

llvm-svn: 339378
2018-08-09 20:18:42 +00:00
Stephen Kelly ed4f51755e Fix typo
llvm-svn: 339377
2018-08-09 20:15:13 +00:00
Stephen Kelly de6dde8bd3 Remove obsolete policy settings
Summary:
The line

 cmake_minimum_required(VERSION 3.4.3)

already has the effect of setting to NEW all policies present in that
release:

 https://cmake.org/cmake/help/v3.4/manual/cmake-policies.7.html

Subscribers: mgorny, llvm-commits

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

llvm-svn: 339376
2018-08-09 20:15:08 +00:00
Erik Pilkington be168a9d34 [Sema] P0961R1: Relaxing the structured bindings customization point finding rules
Differential revision: https://reviews.llvm.org/D50418

llvm-svn: 339375
2018-08-09 20:11:13 +00:00
Stephen Kelly 02a67baf1e Add getEndLoc API to replace getLocEnd
Subscribers: cfe-commits

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

llvm-svn: 339374
2018-08-09 20:05:47 +00:00
Stephen Kelly 3cffc4c76a Add getBeginLoc API to replace getStartLoc
Reviewers: teemperor!

Subscribers: cfe-commits

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

llvm-svn: 339373
2018-08-09 20:05:18 +00:00
Stephen Kelly 724e9e52a4 Add getBeginLoc API to replace getLocStart
Subscribers: cfe-commits

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

llvm-svn: 339372
2018-08-09 20:05:03 +00:00
Sid Manning c53078a1e3 [ELF][HEXAGON] Add R_HEX_HI16/R_HEX_LO16 relocations
Differential Revision: https://reviews.llvm.org/D50520

llvm-svn: 339371
2018-08-09 20:04:53 +00:00
Kostya Kortchinsky d2214053a2 [sanitizer] Remove rsp from the clobber list in internal_clone
Summary:
When compiling with WERROR=ON, a new fatal warning started popping up recently
(due to -Werror,-Winline-asm):
```
.../lib/sanitizer_common/sanitizer_linux.cc:1214:24: error: inline asm clobber list contains reserved registers: RSP [-Werror,-Winline-asm]
                       "syscall\n"
                       ^
<inline asm>:1:1: note: instantiated into assembly here
        syscall
^
.../lib/sanitizer_common/sanitizer_linux.cc:1214:24: note: Reserved registers on the clobber list may not be preserved across the asm statement, and clobbering them may lead to undefined behaviour.
                       "syscall\n"
                       ^
<inline asm>:1:1: note: instantiated into assembly here
        syscall
^
```

Removing `rsp` from the clobber list makes the warning go away, and does not
appear to have a functional impact. If there is another way to solve this, let
me know.

Reviewers: eugenis, vitalybuka

Reviewed By: eugenis

Subscribers: kubamracek, delcypher, llvm-commits, #sanitizers

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

llvm-svn: 339370
2018-08-09 20:01:11 +00:00
George Karpenkov cf40ba8284 [analyzer] Fix the bug in UninitializedObjectChecker caused by not handling block pointers
Differential Revision: https://reviews.llvm.org/D50523

llvm-svn: 339369
2018-08-09 19:03:12 +00:00
Sanjay Patel 55accd7dd3 [InstCombine] allow fsub+fmul FMF folds for vectors
llvm-svn: 339368
2018-08-09 18:42:12 +00:00
David Carlier 89005c33c3 Fix few g++ 8 warning with non obvious copy object operations
Reviewers: dblaikie, dexonsmith	

Reviewed By: dblaikie

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

llvm-svn: 339367
2018-08-09 18:29:07 +00:00
JF Bastien e69ae76b20 [NFC] Remove magic bool param in RAUW
Use an enum class instead.

llvm-svn: 339366
2018-08-09 18:28:54 +00:00
Krzysztof Parzyszek 75c2ca3638 [Hexagon] Map ISD::TRAP to J2_trap0(#0)
llvm-svn: 339365
2018-08-09 18:03:45 +00:00
Rui Ueyama 5cd9c6bcd8 Support RISC-V
Patch by PkmX.

This patch makes lld recognize RISC-V target and implements basic
relocation for RV32/RV64 (and RVC). This should be necessary for static
linking ELF applications.

The ABI documentation for RISC-V can be found at:
https://github.com/riscv/riscv-elf-psabi-doc/blob/master/riscv-elf.md.
Note that the documentation is far from complete so we had to figure out
some details from bfd.

The patch should be pretty straightforward. Some highlights:

 - A new relocation Expr R_RISCV_PC_INDIRECT is added. This is needed as
   the low part of a PC-relative relocation is linked to the corresponding
   high part (auipc), see:
   https://github.com/riscv/riscv-elf-psabi-doc/blob/master/riscv-elf.md#pc-relative-symbol-addresses

 - LLVM's MC support for RISC-V is very incomplete (we are working on
   this), so tests are given in objectyaml format with the original
   assembly included in the comments. Once we have complete support for
   RISC-V in MC, we can switch to llvm-as/llvm-objdump.

 - We don't support linker relaxation for now as it requires greater
   changes to lld that is beyond the scope of this patch. Once this is
   accepted we can start to work on adding relaxation to lld.

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

llvm-svn: 339364
2018-08-09 17:59:56 +00:00
Alina Sbirlea bf9fe79397 SCEV should forget all loops containing a deleted block.
Summary:
LoopSimplifyCFG should update ScEv for all loops after a block is deleted.
If the deleted block "Succ" is part of L, then it is part of all parent loops, so forget topmost loop.

Reviewers: greened, mkazantsev, sanjoy

Subscribers: jlebar, javed.absar, uabelho, llvm-commits

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

llvm-svn: 339363
2018-08-09 17:53:26 +00:00
Paul Semel 7a3dc2c184 [llvm-objcopy] Add --prefix-symbols option
Differential Revision: https://reviews.llvm.org/D50381

llvm-svn: 339362
2018-08-09 17:49:04 +00:00
Sanjay Patel 373790293e [InstCombine] add vector tests for fsub+fmul; NFC
llvm-svn: 339361
2018-08-09 17:40:27 +00:00
Reid Kleckner 80c6ec11d9 [GlobalOpt] Don't apply fastcc if it would break inalloca invariants
The inalloca parameter has to be the only parameter passed in memory.
Changing the convention to fastcc can break that.

At some point we should teach global opt how to optimize ABI attributes
like inalloca and maybe byval. These attributes are mainly used to match
C ABIs. They are harder for LLVM to optimize and they don't always
generate the best code.

Fixes PR38487

llvm-svn: 339360
2018-08-09 17:29:26 +00:00
Sanjay Patel 15d1501aae [SelectionDAG] try harder to convert funnel shift to rotate
Similar to rL337966 - if the DAGCombiner's rotate matching was 
working as expected, I don't think we'd see any test diffs here.

AArch only goes right, and PPC only goes left. 
x86 has both, so no diffs there.

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

llvm-svn: 339359
2018-08-09 17:26:22 +00:00
Paul Semel a42dec7a1b [llvm-objcopy] Add --dump-section
Differential Revision: https://reviews.llvm.org/D49979

llvm-svn: 339358
2018-08-09 17:05:21 +00:00
Michael Berg ca38254601 extend folding fsub/fadd to fneg for FMF
Summary: This change provides a common optimization path for both Unsafe and FMF driven optimization for this fsub fold adding reassociation, as it the flag that most closely represents the translation

Reviewers: spatel, wristow, arsenm

Reviewed By: spatel

Subscribers: wdng

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

llvm-svn: 339357
2018-08-09 17:00:03 +00:00
Evandro Menezes 8c4366273c [ARM] Adjust the feature set for Exynos
Enable `FeatureZCZeroing`, `FeatureHasSlowFPVMLx`, `FeatureExpandMLx`,
`FeatureProfUnpredicate`, `FeatureSlowVDUP32`, `FeatureSlowVGETLNi32`,
`FeatureSplatVFPToNeon`, `FeatureHasRetAddrStack`, `FeatureSlowFPBrcc` for
all Exynos processors.

llvm-svn: 339356
2018-08-09 16:34:38 +00:00
Evandro Menezes 9a92fe0c9e [ARM] Replace processor check with feature
Add new feature, `FeatureUseWideStrideVFP`, that replaces the need for a
processor check.  Otherwise, NFC.

llvm-svn: 339354
2018-08-09 16:13:24 +00:00
Raphael Isemann 92be39d382 Added missing null checks to fix r339351
llvm-svn: 339353
2018-08-09 15:57:43 +00:00
Andrea Di Biagio f3bde0485c [MC][PredicateExpander] Extend the grammar to support simple switch and return statements.
This patch introduces tablegen class MCStatement.

Currently, an MCStatement can be either a return statement, or a switch
statement.

```
MCStatement:
   MCReturnStatement
   MCOpcodeSwitchStatement
```

A MCReturnStatement expands to a return statement, and the boolean expression
associated with the return statement is described by a MCInstPredicate.

An MCOpcodeSwitchStatement is a switch statement where the condition is a check
on the machine opcode. It allows the definition of multiple checks, as well as a
default case. More details on the grammar implemented by these two new
constructs can be found in the diff for TargetInstrPredicates.td.

This patch makes it easier to read the body of auto-generated TargetInstrInfo
predicates.

In future, I plan to reuse/extend the MCStatement grammar to describe more
complex target hooks. For now, this is just a first step (mostly a minor
cosmetic change to polish the new predicates framework).

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

llvm-svn: 339352
2018-08-09 15:32:48 +00:00
Raphael Isemann 879c142130 Also display the output and error output of a failed command
Summary:
Instead of just printing the current "False is not True, ..." message when we
fail to run a certain command, this patch also adds the actual command output or
error output that we received to the assertion message.

Reviewers: davide

Reviewed By: davide

Subscribers: lldb-commits

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

llvm-svn: 339351
2018-08-09 15:29:32 +00:00
Bjorn Pettersson c8b782cec2 [MC] Remove PhysRegSize from MCRegisterClass
Summary:
The interface to get size and spill size of a register
was moved from MCRegisterInfo to TargetRegisterInfo over
a year ago. Afaik the old interface has bee around
to give out-of-tree targets a chance to adapt to the
new interface.

One problem with the old MCRegisterClass::PhysRegSize was that
it represented the size of a register as "size in bits" / 8.
So a register had to be a multiple of eight bits wide for the
size to be correct (and the byte size for the target needed to
be eight bits).

Reviewers: kparzysz, qcolombet

Reviewed By: kparzysz

Subscribers: llvm-commits

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

llvm-svn: 339350
2018-08-09 15:19:07 +00:00
Sanjay Patel ebec4204da [InstCombine] reduce code duplication; NFC
llvm-svn: 339349
2018-08-09 15:07:13 +00:00
George Rimar dffc1911e2 [LLD][ELF] - Add a test for elf::getPriority(StringRef S)
It covers the following line with a test:
https://github.com/llvm-mirror/lld/blob/master/ELF/OutputSections.cpp#L383

llvm-svn: 339348
2018-08-09 15:05:25 +00:00
Sjoerd Meijer 05f33ecb89 [AArch64][NFC] better matching of AArch64 target in aarch64-cpus.c tests
Differential Revision: https://reviews.llvm.org/D50175

llvm-svn: 339347
2018-08-09 14:07:27 +00:00
Simon Pilgrim a9f95429d9 [TargetLowering] Add BuildSDIVPattern helper to BuildExactSDIV (NFCI).
As requested in D50392, pull the magic constant calculations out into a helper function.

llvm-svn: 339346
2018-08-09 13:56:04 +00:00
Hans Wennborg bdd8493f2b [COFF] Make the relocation scanning for CFG more discriminating
link.exe ignores REL32 relocations on 32-bit x86, as well as relocations
against non-function symbols such as labels. This makes lld do the same.

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

llvm-svn: 339345
2018-08-09 13:43:22 +00:00
Erich Keane 44bacdfcaf Implement diagnostic stream operator for ParsedAttr.
As a part of attempting to clean up the way attributes are 
printed, this patch adds an operator << to the diagnostics/
partialdiagnostics so that ParsedAttr can be sent directly.

This patch also rewrites a large amount* of the times when
ParsedAttr was printed using its IdentifierInfo object instead
of being printed itself.  
*"a large amount" == "All I could find".

llvm-svn: 339344
2018-08-09 13:21:32 +00:00
Tim Northover aa8377e8a3 Darwin: mark test unsupported while we sort out how to make it generic.
This test relies on communicating with debugserver via an unnamed (pre-opened)
pipe, but macOS's version of debugserver doesn't seem to support that mode of
operation. So disable the test for now.

llvm-svn: 339343
2018-08-09 13:21:05 +00:00
George Rimar cc8f8194ba [LLD][ELF] - Add a test for ScriptParser::readPhdrType().
This adds a test for https://github.com/llvm-mirror/lld/blob/master/ELF/ScriptParser.cpp#L1289.

llvm-svn: 339342
2018-08-09 13:19:10 +00:00
Sjoerd Meijer 806f70d229 [ARM] FP16: codegen support for VTRN
Differential Revision: https://reviews.llvm.org/D50454

llvm-svn: 339340
2018-08-09 12:45:09 +00:00
Simon Pilgrim 511c3fc529 [X86][SSE] Remove PMULDQ/PMULUDQ by zero
Exposed by D50328

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

llvm-svn: 339337
2018-08-09 12:37:36 +00:00
Gabor Marton 6b01e1c190 Fix structural inequivalency of forward EnumDecl
Summary:
Currently we consider one forward declared RecordDecl and another with a
definition equal. We have to do the same in case of enums.

Reviewers: a_sidorin, r.stahl, xazax.hun

Subscribers: rnkovacs, dkrupp, cfe-commits

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

llvm-svn: 339336
2018-08-09 12:36:25 +00:00
Simon Pilgrim 01ae462fef [X86][SSE] Combine (some) target shuffles with multiple uses
As discussed on D41794, we have many cases where we fail to combine shuffles as the input operands have other uses.

This patch permits these shuffles to be combined as long as they don't introduce additional variable shuffle masks, which should reduce instruction dependencies and allow the total number of shuffles to still drop without increasing the constant pool.

However, this may mean that some memory folds may no longer occur, and on pre-AVX require the occasional extra register move.

This also exposes some poor PMULDQ/PMULUDQ codegen which was doing unnecessary upper/lower calculations which will in fact fold to zero/undef - the fix will be added in a followup commit.

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

llvm-svn: 339335
2018-08-09 12:30:02 +00:00
Gabor Marton bf7f18b79c Add support for importing imaginary literals
Reviewers: a_sidorin, r.stahl, xazax.hun

Subscribers: rnkovacs, dkrupp, cfe-commits

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

llvm-svn: 339334
2018-08-09 12:18:07 +00:00
George Rimar 5570d7d45b [LLD][ELF] - Add a test for ScriptParser::readOutputSectionDescription.
This covers the following line:
https://github.com/llvm-mirror/lld/blob/master/ELF/ScriptParser.cpp#L415

llvm-svn: 339333
2018-08-09 12:14:00 +00:00
Sid Manning 17858207a0 Add R_HEX_6_X relocation support
This is a larger patch.  This relocation has irregular immediate
masks that require a lookup to find the correct mask.

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

llvm-svn: 339332
2018-08-09 12:00:10 +00:00
Hans Wennborg 79cf42e869 vs integration: bump version number
llvm-svn: 339330
2018-08-09 11:57:36 +00:00