161587 Commits

Author SHA1 Message Date
Andrea Di Biagio
ce305b3012 [llvm-mca] Remove unused variable from InstrBuilder.cpp. NFC
This was causing a buildbot failure.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327517 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-14 15:19:47 +00:00
Andrea Di Biagio
2a50eccea8 [llvm-mca] Move the logic that updates the register files from InstrBuilder to DispatchUnit. NFCI
Before this patch, the register file was always updated at instruction creation
time. That means, new read-after-write dependencies, and new temporary registers
were allocated at instruction creation time.

This patch refactors the code in InstrBuilder, and move all the logic that
updates the register file into the dispatch unit. We only want to update the
register file when instructions are effectively dispatched (not before).

This refactoring also helps removing a bad dependency between the InstrBuilder
and the DispatchUnit.

No functional change intended.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327514 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-14 14:57:23 +00:00
Petar Jovanovic
cad9f50df3 [mips] Add support for CRC ASE
This includes

  Instructions: crc32b, crc32h, crc32w, crc32d,
                crc32cb, crc32ch, crc32cw, crc32cd

  Assembler directives: .set crc, .set nocrc, .module crc, .module nocrc

  Attribute: crc

  .MIPS.abiflags: CRC (0x8000)

Patch by Vladimir Stefanovic.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327511 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-14 14:13:31 +00:00
Simon Pilgrim
c2b0f90df1 [X86][Btver2] Fix YMM shuffle, permute and permutevar scheduler costs
Account for ymm double pumping and add proper pshufb/permutevar support

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327510 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-14 14:05:19 +00:00
Teresa Johnson
64c4f712b2 [LTO/gold] Fix workaround for old plugin-api.h in --wrap support
The workaround for older plugin-api.h in r327506 unfortunately
used another union member that is also fairly new and not available
in the plugin-api.h on some of the bots, leading to:
http://lab.llvm.org:8011/builders/clang-with-thin-lto-ubuntu/builds/9121/steps/build-stage2-LLVMgold.so/logs/stdio

Change to use a different member that we will definitely have (as it
is used elsewhere in gold-plugin.cpp already).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327509 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-14 14:00:57 +00:00
Teresa Johnson
ead876539d [LTO/gold] Support --wrap
Summary:
(Restores r327459 with handling for old plugin-api.h)
Utilize new gold plugin api interface for obtaining --wrap option
arguments, and LTO API handling (added for --wrap support in lld LTO),
to mark symbols so that LTO does not optimize them inappropriately.

Note the test cases will be in a new gold test subdirectory that
is dependent on the next release of gold which will contain the new
interfaces.

Reviewers: pcc, tmsriram

Subscribers: mehdi_amini, llvm-commits, inglorion

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327506 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-14 13:26:18 +00:00
Simon Pilgrim
7c95150df8 [X86][SSE] Use WriteFShuffleLd for MOVDDUP/MOVSHDUP/MOVSLDUP reg-mem instructions
They shouldn't be treated as pure loads.

Found while investigating D44428

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327505 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-14 13:22:56 +00:00
Martin Storsjo
fd89485e3c [AArch64] Don't produce R_AARCH64_TLSLE_LDST32_TPREL_LO12_NC
Support for this relocation is missing in both LLD and GNU binutils
at the moment.

This reverts the ELF parts of SVN r327316.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327503 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-14 13:09:10 +00:00
Simon Pilgrim
2d21c59fcf Fix 'not all control paths return a value' MSVC warning. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327502 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-14 12:04:51 +00:00
Pavel Labath
9bb5a07f68 Fix msvc compiler error in r327498
msvc reports an "illegal indirection" error here. Attempt to appease it
with a different initialization syntax.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327500 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-14 11:31:17 +00:00
Alexander Ivchenko
5b113a2c3b [GlobalISel][X86] Support G_LSHR/G_ASHR/G_SHL
Support G_LSHR/G_ASHR/G_SHL. We have 3 variance for
shift instructions : shift gpr, shift imm, shift 1.
Currently GlobalIsel TableGen generate patterns for
shift imm and shift 1, but with shiftCount i8.
In G_LSHR/G_ASHR/G_SHL like LLVM-IR both arguments
has the same type, so for now only shift i8 can use
auto generated TableGen patterns.

The support of G_SHL/G_ASHR enables tryCombineSExt
from LegalizationArtifactCombiner.h to hit, which
results in different legalization for the following tests:
    LLVM :: CodeGen/X86/GlobalISel/ext-x86-64.ll
    LLVM :: CodeGen/X86/GlobalISel/gep.ll
    LLVM :: CodeGen/X86/GlobalISel/legalize-ext-x86-64.mir

-; X64-NEXT:    movsbl %dil, %eax
+; X64-NEXT:    movl $24, %ecx
+; X64-NEXT:    # kill: def $cl killed $ecx
+; X64-NEXT:    shll %cl, %edi
+; X64-NEXT:    movl $24, %ecx
+; X64-NEXT:    # kill: def $cl killed $ecx
+; X64-NEXT:    sarl %cl, %edi
+; X64-NEXT:    movl %edi, %eax

..which is not optimal and should be addressed later.

Rework of the patch by igorb

Reviewed By: igorb

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327499 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-14 11:23:57 +00:00
Pavel Labath
9357220c93 Explicitly initialize dwarf::FormParams in DIEInteger::SizeOf
This could end up inititialized if someone called the function with a
null AsmPrinter. Right now this only happens in DIEHash unit tests,
presumably because it was hard to create an AsmPrinter in the context of
unit tests. This only worked before r327486 because those tests did not
use any dwarf forms whose size actually depended on the dwarf version
(otherwise, they would have crashed due to null dereference).

I fix the uninitialized error, by explicitly initializing FormParams to
an invalid value, which will cause getFixedFormByteSize to return None
if called with a form with version-dependent size. A more principled
solution might be to fix the DIEHash tests to always pass in a valid
AsmPrinter.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327498 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-14 11:14:43 +00:00
Nicolai Haehnle
3e7114a4b6 TableGen: Explicitly forbid some nestings of class, multiclass, and foreach
These previously all failed one way or another, but now we produce a more
helpful error message.

Change-Id: I8ffd2e87c8e35a5134c3be289e0a1fecaa2bb8ca

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327497 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-14 11:01:01 +00:00
Nicolai Haehnle
af0de5073c TableGen: Add !ne, !le, !lt, !ge, and !gt comparisons
Change-Id: I8e2ece677268972d578a787467f7ef52a1f33a71

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327496 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-14 11:00:57 +00:00
Nicolai Haehnle
79175dbbae TableGen: Allow dag operators to be resolved late
Change-Id: I51bb80fd5c48c8ac441ab11e43d43c1b91b4b590

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327495 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-14 11:00:48 +00:00
Nicolai Haehnle
8ed1fd468a TableGen: Type-check BinOps
Additionally, allow more than two operands to !con, !add, !and, !or
in the same way as is already allowed for !listconcat and !strconcat.

Change-Id: I9659411f554201b90cd8ed7c7e004d381a66fa93

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327494 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-14 11:00:43 +00:00
Nicolai Haehnle
14236ebc9c TableGen: Allow ? in lists
This makes using !dag more convenient in some cases.

Change-Id: I0a8c35e15ccd1ecec778fd1c8d64eee38d74517c

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327493 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-14 11:00:33 +00:00
Nicolai Haehnle
231876457f TableGen: Add !dag function for construction
This allows constructing DAG nodes with programmatically determined
names, and can simplify constructing DAG nodes in other cases as
well.

Also, add documentation and some very simple tests for the already
existing !con.

Change-Id: Ida61cd82e99752548d7109ce8da34d29da56a5f7

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327492 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-14 11:00:26 +00:00
Alexander Timofeev
738ee04541 [AMDGPU] Fix for DAGCombiner infinite loop in OCLtst
Differential revision: https://reviews.llvm.org/D44417

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327488 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-14 09:48:51 +00:00
Pavel Labath
fa49d7da44 DWARF: Unify form size handling code
Summary:
This patch replaces the two switches which are deducing the size of
various forms with a single implementation. I have put the new
implementation into BinaryFormat, to avoid introducing dependencies
between the two independent libraries (DebugInfo and CodeGen) that need
this functionality.

Reviewers: aprantl, JDevlieghere, dblaikie

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327486 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-14 09:39:54 +00:00
Jonas Devlieghere
21cda30c18 [dsymutil] Print architecture in warning
Make the architecture part of the warning in the DebugMapParser. This
makes things consistent with the Apple's internal version of dsymutil.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327485 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-14 09:34:54 +00:00
Pavel Labath
4d613a84ce Export LLVM_DYLIB_COMPONENTS in LLVMConfig.cmake
Summary:
This is needed so that external projects (e.g. a standalone build of
lldb) can link to the LLVM shared library via the USE_SHARED argument of
llvm_config. Without this, llvm_config would add LLVM to the link list,
but then also add the constituent static libraries, resulting in
multiply defined symbols.

Reviewers: beanz, mgorny

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327484 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-14 09:28:38 +00:00
Alexander Ivchenko
5b80a6538b [GlobalIsel][X86] Support for G_ZEXT instruction
Reviewed By: igorb

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327482 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-14 09:11:23 +00:00
Robert Widmann
df7c2a2c93 [LLVM-C] Redo unnamed_address attribute bindings
Summary:
The old bindings should have used an enum instead of a boolean.  This
deprecates LLVMHasUnnamedAddr and LLVMSetUnnamedAddr , replacing them
with LLVMGetUnnamedAddress and LLVMSetUnnamedAddress respectively that do.
Though it is unlikely LLVM will gain more supported global value linker
hints, the new API can scale to accommodate this.

Reviewers: deadalnix, whitequark

Reviewed By: whitequark

Subscribers: llvm-commits, harlanhaskins

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327479 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-14 06:45:51 +00:00
Lang Hames
e8aa86b340 [RuntimeDyld] Silence a compiler error.
This should fix the error at
http://lab.llvm.org:8011/builders/lld-x86_64-darwin13/builds/19008

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327478 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-14 06:39:49 +00:00
Lang Hames
58ecc853fc [ORC] Fix a data race in the lookup function.
The Error locals need to be protected by a mutex. (This could be fixed by
having the promises / futures contain Expected and Error values, but
MSVC's future implementation does not support this yet).

Hopefully this will fix some of the errors seen on the builders due to
r327474.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327477 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-14 06:25:08 +00:00
Lang Hames
dda1921ef4 [ExecutionEngine] Add a getSymbolTable method to RuntimeDyld.
This can be used to extract the symbol table from a RuntimeDyld instance prior
to disposing of it.

This patch also updates RTDyldObjectLinkingLayer to use the new method, rather
than requesting symbols one at a time via getSymbol.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327476 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-14 06:25:07 +00:00
Lang Hames
50f412d325 [ORC] Silence a compiler error.
This should fix the builder error at
http://lab.llvm.org:8011/builders/lld-x86_64-darwin13/builds/19006

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327475 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-14 05:23:56 +00:00
Lang Hames
a4b7c02dd5 [ORC] Add a 'lookup' convenience function for finding symbols in a list of VSOs.
The lookup function takes a list of VSOs, a set of symbol names (or just one
symbol name) and a materialization function object. It returns an
Expected<SymbolMap> (if given a set of names) or an Expected<JITEvaluatedSymbol>
(if given just one name). The lookup method constructs an
AsynchronousSymbolQuery for the given names, applies that query to each VSO in
the list in turn, and then blocks waiting for the query to complete. If
threading is enabled then the materialization function object can be used to
execute the materialization on different threads. If threading is disabled the
MaterializeOnCurrentThread utility must be used.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327474 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-14 04:18:04 +00:00
Eugene Zemtsov
144840375f Disable test debuglineinfo-path on powerpc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327472 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-14 02:10:07 +00:00
Eugene Zemtsov
edc3de5687 grep for global functions only
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327469 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-14 01:07:18 +00:00
Matt Arsenault
6f1d6423b3 TargetMachine: Add address space to getPointerSize
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327467 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-14 00:36:23 +00:00
Eugene Zemtsov
ef25e23f6f Add extra output/check to debug clang-ppc64be-linux test failure
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327466 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-14 00:15:16 +00:00
Teresa Johnson
8f15c882eb Revert "[LTO/gold] Support --wrap"
This reverts commit r327459. The new gold plugin interface is not
available with older gold installations, leading to compile failures:
http://lab.llvm.org:8011/builders/clang-with-thin-lto-ubuntu/builds/9109/steps/build-stage2-LLVMgold.so/logs/stdio

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327465 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-13 23:55:34 +00:00
Craig Topper
583a2b4786 [X86] Re-generate test to get proper capitalization of its CHECK lines. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327462 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-13 23:31:48 +00:00
Aditya Nandakumar
39745f957e [GISel]: Fix incorrect type used in Pattern Match for ICst
getConstantVRegVal() returns int64_t but we use uint64_t.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327461 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-13 23:21:13 +00:00
Teresa Johnson
a3a491bfb1 [LTO/gold] Support --wrap
Summary:
Utilize new gold plugin api interface for obtaining --wrap option
arguments, and LTO API handling (added for --wrap support in lld LTO),
to mark symbols so that LTO does not optimize them inappropriately.

Note the test cases will be in a new gold test subdirectory that
is dependent on the next release of gold which will contain the new
interfaces.

Reviewers: pcc, tmsriram

Subscribers: mehdi_amini, llvm-commits, inglorion

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327459 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-13 23:06:19 +00:00
Eugene Zemtsov
6b4846ae8f Disable optimizations in debuglineinfo-path test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327458 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-13 22:48:39 +00:00
Craig Topper
0ae4561211 [X86] Simplify the LowerAVXCONCAT_VECTORS code a little by creating a single path for insert_subvector handling.
We now only create recursive concats if we have more than two non-zero values. This keeps our subvector broadcast DAG combine functioning.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327457 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-13 22:36:07 +00:00
Craig Topper
597af6522c [X86] Rewrite LowerAVXCONCAT_VECTORS similar to how we handle vXi1 concats.
This better able to detect undef and zeros pieces in the concat. Or cases when only one subvector is non-zero. This allows us to avoid silly things like double inserts into progressively larger undefs.

This still builds 512 bit concats of 128 bits by building up through 256 bits first. But I don't know if that's best.

We probably want to merge this with the vXi1 concat code since they are very similar.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327454 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-13 22:05:25 +00:00
Zachary Turner
737a344b6f Disable PDB injected sources test temporarily.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327451 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-13 21:18:00 +00:00
Hiroshi Yamauchi
b80dd9b569 Simplify more cases of logical ops of masked icmps.
Summary:
For example,

((X & 255) != 0) && ((X & 15) == 8) -> ((X & 15) == 8).
((X & 7) != 0) && ((X & 15) == 8) -> false.

Reviewers: davidxl

Reviewed By: davidxl

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327450 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-13 21:13:18 +00:00
Eugene Zemtsov
3640be3663 Remove explicit triple and data layout from the test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327449 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-13 21:10:15 +00:00
Craig Topper
0d74daca01 [DAGCombiner] Allow visitEXTRACT_SUBVECTOR to combine with BUILD_VECTORS between LegalizeVectorOps and LegalizeDAG.
BUILD_VECTORs aren't themselves legalized until LegalizeDAG so we should still be able to create an "illegal" one before that. This helps combine with BUILD_VECTORS that are introduced during LegalizeVectorOps due to unrolling.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327446 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-13 20:36:28 +00:00
Zachary Turner
fc9466dd05 Update modulemap to exclude new DIA headers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327444 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-13 20:16:37 +00:00
Eugene Zemtsov
29c097d544 Fix debuglineinfo-path.ll
This fix is based on an assumption that some build bots are missing 'echo
-n'

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327443 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-13 20:06:33 +00:00
Francis Visoiu Mistrih
12d5807d03 [MIR] Allow frame-setup and frame-destroy on the same instruction
Nothing prevents us from having both frame-setup and frame-destroy on
the same instruction.

When merging:
* frame-setup OPCODE1
* frame-destroy OPCODE2
into
* frame-setup frame-destroy OPCODE3

we want to be able to print and parse both flags.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327442 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-13 19:53:16 +00:00
Eugene Zemtsov
0d729fa5d6 Temporary disable debuglineinfo-path.ll to fix build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327441 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-13 19:48:31 +00:00
Anna Thomas
e4f0193bed Test Commit NFC. Updated comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327436 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-13 19:38:45 +00:00
Sanjay Patel
0b6e4ebf67 [x86] add test for WriteZero sched class instructions; NFC
Nops should have zero latency because there is no result.
Idioms like 'xorps xmm0, xmm0' may have zero latency because 
they are handled without using an execution unit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327435 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-13 19:20:01 +00:00