OSDN Git Service

android-x86/external-llvm.git
6 years agoEntryExitInstrumenter: Handle musttail calls
Hans Wennborg [Fri, 6 Apr 2018 10:14:09 +0000 (10:14 +0000)]
EntryExitInstrumenter: Handle musttail calls

Inserting instrumentation between a musttail call and ret instruction
would create invalid IR. Instead, treat musttail calls as function
exits.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329385 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[NFC] Add missing end of line symbols
Max Kazantsev [Fri, 6 Apr 2018 09:47:06 +0000 (09:47 +0000)]
[NFC] Add missing end of line symbols

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329383 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[MIR] Add support for MachineFrameInfo::LocalFrameSize
Francis Visoiu Mistrih [Fri, 6 Apr 2018 08:56:25 +0000 (08:56 +0000)]
[MIR] Add support for MachineFrameInfo::LocalFrameSize

MFI.LocalFrameSize was not serialized.

It is usually set from LocalStackSlotAllocation, so if that pass doesn't
run it is impossible do deduce it from the stack objects. Until now, this
information was lost.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329382 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[debug_loc] Fix typo in DWARFExpression constructor
Pavel Labath [Fri, 6 Apr 2018 08:49:57 +0000 (08:49 +0000)]
[debug_loc] Fix typo in DWARFExpression constructor

Summary:
The positions of the DwarfVersion and AddressSize arguments were
reversed, which caused parsing for dwarf opcodes which contained
address-size-dependent operands (such as DW_OP_addr). Amusingly enough,
none of the address-size asserts fired, as dwarf version was always 4,
which is a valid address size.

I ran into this when constructing weird inputs for the DWARF verifier. I
I add a test case as hand-written dwarf -- I am not sure how to trigger
this differently, as having a DW_OP_addr inside a location list is a
fairly non-standard thing to do.

Fixing this error exposed a bug in the debug_loc.dwo parser, which was
always being constructed with an address size of 0. I fix that as well
by following the pattern in the non-dwo parser of picking up the address
size from the first compile unit (which is technically not correct, but
probably good enough in practice).

Reviewers: JDevlieghere, aprantl, dblaikie

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329381 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[NFC] Loosen restriction on preheader to fix buildbot
Max Kazantsev [Fri, 6 Apr 2018 07:23:45 +0000 (07:23 +0000)]
[NFC] Loosen restriction on preheader to fix buildbot

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329379 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[PowerPC] allow D-form VSX load/store when accessing FrameIndex without offset
Hiroshi Inoue [Fri, 6 Apr 2018 05:41:16 +0000 (05:41 +0000)]
[PowerPC] allow D-form VSX load/store when accessing FrameIndex without offset

VSX D-form load/store instructions of POWER9 require the offset be a multiple of 16 and a helper`isOffsetMultipleOf` is used to check this.
So far, the helper handles FrameIndex + offset case, but not handling FrameIndex without offset case. Due to this, we are missing opportunities to exploit D-form instructions when accessing an object or array allocated on stack.
For example, x-form store (stxvx) is used for int a[4] = {0}; instead of d-form store (stxv). For larger arrays, D-form instruction is not used when accessing the first 16-byte. Using D-form instructions reduces register pressure as well as instructions.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329377 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[LLVM-C] Fill Out LLVMCallConv
Robert Widmann [Fri, 6 Apr 2018 04:02:39 +0000 (04:02 +0000)]
[LLVM-C] Fill Out LLVMCallConv

Summary: Bring LLVMCallConv up to date with latest [[ http://llvm.org/doxygen/CallingConv_8h_source.html | CallConv ]]

Reviewers: whitequark, deadalnix

Reviewed By: whitequark

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329373 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[LLVM-C] Audit Inline Assembly APIs for Consistency
Robert Widmann [Fri, 6 Apr 2018 02:31:29 +0000 (02:31 +0000)]
[LLVM-C] Audit Inline Assembly APIs for Consistency

Summary:
- Add a missing getter for module-level inline assembly
- Add a missing append function for module-level inline assembly
- Deprecate LLVMSetModuleInlineAsm and replace it with LLVMSetModuleInlineAsm2 which takes an explicit length parameter
- Deprecate LLVMConstInlineAsm and replace it with LLVMGetInlineAsm, a function that allows passing a dialect and is not mis-classified as a constant operation

Reviewers: whitequark, deadalnix

Reviewed By: whitequark

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329369 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoUpdate method names in documentation.
Rafael Espindola [Fri, 6 Apr 2018 01:21:48 +0000 (01:21 +0000)]
Update method names in documentation.

They were renamed in r328848.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329368 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix lld-x86_64-darwin13 build fails.
Manoj Gupta [Thu, 5 Apr 2018 23:23:29 +0000 (23:23 +0000)]
Fix lld-x86_64-darwin13 build fails.

Use double braces in std::array initialization
to keep Darwin builders happy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329363 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] FP: Z - (X - Y) --> Z + (Y - X)
Sanjay Patel [Thu, 5 Apr 2018 23:21:15 +0000 (23:21 +0000)]
[InstCombine] FP: Z - (X - Y) --> Z + (Y - X)

This restores what was lost with rL73243 but without
re-introducing the bug that was present in the old code.

Note that we already have these transforms if the ops are
marked 'fast' (and I assume that's happening somewhere in
the code added with rL170471), but we clearly don't need
all of 'fast' for these transforms.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329362 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] add FP tests for Z - (X - Y); NFC
Sanjay Patel [Thu, 5 Apr 2018 22:56:54 +0000 (22:56 +0000)]
[InstCombine] add FP tests for Z - (X - Y); NFC

A fold for this pattern was removed at rL73243 to fix PR4374:
https://bugs.llvm.org/show_bug.cgi?id=4374
...and apparently there were no tests that went with that fold.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329360 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAttempt to fix Mips breakages.
Manoj Gupta [Thu, 5 Apr 2018 22:47:25 +0000 (22:47 +0000)]
Attempt to fix Mips breakages.

Summary:
Replace ArrayRefs by actual std::array objects so that there are
no dangling references.

Reviewers: rsmith, gkistanova

Subscribers: sdardis, arichardson, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329359 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoX86 Tests: Add a case for combining sdiv by a splatted pow2 negative. NFC.
Zvi Rackover [Thu, 5 Apr 2018 21:57:20 +0000 (21:57 +0000)]
X86 Tests: Add a case for combining sdiv by a splatted pow2 negative. NFC.

Noticed test was missing while working on D42479.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329356 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[RuntimeDyld][PowerPC] Add a test case for r329335.
Lang Hames [Thu, 5 Apr 2018 21:56:55 +0000 (21:56 +0000)]
[RuntimeDyld][PowerPC] Add a test case for r329335.

Checks that calls to different sections go to the function's global entry point,
rather than the local one.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329355 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Separate CDQ and CDQE in the scheduler model.
Craig Topper [Thu, 5 Apr 2018 21:56:19 +0000 (21:56 +0000)]
[X86] Separate CDQ and CDQE in the scheduler model.

According to Agner's data, CDQE is closer to CWDE.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329354 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[IR] Change std::sort to llvm::sort in response to r327219
Mandeep Singh Grang [Thu, 5 Apr 2018 21:52:24 +0000 (21:52 +0000)]
[IR] Change std::sort to llvm::sort in response to r327219

r327219 added wrappers to std::sort which randomly shuffle the container before
sorting.  This will help in uncovering non-determinism caused due to undefined
sorting order of objects having the same key.

To make use of that infrastructure we need to invoke llvm::sort instead of
std::sort.

Note: This patch is one of a series of patches to replace *all* std::sort to
llvm::sort.  Refer D44363 for a list of all the required patches.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329353 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Add MOVZPQILo2PQIrr to the Sandy Bridge scheduler model
Craig Topper [Thu, 5 Apr 2018 21:40:32 +0000 (21:40 +0000)]
[X86] Add MOVZPQILo2PQIrr to the Sandy Bridge scheduler model

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329351 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] nsz: -(X - Y) --> Y - X
Sanjay Patel [Thu, 5 Apr 2018 21:37:17 +0000 (21:37 +0000)]
[InstCombine] nsz: -(X - Y) --> Y - X

This restores part of the fold that was removed with rL73243 (PR4374).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329350 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine][NFC] Regenerate select-of-bittest.ll with instnamer pass
Roman Lebedev [Thu, 5 Apr 2018 21:34:59 +0000 (21:34 +0000)]
[InstCombine][NFC] Regenerate select-of-bittest.ll with instnamer pass

As requested by spatel in https://reviews.llvm.org/D45329

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329349 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] [NFC] Add more tests for getting rid of select of bittest (D45108,...
Roman Lebedev [Thu, 5 Apr 2018 21:34:53 +0000 (21:34 +0000)]
[InstCombine] [NFC] Add more tests for getting rid of select of bittest (D45108, PR36950 / PR17564)

Summary:
More tests for D45108:
* One use tests
* allow shift to be a variable, too

Reviewers: spatel, craig.topper

Reviewed By: spatel

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329348 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Add LEAVE instruction to the scheduler models using the same data as LEAVE64...
Craig Topper [Thu, 5 Apr 2018 21:16:26 +0000 (21:16 +0000)]
[X86] Add LEAVE instruction to the scheduler models using the same data as LEAVE64. Make LEAVE/LEAVE64 more correct on Sandy Bridge.

This is the 32-bit mode version of LEAVE64. It should be at least somewhat similar to LEAVE64.

The Sandy Bridge version was missing a load port use.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329347 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[DWARF v5][NFC]: Refactor DebugRnglists to prepare for the support of the DW_AT_ranges
Wolfgang Pieb [Thu, 5 Apr 2018 21:01:49 +0000 (21:01 +0000)]
[DWARF v5][NFC]: Refactor DebugRnglists to prepare for the support of the DW_AT_ranges
 attribute in conjunction with .debug_rnglists.

Reviewers: JDevlieghere

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329345 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86][SSE] Add floating point add/mul fast-math vector.reduce tests
Simon Pilgrim [Thu, 5 Apr 2018 21:01:21 +0000 (21:01 +0000)]
[X86][SSE] Add floating point add/mul fast-math vector.reduce tests

Strict versions aren't working at all (PR36732) and the accumulators aren't supported (PR36734)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329344 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86][SSE] Add floating point min/max vector.reduce tests
Simon Pilgrim [Thu, 5 Apr 2018 20:54:55 +0000 (20:54 +0000)]
[X86][SSE] Add floating point min/max vector.reduce tests

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329343 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAMDGPU/Metadata: Always report a fixed number of hidden arguments
Konstantin Zhuravlyov [Thu, 5 Apr 2018 20:46:04 +0000 (20:46 +0000)]
AMDGPU/Metadata: Always report a fixed number of hidden arguments

Currently it is 6. If the "feature" was not used, report dummy
hidden argument. Otherwise it does not match the kernarg size
reported in the kernel header.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329341 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Remove some InstRWs for plain store instructions on Sandy Bridge.
Craig Topper [Thu, 5 Apr 2018 20:04:06 +0000 (20:04 +0000)]
[X86] Remove some InstRWs for plain store instructions on Sandy Bridge.

We were forcing the latency of these instructions to 5 cycles, but every other scheduler model had them as 1 cycle. I'm sure I didn't get everything, but this gets a big portion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329339 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm-cov] Prevent llvm-cov from hanging when a symblink doesn't exist.
Max Moroz [Thu, 5 Apr 2018 19:43:24 +0000 (19:43 +0000)]
[llvm-cov] Prevent llvm-cov from hanging when a symblink doesn't exist.

Summary:
Previous code hangs indefinitely when trying to iterate through a
symbol link file that points to an non-exist directory. This change
fixes the bug to make the addCollectedPath function exit ealier and
print out correct warning messages.

Patch by Yuke Liao (@liaoyuke).

Reviewers: Dor1s, vsk

Reviewed By: vsk

Subscribers: bruno, mgrang, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329338 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[RuntimeDyld][PowerPC] Use global entry points for calls between sections.
Lang Hames [Thu, 5 Apr 2018 19:37:05 +0000 (19:37 +0000)]
[RuntimeDyld][PowerPC] Use global entry points for calls between sections.

Functions in different objects may use different TOCs, so calls between such
functions should use the global entry point of the callee which updates the
TOC pointer.

This should fix a bug that the Numba developers encountered (see
https://github.com/numba/numba/issues/2451).

Patch by Olexa Bilaniuk. Thanks Olexa!

No RuntimeDyld checker test case yet as I am not familiar enough with how
RuntimeDyldELF fixes up call-sites, but I do not want to hold up landing
this. I will continue to work on it and see if I can rope some powerpc
experts in.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329335 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Bitcode] Change std::sort to llvm::sort in response to r327219
Mandeep Singh Grang [Thu, 5 Apr 2018 19:27:04 +0000 (19:27 +0000)]
[Bitcode] Change std::sort to llvm::sort in response to r327219

Summary:
r327219 added wrappers to std::sort which randomly shuffle the container before sorting.
This will help in uncovering non-determinism caused due to undefined sorting
order of objects having the same key.

To make use of that infrastructure we need to invoke llvm::sort instead of std::sort.

Note: This patch is one of a series of patches to replace *all* std::sort to llvm::sort.
Refer the comments section in D44363 for a list of all the required patches.

Reviewers: pcc, mehdi_amini, dexonsmith

Reviewed By: dexonsmith

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329334 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] Properly change GEP type when reassociating loop invariant GEP chains
Daniel Neilson [Thu, 5 Apr 2018 18:51:45 +0000 (18:51 +0000)]
[InstCombine] Properly change GEP type when reassociating loop invariant GEP chains

Summary:
This is a fix to PR37005.

Essentially, rL328539 ([InstCombine] reassociate loop invariant GEP chains to enable LICM) contains a bug
whereby it will convert:
%src = getelementptr inbounds i8, i8* %base, <2 x i64> %val
%res = getelementptr inbounds i8, <2 x i8*> %src, i64 %val2
into:
%src = getelementptr inbounds i8, i8* %base, i64 %val2
%res = getelementptr inbounds i8, <2 x i8*> %src, <2 x i64> %val

By swapping the index operands if the GEPs are in a loop, and %val is loop variant while %val2
is loop invariant.

This fix recreates new GEP instructions if the index operand swap would result in the type
of %src changing from vector to scalar, or vice versa.

Reviewers: sebpop, spatel

Reviewed By: sebpop

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329331 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Synchronize the SchedRW on some EVEX instructions with their VEX equivalents.
Craig Topper [Thu, 5 Apr 2018 18:38:45 +0000 (18:38 +0000)]
[X86] Synchronize the SchedRW on some EVEX instructions with their VEX equivalents.

Mostly vector load, store, and move instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329330 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[ARM] Change std::sort to llvm::sort in response to r327219
Mandeep Singh Grang [Thu, 5 Apr 2018 18:31:50 +0000 (18:31 +0000)]
[ARM] Change std::sort to llvm::sort in response to r327219

Summary:
r327219 added wrappers to std::sort which randomly shuffle the container before sorting.
This will help in uncovering non-determinism caused due to undefined sorting
order of objects having the same key.

To make use of that infrastructure we need to invoke llvm::sort instead of std::sort.

Note: This patch is one of a series of patches to replace *all* std::sort to llvm::sort.
Refer the comments section in D44363 for a list of all the required patches.

Reviewers: t.p.northover, RKSimon, MatzeB, bkramer

Reviewed By: bkramer

Subscribers: javed.absar, llvm-commits, kristof.beyls

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329329 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Disassembler support for having an ADSIZE prefix affect instructions with 0xf2...
Craig Topper [Thu, 5 Apr 2018 18:20:14 +0000 (18:20 +0000)]
[X86] Disassembler support for having an ADSIZE prefix affect instructions with 0xf2 and 0xf3 prefixes.

Needed to support umonitor from D45253.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329327 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm-pdbutil] Display types from MSVC precompiled header object files.
Zachary Turner [Thu, 5 Apr 2018 18:18:12 +0000 (18:18 +0000)]
[llvm-pdbutil] Display types from MSVC precompiled header object files.

These appear in a .debug$P section, which is exactly the same in
format as a .debug$T section.  So we shouldn't ignore these when
dumping types.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329326 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agollvm-exegesis: Fix unittests include dirs when llvm is a part of another project
Konstantin Zhuravlyov [Thu, 5 Apr 2018 18:16:02 +0000 (18:16 +0000)]
llvm-exegesis: Fix unittests include dirs when llvm is a part of another project

When llvm is a part of another project (i.e. opencl),
CMAKE_SOURCE_DIR and CMAKE_BINARY_DIR are pointing to
the parent project, which lead to build failures.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329325 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] add test for fneg+fsub with nsz; NFC
Sanjay Patel [Thu, 5 Apr 2018 17:40:51 +0000 (17:40 +0000)]
[InstCombine] add test for fneg+fsub with nsz; NFC

There used to be a fold that would handle this case more generally,
but it was removed at rL73243 to fix PR4374:
https://bugs.llvm.org/show_bug.cgi?id=4374

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329322 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86][SSE] Add integer add/mul vector.reduce tests
Simon Pilgrim [Thu, 5 Apr 2018 17:37:35 +0000 (17:37 +0000)]
[X86][SSE] Add integer add/mul vector.reduce tests

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329321 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86][SSE] Add integer and/or/xor vector.reduce tests
Simon Pilgrim [Thu, 5 Apr 2018 17:29:51 +0000 (17:29 +0000)]
[X86][SSE] Add integer and/or/xor vector.reduce tests

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329320 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86][SSE] Add integer min/max vector.reduce tests
Simon Pilgrim [Thu, 5 Apr 2018 17:25:40 +0000 (17:25 +0000)]
[X86][SSE] Add integer min/max vector.reduce tests

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329319 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAnother fix for r329293: Unbreak the windows bots
Philip Pfaffe [Thu, 5 Apr 2018 17:20:45 +0000 (17:20 +0000)]
Another fix for r329293: Unbreak the windows bots

Only build the unittest if plugins are enabled. Link components into the
TestPlugin on windows and cygwin.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329318 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] use pattern matchers for fsub --> fadd folds
Sanjay Patel [Thu, 5 Apr 2018 17:06:45 +0000 (17:06 +0000)]
[InstCombine] use pattern matchers for fsub --> fadd folds

This allows folding for vectors with undef elements.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329316 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[WebAssembly] Allow for the creation of user-defined custom sections
Sam Clegg [Thu, 5 Apr 2018 17:01:39 +0000 (17:01 +0000)]
[WebAssembly] Allow for the creation of user-defined custom sections

This patch adds a way for users to create their own custom sections to
be added to wasm files. At the LLVM IR layer, they are defined through
the "wasm.custom_sections" named metadata. The expected use case for
this is bindings generators such as wasm-bindgen.

Patch by Dan Gohman

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329315 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] add tests for fsub --> fadd; NFC
Sanjay Patel [Thu, 5 Apr 2018 16:51:09 +0000 (16:51 +0000)]
[InstCombine] add tests for fsub --> fadd; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329313 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[documentation][llvm-mca] Update the documentation.
Andrea Di Biagio [Thu, 5 Apr 2018 16:42:32 +0000 (16:42 +0000)]
[documentation][llvm-mca] Update the documentation.

Scheduling models can now describe processor register files and retire control
units. This updates the existing documentation and the README file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329311 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Use WriteFShuffle256 for VEXTRACTF128 to be consistent with VEXTRACTI128 which...
Craig Topper [Thu, 5 Apr 2018 16:32:48 +0000 (16:32 +0000)]
[X86] Use WriteFShuffle256 for VEXTRACTF128 to be consistent with VEXTRACTI128 which uses WriteShuffle256.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329310 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix r329293: Add a missing CMake dependency
Philip Pfaffe [Thu, 5 Apr 2018 15:58:27 +0000 (15:58 +0000)]
Fix r329293:  Add a missing CMake dependency

The unittest plugin indirectly includes Attributes.gen, so make sure its
target depends on the appropriate tablegen target.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329308 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix the buildbots after r329304.
Andrea Di Biagio [Thu, 5 Apr 2018 15:53:31 +0000 (15:53 +0000)]
Fix the buildbots after r329304.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329306 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[MC][Tablegen] Allow models to describe the retire control unit for llvm-mca.
Andrea Di Biagio [Thu, 5 Apr 2018 15:41:41 +0000 (15:41 +0000)]
[MC][Tablegen] Allow models to describe the retire control unit for llvm-mca.

This patch adds the ability to describe properties of the hardware retire
control unit.

Tablegen class RetireControlUnit has been added for this purpose (see
TargetSchedule.td).

A RetireControlUnit specifies the size of the reorder buffer, as well as the
maximum number of opcodes that can be retired every cycle.

A zero (or negative) value for the reorder buffer size means: "the size is
unknown". If the size is unknown, then llvm-mca defaults it to the value of
field SchedMachineModel::MicroOpBufferSize.  A zero or negative number of
opcodes retired per cycle means: "there is no restriction on the number of
instructions that can be retired every cycle".

Models can optionally specify an instance of RetireControlUnit. There can only
be up-to one RetireControlUnit definition per scheduling model.

Information related to the RCU (RetireControlUnit) is stored in (two new fields
of) MCExtraProcessorInfo.  llvm-mca loads that information when it initializes
the DispatchUnit / RetireControlUnit (see Dispatch.h/Dispatch.cpp).

This patch fixes PR36661.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329304 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[PatternMatch] define m_FNeg using m_FSub
Sanjay Patel [Thu, 5 Apr 2018 15:36:55 +0000 (15:36 +0000)]
[PatternMatch] define m_FNeg using m_FSub

Using cstfp_pred_ty in the definition allows us to match vectors with undef elements.

This replicates the change for m_Not from D44076 / rL326823 and continues
towards making all pattern matchers allow undef elements in vectors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329303 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[PowerPC] fix assertion failure due to missing instruction in P9InstrResources.td
Hiroshi Inoue [Thu, 5 Apr 2018 15:27:06 +0000 (15:27 +0000)]
[PowerPC] fix assertion failure due to missing instruction in P9InstrResources.td

This patch adds L(W|H|B)ZXTLS_32 instructions introduced by https://reviews.llvm.org/rL327635 in P9InstrResources.td.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329299 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] add vector and vector undef tests for FP folds; NFC
Sanjay Patel [Thu, 5 Apr 2018 15:07:35 +0000 (15:07 +0000)]
[InstCombine] add vector and vector undef tests for FP folds; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329294 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRe-land r329273: [Plugins] Add a slim plugin API to work together with the new PM
Philip Pfaffe [Thu, 5 Apr 2018 15:04:13 +0000 (15:04 +0000)]
Re-land r329273: [Plugins] Add a slim plugin API to work together with the new PM

Fix unittest: Do not link LLVM into the test plugin.
Additionally, remove an unrelated change that slipped in in r329273.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329293 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Testing/Support]: Better matching of Error failure states
Pavel Labath [Thu, 5 Apr 2018 14:32:10 +0000 (14:32 +0000)]
[Testing/Support]: Better matching of Error failure states

Summary:
The existing Failed() matcher only allowed asserting that the operation
failed, but it was not possible to verify any details of the returned
error.

This patch adds two new matchers, which make this possible:
- Failed<InfoT>() verifies that the operation failed with a single error
  of a given type.
- Failed<InfoT>(M) additionally check that the contained error info
  object is matched by the nested matcher M.

To make these work, I've changed the implementation of the ErrorHolder
class. Now, instead of just storing the string representation of the
Error, it fetches the ErrorInfo objects and stores then as a list of
shared pointers. This way, ErrorHolder remains copyable, while still
retaining the full information contained in the Error object.

In case the Error object contains two or more errors, the new matchers
will fail to match, instead of trying to match all (or any) of the
individual ErrorInfo objects. This seemed to be the most sensible
behavior for when one wants to match exact error details, but I could be
convinced otherwise...

Reviewers: zturner, lhames

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329288 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoARM: Do not spill CSR to stack on entry to noreturn functions
Tim Northover [Thu, 5 Apr 2018 14:26:06 +0000 (14:26 +0000)]
ARM: Do not spill CSR to stack on entry to noreturn functions

A noreturn nounwind function can be expected to never return in any way, and by
never returning it will also never have to restore any callee-saved registers
for its caller. This makes it possible to skip spills of those registers during
function entry, saving some stack space and time in the process. This is rather
useful for embedded targets with limited stack space.

Should fix PR9970.

Patch by myeisha (pmb).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329287 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Hexagon] Remove default values from lambda parameters
Krzysztof Parzyszek [Thu, 5 Apr 2018 14:25:52 +0000 (14:25 +0000)]
[Hexagon] Remove default values from lambda parameters

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329286 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Lexicon] Add "ICE", internal compiler error
Brian Gesiak [Thu, 5 Apr 2018 14:08:16 +0000 (14:08 +0000)]
[Lexicon] Add "ICE", internal compiler error

Test Plan:
1. `ninja docs-llvm-html`
2. Confirm that the rendered docs HTML contains the new "ICE" entry

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329285 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[MC] Fix spaces between values printed by EmitRegisterFileInfo.
Andrea Di Biagio [Thu, 5 Apr 2018 13:59:52 +0000 (13:59 +0000)]
[MC] Fix spaces between values printed by EmitRegisterFileInfo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329284 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[DAGCombine] Revert r329160
Sam Parker [Thu, 5 Apr 2018 13:46:17 +0000 (13:46 +0000)]
[DAGCombine] Revert r329160

Again, broke the big endian stage 2 builders.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329283 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] cleanup; NFC
Sanjay Patel [Thu, 5 Apr 2018 13:24:26 +0000 (13:24 +0000)]
[InstCombine] cleanup; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329282 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[SchedModel] Complete models shouldn't match against itineraries when they don't...
Simon Pilgrim [Thu, 5 Apr 2018 13:11:36 +0000 (13:11 +0000)]
[SchedModel] Complete models shouldn't match against itineraries when they don't use them (PR35639)

For schedule models that don't use itineraries, checkCompleteness still checks that an instruction has a matching itinerary instead of skipping and going straight to matching the InstRWs. That doesn't seem to match what happens in TargetSchedule.cpp

This patch causes problems for a number of models that had been incorrectly flagged as complete.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329280 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[LoopInterchange] Require asserts for test using -stats (NFC)
Florian Hahn [Thu, 5 Apr 2018 13:07:39 +0000 (13:07 +0000)]
[LoopInterchange] Require asserts for test using -stats (NFC)

This fixes a buildbot failure.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329279 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoMinor fix in docs.
Alexander Kornienko [Thu, 5 Apr 2018 12:48:22 +0000 (12:48 +0000)]
Minor fix in docs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329277 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert "[Plugins] Add a slim plugin API to work together with the new PM"
Philip Pfaffe [Thu, 5 Apr 2018 12:42:12 +0000 (12:42 +0000)]
Revert "[Plugins] Add a slim plugin API to work together with the new PM"

This reverts commit ecf3ba1ab45edb1b0fadce716a7facf50dca4fbb/r329273.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329276 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm-mca] Remove flag -max-retire-per-cycle, and update the docs.
Andrea Di Biagio [Thu, 5 Apr 2018 11:36:50 +0000 (11:36 +0000)]
[llvm-mca] Remove flag -max-retire-per-cycle, and update the docs.

This is done in preparation for D45259.
With D45259, models can specify the size of the reorder buffer, and the retire
throughput directly via tablegen.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329274 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Plugins] Add a slim plugin API to work together with the new PM
Philip Pfaffe [Thu, 5 Apr 2018 11:29:37 +0000 (11:29 +0000)]
[Plugins] Add a slim plugin API to work together with the new PM

Summary:
Add a new plugin API. This closes the gap between pass registration and out-of-tree passes for the new PassManager.

Unlike with the existing API, interaction with a plugin is always
initiated from the tools perspective. I.e., when a plugin is loaded, it
resolves and calls a well-known symbol `llvmGetPassPluginInfo` to obtain
details about the plugin. The fundamental motivation is to get rid of as
many global constructors as possible.  The API exposed by the plugin
info is kept intentionally minimal.

Reviewers: chandlerc

Reviewed By: chandlerc

Subscribers: bollu, grosser, lksbhm, mgorny, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329273 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[UpdateTestChecks] Moved core functionality of add_asm_checks into add_checks
Simon Pilgrim [Thu, 5 Apr 2018 10:48:38 +0000 (10:48 +0000)]
[UpdateTestChecks] Moved core functionality of add_asm_checks into add_checks

As discussed on D45272

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329270 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[LoopInterchange] Add stats counter for number of interchanged loops.
Florian Hahn [Thu, 5 Apr 2018 10:39:23 +0000 (10:39 +0000)]
[LoopInterchange] Add stats counter for number of interchanged loops.

Reviewers: samparker, karthikthecool, blitz.opensource

Reviewed By: samparker

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329269 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[mips] Regenerate test before posting patch for constant multiplication (NFC)
Simon Dardis [Thu, 5 Apr 2018 10:30:17 +0000 (10:30 +0000)]
[mips] Regenerate test before posting patch for constant multiplication (NFC)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329268 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoallow custom OptBisect classes set to LLVMContext
Fedor Sergeev [Thu, 5 Apr 2018 10:29:37 +0000 (10:29 +0000)]
allow custom OptBisect classes set to LLVMContext

This patch introduces a way to set custom OptPassGate instances to LLVMContext.
A new instance field OptBisector and a new method setOptBisect() are added
to the LLVMContext classes. These changes allow to set a custom OptBisect class
that can make its own decisions on skipping optional passes.

Another important feature of this change is ability to set different instances
of OptPassGate to different LLVMContexts. So the different contexts can be used
independently in several compiling threads of one process.

One unit test is added.

Patch by Yevgeny Rouban.

Reviewers: andrew.w.kaylor, fedor.sergeev, vsk, dberlin, Eugene.Zelenko, reames, skatkov
Reviewed By: andrew.w.kaylor, fedor.sergeev
Differential Revision: https://reviews.llvm.org/D44464

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329267 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[UpdateTestChecks] Split core functionality of add_ir_checks into add_checks
Simon Pilgrim [Thu, 5 Apr 2018 10:26:13 +0000 (10:26 +0000)]
[UpdateTestChecks] Split core functionality of add_ir_checks into add_checks

Cherry picked from D45272, also added some setup for add_asm_checks to use add_checks as well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329266 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[UpdateTestChecks] Make add_asm_checks more like add_ir_checks
Simon Pilgrim [Thu, 5 Apr 2018 09:50:58 +0000 (09:50 +0000)]
[UpdateTestChecks] Make add_asm_checks more like add_ir_checks

Towards merging them as mentioned on D45272

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329265 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[LoopInterchange] Preserve LoopInfo after interchanging.
Florian Hahn [Thu, 5 Apr 2018 09:48:45 +0000 (09:48 +0000)]
[LoopInterchange] Preserve LoopInfo after interchanging.

LoopInterchange relies on LoopInfo being up-to-date, so we should
preserve it after interchanging. This patch updates restructureLoops to
move the BBs of the interchanged loops to the right place.

Reviewers: davide, efriedma, karthikthecool, mcrosier

Reviewed By: efriedma

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329264 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[UpdateTestChecks] Remove unnecessary return from add_ir_checks
Simon Pilgrim [Thu, 5 Apr 2018 09:30:42 +0000 (09:30 +0000)]
[UpdateTestChecks] Remove unnecessary return from add_ir_checks

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329262 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm-exegesis] Check for libpfm headers.
Clement Courbet [Thu, 5 Apr 2018 07:35:28 +0000 (07:35 +0000)]
[llvm-exegesis] Check for libpfm headers.

HAVE_LIBPFM is only defined if the libpfm headers are present.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329261 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[MIR-Canon] Fixing warnings in Non-assert builds.
Puyan Lotfi [Thu, 5 Apr 2018 06:56:44 +0000 (06:56 +0000)]
[MIR-Canon] Fixing warnings in Non-assert builds.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329258 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm-exegesis] Suppress a warning.
Clement Courbet [Thu, 5 Apr 2018 05:57:23 +0000 (05:57 +0000)]
[llvm-exegesis] Suppress a warning.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329257 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Revert r329251-329254
Craig Topper [Thu, 5 Apr 2018 05:19:36 +0000 (05:19 +0000)]
[X86] Revert r329251-329254

It's failing on the bots and I'm not sure why.

This reverts:

[X86] Synchronize the SchedRW on some EVEX instructions with their VEX equivalents.
[X86] Use WriteFShuffle256 for VEXTRACTF128 to be consistent with VEXTRACTI128 which uses WriteShuffle256.
[X86] Remove some InstRWs for plain store instructions on Sandy Bridge.
[X86] Auto-generate complete checks. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329256 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Synchronize the SchedRW on some EVEX instructions with their VEX equivalents.
Craig Topper [Thu, 5 Apr 2018 04:42:03 +0000 (04:42 +0000)]
[X86] Synchronize the SchedRW on some EVEX instructions with their VEX equivalents.

Mostly vector load, store, and move instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329254 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Use WriteFShuffle256 for VEXTRACTF128 to be consistent with VEXTRACTI128 which...
Craig Topper [Thu, 5 Apr 2018 04:42:02 +0000 (04:42 +0000)]
[X86] Use WriteFShuffle256 for VEXTRACTF128 to be consistent with VEXTRACTI128 which uses WriteShuffle256.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329253 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Remove some InstRWs for plain store instructions on Sandy Bridge.
Craig Topper [Thu, 5 Apr 2018 04:42:01 +0000 (04:42 +0000)]
[X86] Remove some InstRWs for plain store instructions on Sandy Bridge.

We were forcing the latency of these instructions to 5 cycles, but every other scheduler model had them as 1 cycle. I'm sure I didn't get everything, but this gets a big portion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329252 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Auto-generate complete checks. NFC
Craig Topper [Thu, 5 Apr 2018 04:41:59 +0000 (04:41 +0000)]
[X86] Auto-generate complete checks. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329251 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[CallSiteSplitting] Do not perform callsite splitting inside landing pad
Taewook Oh [Thu, 5 Apr 2018 04:16:23 +0000 (04:16 +0000)]
[CallSiteSplitting] Do not perform callsite splitting inside landing pad

Summary:
If the callsite is inside landing pad, do not perform callsite splitting.

Callsite splitting uses utility function llvm::DuplicateInstructionsInSplitBetween, which eventually calls llvm::SplitEdge. llvm::SplitEdge calls llvm::SplitCriticalEdge with an assumption that the function returns nullptr only when the target edge is not a critical edge (and further assumes that if the return value was not nullptr, the predecessor of the original target edge always has a single successor because critical edge splitting was successful). However, this assumtion is not true because SplitCriticalEdge returns nullptr if the destination block is a landing pad. This invalid assumption results assertion failure.

Fundamental solution might be fixing llvm::SplitEdge to not to rely on the invalid assumption. However, it'll involve a lot of work because current API assumes that llvm::SplitEdge never fails. Instead, this patch makes callsite splitting to not to attempt splitting if the callsite is in a landing pad.

Attached test case will crash with assertion failure without the fix.

Reviewers: fhahn, junbuml, dberlin

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329250 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[gold] Add debug-pass-manager option, and use it to test new-pass-manager
Teresa Johnson [Thu, 5 Apr 2018 03:16:57 +0000 (03:16 +0000)]
[gold] Add debug-pass-manager option, and use it to test new-pass-manager

Summary: Follow up from r314963.

Reviewers: pcc

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329249 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[IR] Upgrade comment token in objc retain release marker
Gerolf Hoflehner [Thu, 5 Apr 2018 02:44:46 +0000 (02:44 +0000)]
[IR] Upgrade comment token in objc retain release marker

Older compiler issued '#' instead of ';'

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329248 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[MIR-Canon] Improving performance by switching to named vregs.
Puyan Lotfi [Thu, 5 Apr 2018 00:27:15 +0000 (00:27 +0000)]
[MIR-Canon] Improving performance by switching to named vregs.

No more skipping thounsands of vregs. Much faster running time.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329246 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[MIR-Canon] Adding support for multi-def -> user distance reduction.
Puyan Lotfi [Thu, 5 Apr 2018 00:08:15 +0000 (00:08 +0000)]
[MIR-Canon] Adding support for multi-def -> user distance reduction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329243 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[WebAssembly] Only write 32-bits for WebAssembly::OPERAND_OFFSET32
Sam Clegg [Wed, 4 Apr 2018 22:27:58 +0000 (22:27 +0000)]
[WebAssembly] Only write 32-bits for WebAssembly::OPERAND_OFFSET32

A bug was found where an offset of -1 would generate an encoding
of max int64 which is invalid in the binary format.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329238 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAArch64: Implement support for the shadowcallstack attribute.
Peter Collingbourne [Wed, 4 Apr 2018 21:55:44 +0000 (21:55 +0000)]
AArch64: Implement support for the shadowcallstack attribute.

The implementation of shadow call stack on aarch64 is quite different to
the implementation on x86_64. Instead of reserving a segment register for
the shadow call stack, we reserve the platform register, x18. Any function
that spills lr to sp also spills it to the shadow call stack, a pointer to
which is stored in x18.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329236 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoDon't inline @llvm.icall.branch.funnel
Vitaly Buka [Wed, 4 Apr 2018 21:46:27 +0000 (21:46 +0000)]
Don't inline @llvm.icall.branch.funnel

Summary: @llvm.icall.branch.funnel is musttail with variable number of
arguments. After inlining current backend can't separate call targets from call
arguments.

Reviewers: pcc

Subscribers: hiraditya, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329235 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[MemorySSA] Fix spelling errors in MemorySSA.cpp. NFC
Zhaoshi Zheng [Wed, 4 Apr 2018 21:08:11 +0000 (21:08 +0000)]
[MemorySSA] Fix spelling errors in MemorySSA.cpp. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329230 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agohwasan: add -hwasan-match-all-tag flag
Evgeniy Stepanov [Wed, 4 Apr 2018 20:44:59 +0000 (20:44 +0000)]
hwasan: add -hwasan-match-all-tag flag

Sometimes instead of storing addresses as is, the kernel stores the address of
a page and an offset within that page, and then computes the actual address
when it needs to make an access. Because of this the pointer tag gets lost
(gets set to 0xff). The solution is to ignore all accesses tagged with 0xff.

This patch adds a -hwasan-match-all-tag flag to hwasan, which allows to ignore
accesses through pointers with a particular pointer tag value for validity.

Patch by Andrey Konovalov.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329228 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[MachineOutliner] Add `useMachineOutliner` target hook
Jessica Paquette [Wed, 4 Apr 2018 19:13:31 +0000 (19:13 +0000)]
[MachineOutliner] Add `useMachineOutliner` target hook

The MachineOutliner has a bunch of target hooks that will call llvm_unreachable
if the target doesn't implement them. Therefore, if you enable the outliner on
such a target, it'll just crash. It'd be much better if it'd just *not* run
the outliner at all in this case.

This commit adds a hook to TargetInstrInfo that returns false by default.
Targets that implement the hook make it return true. The outliner checks the
return value of this hook to decide whether or not to continue.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329220 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Analysis] Support aligned new/delete functions.
Eric Fiselier [Wed, 4 Apr 2018 19:01:51 +0000 (19:01 +0000)]
[Analysis] Support aligned new/delete functions.

Summary:
Clang's __builtin_operator_new/delete was recently taught about the aligned allocation overloads (r328134). This patch makes LLVM aware of them as well.
This allows the compiler to perform certain optimizations including eliding new/delete calls.

Reviewers: rsmith, majnemer, dblaikie, vsk, bkramer

Reviewed By: bkramer

Subscribers: ckennelly, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329218 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert "[Analysis] Support aligned new/delete functions."
Eric Fiselier [Wed, 4 Apr 2018 18:23:00 +0000 (18:23 +0000)]
Revert "[Analysis] Support aligned new/delete functions."

This reverts commit bee3bbd9bdd3ab3364b8fb0cdb6326bc1ae740e0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329217 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[AArch64] Change std::sort to llvm::sort in response to r327219
Mandeep Singh Grang [Wed, 4 Apr 2018 18:20:28 +0000 (18:20 +0000)]
[AArch64] Change std::sort to llvm::sort in response to r327219

Summary:
r327219 added wrappers to std::sort which randomly shuffle the container before sorting.
This will help in uncovering non-determinism caused due to undefined sorting
order of objects having the same key.

To make use of that infrastructure we need to invoke llvm::sort instead of std::sort.

Note: This patch is one of a series of patches to replace *all* std::sort to llvm::sort. Refer the comments section in D44363 for a list of all the required patches.

Reviewers: t.p.northover, jmolloy, RKSimon, rengolin

Reviewed By: rengolin

Subscribers: dexonsmith, rengolin, javed.absar, kristof.beyls, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329216 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Analysis] Support aligned new/delete functions.
Eric Fiselier [Wed, 4 Apr 2018 18:12:01 +0000 (18:12 +0000)]
[Analysis] Support aligned new/delete functions.

Summary:
Clang's __builtin_operator_new/delete was recently taught about the aligned allocation overloads (r328134). This patch makes LLVM aware of them as well.
This allows the compiler to perform certain optimizations including eliding new/delete calls.

Reviewers: rsmith, majnemer, dblaikie, vsk, bkramer

Reviewed By: bkramer

Subscribers: ckennelly, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329215 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[MachineOutliner] Fix typo; NFC
Jessica Paquette [Wed, 4 Apr 2018 18:07:07 +0000 (18:07 +0000)]
[MachineOutliner] Fix typo; NFC

There was a typo in an unreachable statement in one of the outliner target
hooks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329213 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Separate BSWAP32r and BSWAP64r scheduling data in SandyBridge/Haswell/Broadwell...
Craig Topper [Wed, 4 Apr 2018 17:54:19 +0000 (17:54 +0000)]
[X86] Separate BSWAP32r and BSWAP64r scheduling data in SandyBridge/Haswell/Broadwell/Skylake scheduler models.

The BSWAP64r version is 2 uops and BSWAP32r is only 1 uop. The regular expressions also looked for a non-existant BSWAP16r.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329211 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix a compilation failure with non MSVC compilers.
Zachary Turner [Wed, 4 Apr 2018 17:41:05 +0000 (17:41 +0000)]
Fix a compilation failure with non MSVC compilers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329209 91177308-0d34-0410-b5e6-96231b3b80d8