OSDN Git Service

android-x86/external-llvm.git
5 years ago[X86] Remove -costmodel-reduxcost=true from the experimental vector reduction intrins...
Craig Topper [Wed, 5 Dec 2018 07:56:50 +0000 (07:56 +0000)]
[X86] Remove -costmodel-reduxcost=true from the experimental vector reduction intrinsic tests as it appears to be unnecessary. NFC

I think this has something to do with matching reductions from extractelement, binops, and shuffles. But we're not matching here.

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

5 years ago[X86] Add more cost model tests for vector reductions with narrow vector types. NFC
Craig Topper [Wed, 5 Dec 2018 07:26:57 +0000 (07:26 +0000)]
[X86] Add more cost model tests for vector reductions with narrow vector types. NFC

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

5 years agoAArch64: support funclets in fastcall and swift_call
Saleem Abdulrasool [Wed, 5 Dec 2018 07:09:20 +0000 (07:09 +0000)]
AArch64: support funclets in fastcall and swift_call

Functions annotated with `__fastcall` or `__attribute__((__fastcall__))`
or `__attribute__((__swiftcall__))` may contain SEH handlers even on
Win64.  This matches the behaviour of cl which allows for
`__try`/`__except` inside a `__fastcall` function.  This was detected
while trying to self-host clang on Windows ARM64.

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

5 years ago[X86] Add narrow vector test cases to vector-reduce* tests. Add copies of the tests...
Craig Topper [Wed, 5 Dec 2018 06:29:44 +0000 (06:29 +0000)]
[X86] Add narrow vector test cases to vector-reduce* tests. Add copies of the tests with -x86-experimental-vector-widening-legalization

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

5 years ago[NFC] Verify memoryssa in test for PR39783
Max Kazantsev [Wed, 5 Dec 2018 05:20:08 +0000 (05:20 +0000)]
[NFC] Verify memoryssa in test for PR39783

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

5 years ago[MachineLICM][X86][AMDGPU] Fix subtle bug in the updating of PhysRegClobbers in post...
Craig Topper [Wed, 5 Dec 2018 03:41:26 +0000 (03:41 +0000)]
[MachineLICM][X86][AMDGPU] Fix subtle bug in the updating of PhysRegClobbers in post-RA LICM

It looks like MCRegAliasIterator can visit the same physical register twice. When this happens in this code in LICM we end up setting the PhysRegDef and then later in the same loop visit the register again. Now we see that PhysRegDef is set from the earlier iteration so now set PhysRegClobber.

This patch splits the loop so we have one that uses the previous value of PhysRegDef to update PhysRegClobber and second loop that updates PhysRegDef.

The X86 atomic test is an improvement. I had to add sideeffect to the two shrink wrapping tests to prevent hoisting from occurring. I'm not sure about the AMDGPU tests. It looks like the branch instruction changed at end the of the loops. And in the branch-relaxation test I think there is now "and vcc, exec, -1" instruction that wasn't there before.

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

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

5 years ago[asan] Add clang flag -fsanitize-address-use-odr-indicator
Vitaly Buka [Wed, 5 Dec 2018 01:44:31 +0000 (01:44 +0000)]
[asan] Add clang flag -fsanitize-address-use-odr-indicator

Reviewers: eugenis, m.ostapenko, ygribov

Subscribers: hiraditya, llvm-commits

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

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

5 years ago[TableGen] Preserve order of output operands in DAGISelMatcherGen
Craig Topper [Wed, 5 Dec 2018 00:47:59 +0000 (00:47 +0000)]
[TableGen] Preserve order of output operands in DAGISelMatcherGen

Summary:
This fixes support in DAGISelMatcher backend for DAG nodes with multiple
result values. Previously the order of results in selected DAG nodes always
matched the order of results in ISel patterns. After the change the order of
results matches the order of operands in OutOperandList instead.

For example, given this definition from the attached test case:

  def INSTR : Instruction {
    let OutOperandList = (outs GPR:$r1, GPR:$r0);
    let InOperandList = (ins GPR:$t0, GPR:$t1);
    let Pattern = [(set i32:$r0, i32:$r1, (udivrem i32:$t0, i32:$t1))];
  }

the DAGISelMatcher backend currently produces a matcher that creates INSTR
nodes with the first result `$r0` and the second result `$r1`, contrary to the
order in the OutOperandList. The order of operands in OutOperandList does not
matter at all, which is unexpected (and unfortunate) because the order of
results of a DAG node does matters, perhaps a lot.

With this change, if the order in OutOperandList does not match the order in
Pattern, DAGISelMatcherGen emits CompleteMatch opcodes with the order of
results taken from OutOperandList. Backend writers can use it to express
result reorderings in TableGen.

If the order in OutOperandList matches the order in Pattern, the result of
DAGISelMatcherGen is unaffected.

Patch by Eugene Sharygin

Reviewers: andreadb, bjope, hfinkel, RKSimon, craig.topper

Reviewed By: craig.topper

Subscribers: nhaehnle, craig.topper, llvm-commits

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

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

5 years ago[SelectionDAG] Split very large token factors for loads into 64k chunks.
Amara Emerson [Wed, 5 Dec 2018 00:41:30 +0000 (00:41 +0000)]
[SelectionDAG] Split very large token factors for loads into 64k chunks.

There's a 64k limit on the number of SDNode operands, and some very large
functions with 64k or more loads can cause crashes due to this limit being hit
when a TokenFactor with this many operands is created. To fix this, create
sub-tokenfactors if we've exceeded the limit.

No test case as it requires a very large function.

rdar://45196621

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

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

5 years ago[ADT] Add zip_longest iterators.
Michael Kruse [Wed, 5 Dec 2018 00:31:54 +0000 (00:31 +0000)]
[ADT] Add zip_longest iterators.

Like the already existing zip_shortest/zip_first iterators, zip_longest
iterates over multiple iterators at once, but has as many iterations as
the longest sequence.

This means some iterators may reach the end before others do.
zip_longest uses llvm::Optional's None value to mark a
past-the-end value.

zip_longest is not reverse-iteratable because the tuples iterated over
would be different for different length sequences (IMHO for the same
reason neither zip_shortest nor zip_first should be reverse-iteratable;
one can still reverse the ranges individually if that's the expected
behavior).

In contrast to zip_shortest/zip_first, zip_longest tuples contain
rvalues instead of references. This is because llvm::Optional cannot
contain reference types and the value-initialized default does not have
a memory location a reference could point to.

The motivation for these iterators is to use C++ foreach to compare two
lists of ordered attributes in D48100 (SemaOverload.cpp and
ASTReaderDecl.cpp).

Idea by @hfinkel.

This re-commits r348301 which was reverted by r348303.
The compilation error by gcc 5.4 was resolved using make_tuple in the in
the initializer_list.
The compileration error by msvc14 was resolved by splitting
ZipLongestValueType (which already was a workaround for msvc15) into
ZipLongestItemType and ZipLongestTupleType.

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

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

5 years agoLTO: Don't internalize available_externally globals.
Peter Collingbourne [Wed, 5 Dec 2018 00:09:36 +0000 (00:09 +0000)]
LTO: Don't internalize available_externally globals.

This breaks C and C++ semantics because it can cause the address
of the global inside the module to differ from the address outside
of the module.

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

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

5 years ago[AArch64][GlobalISel] Re-enable selection of volatile loads.
Amara Emerson [Wed, 5 Dec 2018 00:03:09 +0000 (00:03 +0000)]
[AArch64][GlobalISel] Re-enable selection of volatile loads.

We previously disabled this in r323371 because of a bug where we selected an
extending load, but didn't delete the old G_LOAD, resulting in two loads being
generated for volatile loads.

Since we now have dedicated G_SEXTLOAD/G_ZEXTLOAD operations, and that the
tablegen patterns should no longer be able to select (ext(load x)) patterns, it
should be safe to re-enable it.

The old test case should still work as expected.

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

5 years agoRemove the hash code from CVRecord.
Zachary Turner [Tue, 4 Dec 2018 23:56:07 +0000 (23:56 +0000)]
Remove the hash code from CVRecord.

This is no longer used and is just taking up space in the structure.
Heap allocation of this structure is on the critical path, so space
actually matters.

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

5 years ago[asan] Split -asan-use-private-alias to -asan-use-odr-indicator
Vitaly Buka [Tue, 4 Dec 2018 23:17:41 +0000 (23:17 +0000)]
[asan] Split -asan-use-private-alias to -asan-use-odr-indicator

Reviewers: eugenis, m.ostapenko, ygribov

Subscribers: mehdi_amini, kubamracek, hiraditya, steven_wu, dexonsmith, llvm-commits

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

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

5 years ago[InstCombine] add tests for implied simplifications; NFC
Sanjay Patel [Tue, 4 Dec 2018 22:25:33 +0000 (22:25 +0000)]
[InstCombine] add tests for implied simplifications; NFC

Ideally, we would fold all of these in InstSimplify in a
similar way to rL347896, but this is a bit awkward when
we're trying to simplify a compare directly because the
ValueTracking API expects the compare as an input, but
in InstSimplify, we just have the operands of the compare.

Given that we can do transforms besides just simplifications,
we might as well just extend the code in InstCombine (which
already does simplifications with constant operands).

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

5 years agoAArch64: clean up some whitespace in Windows CC (NFC)
Saleem Abdulrasool [Tue, 4 Dec 2018 22:19:29 +0000 (22:19 +0000)]
AArch64: clean up some whitespace in Windows CC (NFC)

Drive by clean up for Windows ARM64 variadic CC (NFC).

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

5 years ago[llvm-pdbutil] Remove the analyze subcommand.
Zachary Turner [Tue, 4 Dec 2018 21:49:04 +0000 (21:49 +0000)]
[llvm-pdbutil] Remove the analyze subcommand.

Nobody has used this since it was introduced, and it doesn't have
test coverage.

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

5 years ago[PDB] Emit S_UDT records in LLD.
Zachary Turner [Tue, 4 Dec 2018 21:48:46 +0000 (21:48 +0000)]
[PDB] Emit S_UDT records in LLD.

Previously these were dropped.  We now understand them sufficiently
well to start emitting them.  From the debugger's perspective, this
now enables us to have debug info about typedefs (both global and
function-locally scoped)

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

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

5 years ago[AVR] Silence fallthrough warning. NFC.
Nirav Dave [Tue, 4 Dec 2018 21:41:52 +0000 (21:41 +0000)]
[AVR] Silence fallthrough warning. NFC.

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

5 years agoRevert "[ADT] Add zip_longest iterators"
Michael Kruse [Tue, 4 Dec 2018 21:38:55 +0000 (21:38 +0000)]
Revert "[ADT] Add zip_longest iterators"

This reverts commit r348301.

Compilation fails on buildbots with older versions of gcc and msvc.

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

5 years ago[ADT] Add zip_longest iterators
Michael Kruse [Tue, 4 Dec 2018 21:06:16 +0000 (21:06 +0000)]
[ADT] Add zip_longest iterators

Like the already existing zip_shortest/zip_first iterators, zip_longest
iterates over multiple iterators at once, but has as many iterations as
the longest sequence.

This means some iterators may reach the end before others do.
zip_longest uses llvm::Optional's None value to mark a
past-the-end value.

zip_longest is not reverse-iteratable because the tuples iterated over
would be different for different length sequences (IMHO for the same
reason neither zip_shortest nor zip_first should be reverse-iteratable;
one can still reverse the ranges individually if that's the expected
behavior).

In contrast to zip_shortest/zip_first, zip_longest tuples contain
rvalues instead of references. This is because llvm::Optional cannot
contain reference types and the value-initialized default does not have
a memory location a reference could point to.

The motivation for these iterators is to use C++ foreach to compare two
lists of ordered attributes in D48100 (SemaOverload.cpp and
ASTReaderDecl.cpp).

Idea by @hfinkel.

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

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

5 years ago[PowerPC] Make no-PIC default to match GCC - LLVM
Stefan Pintilie [Tue, 4 Dec 2018 20:14:57 +0000 (20:14 +0000)]
[PowerPC] Make no-PIC default to match GCC - LLVM

Change the default for PowerPC LE to -fno-PIC.

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

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

5 years ago[CmpInstAnalysis] fix function signature for ICmp code to predicate; NFC
Sanjay Patel [Tue, 4 Dec 2018 18:53:27 +0000 (18:53 +0000)]
[CmpInstAnalysis] fix function signature for ICmp code to predicate; NFC

The old function underspecified the return type, took an unused parameter,
and had a misleading name.

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

5 years agoMove llc-start-stop-instance to x86
Matt Arsenault [Tue, 4 Dec 2018 18:19:08 +0000 (18:19 +0000)]
Move llc-start-stop-instance to x86

Avoid bot failures where the host pass
setup might not have 2 dead-mi-elimination runs

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

5 years ago[SelectionDAG] Redefine isGAPlusOffset in terms of unwrapAddress. NFCI.
Nirav Dave [Tue, 4 Dec 2018 17:59:43 +0000 (17:59 +0000)]
[SelectionDAG] Redefine isGAPlusOffset in terms of unwrapAddress. NFCI.

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

5 years agoAMDGPU: Add f32 vectors to SGPR register classes
Matt Arsenault [Tue, 4 Dec 2018 17:51:36 +0000 (17:51 +0000)]
AMDGPU: Add f32 vectors to SGPR register classes

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

5 years agoMIR: Add method to stop after specific runs of passes
Matt Arsenault [Tue, 4 Dec 2018 17:45:12 +0000 (17:45 +0000)]
MIR: Add method to stop after specific runs of passes

Currently if you use -{start,stop}-{before,after}, it picks
the first instance with the matching pass name. If you run
the same pass multiple times, there's no way to distinguish them.

Allow specifying a run index wih ,N to specify which you mean.

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

5 years ago[InstCombine] rearrange foldICmpWithDominatingICmp; NFC
Sanjay Patel [Tue, 4 Dec 2018 17:44:24 +0000 (17:44 +0000)]
[InstCombine] rearrange foldICmpWithDominatingICmp; NFC

Move it out from under the constant check, reorder
predicates, add comments. This makes it easier to
extend to handle the non-constant case.

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

5 years ago[dsymutil] Ensure we're comparing time stamps with the same precision.
Jonas Devlieghere [Tue, 4 Dec 2018 17:15:23 +0000 (17:15 +0000)]
[dsymutil] Ensure we're comparing time stamps with the same precision.

After TimePoint's precision was increased in LLVM we started seeing
failures because the modification times didn't match. This adds a time
cast to ensure that we're comparing TimePoints with the same amount of
precision.

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

5 years ago[X86][SSE] Add SimplifyDemandedBitsForTargetNode handling for MOVMSK
Simon Pilgrim [Tue, 4 Dec 2018 16:52:32 +0000 (16:52 +0000)]
[X86][SSE] Add SimplifyDemandedBitsForTargetNode handling for MOVMSK

Moves existing SimplifyDemandedBits call out of combineMOVMSK and add SimplifyDemandedVectorElts call based on the sign bits we need.

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

5 years agoRevert "Adapt gcov to changes in CFE."
Ilya Biryukov [Tue, 4 Dec 2018 16:30:31 +0000 (16:30 +0000)]
Revert "Adapt gcov to changes in CFE."

This reverts commit r348203.
Reason: this produces absolute paths in .gcno files, breaking us
internally as we rely on them being consistent with the filenames passed
in the command line.

Also reverts r348157 and r348155 to account for revert of r348154 in
clang repository.

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

5 years ago[X86][SSE] Add MOVMSK demandedbits/elts tests
Simon Pilgrim [Tue, 4 Dec 2018 16:01:25 +0000 (16:01 +0000)]
[X86][SSE] Add MOVMSK demandedbits/elts tests

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

5 years ago[InstCombine] auto-generate full checks for icmp overflow tests; NFC
Sanjay Patel [Tue, 4 Dec 2018 15:41:34 +0000 (15:41 +0000)]
[InstCombine] auto-generate full checks for icmp overflow tests; NFC

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

5 years ago[InstCombine] add helper for icmp with dominator; NFC
Sanjay Patel [Tue, 4 Dec 2018 15:35:17 +0000 (15:35 +0000)]
[InstCombine] add helper for icmp with dominator; NFC

There's a potential small enhancement to this code that could
solve the cases currently under proposal in D54827 via SimplifyCFG.

Whether instcombine should be doing this kind of semi-non-local
analysis in the first place is an open question, but separating
the logic out can only help if/when we decide to move it to a
different pass.

AFAICT, any proposal to do this in SimplifyCFG could also be seen
as an overreach + it would be incomplete to start the fold from a
branch rather than an icmp.

There's another question here about the code for processUGT_ADDCST_ADD().
That part may be completely dead after rL234638 ?

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

5 years ago[InstCombine] auto-generate full checks for icmp dominator tests; NFC
Sanjay Patel [Tue, 4 Dec 2018 15:00:35 +0000 (15:00 +0000)]
[InstCombine] auto-generate full checks for icmp dominator tests; NFC

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

5 years ago[Hexagon] Remove unused checker functions from asm parser
Krzysztof Parzyszek [Tue, 4 Dec 2018 14:58:14 +0000 (14:58 +0000)]
[Hexagon] Remove unused checker functions from asm parser

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

5 years ago[SimpleLoopUnswitch] Remove debug dump.
Alina Sbirlea [Tue, 4 Dec 2018 14:43:24 +0000 (14:43 +0000)]
[SimpleLoopUnswitch] Remove debug dump.

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

5 years agoAdd common check prefix. NFCI.
Simon Pilgrim [Tue, 4 Dec 2018 14:32:42 +0000 (14:32 +0000)]
Add common check prefix. NFCI.

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

5 years ago[yaml2obj] Move redundant statements into a separate static function
Xing GUO [Tue, 4 Dec 2018 14:27:51 +0000 (14:27 +0000)]
[yaml2obj] Move redundant statements into a separate static function

Reviewers: jhenderson, grimar

Reviewed By: jhenderson

Subscribers: jakehehrlich, llvm-commits

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

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

5 years agoUpdate MemorySSA in SimpleLoopUnswitch.
Alina Sbirlea [Tue, 4 Dec 2018 14:23:37 +0000 (14:23 +0000)]
Update MemorySSA in SimpleLoopUnswitch.

Summary:
Teach SimpleLoopUnswitch to preserve MemorySSA.

Subscribers: sanjoy, jlebar, Prazek, george.burgess.iv, llvm-commits

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

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

5 years ago[GN][NFC] Update readme example to functional command
Martell Malone [Tue, 4 Dec 2018 12:59:22 +0000 (12:59 +0000)]
[GN][NFC] Update readme example to functional command

`ninja -C out/gn check-lld` is not a valid command yet

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

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

5 years ago[X86][NFC] Add more constant-size memcmp tests.
Clement Courbet [Tue, 4 Dec 2018 12:35:51 +0000 (12:35 +0000)]
[X86][NFC] Add more constant-size memcmp tests.

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

5 years agoFix MSVC "unknown pragma" warning. NFCI.
Simon Pilgrim [Tue, 4 Dec 2018 12:31:52 +0000 (12:31 +0000)]
Fix MSVC "unknown pragma" warning. NFCI.

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

5 years agoFix -Wparentheses warning. NFCI.
Simon Pilgrim [Tue, 4 Dec 2018 12:24:10 +0000 (12:24 +0000)]
Fix -Wparentheses warning. NFCI.

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

5 years ago[X86] Remove unnecessary peekThroughEXTRACT_SUBVECTORs call.
Simon Pilgrim [Tue, 4 Dec 2018 12:21:43 +0000 (12:21 +0000)]
[X86] Remove unnecessary peekThroughEXTRACT_SUBVECTORs call.

The GetSplatValue/IsSplatVector call will call this anyhow and the later code is just for a v2i64 type so doesn't need it.

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

5 years ago[TargetLowering] expandFP_TO_UINT - avoid FPE due to out of range conversion (PR17686)
Simon Pilgrim [Tue, 4 Dec 2018 11:21:30 +0000 (11:21 +0000)]
[TargetLowering] expandFP_TO_UINT - avoid FPE due to out of range conversion (PR17686)

PR17686 demonstrates that for some targets FP exceptions can fire in cases where the FP_TO_UINT is expanded using a FP_TO_SINT instruction.

The existing code converts both the inrange and outofrange cases using FP_TO_SINT and then selects the result, this patch changes this for 'strict' cases to pre-select the FP_TO_SINT input and the offset adjustment.

The X87 cases don't need the strict flag but generates much nicer code with it....

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

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

5 years agoRevert rL348121 from llvm/trunk: [NFC][AArch64] Split out backend features
Simon Pilgrim [Tue, 4 Dec 2018 10:55:48 +0000 (10:55 +0000)]
Revert rL348121 from llvm/trunk: [NFC][AArch64] Split out backend features

This patch splits backend features currently
hidden behind architecture versions.

For example, currently the only way to activate
complex numbers extension is targeting an v8.3
architecture, where after the patch this extension
can be added separately.

This refactoring is required by the new command lines proposal:
http://lists.llvm.org/pipermail/llvm-dev/2018-September/126346.html

Reviewers: DavidSpickett, olista01, t.p.northover

Subscribers: kristof.beyls, bryanpkc, javed.absar, pbarrio

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

........

This has been causing buildbots failures for the past 24 hours: http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/14386

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

5 years agoRevert r348243 "[llvm-mc] - Do not crash when referencing undefined debug sections."
George Rimar [Tue, 4 Dec 2018 10:55:03 +0000 (10:55 +0000)]
Revert r348243 "[llvm-mc] - Do not crash when referencing undefined debug sections."

It broke msan and asan bots it seems:
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/26794/steps/check-llvm%20msan/logs/stdio
http://lab.llvm.org:8011/builders/clang-s390x-linux/builds/20993/steps/ninja%20check%201/logs/stdio

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

5 years ago[TargetLowering] Add SimplifyDemandedVectorElts support to EXTEND opcodes
Simon Pilgrim [Tue, 4 Dec 2018 10:41:06 +0000 (10:41 +0000)]
[TargetLowering] Add SimplifyDemandedVectorElts support to EXTEND opcodes

Add support for ISD::*_EXTEND and ISD::*_EXTEND_VECTOR_INREG opcodes.

The extra broadcast in trunc-subvector.ll will be fixed in an upcoming patch.

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

5 years ago[llvm-mc] - Do not crash when referencing undefined debug sections.
George Rimar [Tue, 4 Dec 2018 10:10:50 +0000 (10:10 +0000)]
[llvm-mc] - Do not crash when referencing undefined debug sections.

MC has code that pre-creates few debug sections:
https://github.com/llvm-mirror/llvm/blob/master/lib/MC/MCObjectFileInfo.cpp#L396

If users code has a reference to such section but does not redefine it,
MC code currently asserts, because still thinks they are normally defined.

The patch fixes the issue.

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

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

5 years ago[llvm-dwarfdump] - Dump the older versions of .eh_frame/.debug_frame correctly.
George Rimar [Tue, 4 Dec 2018 10:01:39 +0000 (10:01 +0000)]
[llvm-dwarfdump] - Dump the older versions of .eh_frame/.debug_frame correctly.

The issue is the following.

DWARF 2 used version 1 for .debug_frame.
(Appendix G, p. 416 http://dwarfstd.org/doc/DWARF5.pdf)

lib/MC now always sets version 1 for .eh_frame (and sets 1-4 versions for .debug_frame correctly):
https://github.com/llvm-mirror/llvm/blob/master/lib/MC/MCDwarf.cpp#L1530
https://github.com/llvm-mirror/llvm/blob/master/lib/MC/MCDwarf.cpp#L1562
https://github.com/llvm-mirror/llvm/blob/master/lib/MC/MCDwarf.cpp#L1602

In version 1, return_address_register was defined as ubyte, while other versions
switched to uleb128.
(p 62, http://www.dwarfstd.org/doc/dwarf-2.0.0.pdf)

Patch teaches llvm-dwarfdump about this difference.

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

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

5 years ago[X86] Remove custom DAG combine for SIGN_EXTEND_VECTOR_INREG/ZERO_EXTEND_VECTOR_INREG.
Craig Topper [Tue, 4 Dec 2018 04:51:07 +0000 (04:51 +0000)]
[X86] Remove custom DAG combine for SIGN_EXTEND_VECTOR_INREG/ZERO_EXTEND_VECTOR_INREG.

We only needed this because it provided really aggressive constant folding even through constant pool entries created from build_vectors. The main case was for vXi8 MULH legalization which was happening as part of legalize DAG instead of as part of legalize vector ops. Now its part of vector op legalization and we've added special handling for build vectors of all constants there. This has removed the need for this code on the list tests we have.

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

5 years agoReverting r348215
Ranjeet Singh [Tue, 4 Dec 2018 02:03:53 +0000 (02:03 +0000)]
Reverting r348215

Causing failures on ubsan buildbot boxes.

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

5 years ago[TableGen] Improve the formatting of the emitted predicates (NFC)
Evandro Menezes [Tue, 4 Dec 2018 01:43:22 +0000 (01:43 +0000)]
[TableGen] Improve the formatting of the emitted predicates (NFC)

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

5 years ago[TableGen] Fix typo in emitted comment (NFC)
Evandro Menezes [Tue, 4 Dec 2018 01:43:19 +0000 (01:43 +0000)]
[TableGen] Fix typo in emitted comment (NFC)

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

5 years ago[ExecutionEngine] Change NotifyObjectEmitted/NotifyObjectFreed API.
Lang Hames [Tue, 4 Dec 2018 00:55:15 +0000 (00:55 +0000)]
[ExecutionEngine] Change NotifyObjectEmitted/NotifyObjectFreed API.

This patch renames both methods (NotifyObjectEmitted -> notifyObjectLoaded, and
NotifyObjectFreed -> notifyObjectFreed), adds an abstract "ObjectKey" (uint64_t)
parameter to notifyObjectLoaded, and replaces the ObjectFile parameter for
notifyObjectFreed with an ObjectKey. Using an ObjectKey to track identify
events, rather than a reference to the ObjectFile, allows us to free the
ObjectFile after notifyObjectLoaded is called, saving memory.

https://reviews.llvm.org/D53773

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

5 years ago[ARM64][Windows] Fix local stack size for funclets
Sanjin Sijaric [Tue, 4 Dec 2018 00:54:52 +0000 (00:54 +0000)]
[ARM64][Windows] Fix local stack size for funclets

The comment was misplaced, and the code didn't do what the comment indicated,
namely ignoring the varargs portion when computing the local stack size of a
funclet in emitEpilogue.  This results in incorrect offset computations within
funclets that are contained in vararg functions.

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

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

5 years ago[asan] Reduce binary size by using unnamed private aliases
Vitaly Buka [Tue, 4 Dec 2018 00:36:14 +0000 (00:36 +0000)]
[asan] Reduce binary size by using unnamed private aliases

Summary:
--asan-use-private-alias increases binary sizes by 10% or more.
Most of this space was long names of aliases and new symbols.
These symbols are not needed for the ODC check at all.

Reviewers: eugenis

Subscribers: hiraditya, llvm-commits

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

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

5 years ago[MachineOutliner] Move stack instr check logic to getOutliningCandidateInfo
Jessica Paquette [Tue, 4 Dec 2018 00:31:55 +0000 (00:31 +0000)]
[MachineOutliner] Move stack instr check logic to getOutliningCandidateInfo

This moves the stack check logic into a lambda within getOutliningCandidateInfo.

This allows us to be less conservative with stack checks. Whether or not a
stack instruction is safe to outline is dependent on the frame variant and call
variant of the outlined function; only in cases where we modify the stack can
these be unsafe.

So, if we move that logic later, when we're looking at an individual candidate,
we can make better decisions here.

This gives some code size savings as a result.

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

5 years ago[MachineOutliner][AArch64][NFC] Add early exit to candidate discarding logic
Jessica Paquette [Tue, 4 Dec 2018 00:31:47 +0000 (00:31 +0000)]
[MachineOutliner][AArch64][NFC] Add early exit to candidate discarding logic

If we dropped too many candidates to be beneficial when dropping candidates
that modify the stack, there's no reason to check for other cost model
qualities.

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

5 years ago[projects] Use directory name for add_llvm_external_projects
Shoaib Meenai [Tue, 4 Dec 2018 00:12:03 +0000 (00:12 +0000)]
[projects] Use directory name for add_llvm_external_projects

add_llvm_external_projects expects the directory name instead of the
full path, otherwise the check for an in-tree subproject will fail and
the project won't be configured.

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

5 years ago[ThinLTO] Look through aliases when computing hash keys
George Burgess IV [Tue, 4 Dec 2018 00:02:33 +0000 (00:02 +0000)]
[ThinLTO] Look through aliases when computing hash keys

Without this, we don't consider types used by aliasees in our cache key.
This caused issues when using the same cache for thin-linking the same
TU with different sets of virtual call candidates for a virtual call
inside of a constructor. That's sort of a mouthful. :)

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

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

5 years ago[IR] Don't assume all functions are 4 byte aligned
Ranjeet Singh [Tue, 4 Dec 2018 00:01:23 +0000 (00:01 +0000)]
[IR] Don't assume all functions are 4 byte aligned

In some cases different alignments for function might be used to save
space e.g. thumb mode with -Oz will try to use 2 byte function
alignment. Similar patch that fixed this in other areas exists here
https://reviews.llvm.org/D46110

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

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

5 years ago[Hexagon] Switch to auto-generated intrinsic definitions and patterns
Krzysztof Parzyszek [Mon, 3 Dec 2018 22:40:36 +0000 (22:40 +0000)]
[Hexagon] Switch to auto-generated intrinsic definitions and patterns

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

5 years ago[CodeExtractor] Split PHI nodes with incoming values from outlined region (PR39433)
Vedant Kumar [Mon, 3 Dec 2018 22:40:21 +0000 (22:40 +0000)]
[CodeExtractor] Split PHI nodes with incoming values from outlined region (PR39433)

If a PHI node out of extracted region has multiple incoming values from it,
split this PHI on two parts. First PHI has incomings only from region and
extracts with it (they are placed to the separate basic block that added to the
list of outlined), and incoming values in original PHI are replaced by first
PHI. Similar solution is already used in CodeExtractor for PHIs in entry block
(severSplitPHINodes method). It covers PR39433 bug.

Patch by Sergei Kachkov!

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

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

5 years agoAdapt gcov to changes in CFE.
Adrian Prantl [Mon, 3 Dec 2018 22:37:48 +0000 (22:37 +0000)]
Adapt gcov to changes in CFE.

The clang frontend no longer emits the current working directory for
DIFiles containing an absolute path in the filename: and will move the
common prefix between current working directory and the file into the
directory: component.

This fixes the GCOV tests in compiler-rt that were broken by the Clang
change.

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

5 years agoBumpPtrAllocator: Add a couple of convenient wrappers around identifyObject().
Artem Dergachev [Mon, 3 Dec 2018 22:05:24 +0000 (22:05 +0000)]
BumpPtrAllocator: Add a couple of convenient wrappers around identifyObject().

This allows obtaining smaller, more readable identifiers
in a more comfortable way.

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

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

5 years ago[Hexagon] Extract operand decoders into a separate file, NFC
Krzysztof Parzyszek [Mon, 3 Dec 2018 21:59:21 +0000 (21:59 +0000)]
[Hexagon] Extract operand decoders into a separate file, NFC

These decoders are automatically generated. Keeping them separated makes
updating architectures easier.

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

5 years ago[DAGCombiner] narrow truncated vector binops when legal
Sanjay Patel [Mon, 3 Dec 2018 21:57:35 +0000 (21:57 +0000)]
[DAGCombiner] narrow truncated vector binops when legal

This is the smallest vector enhancement I could find to D54640.
Here, we're allowing narrowing to only legal vector ops because we'll see
regressions without that. All of the test diffs are wins from what I can tell.
With AVX/AVX512, we can shrink ymm/zmm ops to xmm.

x86 vector multiplies are the problem case that we're avoiding due to the
patchwork ISA, and it's not clear to me if we can dance around those
regressions using TLI hooks or if we need preliminary patches to plug those
holes.

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

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

5 years ago[mips] Fix TestDWARF32Version5Addr8AllForms test failure on MIPS hosts
Simon Atanasyan [Mon, 3 Dec 2018 21:54:43 +0000 (21:54 +0000)]
[mips] Fix TestDWARF32Version5Addr8AllForms test failure on MIPS hosts

The `DIEExpr` is used in debug information entries for either TLS variables
or call sites. For now the last case is unsupported for targets with delay
slots, for MIPS in particular.

The `DIEExpr::EmitValue` method calls a virtual `EmitDebugThreadLocal`
routine which, in case of MIPS, always emits either `.dtprelword` or
`.dtpreldword` directives. That is okay for "main" code, but in unit
tests `DIEExpr` instances can be created not for TLS variables only even
on MIPS hosts. That is a reason of the `TestDWARF32Version5Addr8AllForms`
failure because handling of the `R_MIPS_TLS_DTPREL` relocation writes
incorrect value into dwarf structures. And anyway unconditional emitting
of `.dtprelword` directives will be incorrect when/if debug information
entries for call sites become supported on MIPS.

The patch solves the problem by wrapping expression created in the
`MipsTargetObjectFile::getDebugThreadLocalSymbol` method in to the
`MipsMCExpr` expression with a new `MEK_DTPREL` tag. This tag is
recognized in the `MipsAsmPrinter::EmitDebugThreadLocal` method and
`.dtprelword` directives created in this case only. In other cases the
expression saved as a regular data.

Differential Revision: http://reviews.llvm.org/D54937

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

5 years ago[Hexagon] Remove unused encodings, NFC
Krzysztof Parzyszek [Mon, 3 Dec 2018 21:49:12 +0000 (21:49 +0000)]
[Hexagon] Remove unused encodings, NFC

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

5 years ago[InstCombine] fix undef propagation bug with shuffle+binop
Sanjay Patel [Mon, 3 Dec 2018 21:15:17 +0000 (21:15 +0000)]
[InstCombine] fix undef propagation bug with shuffle+binop

When we have a shuffle that extends a source vector with undefs
and then do some binop on that, we must make sure that the extra
elements remain undef with that binop if we reverse the order of
the binop and shuffle.

'or' is probably the easiest example to show the bug because
'or C, undef --> -1' (not undef). But there are other
opcode/constant combinations where this is true as shown by
the 'shl' test.

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

5 years ago[gn build] Use print_function in write_cmake_config.py
Nico Weber [Mon, 3 Dec 2018 21:10:19 +0000 (21:10 +0000)]
[gn build] Use print_function in write_cmake_config.py

No behavior change, just makes the script match the other scripts in
llvm/utils/gn/build.

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

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

5 years ago[WebAssembly] Enforce assembler emits to streamer in order.
Wouter van Oortmerssen [Mon, 3 Dec 2018 20:30:28 +0000 (20:30 +0000)]
[WebAssembly] Enforce assembler emits to streamer in order.

Summary:
The assembler processes directives and instructions in whatever order
they are in the file, then directly emits them to the streamer. This
could cause badly written (or generated) .s files to produce
incorrect binaries.

It now has state that tracks what it has most recently seen, to
enforce they are emitted in a given order that always produces
correct wasm binaries.

Also added a new test that compares obj2yaml output from llc (the
backend) to that going via .s and the assembler to ensure both paths
generate the same binaries.

The features this test covers could be extended.

Passes all wasm Lit tests.

Fixes: https://bugs.llvm.org/show_bug.cgi?id=39557

Reviewers: sbc100, dschuff, aheejin

Subscribers: jgravelle-google, sunfish, llvm-commits

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

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

5 years ago[Hexagon] Update timing classes
Krzysztof Parzyszek [Mon, 3 Dec 2018 20:13:18 +0000 (20:13 +0000)]
[Hexagon] Update timing classes

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

5 years ago[InstCombine] foldICmpWithLowBitMaskedVal(): disable 2 faulty folds.
Roman Lebedev [Mon, 3 Dec 2018 20:07:58 +0000 (20:07 +0000)]
[InstCombine] foldICmpWithLowBitMaskedVal(): disable 2 faulty folds.

These two folds are invalid for this non-constant pattern
when the mask ends up being all-ones:
https://rise4fun.com/Alive/9au
https://rise4fun.com/Alive/UcQM

Fixes https://bugs.llvm.org/show_bug.cgi?id=39861

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

5 years ago[cmake] Clean up add_llvm_subdirectory
Shoaib Meenai [Mon, 3 Dec 2018 20:05:11 +0000 (20:05 +0000)]
[cmake] Clean up add_llvm_subdirectory

I found the pattern of setting the project_BUILD variable to OFF after
processing the project to be pretty confusing. Using global properties
to explicitly keep track of whether a project has been processed or not
seems much more straightforward, and it also allows us to convert the
macro into a function (which is required for the early return).

Factor the project+type+name combination out into a variable while I'm
here, since it's used a whole bunch of times.

I don't believe this should result in any functional changes.

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

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

5 years ago[TextAPI] Remove a superfluous semicolon, fixing GCC warnings. NFC.
Martin Storsjo [Mon, 3 Dec 2018 20:02:15 +0000 (20:02 +0000)]
[TextAPI] Remove a superfluous semicolon, fixing GCC warnings. NFC.

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

5 years ago[COFF] Remove an outdated/incorrect comment. NFC.
Martin Storsjo [Mon, 3 Dec 2018 20:02:11 +0000 (20:02 +0000)]
[COFF] Remove an outdated/incorrect comment. NFC.

Making the section writable doesn't affect how windows does
base relocs in case a DLL can't be loaded at the intended base
address.

This comment dates back to SVN r79346.

Differential Revision:

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

5 years ago[COFF] Don't mark mingw .eh_frame sections writable
Martin Storsjo [Mon, 3 Dec 2018 20:02:05 +0000 (20:02 +0000)]
[COFF] Don't mark mingw .eh_frame sections writable

This improves compatibility with GCC produced object files, where
the .eh_frame sections are read only. With mixed flags for the
involved .eh_frame sections, LLD creates two separate .eh_frame
sections in the output binary, one for each flag combination,
while ld.bfd probably merges them.

The previous setup of flags can be traced back to SVN r79346.

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

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

5 years ago[InstCombine] rearrange shuffle+binop fold; NFC
Sanjay Patel [Mon, 3 Dec 2018 19:53:04 +0000 (19:53 +0000)]
[InstCombine] rearrange shuffle+binop fold; NFC

This code has a bug dealing with undefs, so we need
to add another escape hatch, so doing some cleanup
ahead of that.

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

5 years ago[llvm-objcopy] Add --build-id-link-dir flag
Jake Ehrlich [Mon, 3 Dec 2018 19:49:23 +0000 (19:49 +0000)]
[llvm-objcopy] Add --build-id-link-dir flag

This flag does not exist in GNU objcopy but has a major use case.
Debugging tools support the .build-id directory structure to find
debug binaries. There is no easy way to build this structure up
however. One way to do it is by using llvm-readelf and some crazy
shell magic. This implements the feature directly. It is most often
the case that you'll want to strip a file and send the original to
the .build-id directory but if you just want to send a file to the
.build-id directory you can copy to /dev/null instead.

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

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

5 years ago[InstCombine] add tests for shuffle+binop fold; NFC
Sanjay Patel [Mon, 3 Dec 2018 19:41:21 +0000 (19:41 +0000)]
[InstCombine] add tests for shuffle+binop fold; NFC

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

5 years ago[Hexagon] Change instruction type field in TSFlags to 7 bits
Krzysztof Parzyszek [Mon, 3 Dec 2018 19:34:04 +0000 (19:34 +0000)]
[Hexagon] Change instruction type field in TSFlags to 7 bits

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

5 years ago[llvm-tapi] initial commit, supports ELF text stubs
Armando Montanez [Mon, 3 Dec 2018 19:30:52 +0000 (19:30 +0000)]
[llvm-tapi] initial commit, supports ELF text stubs

http://lists.llvm.org/pipermail/llvm-dev/2018-September/126472.html

TextAPI is a library and accompanying tool that allows conversion between binary shared object stubs and textual counterparts. The motivations and uses cases for this are explained thoroughly in the llvm-dev proposal [1]. This initial commit proposes a potential structure for the TAPI library, also including support for reading/writing text-based ELF stubs (.tbe) in addition to preliminary support for reading binary ELF files. The goal for this patch is to ensure the project architecture appropriately welcomes integration of Mach-O stubbing from Apple's TAPI [2].

Added:

 - TextAPI library
 - .tbe read support
 - .tbe write (to raw_ostream) support

[1] http://lists.llvm.org/pipermail/llvm-dev/2018-September/126472.html
[2] https://github.com/ributzka/tapi

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

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

5 years ago[MachineOutliner] Drop candidates that require fixups if it's beneficial
Jessica Paquette [Mon, 3 Dec 2018 19:11:27 +0000 (19:11 +0000)]
[MachineOutliner] Drop candidates that require fixups if it's beneficial

If it's a bigger code size win to drop candidates that require stack fixups
than to demote every candidate to that variant, the outliner should do that.

This happens if the number of bytes taken by calls to functions that don't
require fixups, plus the number of bytes that'd be left is less than the
number of bytes that it'd take to emit a save + restore for all candidates.

Also add tests for each possible new behaviour.

- machine-outliner-compatible-candidates shows that when we have candidates
that don't use the stack, we can use the default call variant along with the
no save/regsave variant.

- machine-outliner-all-stack shows that when it's better to fix up the stack,
we still will demote all candidates to that case

- machine-outliner-drop-stack shows that we can discard candidates that
require stack fixups when it would be beneficial to do so.

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

5 years ago[Hexagon] Add HasV5 predicate for compatibility with auto-generated files
Krzysztof Parzyszek [Mon, 3 Dec 2018 19:05:42 +0000 (19:05 +0000)]
[Hexagon] Add HasV5 predicate for compatibility with auto-generated files

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

5 years agoFix issue with Tpi Stream hash map.
Zachary Turner [Mon, 3 Dec 2018 19:05:12 +0000 (19:05 +0000)]
Fix issue with Tpi Stream hash map.

Part of the patch to not build the hash map eagerly was omitted
due to a merge conflict.  Add it back, which should fix the failing
tests.

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

5 years ago[X86] Fix bad formatting. NFC
Craig Topper [Mon, 3 Dec 2018 18:58:57 +0000 (18:58 +0000)]
[X86] Fix bad formatting. NFC

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

5 years ago[Hexagon] Remove unused operand definitions, NFC
Krzysztof Parzyszek [Mon, 3 Dec 2018 18:54:24 +0000 (18:54 +0000)]
[Hexagon] Remove unused operand definitions, NFC

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

5 years ago[Hexagon] Some formatting changes, NFC
Krzysztof Parzyszek [Mon, 3 Dec 2018 18:40:15 +0000 (18:40 +0000)]
[Hexagon] Some formatting changes, NFC

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

5 years agoDon't build the Tpi Hash map by default.
Zachary Turner [Mon, 3 Dec 2018 18:32:05 +0000 (18:32 +0000)]
Don't build the Tpi Hash map by default.

This is very slow and should be done for specific cases where
lookups will need to happen.

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

5 years ago[X86] Teach LowerMUL/LowerMULH for vXi8 to unpack constant RHS.
Craig Topper [Mon, 3 Dec 2018 18:26:27 +0000 (18:26 +0000)]
[X86] Teach LowerMUL/LowerMULH for vXi8 to unpack constant RHS.

Summary:
We need to unpackl and unpackh the operands to use two vXi16 multiplies. Previously it looks like the low unpack would get constant folded at least in the 128-bit case after shuffle lowering turned the unpackl into ZERO_EXTEND_VECTOR_INREG and X86 custom DAG combined it. The same doesn't happen for the high half. So we'd load a constant and then shuffle it. But the low half would just be loaded and used by the multiply directly.

After this patch we now end up with a constant pool entry for the low and high unpacks separately with no shuffle operations.

This is a step towards removing custom constant folding for ZERO_EXTEND_VECTOR_INREG/SIGN_EXTEND_VECTOR_INREG in the X86 backend.

Reviewers: RKSimon, spatel

Reviewed By: RKSimon

Subscribers: llvm-commits

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

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

5 years ago[X86] Add DAG combine to combine a v8i32->v8i16 truncate with a packuswb that truncat...
Craig Topper [Mon, 3 Dec 2018 18:26:24 +0000 (18:26 +0000)]
[X86] Add DAG combine to combine a v8i32->v8i16 truncate with a packuswb that truncates v8i16->v8i8.

Summary:
Under -x86-experimental-vector-widening-legalization, fp_to_uint/fp_to_sint with a smaller than 128 bit vector type results are custom type legalized by promoting the result to a 128 bit vector by promoting the elements, inserting an assertzext/assertsext, then truncating back to original type. The truncate will be further legalizdd to a pack shuffle. In the case of a v8i8 result type, we'll end up with a v8i16 fp_to_sint. This will need to be further legalized during vector op legalization by promoting to v8i32 and then truncating again. Under avx2 this produces good code with two pack instructions, but Under avx512 this will result in a truncate instruction and a packuswb instruction. But we should be able to get away with a single truncate instruction.

The other option is to promote all the way to vXi32 result type during the first type legalization. But in some experimentation that seemed to require more work to produce good code for other configurations.

Reviewers: RKSimon, spatel

Reviewed By: RKSimon

Subscribers: llvm-commits

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

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

5 years agoFix non-modular build.
Adrian Prantl [Mon, 3 Dec 2018 18:07:03 +0000 (18:07 +0000)]
Fix non-modular build.

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

5 years agoUpdate Diagnostic handling for changes in CFE.
Adrian Prantl [Mon, 3 Dec 2018 17:55:29 +0000 (17:55 +0000)]
Update Diagnostic handling for changes in CFE.

The clang frontend no longer emits the current working directory for
DIFiles containing an absolute path in the filename: and will move the
common prefix between current working directory and the file into the
directory: component.

https://reviews.llvm.org/D55085

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

5 years ago[SimplifyCFG] add tests for cross block compare folding; NFC
Sanjay Patel [Mon, 3 Dec 2018 16:55:29 +0000 (16:55 +0000)]
[SimplifyCFG] add tests for cross block compare folding; NFC

These are the baseline tests for D54827.
Patch based on code originally written by: @yinyuefengyi (luo xionghu)

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

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

5 years ago[CmpInstAnalysis] fix formatting; NFC
Sanjay Patel [Mon, 3 Dec 2018 15:48:30 +0000 (15:48 +0000)]
[CmpInstAnalysis] fix formatting; NFC

There are potential improvements to the structure of this API
raised by D54994, but remove some cosmetic blemishes before
making any functional changes.

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

5 years agoFix line endings. NFCI.
Simon Pilgrim [Mon, 3 Dec 2018 14:55:09 +0000 (14:55 +0000)]
Fix line endings. NFCI.

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

5 years agoFixing -print-module-scope for legacy SCC passes
Fedor Sergeev [Mon, 3 Dec 2018 14:48:15 +0000 (14:48 +0000)]
Fixing -print-module-scope for legacy SCC passes

It appears that print-module-scope was not implemented for legacy SCC passes.
Fixed to print a whole module instead of just current SCC.

Reviewed By: mkazantsev
Differential Revision: https://reviews.llvm.org/D54793

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