149087 Commits

Author SHA1 Message Date
Eric Beckmann
baef3d539e Revert "Hopefully one last commit to fix this patch, addresses string reference"
Summary:
This reverts commit 56beec1b1cfc6d263e5eddb7efff06117c0724d2.

Revert "Quick fix to D32609, it seems .o files are not transferred in all cases."

This reverts commit 7652eecd29cfdeeab7f76f687586607a99ff4e36.

Revert "Update llvm-readobj -coff-resources to display tree structure."

This reverts commit 422b62c4d302cfc92401418c2acd165056081ed7.

Reviewers: zturner

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302397 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-08 02:25:03 +00:00
Eric Beckmann
fffb7130dd Hopefully one last commit to fix this patch, addresses string reference
issues.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302395 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-08 01:48:55 +00:00
Eric Beckmann
a03681ed23 Quick fix to D32609, it seems .o files are not transferred in all cases.
Therefore the .o file in question is renamed to .obj.coff.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302388 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-07 23:31:14 +00:00
Eric Beckmann
4899f6643e Update llvm-readobj -coff-resources to display tree structure.
Summary: Continue making updates to llvm-readobj to display resource sections.  This is necessary for testing the up and coming cvtres tool.

Reviewers: zturner

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302386 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-07 22:47:22 +00:00
Craig Topper
677051d58f [ConstantRange][SimplifyCFG] Add a helper method to allow SimplifyCFG to determine if a ConstantRange has more than 8 elements without requiring an allocation if the ConstantRange is 64-bits wide.
Previously SimplifyCFG used getSetSize which returns an APInt that is 1 bit wider than the ConstantRange's bit width. In the reasonably common case that the ConstantRange is 64-bits wide, this requires returning a 65-bit APInt. APInt's can only store 64-bits without a memory allocation so this is inefficient.

The new method takes the 8 as an input and tells if the range contains more than that many elements without requiring any wider math.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302385 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-07 22:22:11 +00:00
Craig Topper
34ad4ae921 [ConstantRange] Remove 'Of' from name of ConstantRange::isSizeStrictlySmallerThanOf so that it reads better. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302383 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-07 21:48:08 +00:00
Simon Pilgrim
8d84aa2cce [X86][AVX1] Improve 256-bit vector costs for integer unary intrinsics.
Account for subvector extraction/insertion, helps prevent the vectorizers from selecting 256-bit vectors that will have to be split anyhow on AVX1 targets. 

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302378 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-07 20:58:55 +00:00
Lang Hames
33aa99e46a [Orc] Remove trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302377 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-07 20:39:46 +00:00
Sanjay Patel
b742cd68a5 [InstSimplify] add tests for PR32949 miscompile; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302374 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-07 18:19:13 +00:00
Zvi Rackover
88c686221f InstructionSimplify: Relanding r301766
Summary:
Re-applying r301766 with a fix to a typo and a regression test.

The log message for r301766 was:
==================================================================================
    InstructionSimplify: Canonicalize shuffle operands. NFC-ish.

    Summary:
     Apply canonicalization rules:
        1. Input vectors with no elements selected from can be replaced with undef.
        2. If only one input vector is constant it shall be the second one.

    This allows constant-folding to cover more ad-hoc simplifications that
    were in place and avoid duplication for RHS and LHS checks.

    There are more rules we may want to add in the future when we see a
    justification. e.g. mask elements that select undef elements can be
    replaced with undef.
==================================================================================

Reviewers: spatel, RKSimon

Reviewed By: spatel

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302373 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-07 18:16:37 +00:00
Lang Hames
e3f371483f Make llvm-rtdlyd -check preserve automatic address mappings made by RuntimeDyld.
Currently llvm-rtdyld in -check mode will map sections to back-to-back 4k
aligned slabs starting at 0x1000. Automatically remapping sections by default is
helpful because it quickly exposes relocation bugs due to use of local addresses
rather than load addresses (these would silently pass if the load address was
not remapped). These mappings can be explicitly overridden on a per-section
basis using llvm-rtdlyd's -map-section option. This patch extends this scheme to
also preserve any mappings made by RuntimeDyld itself. Preserving RuntimeDyld's
automatic mappings allows us to write test cases to verify that these automatic
mappings have been applied.

This will allow the fix in https://reviews.llvm.org/D32899 to be tested with
llvm-rtdyld -check.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302372 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-07 17:19:53 +00:00
Craig Topper
038bc52dc9 [SCEV] Use move semantics in ScalarEvolution::setRange
Summary: This makes setRange take ConstantRange by rvalue reference since most callers were passing an unnamed temporary ConstantRange. We can then move that ConstantRange into the DenseMap caches. For the callers that weren't passing a temporary, I've added std::move to to the local variable being passed.

Reviewers: sanjoy, mzolotukhin, efriedma

Reviewed By: sanjoy

Subscribers: takuto.ikuta, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302371 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-07 16:28:17 +00:00
Sanjay Patel
2a7ef8d5f2 [InstSimplify] use ConstantRange to simplify or-of-icmps
We can simplify (or (icmp X, C1), (icmp X, C2)) to 'true' or one of the icmps in many cases.
I had to check some of these with Alive to prove to myself it's right, but everything seems 
to check out. Eg, the deleted code in instcombine was completely ignoring predicates with
mismatched signedness.

This is a follow-up to:
https://reviews.llvm.org/rL301260
https://reviews.llvm.org/D32143


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302370 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-07 15:11:40 +00:00
Peter Szecsi
2c224bcd52 [Kaleidoscope] toy.cpp use after move fix
The variable Proto is moved at the beginning of the codegen() function.
According to the comment above, the pointed object should be used due the
reference P.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302369 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-07 11:00:01 +00:00
Sanjoy Das
8582763b65 Remove unnecessary const_cast
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302368 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-07 05:29:36 +00:00
Sanjoy Das
23430d8ce1 Use array_pod_sort instead of std::sort
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302367 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-07 05:29:34 +00:00
Lang Hames
98dab84b5c Fix comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302366 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-07 03:54:53 +00:00
Saleem Abdulrasool
731d5fe6e9 COFF: add ARM64 relocation types
Add the ARM64 COFF relocation types.  This will be needed to add support
for the AArch64 Windows object file emission support.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302365 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-06 23:48:02 +00:00
Simon Pilgrim
93ed699220 [X86][AVX512] Relax assertion and just exit combine for unsupported types (PR32907)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302361 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-06 20:53:52 +00:00
Simon Pilgrim
a299d1ac39 [X86][AVX512] Move v2i64/v4i64 VPABS lowering to tablegen
Extend NoVLX targets to use the 512-bit versions

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302359 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-06 19:11:59 +00:00
Simon Pilgrim
3f0b5e2dd0 [X86] Reduce code for setting operations actions by merging into loops across multiple types/ops. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302357 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-06 18:17:56 +00:00
Simon Pilgrim
cd67ae1c63 [NVPTX] Add support for ISD::ABS lowering
Use the ISD::ABS opcode directly

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302356 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-06 17:42:09 +00:00
Simon Pilgrim
ad814518f6 [X86][SSE] Break register dependencies on v16i8/v8i16 BUILD_VECTOR on SSE41
rL294581 broke unnecessary register dependencies on partial v16i8/v8i16 BUILD_VECTORs, but on SSE41 we (currently) use insertion for full BUILD_VECTORs as well. By allowing full insertion to occur on SSE41 targets we can break register dependencies here as well.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302355 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-06 17:30:39 +00:00
Brian Gesiak
8a886c7975 [Analysis] Print out unreachable loops
Summary:
When writing a loop pass I made a mistake and hit the assertion
"Unreachable block in loop". Later, I hit an assertion when I called
`BasicBlock::eraseFromParent()` incorrectly: "Use still stuck around
after Def is destroyed". This latter assertion, however, printed out
exactly which value is being deleted and what uses remain, which helped
me debug the issue.

To help people debugging their loop passes in the future, print out
exactly which basic block is unreachable in a loop.

Reviewers: sanjoy, hfinkel, mehdi_amini

Reviewed By: mehdi_amini

Subscribers: mzolotukhin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302354 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-06 16:22:53 +00:00
Simon Pilgrim
88a4e3bee5 [X86][AVX2] Add scheduling latency/throughput tests for some AVX2 instructions
Many more to come...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302338 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-06 13:46:09 +00:00
Simon Pilgrim
461798230c [DAGCombiner] If ISD::ABS is legal/custom, use it directly instead of canonicalizing first.
Remove an extra canonicalization step if ISD::ABS is going to be used anyway.

Updated x86 abs combine to check that we are lowering from both canonicalizations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302337 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-06 13:44:42 +00:00
Craig Topper
74fe5ca724 [SCEV] Remove extra APInt copies from getRangeForAffineARHelper.
This changes one parameter to be a const APInt& since we only read from it. Use std::move on local APInts once they are no longer needed so we can reuse their allocations. Lastly, use operator+=(uint64_t) instead of adding 1 to an APInt twice creating a new APInt each time.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302335 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-06 06:03:07 +00:00
Craig Topper
f5a46e85a5 [SCEV] Use std::move to avoid some APInt copies.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302334 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-06 05:22:56 +00:00
Craig Topper
f1e55e53fd [SCEV] Use APInt's uint64_t operations instead of creating a temporary APInt to hold 1.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302333 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-06 05:15:11 +00:00
Craig Topper
7ab4d4886e [SCEV] Avoid a couple APInt copies by capturing by reference since the method returns a reference.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302332 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-06 05:15:09 +00:00
Craig Topper
583a25140f [LazyValueInfo] Avoid unnecessary copies of ConstantRanges
Summary:
ConstantRange contains two APInts which can allocate memory if their width is larger than 64-bits. So we shouldn't copy it when we can avoid it.

This changes LVILatticeVal::getConstantRange() to return its internal ConstantRange by reference. This allows many places that just need a ConstantRange reference to avoid making a copy.

Several places now capture the return value of getConstantRange() by reference so they can call methods on it that don't need a new object.

Lastly it adds std::move in one place to capture to move a local ConstantRange into an LVILatticeVal.

Reviewers: reames, dberlin, sanjoy, anna

Reviewed By: reames

Subscribers: grandinj, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302331 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-06 03:35:15 +00:00
Kamil Rytarowski
3ff0533844 Note addition of NetBSD support in googletest
Recreated patch for __NetBSD__ has been pushed upstream to Google.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302329 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-06 02:45:42 +00:00
Kostya Serebryany
9d90a01faf [sanitizer-coverage] implement -fsanitize-coverage=no-prune,... instead of a hidden -mllvm flag. llvm part.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302319 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-05 23:14:40 +00:00
Quentin Colombet
ce22b10a6e [RegisterBankInfo] Uniquely allocate instruction mapping.
This is a step toward having statically allocated instruciton mapping.
We are going to tablegen them eventually, so let us reflect that in
the API.

NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302316 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-05 22:48:22 +00:00
Craig Topper
58d2d9869a [BitVector] Improve the description of the BitVector::clear to say it removes the bits rather than clearing since clearing could be interpreted as just zeroing. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302315 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-05 22:46:40 +00:00
Craig Topper
da0638fc06 Fix spelling error in command line option description. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302311 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-05 22:31:11 +00:00
Eugene Zelenko
e5dc33d4f6 [IR] Fix some Clang-tidy modernize-use-using warnings; other minor fixes (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302310 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-05 22:30:37 +00:00
Easwaran Raman
66092ae0e8 Override invalidate of ProfileSummaryInfo to return false.
Differential revision: https://reviews.llvm.org/D32775

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302308 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-05 22:15:09 +00:00
Krzysztof Parzyszek
3804dab793 [Hexagon] Disable predicated calls by default
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302307 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-05 22:13:57 +00:00
Krzysztof Parzyszek
b5c0fee11c [Hexagon] Remove C6 and C7 as separate registers
These are M0 and M1. Removing duplicated registers reduces the number
of explicit register aliasing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302306 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-05 22:12:12 +00:00
Krzysztof Parzyszek
6d59bf7ade [RDF] Remove covered parts of reached uses for phi and use in same block
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302305 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-05 22:10:32 +00:00
Matthias Braun
97beda0626 ARM: Compute MaxCallFrame size early
This exposes a method in MachineFrameInfo that calculates
MaxCallFrameSize and calls it after instruction selection in the ARM
target.

This avoids
ARMBaseRegisterInfo::canRealignStack()/ARMFrameLowering::hasReservedCallFrame()
giving different answers in early/late phases of codegen.

The testcase shows a particular nasty example result of that where we
would fail to properly align an alloca.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302303 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-05 22:04:05 +00:00
Zachary Turner
4a6f9ee16e [CodeView] Reserve TypeDatabase records up front.
Most of the time we know exactly how many type records we
have in a list, and we want to use the visitor to deserialize
them into actual records in a database.  Previously we were
just using push_back() every time without reserving the space
up front in the vector.  This is obviously terrible from a
performance standpoint, and it's not uncommon to have PDB
files with half a million type records, where the performance
degredation was quite noticeable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302302 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-05 22:02:37 +00:00
Matthias Braun
4463e11348 Add missing target triple to test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302301 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-05 21:50:26 +00:00
Zachary Turner
1ed19d1faa Fix -Wreorder warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302294 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-05 21:25:31 +00:00
Zachary Turner
ba512990af [StreamArray] Pipe the Offset through the constructor.
When randomly accessing an element by offset, we weren't passing
the offset through so if you called .offset() it would return a
value of 0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302292 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-05 21:15:31 +00:00
Kannan Narayanan
96d48fac54 [AMDGPU] In the new waitcnt insertion pass, use getHeader
instead of getTopBlock to find the loop header.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302290 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-05 21:10:17 +00:00
Matthias Braun
0cb25a2a10 MIParser/MIRPrinter: Compute block successors if not explicitely specified
- MIParser: If the successor list is not specified successors will be
  added based on basic block operands in the block and possible
  fallthrough.

- MIRPrinter: Adds a new `simplify-mir` option, with that option set:
  Skip printing of block successor lists in cases where the
  parser is guaranteed to reconstruct it. This means we still print the
  list if some successor cannot be determined (happens for example for
  jump tables), if the successor order changes or branch probabilities
  being unequal.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302289 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-05 21:09:30 +00:00
Simon Pilgrim
4468ee17b8 [X86] Use SDValue::getConstantOperandVal helper. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302286 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-05 20:53:52 +00:00
Matthias Braun
738a26c4e2 TargetLibraryInfo: Introduce wcslen
wcslen is part of the C99 and C++98 standards.

- This introduces the function to TargetLibraryInfo.
- Also set attributes for wcslen in llvm::inferLibFuncAttributes().

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302278 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-05 20:25:50 +00:00