OSDN Git Service

android-x86/external-llvm.git
6 years ago[X86][SSE] Drop old insertps stack folding test
Simon Pilgrim [Thu, 11 Jan 2018 16:57:58 +0000 (16:57 +0000)]
[X86][SSE] Drop old insertps stack folding test

Broken test from old attempt for folding tables - we don't peek through extract_subvector spills at all (which is why it doesn't fold), and we already have foldMemoryOperandCustom to handle insertps immediate correction anyway.

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

6 years ago[AArch64] Remove Unsupported = 1 flag for the WriteAtomic WriteRes.
Joel Jones [Thu, 11 Jan 2018 16:50:56 +0000 (16:50 +0000)]
[AArch64] Remove Unsupported = 1 flag for the WriteAtomic WriteRes.

In practice, this patch has no effect on scheduling.

There is no test case as there already exists a comprehensive test case for
LSE Atomics.

Patch by Stefan Teleman

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

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

6 years ago[docs] Update Phabricator docs about setting repository for diffs uploaded via web
Ben Hamilton [Thu, 11 Jan 2018 16:30:08 +0000 (16:30 +0000)]
[docs] Update Phabricator docs about setting repository for diffs uploaded via web

Summary:
Docs are out of date now that we have separate repositories for LLVM,
Clang, etc.

Reviewers: asb

Reviewed By: asb

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

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

6 years ago[NFC] Abstract out source argument index in MemTransferInst.
Daniel Neilson [Thu, 11 Jan 2018 16:28:32 +0000 (16:28 +0000)]
[NFC] Abstract out source argument index in MemTransferInst.

Summary:
 References to the source operand within class MemTransferInst are currently
by a constant 1. Abstract this out into a named constant.

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

6 years ago[InstCombine] Apply the fix from r322284 for sin / cos -> tan too
Benjamin Kramer [Thu, 11 Jan 2018 15:33:21 +0000 (15:33 +0000)]
[InstCombine] Apply the fix from r322284 for sin / cos -> tan too

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

6 years ago[InstCombine] For cos/sin -> tan copy attributes from cos instead of the
Benjamin Kramer [Thu, 11 Jan 2018 15:19:02 +0000 (15:19 +0000)]
[InstCombine] For cos/sin -> tan copy attributes from cos instead of the
parent function

Ideally we should merge the attributes from the functions somehow, but
this is obviously an improvement over taking random attributes from the
caller which will trip up the verifier if they're nonsensical for an
unary intrinsic call.

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

6 years ago[ValueTracking] recognize min/max-of-min/max with notted ops (PR35875)
Sanjay Patel [Thu, 11 Jan 2018 15:13:47 +0000 (15:13 +0000)]
[ValueTracking] recognize min/max-of-min/max with notted ops (PR35875)

This was originally planned as the fix for:
https://bugs.llvm.org/show_bug.cgi?id=35834
...but simpler transforms handled that case, so I implemented a
lesser solution. It turns out we need to handle the case with 'not'
ops too because the real code example that we are trying to solve:
https://bugs.llvm.org/show_bug.cgi?id=35875
...has extra uses of the intermediate values, so we can't rely on
smaller canonicalizations to get us to the goal.

As with rL321672, I've tried to show every possibility in the
codegen tests because that's the simplest way to prove we're doing
the right thing in the wide variety of permutations of this pattern.

We can also show an InstCombine win because we added a fold for
this case in:
rL321998 / D41603

An Alive proof for one variant of the pattern to show that the
InstCombine and codegen results are correct:
https://rise4fun.com/Alive/vd1

Name: min3_nots
  %nx = xor i8 %x, -1
  %ny = xor i8 %y, -1
  %nz = xor i8 %z, -1
  %cmpxz = icmp slt i8 %nx, %nz
  %minxz = select i1 %cmpxz, i8 %nx, i8 %nz
  %cmpyz = icmp slt i8 %ny, %nz
  %minyz = select i1 %cmpyz, i8 %ny, i8 %nz
  %cmpyx = icmp slt i8 %y, %x
  %r = select i1 %cmpyx, i8 %minxz, i8 %minyz
=>
  %cmpxyz = icmp slt i8 %minxz, %ny
  %r = select i1 %cmpxyz, i8 %minxz, i8 %ny

Name: min3_nots_alt
  %nx = xor i8 %x, -1
  %ny = xor i8 %y, -1
  %nz = xor i8 %z, -1
  %cmpxz = icmp slt i8 %nx, %nz
  %minxz = select i1 %cmpxz, i8 %nx, i8 %nz
  %cmpyz = icmp slt i8 %ny, %nz
  %minyz = select i1 %cmpyz, i8 %ny, i8 %nz
  %cmpyx = icmp slt i8 %y, %x
  %r = select i1 %cmpyx, i8 %minxz, i8 %minyz
=>
  %xz = icmp sgt i8 %x, %z
  %maxxz = select i1 %xz, i8 %x, i8 %z
  %xyz = icmp sgt i8 %maxxz, %y
  %maxxyz = select i1 %xyz, i8 %maxxz, i8 %y
  %r = xor i8 %maxxyz, -1

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

6 years ago[InstCombine] add min3-with-nots test (PR35875); NFC
Sanjay Patel [Thu, 11 Jan 2018 14:53:45 +0000 (14:53 +0000)]
[InstCombine] add min3-with-nots test (PR35875); NFC

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

6 years ago[FuzzMutate] Avoid using swifterror as a source operand
Igor Laevsky [Thu, 11 Jan 2018 14:43:05 +0000 (14:43 +0000)]
[FuzzMutate] Avoid using swifterror as a source operand

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

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

6 years ago[X86][SSE] Add ISD::VECTOR_SHUFFLE to faux shuffle decoding
Simon Pilgrim [Thu, 11 Jan 2018 14:25:18 +0000 (14:25 +0000)]
[X86][SSE] Add ISD::VECTOR_SHUFFLE to faux shuffle decoding

Primarily, this allows us to use the aggressive extraction mechanisms in combineExtractWithShuffle earlier and make use of UNDEF elements that may be lost during lowering.

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

6 years ago[VectorLegalizer] Remove broken code in ExpandStore.
Jonas Paulsson [Thu, 11 Jan 2018 13:03:21 +0000 (13:03 +0000)]
[VectorLegalizer]  Remove broken code in ExpandStore.

The code that is supposed to "Round odd types to the next pow of two" seems
broken and as well completely unused (untested). It also seems that
ExpandStore really shouldn't ever change the memory VT, which this in fact
does.

As a first step in fixing the broken handling of vector stores (of irregular
types, e.g. an i1 vector), this code is removed. For discussion, see
https://bugs.llvm.org/show_bug.cgi?id=35520.

Review: Eli Friedman

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

6 years agoX86: Fix LowerBUILD_VECTORAsVariablePermute for case Src is smaller than Indices
Zvi Rackover [Thu, 11 Jan 2018 12:26:52 +0000 (12:26 +0000)]
X86: Fix LowerBUILD_VECTORAsVariablePermute for case Src is smaller than Indices

Summary:
As RKSimon suggested in pr35820, in the case that Src is smaller in
bit-size than Indices, need to widen Src to avoid type mismatch.

Fixes pr35820

Reviewers: RKSimon, craig.topper

Reviewed By: RKSimon

Subscribers: llvm-commits

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

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

6 years ago[RISCV] Reserve an emergency spill slot for the register scavenger when necessary
Alex Bradbury [Thu, 11 Jan 2018 11:17:19 +0000 (11:17 +0000)]
[RISCV] Reserve an emergency spill slot for the register scavenger when necessary

Although the register scavenger can often find a spare register, an emergency
spill slot is needed to guarantee success. Reserve this slot in cases where
the function is known to have a large stack (meaning the scavenger may be
needed when forming stack addresses).

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

6 years agoImplementation of X86Operand::print.
Andrew V. Tischenko [Thu, 11 Jan 2018 10:31:01 +0000 (10:31 +0000)]
Implementation of X86Operand::print.
Differential Revision: https://reviews.llvm.org/D41610

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

6 years ago[Mips] Handle one byte unsupported relocations
Stefan Maksimovic [Thu, 11 Jan 2018 10:07:47 +0000 (10:07 +0000)]
[Mips] Handle one byte unsupported relocations

Fail gracefully instead of crashing upon encountering
this type of relocation.

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

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

6 years ago[AArch64][SVE] Asm: Negative tests for predicated ADD/SUB register constraints
Sander de Smalen [Thu, 11 Jan 2018 10:02:27 +0000 (10:02 +0000)]
[AArch64][SVE] Asm: Negative tests for predicated ADD/SUB register constraints

Summary: Patch [3/3] in a series to add operand constraint checks for SVE's predicated ADD/SUB.

Reviewers: rengolin, mcrosier, evandro, fhahn, echristo

Reviewed By: rengolin, fhahn

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

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

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

6 years ago[X86] Fix unused variable in release builds.
Craig Topper [Thu, 11 Jan 2018 07:19:29 +0000 (07:19 +0000)]
[X86] Fix unused variable in release builds.

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

6 years ago[CodeView] Fix the type for a variadic argument
Aaron Smith [Thu, 11 Jan 2018 06:42:11 +0000 (06:42 +0000)]
[CodeView] Fix the type for a variadic argument

Summary:
- MSVC uses the none type for a variadic argument in CodeView
- Add a unit test

Reviewers: zturner, llvm-commits

Reviewed By: zturner

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

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

6 years ago[InstCombine] Missed optimization in math expression: sin(x) / cos(x) => tan(x)
Dmitry Venikov [Thu, 11 Jan 2018 06:33:00 +0000 (06:33 +0000)]
[InstCombine] Missed optimization in math expression: sin(x) / cos(x) => tan(x)

Summary: This patch enables folding sin(x) / cos(x) -> tan(x), cos(x) / sin(x) -> 1 / tan(x) under -ffast-math flag

Reviewers: hfinkel, spatel

Reviewed By: spatel

Subscribers: andrew.w.kaylor, efriedma, scanon, llvm-commits

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

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

6 years ago[X86] Optimize v2i32/v2f32 scatters.
Craig Topper [Thu, 11 Jan 2018 06:31:28 +0000 (06:31 +0000)]
[X86] Optimize v2i32/v2f32 scatters.

If the index is v2i64 we can use the scatter instruction that has v4i32/v4f32 data register, v2i64 index, and v2i1 mask. Similar was already done for gather.

Implement custom widening for v2i32 data to remove the code that reverses type legalization during lowering.

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

6 years ago[DWARF][NFC] Overload AsmPrinter::emitDwarfStringOffsets() to take a DwarfStringPoolEntry
Wolfgang Pieb [Thu, 11 Jan 2018 02:35:00 +0000 (02:35 +0000)]
[DWARF][NFC] Overload AsmPrinter::emitDwarfStringOffsets() to take a DwarfStringPoolEntry
record.

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

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

6 years ago[NFC] Commit to mention that r322248 is actually made by AndrewScheidecker
Marcello Maggioni [Thu, 11 Jan 2018 02:06:28 +0000 (02:06 +0000)]
[NFC] Commit to mention that r322248 is actually made by AndrewScheidecker

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

6 years ago[SimplifyCFG] Add cut-off for InitializeUniqueCases.
Marcello Maggioni [Thu, 11 Jan 2018 02:01:16 +0000 (02:01 +0000)]
[SimplifyCFG] Add cut-off for InitializeUniqueCases.

The function can take a significant amount of time on some
complicated test cases, but for the currently only use of
the function we can stop the initialization much earlier
when we find out we are going to discard the result anyway
in the caller of the function.

Adding configurable cut-off points so that we avoid wasting time.
NFCI.

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

6 years agoSmallVector: fix use-after-poison MSAN error in destructor
Matt Morehouse [Wed, 10 Jan 2018 23:53:11 +0000 (23:53 +0000)]
SmallVector: fix use-after-poison MSAN error in destructor

Summary:
Addresses issue: https://bugs.llvm.org/show_bug.cgi?id=34595

The topmost class, `SmallVector`, has internal storage for some
elements; `N - 1` elements' bytes worth of space.  Meanwhile a base
class `SmallVectorTemplateCommon` has room for one element as well,
totaling `N` elements' worth of space.

The space for the N elements is contiguous and straddles
`SmallVectorTemplateCommon` and `SmallVector`.

A class "between" those two owning the storage, `SmallVectorImpl`, in
its destructor, calls the destructor for elements contained in the
vector, if any.  It uses `destroy_range(begin, end)` and deletes all
items in sequence, starting from the end.

By the time the destructor for `SmallVectorImpl` is running, though, the
memory for elements `[1, N)` is already poisoned, due to `SmallVector`'s
destructor having done its thing already.

So if the element type `T` has a nontrivial destructor that accesses any
members of the `T` instance being destroyed, we'll run into a
user-after-poison bug.

This patch moves the destruction loop into `SmallVector`'s destructor,
so any memory being accessed while dtors are running is not yet
poisoned.

Confirmed this broke before (and now works with this patch) with these
compiler flags:

  -fsanitize=memory
  -fsanitize-memory-use-after-dtor
  -fsanitize-memory-track-origins

and with the cmake flag
`-DLLVM_USE_SANITIZER='MemoryWithOrigins;Undefined'` as well as
`MSAN_OPTIONS=poison_in_dtor=1`.

Patch By: elsteveogrande

Reviewers: eugenis, morehouse, dblaikie

Reviewed By: eugenis, dblaikie

Subscribers: llvm-commits

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

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

6 years ago[AArch64] add tests for notted variants of min/max; NFC
Sanjay Patel [Wed, 10 Jan 2018 23:31:42 +0000 (23:31 +0000)]
[AArch64] add tests for notted variants of min/max; NFC

Like rL321668 / rL321672, the planned optimizer change to
fix these will be in ValueTracking, but we can test the
changes cleanly here with AArch64 codegen.

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

6 years agoRevert "AArch64: Fix emergency spillslot being out of reach for large callframes"
Matthias Braun [Wed, 10 Jan 2018 22:36:28 +0000 (22:36 +0000)]
Revert "AArch64: Fix emergency spillslot being out of reach for large callframes"

Revert for now as the testcase is hitting a pre-existing verifier error
that manifest as a failure when expensive checks are enabled (or
-verify-machineinstrs) is used.

This reverts commit r322200.

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

6 years agoLiveRangeEdit: Inline markDeadRemat() into only user; NFC
Matthias Braun [Wed, 10 Jan 2018 22:36:26 +0000 (22:36 +0000)]
LiveRangeEdit: Inline markDeadRemat() into only user; NFC

This function was only called from a single place in which we didn't
even need the `if (DeadRemats)` check.

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

6 years ago[X86] Move HasNOPL to a subtarget feature bit. Plumb MCSubtargetInfo through the...
Craig Topper [Wed, 10 Jan 2018 22:07:16 +0000 (22:07 +0000)]
[X86] Move HasNOPL to a subtarget feature bit. Plumb MCSubtargetInfo through the MCAsmBackend constructor

After D41349, we can no get a MCSubtargetInfo into the MCAsmBackend constructor. This allows us to get NOPL from a subtarget feature rather than a CPU name blacklist.

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

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

6 years agoLiveRangeEdit: Simplify code; NFC
Matthias Braun [Wed, 10 Jan 2018 21:41:02 +0000 (21:41 +0000)]
LiveRangeEdit: Simplify code; NFC

Simplify the code slightly: Instead of creating empty subranges in one
case and immediately removing them, do not create them in the first
place.

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

6 years ago[SLP] Add/update tests for SLP vectorizer, NFC.
Alexey Bataev [Wed, 10 Jan 2018 21:29:18 +0000 (21:29 +0000)]
[SLP] Add/update tests for SLP vectorizer, NFC.

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

6 years ago[RISCV] Implement support for the BranchRelaxation pass
Alex Bradbury [Wed, 10 Jan 2018 21:05:07 +0000 (21:05 +0000)]
[RISCV] Implement support for the BranchRelaxation pass

Branch relaxation is needed to support branch displacements that overflow the
instruction's immediate field.

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

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

6 years agoTargetLoweringBase: The ios simulator has no bzero function.
Matthias Braun [Wed, 10 Jan 2018 20:49:57 +0000 (20:49 +0000)]
TargetLoweringBase: The ios simulator has no bzero function.

Make sure I really get back to the beahvior before my rewrite in r321035
which turned out not to be completely NFC as I changed the behavior for
the ios simulator environment.

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

6 years ago[RISCV] Implement branch analysis
Alex Bradbury [Wed, 10 Jan 2018 20:47:00 +0000 (20:47 +0000)]
[RISCV] Implement branch analysis

This is a prerequisite for the branch relaxation pass, and allows a number of
optimisation passes (e.g. BranchFolding and MachineBlockPlacement) to work.

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

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

6 years ago[RISCV] Add support for llvm.{frameaddress,returnaddress} intrinsics
Alex Bradbury [Wed, 10 Jan 2018 20:12:00 +0000 (20:12 +0000)]
[RISCV] Add support for llvm.{frameaddress,returnaddress} intrinsics

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

6 years ago[RISCV] Add basic support for inline asm constraints
Alex Bradbury [Wed, 10 Jan 2018 20:05:09 +0000 (20:05 +0000)]
[RISCV] Add basic support for inline asm constraints

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

6 years ago[RISCV] Support stack frames and offsets up to 32-bits
Alex Bradbury [Wed, 10 Jan 2018 19:53:46 +0000 (19:53 +0000)]
[RISCV] Support stack frames and offsets up to 32-bits

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

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

6 years ago[RISCV] Support for varargs
Alex Bradbury [Wed, 10 Jan 2018 19:41:03 +0000 (19:41 +0000)]
[RISCV] Support for varargs

Includes support for expanding va_copy. Also adds support for using 'aligned'
registers when necessary for vararg calls, and ensure the frame pointer always
points to the bottom of the vararg spill region. This is necessary to ensure
that the saved return address and stack pointer are always available at fixed
known offsets of the frame pointer.

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

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

6 years agoTest commit access
Scott Linder [Wed, 10 Jan 2018 19:27:20 +0000 (19:27 +0000)]
Test commit access

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

6 years ago[SelectionDAG][X86] Explicitly store the scale in the gather/scatter ISD nodes
Craig Topper [Wed, 10 Jan 2018 19:16:05 +0000 (19:16 +0000)]
[SelectionDAG][X86] Explicitly store the scale in the gather/scatter ISD nodes

Currently we infer the scale at isel time by analyzing whether the base is a constant 0 or not. If it is we assume scale is 1, else we take it from the element size of the pass thru or stored value. This seems a little weird and I think it makes more sense to make it explicit in the DAG rather than doing tricky things in the backend.

Most of this patch is just making sure we copy the scale around everywhere.

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

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

6 years ago[MachineOutliner] Outline ADRPs
Jessica Paquette [Wed, 10 Jan 2018 18:49:57 +0000 (18:49 +0000)]
[MachineOutliner] Outline ADRPs

ADRP instructions weren't being outlined because they're PC-relative and thus
fail the LR checks. This patch adds a special case for ADRPs to
getOutliningType to make sure that ADRPs can be outlined and updates the MIR
test.

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

6 years ago[InstCombine] add test to show missed bswap; NFC
Sanjay Patel [Wed, 10 Jan 2018 18:47:21 +0000 (18:47 +0000)]
[InstCombine] add test to show missed bswap; NFC

D41353 / D41233 are proposing to alter the shl/and canonicalization,
but I think that would just move an existing pattern-matching hole
to a different place.

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

6 years agoAArch64: Fix emergency spillslot being out of reach for large callframes
Matthias Braun [Wed, 10 Jan 2018 18:16:24 +0000 (18:16 +0000)]
AArch64: Fix emergency spillslot being out of reach for large callframes

Large callframes (calls with several hundreds or thousands or
parameters) could lead to situations in which the emergency spillslot is
out of range to be addressed relative to the stack pointer.
This commit forces the use of a frame pointer in the presence of large
callframes.

This commit does several things:
- Compute max callframe size at the end of instruction selection.
- Add mirFileLoaded target callback. Use it to compute the max callframe size
  after loading a .mir file when the size wasn't specified in the file.
- Let TargetFrameLowering::hasFP() return true if there exists a
  callframe > 255 bytes.
- Always place the emergency spillslot close to FP if we have a frame
  pointer.
- Note that `useFPForScavengingIndex()` would previously return false
  when a base pointer was available leading to the emergency spillslot
  getting allocated late (that's the whole effect of this callback).
  Which made no sense to me so I took this case out: Even though the
  emergency spillslot is technically not referenced by FP in this case
  we still want it allocated early.

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

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

6 years ago[MIR] Update MIRLangRef with documentation on bundled instructions
Francis Visoiu Mistrih [Wed, 10 Jan 2018 17:53:16 +0000 (17:53 +0000)]
[MIR] Update MIRLangRef with documentation on bundled instructions

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

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

6 years ago[X86][MMX] Add test for PR35869
Simon Pilgrim [Wed, 10 Jan 2018 17:05:03 +0000 (17:05 +0000)]
[X86][MMX] Add test for PR35869

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

6 years ago[X86][MMX] Pull out common MMX VT test. NFCI.
Simon Pilgrim [Wed, 10 Jan 2018 15:32:19 +0000 (15:32 +0000)]
[X86][MMX] Pull out common MMX VT test. NFCI.

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

6 years agoX86 Tests: Add isel tests for truncate-extract_vector-extend. NFC.
Zvi Rackover [Wed, 10 Jan 2018 14:56:15 +0000 (14:56 +0000)]
X86 Tests: Add isel tests for truncate-extract_vector-extend. NFC.

To be improved in a future patch

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

6 years ago[AMDGPU][MC][GFX8][GFX9] Added XNACK_MASK support
Dmitry Preobrazhensky [Wed, 10 Jan 2018 14:22:19 +0000 (14:22 +0000)]
[AMDGPU][MC][GFX8][GFX9] Added XNACK_MASK support

See bug 35764: https://bugs.llvm.org/show_bug.cgi?id=35764

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

Reviewers: vpykhtin, artem.tamazov, arsenm

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

6 years agoFix -Wdocumentation warning by removing empty @brief. NFCI
Simon Pilgrim [Wed, 10 Jan 2018 13:52:30 +0000 (13:52 +0000)]
Fix -Wdocumentation warning by removing empty @brief. NFCI

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

6 years ago[X86][SSE] Add some basic FABS combine tests
Simon Pilgrim [Wed, 10 Jan 2018 13:28:34 +0000 (13:28 +0000)]
[X86][SSE] Add some basic FABS combine tests

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

6 years agoAvoid inlining if there is byval arguments with non-alloca address space
Bjorn Pettersson [Wed, 10 Jan 2018 13:01:18 +0000 (13:01 +0000)]
Avoid inlining if there is byval arguments with non-alloca address space

Summary:
After teaching InlineCost more about address spaces ()
another fault was detected in the inliner. If an argument has
the byval attribute the parameter might be copied to an alloca.
That part seems to work fine even if the argument has a different
address space than the alloca address space. However, if the
address spaces differ, then the inlined function still might
refer to the parameter using the original address space (the
inliner does not handle that situation very well).

This patch avoids the problem by simply disallowing inlining
when there are byval arguments with address space that differs
from the alloca address space.

I'm not really sure how to transform the code if we want to
get inlining for this situation. I assume that it never has
been working, and that the fixes in r321809 just exposed an
old problem.

Fault found by skatkov (Serguei Katkov). It is mentioned in
follow up comments to https://reviews.llvm.org/D40455.

Reviewers: skatkov

Reviewed By: skatkov

Subscribers: uabelho, eraman, llvm-commits, haicheng

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

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

6 years ago[X86][SSE] Add v2f64 u2 shuffle test
Simon Pilgrim [Wed, 10 Jan 2018 12:23:39 +0000 (12:23 +0000)]
[X86][SSE] Add v2f64 u2 shuffle test

Adds missing coverage for SHUFPD undef argument lowering, and also shows a missed opportunity to remove a unnecessary move compared to 02 shuffle mask.

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

6 years ago[AArch64][SVE] Asm: Add support for (mov|dup) of scalar
Sander de Smalen [Wed, 10 Jan 2018 11:32:47 +0000 (11:32 +0000)]
[AArch64][SVE] Asm: Add support for (mov|dup) of scalar

Summary: This patch adds support for 'dup' (Scalar -> SVE) and its corresponding 'mov' alias.

Reviewers: fhahn, rengolin, evandro, echristo

Reviewed By: fhahn

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

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

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

6 years ago[ARM GlobalISel] Add inst selector tests for G_FNEG s32 and s64
Diana Picus [Wed, 10 Jan 2018 11:13:36 +0000 (11:13 +0000)]
[ARM GlobalISel] Add inst selector tests for G_FNEG s32 and s64

G_FNEG is already handled by the TableGen'erated code. Just add a few
tests to make sure everything works as expected.

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

6 years ago[ARM GlobalISel] Map G_FNEG to the FPR bank
Diana Picus [Wed, 10 Jan 2018 11:13:31 +0000 (11:13 +0000)]
[ARM GlobalISel] Map G_FNEG to the FPR bank

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

6 years ago[ARM GlobalISel] Legalize G_FNEG for s32 and s64
Diana Picus [Wed, 10 Jan 2018 10:45:34 +0000 (10:45 +0000)]
[ARM GlobalISel] Legalize G_FNEG for s32 and s64

For hard float, it is legal.

For soft float, we need to lower to 0 - x first, and then we can use the
libcall for G_FSUB. This is undoing some of the canonicalization
performed by the IRTranslator (which introduces G_FNEG when it sees a
0 - x). Ideally, that canonicalization would be performed by a
pre-legalizer pass that would allow targets to opt out of this behaviour
rather than dance around it in the legalizer.

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

6 years ago[TableGen][AsmMatcherEmitter] Generate assembler checks for tied operands
Sander de Smalen [Wed, 10 Jan 2018 10:10:56 +0000 (10:10 +0000)]
[TableGen][AsmMatcherEmitter] Generate assembler checks for tied operands

Summary:
This extends TableGen's AsmMatcherEmitter with code that generates
a table with tied-operand constraints. The constraints are checked
when parsing the instruction. If an operand is not equal to its tied operand,
the assembler will give an error.

Patch [2/3] in a series to add operand constraint checks for SVE's predicated ADD/SUB.

Reviewers: olista01, rengolin, mcrosier, fhahn, craig.topper, evandro, echristo

Reviewed By: fhahn

Subscribers: javed.absar, llvm-commits

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

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

6 years agoTemporarily revert
Jonas Paulsson [Wed, 10 Jan 2018 10:05:55 +0000 (10:05 +0000)]
Temporarily revert

"[SystemZ]  Check for legality before doing LOAD AND TEST transformations."

, due to test failures.

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

6 years ago[ARM GlobalISel] Legalize s32/s64 G_FCONSTANT
Diana Picus [Wed, 10 Jan 2018 10:01:49 +0000 (10:01 +0000)]
[ARM GlobalISel] Legalize s32/s64 G_FCONSTANT

Legal for hard float.
Change to G_CONSTANT for soft float (but preserve the binary
representation).

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

6 years ago[SelectionDAGBuilder] Chain prefetches less aggressively.
Jonas Paulsson [Wed, 10 Jan 2018 09:33:00 +0000 (09:33 +0000)]
[SelectionDAGBuilder]  Chain prefetches less aggressively.

Prefetches used to always be chained between any previous and following
memory accesses. The problem with this was that later optimizations, such as
folding of a load into the user instruction, got disrupted.

This patch relaxes the chaining of prefetches in order to remedy this.

Reveiw: Hal Finkel
https://reviews.llvm.org/D38886

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

6 years ago[ARM GlobalISel] Legalize G_CONSTANT for scalars > 32 bits
Diana Picus [Wed, 10 Jan 2018 09:32:01 +0000 (09:32 +0000)]
[ARM GlobalISel] Legalize G_CONSTANT for scalars > 32 bits

Make G_CONSTANT narrow for any scalars larger than 32 bits.

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

6 years ago[SystemZ] Check for legality before doing LOAD AND TEST transformations.
Jonas Paulsson [Wed, 10 Jan 2018 09:18:17 +0000 (09:18 +0000)]
[SystemZ]  Check for legality before doing LOAD AND TEST transformations.

Since a load and test instruction treat its operands as signed, it can only
replace a logical compare for EQ/NE uses.

Review: Ulrich Weigand
https://bugs.llvm.org/show_bug.cgi?id=35662

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

6 years ago[ORC] Incorporate Dave Blaikie's feedback on r319839.
Lang Hames [Wed, 10 Jan 2018 04:01:44 +0000 (04:01 +0000)]
[ORC] Incorporate Dave Blaikie's feedback on r319839.

- Turn some member functions into free functions.
- Avoid a redundant map lookup
- Simplify a loop index

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

6 years ago[ExecutionEngine] Remove an unused variable.
Lang Hames [Wed, 10 Jan 2018 03:43:14 +0000 (03:43 +0000)]
[ExecutionEngine] Remove an unused variable.

Patch by Evgeniy Tyurin. Thanks Evgeniy!

Review: https://reviews.llvm.org/D41431

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

6 years agoAdd explanatory comment to LoadStoreVectorizer.
Justin Lebar [Wed, 10 Jan 2018 03:02:12 +0000 (03:02 +0000)]
Add explanatory comment to LoadStoreVectorizer.

Reviewers: arsenm

Subscribers: rengolin, sanjoy, wdng, hiraditya, asbirlea

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

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

6 years ago[MIR] Repurposing '$' sigil used by external symbols. Replacing with '&'.
Puyan Lotfi [Wed, 10 Jan 2018 00:56:48 +0000 (00:56 +0000)]
[MIR] Repurposing '$' sigil used by external symbols. Replacing with '&'.

Planning to add support for named vregs. This puts is in a conundrum since
physregs are named as well. To rectify this we need to use a sigil other than
'%' for physregs in MIR. We've settled on using '$' for physregs but first we
must repurpose it from external symbols using it, which is what this commit is
all about. We think '&' will have familiar semantics for C/C++ users.

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

6 years ago[llvm-readobj] Consistent use of ScopedPrinter
Sam Clegg [Wed, 10 Jan 2018 00:14:19 +0000 (00:14 +0000)]
[llvm-readobj] Consistent use of ScopedPrinter

There were a few places where outs() was being used
directly rather than the ScopedPrinter object.

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

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

6 years ago[ORC] Re-apply r321838 again with a workaround for a bug present in the libcxx
Lang Hames [Wed, 10 Jan 2018 00:09:38 +0000 (00:09 +0000)]
[ORC] Re-apply r321838 again with a workaround for a bug present in the libcxx
version being used on some of the green dragon builders (plus a clang-format).

Workaround: AsynchronousSymbolQuery and VSO want to work with
JITEvaluatedSymbols anyway, so just use them (instead of JITSymbol, which
happens to tickle the bug).

The libcxx bug being worked around was fixed in r276003, and there are plans to
update the offending builders.

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

6 years agoLowerTypeTests: Add limited support for aliases
Vlad Tsyrklevich [Wed, 10 Jan 2018 00:00:51 +0000 (00:00 +0000)]
LowerTypeTests: Add limited support for aliases

Summary:
LowerTypeTests moves some function definitions from individual object
files to the merged module, leaving a stub to be called in the merged
module's jump table. If an alias was pointing to such a function
definition LowerTypeTests would fail because the alias would be left
without a definition to point to.

This change 1) emits information about aliases to the ThinLTO summary,
2) replaces aliases pointing to function definitions that are moved to
the merged module with function declarations, and 3) re-emits those
aliases in the merged module pointing to the correct function
definitions.

The patch does not correctly fix all possible mis-uses of aliases in
LowerTypeTests. For example, it does not handle aliases with a different
type from the pointed to function.

The addition of alias data increases the size of Chrome build artifacts
by less than 1%.

Reviewers: pcc

Reviewed By: pcc

Subscribers: mehdi_amini, eraman, mgrang, llvm-commits, eugenis, kcc

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

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

6 years ago[LoopRotate] Detect loops with indirect branches better (we're giving up on them).
Michael Zolotukhin [Tue, 9 Jan 2018 23:54:35 +0000 (23:54 +0000)]
[LoopRotate] Detect loops with indirect branches better (we're giving up on them).

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

6 years agoReland "Emit Function IDs table for Control Flow Guard"
Adrian McCarthy [Tue, 9 Jan 2018 23:49:30 +0000 (23:49 +0000)]
Reland "Emit Function IDs table for Control Flow Guard"

Adds option /guard:cf to clang-cl and -cfguard to cc1 to emit function IDs
of functions that have their address taken into a section named .gfids$y for
compatibility with Microsoft's Control Flow Guard feature.

The original patch didn't have the lit.local.cfg file that restricts the new
test to x86, thus the new test was failing on the non-x86 bots.

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

The reverts r322008, which was a revert of r322005.

This reverts commit a05b89f9aca70597dc79fe97bc49b50b51f525ba.

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

6 years ago[WebAssembly] Add COMDAT support
Sam Clegg [Tue, 9 Jan 2018 23:43:14 +0000 (23:43 +0000)]
[WebAssembly] Add COMDAT support

This adds COMDAT support to the Wasm object-file format.
Spec: https://github.com/WebAssembly/tool-conventions/pull/31

Corresponding LLD change:
https://bugs.llvm.org/show_bug.cgi?id=35533, and D40845

Patch by Nicholas Wilson

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

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

6 years ago[DWARFv5] MC support for MD5 file checksums
Paul Robinson [Tue, 9 Jan 2018 23:31:48 +0000 (23:31 +0000)]
[DWARFv5] MC support for MD5 file checksums

Extend .file directive syntax to allow specifying an MD5 checksum for
the source file.  Emit the checksums in DWARF v5 line tables.

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

6 years agoTidy some grammar in some comments
Eric Christopher [Tue, 9 Jan 2018 23:25:38 +0000 (23:25 +0000)]
Tidy some grammar in some comments

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

6 years agotemp
Jake Ehrlich [Tue, 9 Jan 2018 23:00:25 +0000 (23:00 +0000)]
temp

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

6 years agoUse a MCExpr for the size of MCFillFragment.
Rafael Espindola [Tue, 9 Jan 2018 22:48:37 +0000 (22:48 +0000)]
Use a MCExpr for the size of MCFillFragment.

This allows the size to be found during ralaxation. This fixes
pr35858.

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

6 years ago[WebAssembly] MC: Use zero for provisional value of undefined symbols
Sam Clegg [Tue, 9 Jan 2018 22:44:02 +0000 (22:44 +0000)]
[WebAssembly] MC: Use zero for provisional value of undefined symbols

This is more in line with what happens in the final
executable when symbols are undefined (i.e. weak
references).

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

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

6 years agoAdd a test.
Rafael Espindola [Tue, 9 Jan 2018 22:30:54 +0000 (22:30 +0000)]
Add a test.

Currently we don't have any tests for this error case.

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

6 years agoADT: Add a range-based version of std::copy
David Blaikie [Tue, 9 Jan 2018 22:13:56 +0000 (22:13 +0000)]
ADT: Add a range-based version of std::copy

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

6 years ago[IPSCCP] Remove calls without side effects
Chris Bieneman [Tue, 9 Jan 2018 21:58:46 +0000 (21:58 +0000)]
[IPSCCP] Remove calls without side effects

Summary:
When performing constant propagation for call instructions we have historically replaced all uses of the return from a call, but not removed the call itself. This is required for correctness if the calls have side effects, however the compiler should be able to safely remove calls that don't have side effects.

This allows the compiler to completely fold away calls to functions that have no side effects if the inputs are constant and the output can be determined at compile time.

Reviewers: davide, sanjoy, bruno, dberlin

Subscribers: llvm-commits

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

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

6 years ago[PowerPC] Manually schedule the prologue and epilogue
Stefan Pintilie [Tue, 9 Jan 2018 21:57:49 +0000 (21:57 +0000)]
[PowerPC] Manually schedule the prologue and epilogue

This patch makes the following changes to the schedule of instructions in the
prologue and epilogue.

The stack pointer update is moved down in the prologue so that the callee saves
do not have to wait for the update to happen.
Saving the lr is moved down in the prologue to hide the latency of the mflr.
The stack pointer is moved up in the epilogue so that restoring of the lr can
happen sooner.
The mtlr is moved up in the epilogue so that it is away form the blr at the end
of the epilogue. The latency of the mtlr can now be hidden by the loads of the
callee saved registers.

This commit is almost identical to this one: r322036 except that two warnings
that broke build bots have been fixed.

The revision number is D41737 as before.

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

6 years agoDon't create MCFillFragment directly.
Rafael Espindola [Tue, 9 Jan 2018 21:55:10 +0000 (21:55 +0000)]
Don't create MCFillFragment directly.

Instead use higher level APIs that take care of most bookkeeping.

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

6 years ago[WebAssembly] Explicitly specify function/global index space in YAML
Sam Clegg [Tue, 9 Jan 2018 21:38:53 +0000 (21:38 +0000)]
[WebAssembly] Explicitly specify function/global index space in YAML

These indexes are useful because they are not always zero based and
functions and globals are referenced elsewhere by their index.

This matches what we already do for the type index space.

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

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

6 years ago[SelectionDAG] Fixed f16-from-vector promotion problem
Tim Renouf [Tue, 9 Jan 2018 21:36:25 +0000 (21:36 +0000)]
[SelectionDAG] Fixed f16-from-vector promotion problem

Summary:
In the case of an fp_extend of v1f16 to v1f32 where the v1f16 is the
result of a bitcast from i16, avoid creating an illegal fp16_to_fp where
the input is not a vector and the result is a v1f32.

V2: The fix is now to avoid vector scalarization creating a v1->scalar
bitcast.

Reviewers: srhines, t.p.northover

Subscribers: nhaehnle, llvm-commits, dstuttard, t-tye, yaxunl, wdng, kzhuravl, arsenm

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

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

6 years ago[AMDGPU] Fixed incorrect uniform branch condition
Tim Renouf [Tue, 9 Jan 2018 21:34:43 +0000 (21:34 +0000)]
[AMDGPU] Fixed incorrect uniform branch condition

Summary:
I had a case where multiple nested uniform ifs resulted in code that did
v_cmp comparisons, combining the results with s_and_b64, s_or_b64 and
s_xor_b64 and using the resulting mask in s_cbranch_vccnz, without first
ensuring that bits for inactive lanes were clear.

There was already code for inserting an "s_and_b64 vcc, exec, vcc" to
clear bits for inactive lanes in the case that the branch is instruction
selected as s_cbranch_scc1 and is then changed to s_cbranch_vccnz in
SIFixSGPRCopies. I have added the same code into SILowerControlFlow for
the case that the branch is instruction selected as s_cbranch_vccnz.

This de-optimizes the code in some cases where the s_and is not needed,
because vcc is the result of a v_cmp, or multiple v_cmp instructions
combined by s_and/s_or. We should add a pass to re-optimize those cases.

Reviewers: arsenm, kzhuravl

Subscribers: wdng, yaxunl, t-tye, llvm-commits, dstuttard, timcorringham, nhaehnle

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

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

6 years ago[COFF] Process /EXPORT option in fastpath
Rui Ueyama [Tue, 9 Jan 2018 20:36:42 +0000 (20:36 +0000)]
[COFF] Process /EXPORT option in fastpath

Patch by Takuto Ikuta.

This patch reduces lld link time of chromium's blink_core.dll in
component build.

Total size of input argument in .directives become nearly 300MB in the
build and almost all its content are /EXPORT.

To reduce time of parsing too many /EXPORT option in the build, I
introduce fastpath for /EXPORT in ArgParser::parseDirectives.

On my desktop machine, 4 times stats of the link time are like below.
Improved around 20%.

This patch
TotalSeconds : 8.6217627
TotalSeconds : 8.5402175
TotalSeconds : 8.6855853
TotalSeconds : 8.3624441
Ave : 8.5525024

master
TotalSeconds : 10.9975031
TotalSeconds : 11.3409428
TotalSeconds : 10.6332897
TotalSeconds : 10.7650687
Ave : 10.934201075

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

6 years agoNewGVN: Fix PR/33367, which was causing us to delete non-copy intrinsics accidentally...
Daniel Berlin [Tue, 9 Jan 2018 20:12:42 +0000 (20:12 +0000)]
NewGVN: Fix PR/33367, which was causing us to delete non-copy intrinsics accidentally in some rare cases

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

6 years agoProfiling tests: Endianess XFAIL for powerpc- (32-bit)
Hubert Tong [Tue, 9 Jan 2018 20:09:23 +0000 (20:09 +0000)]
Profiling tests: Endianess XFAIL for powerpc- (32-bit)

Add powerpc- (32-bit) as XFAIL for tests that are documented either in-
line or via commit messages as expected to fail on big-endian systems.

Tests not documented in-line are documented in commit messages as
follows:
r211172 - test/tools/llvm-cov/llvm-cov.test
r247920 - test/Transforms/SampleProfile/gcc-simple.ll

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

6 years agoDon't duplicate names in comments. NFC.
Rafael Espindola [Tue, 9 Jan 2018 20:02:35 +0000 (20:02 +0000)]
Don't duplicate names in comments. NFC.

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

6 years agoInline a emitFill variant that is only used once. NFC.
Rafael Espindola [Tue, 9 Jan 2018 19:50:29 +0000 (19:50 +0000)]
Inline a emitFill variant that is only used once. NFC.

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

6 years agoAdd a pass to generate synthetic function entry counts.
Easwaran Raman [Tue, 9 Jan 2018 19:39:35 +0000 (19:39 +0000)]
Add a pass to generate synthetic function entry counts.

Summary:
This pass synthesizes function entry counts by traversing the callgraph
and using the relative block frequencies of the callsites. The intended
use of these counts is in inlining to determine hot/cold callsites in
the absence of profile information.

The pass is split into two files with the code that propagates the
counts in a callgraph in a Utils file. I plan to add support for
propagation in the thinlto link phase and the propagation code will be
shared and hence this split. I did not add support to the old PM since
hot callsite determination in inlining is not possible in old PM
(although we could use hot callee heuristic with synthetic counts in the
old PM it is not worth the effort tuning it)

Reviewers: davidxl, silvas

Subscribers: mgorny, mehdi_amini, llvm-commits

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

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

6 years ago[Option] For typo '-foo', suggest '--foo'
Brian Gesiak [Tue, 9 Jan 2018 19:38:04 +0000 (19:38 +0000)]
[Option] For typo '-foo', suggest '--foo'

Summary:
https://reviews.llvm.org/rL321877 introduced the `OptTable::findNearest`
method, to find the closest edit distance option for a given string.
However, the implementation contained a bug: for a typo `-foo` with an
edit distance of 1 away from a valid option `--foo`, `findNearest`
would suggest a nearby option of `foo`. That is, the result would not
include the `--` prefix, and so was not a valid option.

Fix the bug by ensuring that the prefix string is initialized to one of
the valid prefixes for the option.

Test Plan: `check-llvm-unit`

Reviewers: v.g.vassilev, teemperor, ruiu, jroelofs, yamaguchi

Reviewed By: jroelofs

Subscribers: llvm-commits

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

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

6 years agoMake one of the emitFill methods non virtual. NFC.
Rafael Espindola [Tue, 9 Jan 2018 19:29:33 +0000 (19:29 +0000)]
Make one of the emitFill methods non virtual. NFC.

This is just preparatory work to fix PR35858.

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

6 years ago[COST]Fix PR35865: Fix cost model evaluation for shuffle on X86.
Alexey Bataev [Tue, 9 Jan 2018 19:08:22 +0000 (19:08 +0000)]
[COST]Fix PR35865: Fix cost model evaluation for shuffle on X86.

Summary:
If the vector type is transformed to non-vector single type, the compile
may crash trying to get vector information about non-vector type.

Reviewers: RKSimon, spatel, mkuper, hfinkel

Subscribers: llvm-commits

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

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

6 years ago[WebAssembly] Update libcall signature lists
Derek Schuff [Tue, 9 Jan 2018 19:05:34 +0000 (19:05 +0000)]
[WebAssembly] Update libcall signature lists

New signatures added in r322087. A fix for this tight coupling is forthcoming.

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

6 years ago[InstCombine] weaken assertions for icmp folds (PR35846)
Sanjay Patel [Tue, 9 Jan 2018 18:56:03 +0000 (18:56 +0000)]
[InstCombine] weaken assertions for icmp folds (PR35846)

Because of potential UB (known bits conflicts with an llvm.assume),
we have to check rather than assert here because InstSimplify doesn't
kill the compare:
https://bugs.llvm.org/show_bug.cgi?id=35846

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

6 years agoFix crash when linking metadata with ODR type uniquing
Teresa Johnson [Tue, 9 Jan 2018 18:32:53 +0000 (18:32 +0000)]
Fix crash when linking metadata with ODR type uniquing

Summary:
With DebugTypeODRUniquing enabled, during IR linking debug metadata
in the destination module may be reached from the source module.
This means that ConstantAsMetadata nodes (e.g. on DITemplateValueParameter)
may contain a value the destination module. When trying to map such
metadata nodes, we will attempt to map a GV already in the dest module.
linkGlobalValueProto will end up with a source GV that is the same as
the dest GV as well as the new GV. Trying to access the TypeMap for the
source GV type, which is actually a dest GV type, hits an assertion
since it appears that we have mapped into the source module (because the
type is the value not a key into the map).

Detect that we don't need to access the TypeMap in this case, since
there is no need to create a bitcast from the new GV to the source GV
type as they GV are the same.

Fixes PR35722.

Reviewers: mehdi_amini, pcc

Subscribers: probinson, llvm-commits, eraman

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

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

6 years ago[lit] Implement "-r" option for builtin "diff" command + a test using that.
Max Moroz [Tue, 9 Jan 2018 18:23:34 +0000 (18:23 +0000)]
[lit] Implement "-r" option for builtin "diff" command + a test using that.

Summary:
That would allow to recursively compare directories in tests using
"diff -r" on Windows in a similar way as it can be done on Linux or Mac.

Reviewers: zturner, morehouse, vsk

Reviewed By: zturner

Subscribers: kcc, llvm-commits

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

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

6 years ago[X86] Add a DAG combine to combine (sext (setcc)) with VLX
Craig Topper [Tue, 9 Jan 2018 18:14:22 +0000 (18:14 +0000)]
[X86] Add a DAG combine to combine (sext (setcc)) with VLX

Normally target independent DAG combine would do this combine based on getSetCCResultType, but with VLX getSetCCResultType returns a vXi1 type preventing the DAG combining from kicking in.

But doing this combine can allow us to remove the explicit sign extend that would otherwise be emitted.

This patch adds a target specific DAG combine to combine the sext+setcc when the result type is the same size as the input to the setcc. I've restricted this to FP compares and things that can be represented with PCMPEQ and PCMPGT since we don't have full integer compare support on the older ISAs.

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

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

6 years ago[lli] Make lli support -mcpu=native for CPU autodetection
Craig Topper [Tue, 9 Jan 2018 18:14:18 +0000 (18:14 +0000)]
[lli] Make lli support -mcpu=native for CPU autodetection

llc, opt, and clang can all autodetect the CPU and supported features. lli cannot as far as I could tell.

This patch uses the getCPUStr() and introduces a new getCPUFeatureList() and uses those in lli in place of MCPU and MAttrs.

Ideally, we would merge getCPUFeatureList and getCPUFeatureStr, but opt and llc need a string and lli wanted a list. Maybe we should just return the SubtargetFeature object and let the caller decide what it needs?

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

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

6 years agoTest commit
Matthew Voss [Tue, 9 Jan 2018 17:52:00 +0000 (17:52 +0000)]
Test commit

This is a commit to test commit access.

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