OSDN Git Service

android-x86/external-llvm.git
5 years ago[DWARF] Delete a stray break and a stray comment. NFC
Fangrui Song [Sat, 23 Mar 2019 16:15:40 +0000 (16:15 +0000)]
[DWARF] Delete a stray break and a stray comment. NFC

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

5 years ago[X86][SLP] Show example of failure to uniformly commute splats for 'alt' shuffles.
Simon Pilgrim [Sat, 23 Mar 2019 16:14:04 +0000 (16:14 +0000)]
[X86][SLP] Show example of failure to uniformly commute splats for 'alt' shuffles.

If either the main/alt opcodes isn't commutable we may end up with the splats not correctly commuted to the same side.

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

5 years ago[x86] reduce code duplication; NFC
Sanjay Patel [Sat, 23 Mar 2019 15:00:52 +0000 (15:00 +0000)]
[x86] reduce code duplication; NFC

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

5 years ago[SLPVectorizer] reorderInputsAccordingToOpcode - use InstructionState directly. NFCI.
Simon Pilgrim [Sat, 23 Mar 2019 13:44:06 +0000 (13:44 +0000)]
[SLPVectorizer] reorderInputsAccordingToOpcode - use InstructionState directly. NFCI.

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

5 years ago[LowerSwitch] Use ConstantRange::fromKnownBits(); NFC
Nikita Popov [Sat, 23 Mar 2019 12:48:54 +0000 (12:48 +0000)]
[LowerSwitch] Use ConstantRange::fromKnownBits(); NFC

Using an unsigned range to stay NFC, but a signed range would really
be more useful here.

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

5 years ago[SLPVectorizer] Don't repeat VL.size() call. NFCI.
Simon Pilgrim [Sat, 23 Mar 2019 12:11:25 +0000 (12:11 +0000)]
[SLPVectorizer] Don't repeat VL.size() call. NFCI.

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

5 years ago [DebugInfo] follow up for "add SectionedAddress to DebugInfo interfaces"
Alexey Lapshin [Sat, 23 Mar 2019 08:08:40 +0000 (08:08 +0000)]
  [DebugInfo] follow up for "add SectionedAddress to DebugInfo interfaces"

  [Symbolizer] Add getModuleSectionIndexForAddress() helper routine

  The https://reviews.llvm.org/D58194 patch changed symbolizer interface.
  Particularily it requires not only Address but SectionIndex also.
  Note object::SectionedAddress parameter:

  Expected<DILineInfo> symbolizeCode(const std::string &ModuleName,
                                   object::SectionedAddress ModuleOffset,
                                   StringRef DWPName = "");

  There are callers of symbolizer which do not know particular section index.
  That patch creates getModuleSectionIndexForAddress() routine which
  will detect section index for the specified address. Thus if caller
  set ModuleOffset.SectionIndex into object::SectionedAddress::UndefSection
  state then symbolizer would detect section index using
  getModuleSectionIndexForAddress routine.

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

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

5 years ago[gn] Add clang-tools-extra/clang-tidy/tool/BUILD.gn
Vitaly Buka [Sat, 23 Mar 2019 02:31:23 +0000 (02:31 +0000)]
[gn] Add clang-tools-extra/clang-tidy/tool/BUILD.gn

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

5 years ago[gn] Add clang-tools-extra/clang-tidy/tool/BUILD.gn
Vitaly Buka [Sat, 23 Mar 2019 02:20:48 +0000 (02:20 +0000)]
[gn] Add clang-tools-extra/clang-tidy/tool/BUILD.gn

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

5 years agoDisable MachO TBD write tests for Windows.
Juergen Ributzka [Sat, 23 Mar 2019 00:03:23 +0000 (00:03 +0000)]
Disable MachO TBD write tests for Windows.

The tests are failing on the windows bots. I am disabling them for now.
This is a followup to r356820.

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

5 years ago[Legacy][TimePasses] allow -time-passes reporting into a custom stream
Fedor Sergeev [Fri, 22 Mar 2019 23:11:08 +0000 (23:11 +0000)]
[Legacy][TimePasses] allow -time-passes reporting into a custom stream

As a followup to newpm -time-passes fix (D59366), now adding a similar
functionality to legacy time-passes.

Enhancing llvm::reportAndResetTimings to accept an optional stream
for reporting output. By default it still reports into the stream created
by CreateInfoOutputFile (-info-output-file).

Also fixing to actually reset after printing as declared.

Reviewed By: philip.pfaffe
Differential Revision: https://reviews.llvm.org/D59416

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

5 years agoFollowup for r356820 to fix the bots.
Juergen Ributzka [Fri, 22 Mar 2019 23:10:51 +0000 (23:10 +0000)]
Followup for r356820 to fix the bots.

Try using a move constructor instead.

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

5 years ago[TextAPI] TBD Reader/Writer
Juergen Ributzka [Fri, 22 Mar 2019 22:46:52 +0000 (22:46 +0000)]
[TextAPI] TBD Reader/Writer

Add basic infrastructure for reading and writting TBD files (version 1 - 3).

The TextAPI library is not used by anything yet (besides the unit tests). Tool
support will be added in a separate commit.

The TBD format is currently documented in the implementation file (TextStub.cpp).

https://reviews.llvm.org/D53945

Update: This contains changes to fix issues discovered by the bots:
 - add parentheses to silence warnings.
 - rename variables
 - use PlatformType from BinaryFormat
 - Trying if switching from a vector to an array will appeas the bots.
 - Replace the tuple with a struct to work around an explicit constructor bug.
 - This fixes an issue where we were leaking the YAML document if there was a
   parsing error.

Updated the license information in all files.

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

5 years ago[SLP] Remove redundancy of performing operand reordering twice: once in buildTree...
Simon Pilgrim [Fri, 22 Mar 2019 21:27:11 +0000 (21:27 +0000)]
[SLP] Remove redundancy of performing operand reordering twice: once in buildTree() and later in vectorizeTree().

This is a refactoring patch that removes the redundancy of performing operand reordering twice, once in buildTree() and later in vectorizeTree().
To achieve this we need to keep track of the operands within the TreeEntry struct while building the tree, and later in vectorizeTree() we are just accessing them from the TreeEntry in the right order.

This patch is the first in a series of patches that will allow for better operand reordering across chains of instructions (e.g., a chain of ADDs), as presented here: https://www.youtube.com/watch?v=gIEn34LvyNo

Patch by: @vporpo (Vasileios Porpodas)

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

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

5 years ago[pdb] Add -type-stats and sort stats by descending size
Reid Kleckner [Fri, 22 Mar 2019 21:22:13 +0000 (21:22 +0000)]
[pdb] Add -type-stats and sort stats by descending size

Summary:
It prints this on chromium browser_tests.exe.pdb:

  Types
           Total: 5647475 entries ( 371,897,512 bytes,   65.85 avg)
  --------------------------------------------------------------------------
        LF_CLASS:  397894 entries ( 119,537,780 bytes,  300.43 avg)
    LF_STRUCTURE:  236351 entries (  83,208,084 bytes,  352.05 avg)
    LF_FIELDLIST:  291003 entries (  66,087,920 bytes,  227.10 avg)
    LF_MFUNCTION: 1884176 entries (  52,756,928 bytes,   28.00 avg)
      LF_POINTER: 1149030 entries (  13,877,344 bytes,   12.08 avg)
      LF_ARGLIST:  789980 entries (  12,436,752 bytes,   15.74 avg)
   LF_METHODLIST:  361498 entries (   8,351,008 bytes,   23.10 avg)
         LF_ENUM:   16069 entries (   6,108,340 bytes,  380.13 avg)
    LF_PROCEDURE:  269374 entries (   4,309,984 bytes,   16.00 avg)
     LF_MODIFIER:  235602 entries (   2,827,224 bytes,   12.00 avg)
        LF_UNION:    9131 entries (   2,072,168 bytes,  226.94 avg)
      LF_VFTABLE:     323 entries (     207,784 bytes,  643.29 avg)
        LF_ARRAY:    6639 entries (     106,380 bytes,   16.02 avg)
      LF_VTSHAPE:     126 entries (       6,472 bytes,   51.37 avg)
     LF_BITFIELD:     278 entries (       3,336 bytes,   12.00 avg)
        LF_LABEL:       1 entries (           8 bytes,    8.00 avg)

The PDB is overall 1.9GB, so the LF_CLASS and LF_STRUCTURE declarations
account for about 10% of the overall file size. I was surprised to find
that on average LF_FIELDLIST records are short. Maybe this is because
there are many more types with short member lists than there are
instantiations with lots of members, like std::vector.

Reviewers: aganea, zturner

Subscribers: llvm-commits

Tags: #llvm

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

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

5 years agoRevert "[llvm-readobj] Separate `Symbol Version` dumpers into `LLVM style` and `GNU...
Douglas Yung [Fri, 22 Mar 2019 21:07:57 +0000 (21:07 +0000)]
Revert "[llvm-readobj] Separate `Symbol Version` dumpers into `LLVM style` and `GNU style`"

This reverts commit 94a0cffe250c1cd6b8fea5607be502cadf617bdc (r356764).

This change was originally committed in r356764, but then partially
reverted in r356777 due to "bad changes". This caused test failures
because the test changes committed along with the original change
were not reverted, so this change reverts the rest of the changes.

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

5 years ago[TargetLowering] SimplifyDemandedBits trunc(srl(x, C1)) - early out for out of range...
Simon Pilgrim [Fri, 22 Mar 2019 20:53:49 +0000 (20:53 +0000)]
[TargetLowering] SimplifyDemandedBits trunc(srl(x, C1)) - early out for out of range C1. NFCI.

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

5 years ago[ARM] Don't form "ands" when it isn't scheduled correctly.
Eli Friedman [Fri, 22 Mar 2019 20:49:15 +0000 (20:49 +0000)]
[ARM] Don't form "ands" when it isn't scheduled correctly.

In r322972/r323136, the iteration here was changed to catch cases at the
beginning of a basic block... but we accidentally deleted an important
safety check.  Restore that check to the way it was.

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

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

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

5 years ago[X86] Use xmm registers to implement 64-bit popcnt on 32-bit targets if possible...
Craig Topper [Fri, 22 Mar 2019 20:47:02 +0000 (20:47 +0000)]
[X86] Use xmm registers to implement 64-bit popcnt on 32-bit targets if possible if popcnt instruction is not available

On 32-bit targets without popcnt, we currently expand 64-bit popcnt to sequences of arithmetic and logic ops for each 32-bit half and then add the 32 bit halves together. If we have xmm registers we can use use those to implement the operation instead. This results in less instructions then doing two separate 32-bit popcnt sequences.

This mitigates some of PR41151 for the i64 on i686 case when we have SSE2.

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

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

5 years ago[X86] Use movq for i64 atomic load on 32-bit targets when sse2 is enable
Craig Topper [Fri, 22 Mar 2019 20:46:56 +0000 (20:46 +0000)]
[X86] Use movq for i64 atomic load on 32-bit targets when sse2 is enable

We used a lock cmpxchg8b to do i64 atomic loads. But if we have SSE2 we can do better and use a plain movq to do the load instead.

I tried to just use an f64 atomic load and add isel patterns to MOVSD(which the domain fixing pass can turn to MOVQ), but the atomic_load SDNode in TargetSelectionDAG.td requires the type to be integer.

So I've emitted VZEXT_LOAD instead which should be selected by isel to a MOVQ. Hopefully we don't need a specific atomic flavor of this. I kept the memory operand from the original AtomicSDNode. I wasn't sure if I might need to set the MOVolatile flag?

I've left some FIXMEs for improvements we can do without SSE2.

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

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

5 years agoFix non-determinism in Reassociate caused by address coincidences
Daniel Sanders [Fri, 22 Mar 2019 20:16:35 +0000 (20:16 +0000)]
Fix non-determinism in Reassociate caused by address coincidences

Summary:
Between building the pair map and querying it there are a few places that
erase and create Values. It's rare but the address of these newly created
Values is occasionally the same as a just-erased Value that we already
have in the pair map. These coincidences should be accounted for to avoid
non-determinism.

Thanks to Roman Tereshin for the test case.

Reviewers: rtereshin, bogner

Reviewed By: rtereshin

Subscribers: mgrang, llvm-commits

Tags: #llvm

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

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

5 years ago[KnownBits] Add const to some methods. NFC
Bjorn Pettersson [Fri, 22 Mar 2019 19:36:51 +0000 (19:36 +0000)]
[KnownBits] Add const to some methods. NFC

Add "const" to the trunc, zext, sext and zextOrTrunc
methods to make it clear that they aren't updating
the object itself.

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

5 years ago[AArch64, ARM] Add support for Exynos M5
Evandro Menezes [Fri, 22 Mar 2019 18:42:14 +0000 (18:42 +0000)]
[AArch64, ARM] Add support for Exynos M5

Add Exynos M5 support and test cases.

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

5 years ago[ARM] [NFC] Use tGPR in patterns where appropriate.
Eli Friedman [Fri, 22 Mar 2019 18:37:26 +0000 (18:37 +0000)]
[ARM] [NFC] Use tGPR in patterns where appropriate.

This doesn't have any practical effect at the moment, as far as I know,
because high registers aren't allocatable in Thumb1 mode. But it might
matter in the future.

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

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

5 years ago[SLP] fix variables names in test; NFC
Sanjay Patel [Fri, 22 Mar 2019 18:33:11 +0000 (18:33 +0000)]
[SLP] fix variables names in test; NFC

'tmpXXX' conflicts with the auto-generated script regex names.
That could cause mask a bug or fail if the output changes.

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

5 years agoIR: Support parsing numeric block ids, and emit them in textual output.
James Y Knight [Fri, 22 Mar 2019 18:27:13 +0000 (18:27 +0000)]
IR: Support parsing numeric block ids, and emit them in textual output.

Just as as llvm IR supports explicitly specifying numeric value ids
for instructions, and emits them by default in textual output, now do
the same for blocks.

This is a slightly incompatible change in the textual IR format.

Previously, llvm would parse numeric labels as string names. E.g.
  define void @f() {
    br label %"55"
  55:
    ret void
  }
defined a label *named* "55", even without needing to be quoted, while
the reference required quoting. Now, if you intend a block label which
looks like a value number to be a name, you must quote it in the
definition too (e.g. `"55":`).

Previously, llvm would print nameless blocks only as a comment, and
would omit it if there was no predecessor. This could cause confusion
for readers of the IR, just as unnamed instructions did prior to the
addition of "%5 = " syntax, back in 2008 (PR2480).

Now, it will always print a label for an unnamed block, with the
exception of the entry block. (IMO it may be better to print it for
the entry-block as well. However, that requires updating many more
tests.)

Thus, the following is supported, and is the canonical printing:
  define i32 @f(i32, i32) {
    %3 = add i32 %0, %1
    br label %4

  4:
    ret i32 %3
  }

New test cases covering this behavior are added, and other tests
updated as required.

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

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

5 years ago[X86] Regenerate powi tests to include i686 x87/sse targets
Simon Pilgrim [Fri, 22 Mar 2019 18:04:28 +0000 (18:04 +0000)]
[X86] Regenerate powi tests to include i686 x87/sse targets

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

5 years ago[X86] Add PR13897 test case (i128 mul on i686)
Simon Pilgrim [Fri, 22 Mar 2019 17:52:21 +0000 (17:52 +0000)]
[X86] Add PR13897 test case (i128 mul on i686)

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

5 years ago[ValueTracking] Avoid redundant known bits calculation in computeOverflowForSignedAdd()
Nikita Popov [Fri, 22 Mar 2019 17:51:40 +0000 (17:51 +0000)]
[ValueTracking] Avoid redundant known bits calculation in computeOverflowForSignedAdd()

We're already computing the known bits of the operands here. If the
known bits of the operands can determine the sign bit of the result,
we'll already catch this in signedAddMayOverflow(). The only other
way (and as the comment already indicates) we'll get new information
from computing known bits on the whole add, is if there's an assumption
on it.

As such, we change the code to only compute known bits from assumptions,
instead of computing full known bits on the add (which would unnecessarily
recompute the known bits of the operands as well).

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

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

5 years ago[X86] lowerShuffleAsBitMask - ensure float bit masks are the correct width (PR41203)
Simon Pilgrim [Fri, 22 Mar 2019 17:23:55 +0000 (17:23 +0000)]
[X86] lowerShuffleAsBitMask - ensure float bit masks are the correct width (PR41203)

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

5 years ago[AliasAnalysis] Second prototype to cache BasicAA / anyAA state.
Alina Sbirlea [Fri, 22 Mar 2019 17:22:19 +0000 (17:22 +0000)]
[AliasAnalysis] Second prototype to cache BasicAA / anyAA state.

Summary:
Adding contained caching to AliasAnalysis. BasicAA is currently the only one using it.

AA changes:
- This patch is pulling the caches from BasicAAResults to AAResults, meaning the getModRefInfo call benefits from the IsCapturedCache as well when in "batch mode".
- All AAResultBase implementations add the QueryInfo member to all APIs. AAResults APIs maintain wrapper APIs such that all alias()/getModRefInfo call sites are unchanged.
- AA now provides a BatchAAResults type as a wrapper to AAResults. It keeps the AAResults instance and a QueryInfo instantiated to batch mode. It delegates all work to the AAResults instance with the batched QueryInfo. More API wrappers may be needed in BatchAAResults; only the minimum needed is currently added.

MemorySSA changes:
- All walkers are now templated on the AA used (AliasAnalysis=AAResults or BatchAAResults).
- At build time, we optimize uses; now we create a local walker (lives only as long as OptimizeUses does) using BatchAAResults.
- All Walkers have an internal AA and only use that now, never the AA in MemorySSA. The Walkers receive the AA they will use when built.

- The walker we use for queries after the build is instantiated on AliasAnalysis and is built after building MemorySSA and setting AA.
- All static methods doing walking are now templated on AliasAnalysisType if they are used both during build and after. If used only during build, the method now only takes a BatchAAResults. If used only after build, the method now takes an AliasAnalysis.

Subscribers: sanjoy, arsenm, jvesely, nhaehnle, jlebar, george.burgess.iv, llvm-commits

Tags: #llvm

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

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

5 years ago[Tests] Add masked.gather tests for non-constant masks + speculation possibilities
Philip Reames [Fri, 22 Mar 2019 16:39:04 +0000 (16:39 +0000)]
[Tests] Add masked.gather tests for non-constant masks + speculation possibilities

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

5 years ago[ConstantFolding] Fix GetConstantFoldFPValue to avoid cast overflow.
Bixia Zheng [Fri, 22 Mar 2019 16:37:37 +0000 (16:37 +0000)]
[ConstantFolding] Fix GetConstantFoldFPValue to avoid cast overflow.

Summary:
In C++, the behavior of casting a double value that is beyond the range
of a single precision floating-point to a float value is undefined. This
change replaces such a cast with APFloat::convert to convert the value,
which is consistent with how we convert a double value to a half value.

Reviewers: sanjoy

Subscribers: lebedev.ri, sanjoy, jlebar, llvm-commits

Tags: #llvm

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

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

5 years agoMake clang-move use same file naming convention as other tools
Nico Weber [Fri, 22 Mar 2019 16:34:39 +0000 (16:34 +0000)]
Make clang-move use same file naming convention as other tools

In all the other clang-foo tools, the main library file is called
Foo.cpp and the file in the tool/ folder is called ClangFoo.cpp.
Do this for clang-move too.

No intended behavior change.

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

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

5 years ago[tests] Add a generic masked.gather test to show sometimes we can't transform
Philip Reames [Fri, 22 Mar 2019 16:30:56 +0000 (16:30 +0000)]
[tests] Add a generic masked.gather test to show sometimes we can't transform

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

5 years ago[tests] Add tests for converting masked.load to load speculatively
Philip Reames [Fri, 22 Mar 2019 16:26:57 +0000 (16:26 +0000)]
[tests] Add tests for converting masked.load to load speculatively

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

5 years ago[llvm-readobj] Revert bad changes
Xing GUO [Fri, 22 Mar 2019 16:20:54 +0000 (16:20 +0000)]
[llvm-readobj] Revert bad changes

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

5 years ago[Tests] Use valid alignment in masked.gather tests
Philip Reames [Fri, 22 Mar 2019 16:20:24 +0000 (16:20 +0000)]
[Tests] Use valid alignment in masked.gather tests

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

5 years agogn build: Merge r356750
Nico Weber [Fri, 22 Mar 2019 16:00:16 +0000 (16:00 +0000)]
gn build: Merge r356750

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

5 years agogn build: Merge r356570
Nico Weber [Fri, 22 Mar 2019 15:58:33 +0000 (15:58 +0000)]
gn build: Merge r356570

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

5 years agogn build: Merge r356662
Nico Weber [Fri, 22 Mar 2019 15:56:33 +0000 (15:56 +0000)]
gn build: Merge r356662

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

5 years agogn build: Merge r356692
Nico Weber [Fri, 22 Mar 2019 15:54:29 +0000 (15:54 +0000)]
gn build: Merge r356692

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

5 years agoInstCombineSimplifyDemanded: Allow v3 results for AMDGCN buffer and image intrinsics
Tim Renouf [Fri, 22 Mar 2019 15:53:50 +0000 (15:53 +0000)]
InstCombineSimplifyDemanded: Allow v3 results for AMDGCN buffer and image intrinsics

This helps to avoid the situation where RA spots that only 3 of the
v4f32 result of a load are used, and immediately reallocates the 4th
register for something else, requiring a stall waiting for the load.

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

Change-Id: I947661edfd5715f62361a02b100f14aeeada29aa

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

5 years agogn build: Merge r356753
Nico Weber [Fri, 22 Mar 2019 15:50:24 +0000 (15:50 +0000)]
gn build: Merge r356753

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

5 years agogn build: Merge r356652 (and follow-up r56655)
Nico Weber [Fri, 22 Mar 2019 15:48:11 +0000 (15:48 +0000)]
gn build: Merge r356652 (and follow-up r56655)

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

5 years agogn build: Merge r356729
Nico Weber [Fri, 22 Mar 2019 15:43:06 +0000 (15:43 +0000)]
gn build: Merge r356729

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

5 years ago[llvm-readobj] Separate `Symbol Version` dumpers into `LLVM style` and `GNU style`
Xing GUO [Fri, 22 Mar 2019 15:42:13 +0000 (15:42 +0000)]
[llvm-readobj] Separate `Symbol Version` dumpers into `LLVM style` and `GNU style`

Summary:
Currently, llvm-readobj can dump symbol version sections only in LLVM style. In this patch, I would like to separate these dumpers into GNU style and
LLVM style for future implementation.

Reviewers: grimar, jhenderson, mattd, rupprecht

Reviewed By: rupprecht

Subscribers: llvm-commits

Tags: #llvm

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

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

5 years ago[x86] auto-generate complete test checks; NFC
Sanjay Patel [Fri, 22 Mar 2019 15:33:59 +0000 (15:33 +0000)]
[x86] auto-generate complete test checks; NFC

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

5 years ago[x86] auto-generate complete test checks; NFC
Sanjay Patel [Fri, 22 Mar 2019 15:33:55 +0000 (15:33 +0000)]
[x86] auto-generate complete test checks; NFC

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

5 years ago[x86] add 'nounwind' to tests to reduce noise; NFC
Sanjay Patel [Fri, 22 Mar 2019 15:33:51 +0000 (15:33 +0000)]
[x86] add 'nounwind' to tests to reduce noise; NFC

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

5 years ago[x86] auto-generate complete checks for test; NFC
Sanjay Patel [Fri, 22 Mar 2019 15:33:47 +0000 (15:33 +0000)]
[x86] auto-generate complete checks for test; NFC

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

5 years ago[AMDGPU] Use three- and five-dword result type in image ops
Tim Renouf [Fri, 22 Mar 2019 15:21:11 +0000 (15:21 +0000)]
[AMDGPU] Use three- and five-dword result type in image ops

Some image ops return three or five dwords.  Previously, we modeled that
with a 4 or 8 dword register class.  The register allocator could
cleverly spot that some subregs were dead and allocate something else
there, but that caused the de-optimization that waitcnt insertion would
think that the result was used immediately.

This commit allows such an image op to have a result with a three or
five dword result, avoiding the above de-optimization.

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

Change-Id: I3651211bbd7ed22721ee7b9fefd7bcc60a809d8b

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

5 years ago[AMDGPU] Implemented dwordx3 variants of buffer/tbuffer load/store intrinsics
Tim Renouf [Fri, 22 Mar 2019 14:58:02 +0000 (14:58 +0000)]
[AMDGPU] Implemented dwordx3 variants of buffer/tbuffer load/store intrinsics

Now we have vec3 MVTs, this commit implements dwordx3 variants of the
buffer intrinsics.

On gfx6, a dwordx3 buffer load intrinsic is implemented as a dwordx4
instruction, and a dwordx3 buffer store intrinsic is not supported.
We need to support the dwordx3 load intrinsic because it is generated by
subtarget-unaware code in InstCombine.

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

Change-Id: I016729d8557b98a52f529638ae97c340a5922a4e

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

5 years ago[SLPVectorizer] Add test related to SLP Throttling support, NFCI.
Dinar Temirbulatov [Fri, 22 Mar 2019 14:50:53 +0000 (14:50 +0000)]
[SLPVectorizer] Add test related to SLP Throttling support, NFCI.

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

5 years ago[ObjectYAML] Add basic minidump generation support
Pavel Labath [Fri, 22 Mar 2019 14:47:26 +0000 (14:47 +0000)]
[ObjectYAML] Add basic minidump generation support

Summary:
This patch adds the ability to read a yaml form of a minidump file and
write it out as binary. Apart from the minidump header and the stream
directory, only three basic stream kinds are supported:
- Text: This kind is used for streams which contain textual data. This
  is typically the contents of a /proc file on linux (e.g.
  /proc/PID/maps). In this case, we just put the raw stream contents
  into the yaml.
- SystemInfo: This stream contains various bits of information about the
  host system in binary form. We expose the data in a structured form.
- Raw: This kind is used as a fallback when we don't have any special
  knowledge about the stream. In this case, we just print the stream
  contents in hex.

For this code to be really useful, more stream kinds will need to be
added (particularly for things like lists of memory regions and loaded
modules). However, these can be added incrementally.

Reviewers: jhenderson, zturner, clayborg, aprantl

Subscribers: mgorny, lemo, llvm-commits, lldb-commits

Tags: #llvm

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

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

5 years ago[llvm-exegesis] Fix compilation before c++17.
Clement Courbet [Fri, 22 Mar 2019 13:37:39 +0000 (13:37 +0000)]
[llvm-exegesis] Fix compilation before c++17.

ClusteringTest.cpp:25:23: error: constexpr variable cannot have non-literal type 'const llvm::exegesis::(anonymous namespace)::(lambda at /home/buildslave/ps4-buildslave4/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/llvm.src/unittests/tools/llvm-exegesis/ClusteringTest.cpp:25:35)'
static constexpr auto HasPoints = [](const std::vector<int> &Indices) {

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

5 years ago[llvm-exegesis] Add clustering test.
Clement Courbet [Fri, 22 Mar 2019 13:13:12 +0000 (13:13 +0000)]
[llvm-exegesis] Add clustering test.

Summary: To show that dbscan is insensitive to the order of the points.

Subscribers: tschuett, llvm-commits

Tags: #llvm

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

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

5 years ago[llvm-objcopy]Add coverage for --split-dwo and --output-format
James Henderson [Fri, 22 Mar 2019 12:45:27 +0000 (12:45 +0000)]
[llvm-objcopy]Add coverage for --split-dwo and --output-format

Also fix up a couple of minor issues in the test being updated, where
FileCheck could match on incorrect output and fix the test case order to
match the struct order.

Reviewed by: grimar

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

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

5 years agoRevert r356738 "[llvm-objcopy] - Implement replaceSectionReferences for GroupSection...
George Rimar [Fri, 22 Mar 2019 12:14:04 +0000 (12:14 +0000)]
Revert r356738 "[llvm-objcopy] - Implement replaceSectionReferences for GroupSection class."

Seems this broke ubsan bot:
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap-ubsan/builds/11760

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

5 years ago[RISCV] Add basic RV32E definitions and MC layer support
Alex Bradbury [Fri, 22 Mar 2019 11:21:40 +0000 (11:21 +0000)]
[RISCV] Add basic RV32E definitions and MC layer support

The RISC-V ISA defines RV32E as an alternative "base" instruction set
encoding, that differs from RV32I by having only 16 rather than 32 registers.
This patch adds basic definitions for RV32E as well as MC layer support
(assembling, disassembling) and tests. The only supported ABI on RV32E is
ILP32E.

Add a new RISCVFeatures::validate() helper to RISCVUtils which can be called
from codegen or MC layer libraries to validate the combination of TargetTriple
and FeatureBitSet. Other targets have similar checks (e.g. erroring if SPE is
enabled on PPC64 or oddspreg + o32 ABI on Mips), but they either duplicate the
checks (Mips), or fail to check for both codegen and MC codepaths (PPC).

Codegen for the ILP32E ABI support and RV32E codegen are left for a future
patch/patches.

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

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

5 years ago[RISCV] Optimize emission of SELECT sequences
Alex Bradbury [Fri, 22 Mar 2019 10:45:03 +0000 (10:45 +0000)]
[RISCV] Optimize emission of SELECT sequences

This patch optimizes the emission of a sequence of SELECTs with the same
condition, avoiding the insertion of unnecessary control flow. Such a sequence
often occurs when a SELECT of values wider than XLEN is legalized into two
SELECTs with legal types. We have identified several use cases where the
SELECTs could be interleaved with other instructions. Therefore, we extend the
sequence to include non-SELECT instructions if we are able to detect that the
non-SELECT instructions do not impact the optimization.

This patch supersedes https://reviews.llvm.org/D59096, which attempted to
address this issue by introducing a new SelectionDAG node. Hat tip to Eli
Friedman for his feedback on how to best handle this issue.

Differential Revision: https://reviews.llvm.org/D59355
Patch by Luís Marques.

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

5 years ago[RISCV] Allow conversion of CC logic to bitwise logic
Alex Bradbury [Fri, 22 Mar 2019 10:39:22 +0000 (10:39 +0000)]
[RISCV] Allow conversion of CC logic to bitwise logic

Indicates in the TargetLowering interface that conversions from CC logic to
bitwise logic are allowed. Adds tests that show the benefit when optimization
opportunities are detected. Also adds tests that show that when the optimization
is not applied correct code is generated (but opportunities for other
optimizations remain).

Differential Revision: https://reviews.llvm.org/D59596
Patch by Luís Marques.

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

5 years ago[llvm-objcopy] - Fix a st_name of the first symbol table entry.
George Rimar [Fri, 22 Mar 2019 10:28:56 +0000 (10:28 +0000)]
[llvm-objcopy] - Fix a st_name of the first symbol table entry.

Spec says about the first symbol table entry that index 0 both designates the first entry in the table
and serves as the undefined symbol index. It should have zero value.
Hence the first symbol table entry has no name. And so has to have a st_name == 0.
(http://refspecs.linuxbase.org/elf/gabi4+/ch4.symtab.html)

Currently, we do not emit zero value for the first symbol table entry.
That happens because we add empty strings to the string builder, which
for each such case adds a zero byte:
(https://github.com/llvm-mirror/llvm/blob/master/lib/MC/StringTableBuilder.cpp#L185)
After the string optimization performed it might return non zero indexes for the
empty string requested.

The patch fixes this issue for the case above and other sections with no names.

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

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

5 years ago[llvm-objcopy] - Implement replaceSectionReferences for GroupSection class.
George Rimar [Fri, 22 Mar 2019 10:24:37 +0000 (10:24 +0000)]
[llvm-objcopy] - Implement replaceSectionReferences for GroupSection class.

Currently, llvm-objcopy incorrectly handles compression and decompression of the
sections from COMDAT groups, because we do not implement the
replaceSectionReferences for this type of the sections.

The patch does that.

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

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

5 years ago[llvm-objcopy]Add support for *-freebsd output formats
James Henderson [Fri, 22 Mar 2019 10:21:09 +0000 (10:21 +0000)]
[llvm-objcopy]Add support for *-freebsd output formats

GNU objcopy can support output formats like elf32-i386-freebsd and
elf64-x86-64-freebsd. The only difference from their regular non-freebsd
counterparts that I have observed is that the freebsd versions set the
OS/ABI field to ELFOSABI_FREEBSD. This patch sets the OS/ABI field
according based on the format whenever --output-format is specified.

Reviewed by: rupprecht, grimar

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

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

5 years ago[RISCV][NFC] Add test case to MC/RISCV/linker-relaxation.s showing incorrect relocati...
Alex Bradbury [Fri, 22 Mar 2019 10:20:21 +0000 (10:20 +0000)]
[RISCV][NFC] Add test case to MC/RISCV/linker-relaxation.s showing incorrect relocations being emitted

A follow-up patch will fix this case.

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

5 years ago[AMDGPU] Added v5i32 and v5f32 register classes
Tim Renouf [Fri, 22 Mar 2019 10:11:21 +0000 (10:11 +0000)]
[AMDGPU] Added v5i32 and v5f32 register classes

They are not used by anything yet, but a subsequent commit will start
using them for image ops that return 5 dwords.

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

Change-Id: I63e1904081e39a6d66e4eb96d51df25ad399d271

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

5 years ago[RISCV][NFC] Expand test/MC/RISCV/linker-relaxation.s tests
Alex Bradbury [Fri, 22 Mar 2019 06:05:52 +0000 (06:05 +0000)]
[RISCV][NFC] Expand test/MC/RISCV/linker-relaxation.s tests

Add more complete CHECK lines for the relocations generated when relaxation is
enabled, and add cases where a locally defined symbol is referenced.

Two instances of pcrel_lo(defined_symbol) are commented out, as they will
produce an error. A follow-up patch will fix this.

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

5 years ago[X86] Add 32-bit command lines with and without SSE2 to atomic-non-integer.ll. NFC
Craig Topper [Fri, 22 Mar 2019 04:28:40 +0000 (04:28 +0000)]
[X86] Add 32-bit command lines with and without SSE2 to atomic-non-integer.ll. NFC

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

5 years ago[BPF] fix flaky btf unit test static-var-derived-type.ll
Yonghong Song [Fri, 22 Mar 2019 02:54:47 +0000 (02:54 +0000)]
[BPF] fix flaky btf unit test static-var-derived-type.ll

The DataSecEentries is defined as an unordered_map since
order does not really matter.
  std::unordered_map<std::string, std::unique_ptr<BTFKindDataSec>>
      DataSecEntries;
This seems causing the test static-var-derived-type.ll flaky
as two sections ".bss" and ".readonly" have undeterministic
ordering when performing map iterating, which decides the
output assembly code sequence of BTF_KIND_DATASEC entries.

Fix the test to have only one data section to remove
flakiness.

Signed-off-by: Yonghong Song <yhs@fb.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356731 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[DWARF] Refactor RelocVisitor and fix computation of SHT_RELA-typed relocation entries
Fangrui Song [Fri, 22 Mar 2019 02:43:11 +0000 (02:43 +0000)]
[DWARF] Refactor RelocVisitor and fix computation of SHT_RELA-typed relocation entries

Summary:
getRelocatedValue may compute incorrect value for SHT_RELA-typed relocation entries.

// DWARFDataExtractor.cpp
uint64_t DWARFDataExtractor::getRelocatedValue(uint32_t Size, uint32_t *Off,
...
  // This formula is correct for REL, but may be incorrect for RELA if the value
  // stored in the location (getUnsigned(Off, Size)) is not zero.
  return getUnsigned(Off, Size) + Rel->Value;

In this patch, we

* refactor these visit* functions to include a new parameter `uint64_t A`.
  Since these visit* functions are no longer used as visitors, rename them to resolve*.
  + REL: A is used as the addend. A is the value stored in the location where the
    relocation applies: getUnsigned(Off, Size)
  + RELA: The addend encoded in RelocationRef is used, e.g. getELFAddend(R)
* and add another set of supports* functions to check if a given relocation type is handled.
  DWARFObjInMemory uses them to fail early.

Reviewers: echristo, dblaikie

Reviewed By: echristo

Subscribers: mgorny, aprantl, aheejin, fedor.sergeev, llvm-commits

Tags: #llvm

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

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

5 years ago[BPF] handle derived type properly for computing type id
Yonghong Song [Fri, 22 Mar 2019 01:30:50 +0000 (01:30 +0000)]
[BPF] handle derived type properly for computing type id

Currently, the type id for a derived type is computed incorrectly.
For example,
  type #1: int
  type #2: ptr to #1

For a global variable "int *a", type #1 will be attributed to variable "a".
This is due to a bug which assigns the type id of the basetype of
that derived type as the derived type's type id. This happens
to "const", "volatile", "restrict", "typedef" and "pointer" types.

This patch fixed this bug, fixed existing test cases and added
a new one focusing on pointers plus other derived types.

Signed-off-by: Yonghong Song <yhs@fb.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356727 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Autogenerate complete checks. NFC
Craig Topper [Thu, 21 Mar 2019 23:09:56 +0000 (23:09 +0000)]
[X86] Autogenerate complete checks. NFC

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

5 years ago[AArch64] Split the neon.addp intrinsic into integer and fp variants.
Amara Emerson [Thu, 21 Mar 2019 22:31:37 +0000 (22:31 +0000)]
[AArch64] Split the neon.addp intrinsic into integer and fp variants.

This is the result of discussions on the list about how to deal with intrinsics
which require codegen to disambiguate them via only the integer/fp overloads.
It causes problems for GlobalISel as some of that information is lost during
translation, while with other operations like IR instructions the information is
encoded into the instruction opcode.

This patch changes clang to emit the new faddp intrinsic if the vector operands
to the builtin have FP element types. LLVM IR AutoUpgrade has been taught to
upgrade existing calls to aarch64.neon.addp with fp vector arguments, and
we remove the workarounds introduced for GlobalISel in r355865.

This is a more permanent solution to PR40968.

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

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

5 years ago[X86] Use LoadInst->getType() instead of LoadInst->getPointerOperandType()->getElemen...
Craig Topper [Thu, 21 Mar 2019 21:37:18 +0000 (21:37 +0000)]
[X86] Use LoadInst->getType() instead of LoadInst->getPointerOperandType()->getElementType(). NFCI

For the future day when the pointer's don't have element types, we shoudl just use the type of the load result instead.

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

5 years ago[InstSimplify] Add tests for signed icmp of and/or; NFC
Nikita Popov [Thu, 21 Mar 2019 21:13:08 +0000 (21:13 +0000)]
[InstSimplify] Add tests for signed icmp of and/or; NFC

Even if a signed predicate is used, the ranges computed for and/or
are unsigned, resulting in missed simplifications.

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

5 years ago[Object] Fix reading objects created with -fembed-bitcode-marker
Steven Wu [Thu, 21 Mar 2019 21:01:31 +0000 (21:01 +0000)]
[Object] Fix reading objects created with -fembed-bitcode-marker

Currently, this fails with many tools, e.g.

$ clang -fembed-bitcode-marker -c -o test.o test.c
$ nm test.o
nm: test.o The file was not recognized as a valid object file

-fembed-bitcode-marker creates a LLVM,bitcode section consisting of a single
byte. When reading the object file, IRObjectFile::findBitcodeInObject succeeds,
causing SymbolicFile::createSymbolicFile to try to read the "bitcode" rather
than using the outer Mach-O data - when then fails.

Fix this by making findBitcodeInObject return an error if the section size <= 1.

Patched by: Nicholas Allegra

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

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

5 years agoMips: Fix typo in assert message
Matt Arsenault [Thu, 21 Mar 2019 20:56:06 +0000 (20:56 +0000)]
Mips: Fix typo in assert message

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

5 years agoMips: Don't create copy of nothing
Matt Arsenault [Thu, 21 Mar 2019 20:56:05 +0000 (20:56 +0000)]
Mips: Don't create copy of nothing

This was creating a copy of the register the pseudo itself was
def'ing, leaving a copy of an undefined register. I'm not sure how
the verifier is not catching this, but this avoids asserting in a
future change to RegAllocFast

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

5 years agoGlobalISel: Fix RegBankSelect for REG_SEQUENCE
Matt Arsenault [Thu, 21 Mar 2019 20:45:36 +0000 (20:45 +0000)]
GlobalISel: Fix RegBankSelect for REG_SEQUENCE

The AArch64 test was broken since the result register already had a
set register class, so this test was a no-op. The mapping verify call
would fail because the result size is not the same as the inputs like
in a copy or phi.

The AMDGPU testcases are half broken and introduce illegal VGPR->SGPR
copies which need much more work to handle correctly (same for phis),
but add them as a baseline.

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

5 years agoDon't add a tail keyword to calls to ObjC runtime functions if the calls
Akira Hatanaka [Thu, 21 Mar 2019 20:16:09 +0000 (20:16 +0000)]
Don't add a tail keyword to calls to ObjC runtime functions if the calls
are annotated with notail.

r356705 annotated calls to objc_retainAutoreleasedReturnValue with
notail on x86-64. This commit teaches ARC optimizer to check the notail
marker on the call before turning it into a tail call.

rdar://problem/38675807

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

5 years ago[AArch64] Update for Exynos
Evandro Menezes [Thu, 21 Mar 2019 18:54:58 +0000 (18:54 +0000)]
[AArch64] Update for Exynos

Fix the feature set for Exynos M4 by removing support for `+fp16fml` and fix test case.

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

5 years ago[llvm-objdump] Support arg grouping for -j and -M (e.g. llvm-objdump -sj.foo -dMreg...
Jordan Rupprecht [Thu, 21 Mar 2019 18:45:44 +0000 (18:45 +0000)]
[llvm-objdump] Support arg grouping for -j and -M (e.g. llvm-objdump -sj.foo -dMreg-names-raw)

Summary:
r354375 added support for most objdump groupings, but didn't add support for -j|--sections, because that wasn't possible.
r354870 added --disassembler options, but grouping still wasn't available.
r355185 supported values for grouped options.

This just puts the three of them together. This supports -j in modes like `-s -j .foo`, `-sj .foo`, `-sj=.foo`, or `-sj.foo`, and similar for `-M`.

Reviewers: ormris, jhenderson, ikudrin

Reviewed By: jhenderson, ikudrin

Subscribers: javed.absar, llvm-commits

Tags: #llvm

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

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

5 years ago[X86] canonicalizeBitSelect - don't attempt to canonicalize mask registers
Simon Pilgrim [Thu, 21 Mar 2019 18:32:38 +0000 (18:32 +0000)]
[X86] canonicalizeBitSelect - don't attempt to canonicalize mask registers

We don't use X86ISD::ANDNP for mask registers.

Test case from @craig.topper (Craig Topper)

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

5 years ago[llvm-pdbutil] Add -type-ref-stats to help find unused type info
Reid Kleckner [Thu, 21 Mar 2019 18:02:34 +0000 (18:02 +0000)]
[llvm-pdbutil] Add -type-ref-stats to help find unused type info

Summary:
This considers module symbol streams and the global symbol stream to be
roots. Most types that this considers "unreferenced" are referenced by
LF_UDT_MOD_SRC_LINE id records, which VC seems to always include.
Essentially, they are types that the user can only find in the debugger
if they call them by name, they cannot be found by traversing a symbol.

In practice, around 80% of type information in a PDB is referenced by a
symbol. That seems like a reasonable number.

I don't really plan to do anything with this tool. It mostly just exists
for informational purposes, and to confirm that we probably don't need
to implement type reference tracking in LLD. We can continue to merge
all types as we do today without wasting space.

Reviewers: zturner, aganea

Subscribers: mgorny, hiraditya, arphaman, jdoerfert, llvm-commits

Tags: #llvm

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

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

5 years ago[x86] add tests with movmsk potential (PR39665); NFC
Sanjay Patel [Thu, 21 Mar 2019 17:57:56 +0000 (17:57 +0000)]
[x86] add tests with movmsk potential (PR39665); NFC

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

5 years ago[InstCombine] Don't transform ((C1 OP zext(X)) & C2) -> zext((C1 OP X) & C2) if eithe...
Craig Topper [Thu, 21 Mar 2019 17:50:49 +0000 (17:50 +0000)]
[InstCombine] Don't transform ((C1 OP zext(X)) & C2) -> zext((C1 OP X) & C2) if either zext or OP has another use.

If they have other users we'll just end up increasing the instruction count.

We might be able to weaken this to only one of them having a single use if we can prove that the and will be removed.

Fixes PR41164.

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

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

5 years ago[X86] Don't avoid folding multiple use sign extended 8-bit immediate into instruction...
Craig Topper [Thu, 21 Mar 2019 17:38:58 +0000 (17:38 +0000)]
[X86] Don't avoid folding multiple use sign extended 8-bit immediate into instructions under optsize.

Under optsize we try to avoid folding immediates into instructions under optsize. But if the immediate is 16-bits or 32 bits, but can be encoded as an 8-bit immediate we don't save enough from disabling the folding unless the immediate has enough uses to make up for the size of the move which is either 3 bytes or 5 bytes since there are no sign extended 8-bit moves. We would also save something if the immediate was a live out of the basic block and thus a move was unavoidable, but that would require a more advanced heuristic than just counting uses.

Note we only avoid folding multiple use immediates into the patterns that use X86ISD::ADD/SUB/XOR/OR/AND/CMP/ADC/SBB nodes and not the more common ISD::ADD/SUB/XOR/OR/AND nodes.

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

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

5 years ago[ScalarizeMaskedMemIntrin] Add support for scalarizing expandload and compressstore...
Craig Topper [Thu, 21 Mar 2019 17:38:52 +0000 (17:38 +0000)]
[ScalarizeMaskedMemIntrin] Add support for scalarizing expandload and compressstore intrinsics.

This adds support for scalarizing these intrinsics as well the X86TargetTransformInfo support to avoid scalarizing them in the cases X86 can handle.

I've omitted handling special cases for constant masks for this first pass. Though CodeGenPrepare can constant fold the branch conditions and remove some of the control flow anyway.

Fixes PR40994 and is covers most of PR3666. Might want to implement constant masks to close that.

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

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

5 years ago[ValueTracking] Use ConstantRange based overflow check for signed sub
Nikita Popov [Thu, 21 Mar 2019 17:23:51 +0000 (17:23 +0000)]
[ValueTracking] Use ConstantRange based overflow check for signed sub

This is D59450, but for signed sub. This case is not NFC, because
the overflow logic in ConstantRange is more powerful than the existing
check. This resolves the TODO in the function.

I've added two tests to show that this indeed catches more cases than
the previous logic, but the main correctness test coverage here is in
the existing ConstantRange unit tests.

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

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

5 years agoAdd more rotate tests, including ORs of rotates
Krzysztof Parzyszek [Thu, 21 Mar 2019 17:14:22 +0000 (17:14 +0000)]
Add more rotate tests, including ORs of rotates

This is a part of https://reviews.llvm.org/D47735.

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

5 years agoFixup opt-remarks.ll gold plugin test. NFC
David Green [Thu, 21 Mar 2019 14:35:06 +0000 (14:35 +0000)]
Fixup opt-remarks.ll gold plugin test. NFC

Now that rL356594 has added a TailCallElim pass to LTO, the call gets marked as
tail.

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

5 years ago[DAGCombiner] Use getTokenFactor in a few more cases.
Florian Hahn [Thu, 21 Mar 2019 14:32:09 +0000 (14:32 +0000)]
[DAGCombiner] Use getTokenFactor in a few more cases.

SDNodes can only have 64k operands and for some inputs (e.g. large
number of stores), we can reach this limit when creating TokenFactor
nodes. This patch is a follow up to D56740 and updates a few more places
that potentially can create TokenFactors with too many operands.

Reviewers: efriedma, craig.topper, aemerson, RKSimon

Reviewed By: RKSimon

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

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

5 years ago[DAGCombine] SimplifySelectCC - call FoldSetCC with the setcc result type
Simon Pilgrim [Thu, 21 Mar 2019 14:07:18 +0000 (14:07 +0000)]
[DAGCombine] SimplifySelectCC - call FoldSetCC with the setcc result type

We were calling FoldSetCC with the compare operand type instead of the result type.

Found by OSS-Fuzz #13838 (https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=13838)

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

5 years ago[CodeGenPrepare] limit formation of overflow intrinsics (PR41129)
Sanjay Patel [Thu, 21 Mar 2019 13:57:07 +0000 (13:57 +0000)]
[CodeGenPrepare] limit formation of overflow intrinsics (PR41129)

This is probably a bigger limitation than necessary, but since we don't have any evidence yet
that this transform led to real-world perf improvements rather than regressions, I'm making a
quick, blunt fix.

In the motivating x86 example from:
https://bugs.llvm.org/show_bug.cgi?id=41129
...and shown in the regression test, we want to avoid an extra instruction in the dominating
block because that could be costly.

The x86 LSR test diff is reversing the changes from D57789. There's no evidence that 1 version
is any better than the other yet.

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

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

5 years ago[llvm-readobj] Format codes. NFC.
Xing GUO [Thu, 21 Mar 2019 13:42:06 +0000 (13:42 +0000)]
[llvm-readobj] Format codes. NFC.

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

5 years ago[Thumb] Fix infinite loop in ABS expansion (PR41160)
Simon Pilgrim [Thu, 21 Mar 2019 12:41:18 +0000 (12:41 +0000)]
[Thumb] Fix infinite loop in ABS expansion (PR41160)

Don't expand ISD::ABS node if its legal.

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

5 years ago[AMDGPU] Support for v3i32/v3f32
Tim Renouf [Thu, 21 Mar 2019 12:01:21 +0000 (12:01 +0000)]
[AMDGPU] Support for v3i32/v3f32

Added support for dwordx3 for most load/store types, but not DS, and not
intrinsics yet.

SI (gfx6) does not have dwordx3 instructions, so they are not enabled
there.

Some of this patch is from Matt Arsenault, also of AMD.

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

Change-Id: I913ef54f1433a7149da8d72f4af54dbb13436bd9

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

5 years agoFix -Wmisleading-indentation gcc7 warning. NFCI.
Simon Pilgrim [Thu, 21 Mar 2019 11:58:22 +0000 (11:58 +0000)]
Fix -Wmisleading-indentation gcc7 warning. NFCI.

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

5 years ago[AArch64] Allow -mattr=tpidr-el[1|2|3]
Oliver Stannard [Thu, 21 Mar 2019 11:30:17 +0000 (11:30 +0000)]
[AArch64] Allow -mattr=tpidr-el[1|2|3]

Added subtarget features for AArch64 to use TPIDR_EL[1|2|3] as the TLS base
register, rather than the default TPIDR_EL0.

Patch by Philip Derrin!

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

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