]> granicus.if.org Git - llvm/log
llvm
6 years ago[X86][NFC] Autogenerate check lines in cmovcmov.ll test
Roman Lebedev [Wed, 6 Mar 2019 11:47:43 +0000 (11:47 +0000)]
[X86][NFC] Autogenerate check lines in cmovcmov.ll test

Investigating 8-bit cmov promotion, this test comes up.

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

6 years ago[DAGCombiner] Enable SMULO/UMULO vector combine support (PR40442)
Simon Pilgrim [Wed, 6 Mar 2019 11:04:21 +0000 (11:04 +0000)]
[DAGCombiner] Enable SMULO/UMULO vector combine support (PR40442)

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

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

6 years ago[X86][SSE] VSELECT(XOR(Cond,-1), LHS, RHS) --> VSELECT(Cond, RHS, LHS)
Simon Pilgrim [Wed, 6 Mar 2019 10:54:43 +0000 (10:54 +0000)]
[X86][SSE] VSELECT(XOR(Cond,-1), LHS, RHS) --> VSELECT(Cond, RHS, LHS)

As noticed on D58965

DAGCombiner::visitSELECT has something similar, so we should be able to move this to DAGCombiner and support VSELECT as well at some point.

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

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

6 years ago[CodeGen] Omit range checks from jump tables when lowering switches with unreachable...
Ayonam Ray [Wed, 6 Mar 2019 10:01:02 +0000 (10:01 +0000)]
[CodeGen] Omit range checks from jump tables when lowering switches with unreachable default

During the lowering of a switch that would result in the generation of a
jump table, a range check is performed before indexing into the jump
table, for the switch value being outside the jump table range and a
conditional branch is inserted to jump to the default block. In case the
default block is unreachable, this conditional jump can be omitted. This
patch implements omitting this conditional branch for unreachable
defaults.

Differential Revision: https://reviews.llvm.org/D52002
Reviewers: Hans Wennborg, Eli Freidman, Roman Lebedev

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

6 years agoReversing the commit of revision 355483 since it is giving a regression on a newly...
Ayonam Ray [Wed, 6 Mar 2019 07:51:28 +0000 (07:51 +0000)]
Reversing the commit of revision 355483 since it is giving a regression on a newly added test.

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

6 years ago[X86] Enable the add with 128 -> sub with -128 encoding trick with X86ISD::ADD when...
Craig Topper [Wed, 6 Mar 2019 07:36:38 +0000 (07:36 +0000)]
[X86] Enable the add with 128 -> sub with -128 encoding trick with X86ISD::ADD when the carry flag isn't used.

This allows us to use an 8-bit sign extended immediate instead of a 16 or 32 bit immediate.

Also do similar for 0x80000000 with 64-bit adds to avoid having to use a movabsq.

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

6 years ago[X86] Suppress load folding for add/sub with 128 immediate.
Craig Topper [Wed, 6 Mar 2019 07:36:36 +0000 (07:36 +0000)]
[X86] Suppress load folding for add/sub with 128 immediate.

128 won't fit in a sign extended 8-bit immediate, but we can negate it to -128 and use the other operation. This results in a shorter encoding since the move would have used 16 or 32 bits for the immediate.

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

6 years ago[CodeGen] Omit range checks from jump tables when lowering switches with unreachable...
Ayonam Ray [Wed, 6 Mar 2019 07:27:45 +0000 (07:27 +0000)]
[CodeGen] Omit range checks from jump tables when lowering switches with unreachable default

During the lowering of a switch that would result in the generation of a
jump table, a range check is performed before indexing into the jump
table, for the switch value being outside the jump table range and a
conditional branch is inserted to jump to the default block. In case the
default block is unreachable, this conditional jump can be omitted. This
patch implements omitting this conditional branch for unreachable
defaults.

Differential Revision: https://reviews.llvm.org/D52002
Reviewers: Hans Wennborg, Eli Freidman, Roman Lebedev

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

6 years agogn build: Merge r355439.
Peter Collingbourne [Wed, 6 Mar 2019 03:08:06 +0000 (03:08 +0000)]
gn build: Merge r355439.

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

6 years ago[NFC] Declare the member data of class PostGenericScheduler as "protected" instead...
QingShan Zhang [Wed, 6 Mar 2019 02:39:18 +0000 (02:39 +0000)]
[NFC] Declare the member data of class PostGenericScheduler as "protected" instead of "private"

Some target might try to subclass the PostGenericScheduler to custom the scheduling strategy.
We need to declare the member data of PostGenericScheduler as "protected", which acts the same as "GenericScheduler".

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

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

6 years ago[X86] Remove periods from the end of SubtargetFeature descriptions since the help...
Craig Topper [Wed, 6 Mar 2019 02:36:48 +0000 (02:36 +0000)]
[X86] Remove periods from the end of SubtargetFeature descriptions since the help printer adds a period.

Most features don't have periods already, but some did. When there is a period it causes llc -mattr=+help to print 2 periods.

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

6 years ago[WebAssembly] Remove trailing whitespaces in tests (NFC)
Heejin Ahn [Wed, 6 Mar 2019 02:00:22 +0000 (02:00 +0000)]
[WebAssembly] Remove trailing whitespaces in tests (NFC)

Reviewers: sbc100

Subscribers: dschuff, jgravelle-google, sunfish, llvm-commits

Tags: #llvm

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

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

6 years ago[BinaryFormat] Add DT_USED tag into dynamic section.
Xing GUO [Wed, 6 Mar 2019 01:28:40 +0000 (01:28 +0000)]
[BinaryFormat] Add DT_USED tag into dynamic section.

Summary:
This tag is documented in https://docs.oracle.com/cd/E19253-01/817-1984/chapter6-42444/index.html
Though I could not find some docs that describe it in detail, I found some code snippets.

1.
```
/*
 * Look up the string in the string table and get its offset. If
 * this succeeds, then it is possible that there is a DT_NEEDED
 * dynamic entry that references it.
 */
have_string = elfedit_sec_findstr(argstate->str.sec,
    strpad_elt.dn_dyn.d_un.d_val, arg, &str_offset) != 0;
if (have_string) {
dyn = argstate->dynamic.data;
for (ndx = 0; ndx < numdyn; dyn++, ndx++) {
if (((dyn->d_tag == DT_NEEDED) ||
    (dyn->d_tag == DT_USED)) &&
    (dyn->d_un.d_val == str_offset))
goto done;
}
}
```
https://github.com/kofemann/opensolaris/blob/80192cd83bf665e708269dae856f9145f7190f74/usr/src/cmd/sgs/elfedit/modules/common/syminfo.c#L512

2.
```
    case DT_USED:
    case DT_INIT_ARRAY:
    case DT_FINI_ARRAY:
      if (do_dynamic)
        {
          if (entry->d_tag == DT_USED
          && VALID_DYNAMIC_NAME (entry->d_un.d_val))
        {
          char *name = GET_DYNAMIC_NAME (entry->d_un.d_val);

          if (*name)
            {
              printf (_("Not needed object: [%s]\n"), name);
              break;
            }
        }

          print_vma (entry->d_un.d_val, PREFIX_HEX);
          putchar ('\n');
        }
      break;
```
http://web.mit.edu/freebsd/head/contrib/binutils/binutils/readelf.c

3.
```
#define DT_USED     0x7ffffffe  /* ignored - same as needed */
```
https://github.com/switchbrew/switch-tools/blob/master/src/elf_common.h

Reviewers: jhenderson, grimar

Reviewed By: jhenderson, grimar

Subscribers: emaste, krytarowski, fedor.sergeev, llvm-commits

Tags: #llvm

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

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

6 years agogn build: Add 32-bit Linux support.
Peter Collingbourne [Wed, 6 Mar 2019 01:28:32 +0000 (01:28 +0000)]
gn build: Add 32-bit Linux support.

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

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

6 years agoRevert "[AtomicExpand] Allow libcall expansion for non-zero address spaces" for build...
Mitch Phillips [Wed, 6 Mar 2019 00:25:40 +0000 (00:25 +0000)]
Revert "[AtomicExpand] Allow libcall expansion for non-zero address spaces" for buildbot failures.

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

6 years ago[ARM] Sink zext/sext operands for add and sub to enable vsubl generation.
Florian Hahn [Wed, 6 Mar 2019 00:10:03 +0000 (00:10 +0000)]
[ARM] Sink zext/sext operands for add and sub to enable vsubl generation.

This uses the infrastructure added in rL353152 to sink zext and sexts to
sub/add users, to enable vsubl/vaddl generation when NEON is available.

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

Reviewers: SjoerdMeijer, t.p.northover, samparker, efriedma

Reviewed By: samparker

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

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

6 years ago[DWARFFormValue] Don't consider DW_FORM_data4/8 to be section offsets.
Jonas Devlieghere [Tue, 5 Mar 2019 23:47:22 +0000 (23:47 +0000)]
[DWARFFormValue] Don't consider DW_FORM_data4/8 to be section offsets.

When dumping ToT clan's debug info with dwarfdump, we were seeing an
error saying that that the location list overflows the debug_loc
section. After reducing the testcase we figured out that we were
interpreting the DW_FORM_data4 as a section offset.

In DWARF3 DW_FORM_data4 and DW_FORM_data8 served also as a section
offset. Until now we didn't check check for the DWARF version, because
some producers (read old versions of clang) were still emitting this.
The relevant code/comment was added in 2013, and I believe it's now
reasonable to start checking the version.

The FormValue class is a little bit of a mess because it cashes the
DWARF unit and context when it extracted the value itself. Several
methods of the class rely on it being present, or return an Optional for
the code path that needs it. At the same time the FormValue class also
used in places where there's no DWARF unit.

For this patch I went with the least invasive change: checking the
version from the CU when it's available. If it's not (because the form
value was created from a value directly) we default to the old behavior.

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

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

6 years ago[opt] Report if the provided architecture is invalid.
Florian Hahn [Tue, 5 Mar 2019 23:10:28 +0000 (23:10 +0000)]
[opt] Report if the provided architecture is invalid.

Partly addresses PR15026.

There are a few tests that passed in invalid architectures, which are fixed in: rL355349 and D58931

Reviewers: echristo, efriedma, rengolin, atrick

Reviewed By: efriedma

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

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

6 years ago[AtomicExpand] Allow libcall expansion for non-zero address spaces
Philip Reames [Tue, 5 Mar 2019 23:00:14 +0000 (23:00 +0000)]
[AtomicExpand] Allow libcall expansion for non-zero address spaces

Be consistent about how we treat atomics in non-zero address spaces.  If we get to the backend, we tend to lower them as if in address space 0.  Do the same if we need to insert a libcall instead.

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

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

6 years ago[X86][NFC] Add proper test for promotion of i8 cmov's of trunc's
Roman Lebedev [Tue, 5 Mar 2019 22:43:53 +0000 (22:43 +0000)]
[X86][NFC] Add proper test for promotion of i8 cmov's of trunc's

There was no proper test for that code in X86TargetLowering::LowerSELECT().
Noticed accidentally while trying to modify the last branch in that function.

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

6 years ago[WebAssembly] Simplify iterator navigations (NFC)
Heejin Ahn [Tue, 5 Mar 2019 21:05:09 +0000 (21:05 +0000)]
[WebAssembly] Simplify iterator navigations (NFC)

Summary:
- Replaces some uses of `MachineFunction::iterator(MBB)` with
  `MBB->getIterator()` and `MachineBasicBlock::iterator(MI)` with
  `MI->getIterator()`, which are simpler.
- Replaces some uses of `std::prev` of `std::next` that takes a
  MachineFunction or MachineBasicBlock iterator with `getPrevNode` and
  `getNextNode`, which are also simpler.

Reviewers: sbc100

Subscribers: dschuff, sunfish, jgravelle-google, llvm-commits

Tags: #llvm

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

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

6 years ago[Remarks][NFC] Rename RemarkParser to YAMLRemarkParser
Francis Visoiu Mistrih [Tue, 5 Mar 2019 20:50:35 +0000 (20:50 +0000)]
[Remarks][NFC] Rename RemarkParser to YAMLRemarkParser

Rename it to reflect that it's parsing YAML remarks.

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

6 years ago[OptRemarks] Make OptRemarks more generic: rename OptRemarks to Remarks
Francis Visoiu Mistrih [Tue, 5 Mar 2019 20:45:17 +0000 (20:45 +0000)]
[OptRemarks] Make OptRemarks more generic: rename OptRemarks to Remarks

Getting rid of the name "optimization remarks" for anything that
involves handling remarks on the client side.

It's safer to do this now, before we get stuck with that name in all the
APIs and public interfaces we decide to export to users in the future.

This renames llvm/tools/opt-remarks to llvm/tools/remarks-shlib, and now
generates `libRemarks.dylib` instead of `libOptRemarks.dylib`.

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

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

6 years ago[WebAssembly] Disable MachineBlockPlacement pass
Heejin Ahn [Tue, 5 Mar 2019 20:35:34 +0000 (20:35 +0000)]
[WebAssembly] Disable MachineBlockPlacement pass

Summary:
This pass hurts code size for wasm and sometimes generates irreducible
control flow.
Context: https://github.com/emscripten-core/emscripten/pull/8233

Reviewers: kripken, dschuff

Subscribers: sunfish, sbc100, jgravelle-google, llvm-commits

Tags: #llvm

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

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

6 years ago[NFC][CodeGen][X86][AArch64] Add tests for C++ std::midpoint() pattern (PR40965)
Roman Lebedev [Tue, 5 Mar 2019 20:18:47 +0000 (20:18 +0000)]
[NFC][CodeGen][X86][AArch64] Add tests for C++ std::midpoint() pattern (PR40965)

Tests only for integers, not floating point or pointers.

The scalar 8-bit case uses branch instead of CMOV,
because there is no no 8-bit CMOV.

Vector tests are for consistency, since it can be vectorized.

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

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

6 years agoRevert r355224 "[TableGen][SelectionDAG][X86] Add specific isel matchers for immAllZe...
Craig Topper [Tue, 5 Mar 2019 19:18:16 +0000 (19:18 +0000)]
Revert r355224 "[TableGen][SelectionDAG][X86] Add specific isel matchers for immAllZerosV/immAllOnesV. Remove bitcasts from X86 patterns that are no longer necessary."

This caused the first matcher in the isel table for many targets to Opc_Scope instead of Opc_SwitchOpcode. This leads to a significant increase in isel match failures.

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

6 years ago[Subtarget] Merge ProcSched and ProcDesc arrays in MCSubtargetInfo into a single...
Craig Topper [Tue, 5 Mar 2019 18:54:38 +0000 (18:54 +0000)]
[Subtarget] Merge ProcSched and ProcDesc arrays in MCSubtargetInfo into a single array.

These arrays are both keyed by CPU name and go into the same tablegenerated file. Merge them so we only need to store keys once.

This also removes a weird space saving quirk where we used the ProcDesc.size() to create to build an ArrayRef for ProcSched.

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

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

6 years ago[X86] In X86DomainReassignment.cpp add enclosed registers to EnclosedEdges
Guozhi Wei [Tue, 5 Mar 2019 18:54:34 +0000 (18:54 +0000)]
[X86] In X86DomainReassignment.cpp add enclosed registers to EnclosedEdges

The variable X86DomainReassignment::EnclosedEdges is used to store registers that have been enclosed in some closure, so those registers will be ignored when create new closures. But there is no registers has ever been put into this set, so a single register can be enclosed in multiple closures, it significantly increase compile time.

This patch adds a register into EnclosedEdges when it is enclosed into a closure.

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

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

6 years ago[Subtarget] Create a separate SubtargetSubtargetKV struct for ProcDesc to remove...
Craig Topper [Tue, 5 Mar 2019 18:54:34 +0000 (18:54 +0000)]
[Subtarget] Create a separate SubtargetSubtargetKV struct for ProcDesc to remove fields from the stack tables that aren't needed for CPUs

The description for CPUs was just the CPU name wrapped with "Select the " and " processor". We can just do that directly in the help printer instead of making a separate version in the binary for each CPU.

Also remove the Value field that isn't needed and was always 0.

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

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

6 years ago[Subtarget] Move SubtargetFeatureKV/SubtargetInfoKV from SubtargetFeature.h to MCSubt...
Craig Topper [Tue, 5 Mar 2019 18:54:30 +0000 (18:54 +0000)]
[Subtarget] Move SubtargetFeatureKV/SubtargetInfoKV from SubtargetFeature.h to MCSubtargetInfo.h. Move all code that operates on ProcFeatures and ProcDesc arrays to MCSubtargetInfo.

The SubtargetFeature class managed a list of features as strings. And it also had functions for setting bits in a FeatureBitset.

The methods that operated on the Feature list as strings are used in other parts of the backend. But the parts that operate on FeatureBitset are very tightly coupled to MCSubtargetInfo and requires passing in the arrays that MCSubtargetInfo owns. And the same struct type is used for ProcFeatures and ProcDesc.

This has led to MCSubtargetInfo having 2 arrays keyed by CPU name. One containing a mapping from a CPU name to its features. And one containing a mapping from CPU name to its scheduler model.

I would like to make a single CPU array containing all CPU information and remove some unneeded fields the ProcDesc array currently has. But I don't want to make SubtargetFeatures.h have to know about the scheduler model type and have to forward declare or pull in the header file.

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

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

6 years agoAMDGPU: Preserve undef flag when expanding SI_IF
Matt Arsenault [Tue, 5 Mar 2019 18:38:00 +0000 (18:38 +0000)]
AMDGPU: Preserve undef flag when expanding SI_IF

Fixes undefined value verifier error.

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

6 years ago[X86] Enable 8-bit SHL to convert to LEA
Craig Topper [Tue, 5 Mar 2019 18:37:41 +0000 (18:37 +0000)]
[X86] Enable 8-bit SHL to convert to LEA

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

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

6 years ago[X86] Allow 8-bit INC/DEC to be converted to LEA.
Craig Topper [Tue, 5 Mar 2019 18:37:37 +0000 (18:37 +0000)]
[X86] Allow 8-bit INC/DEC to be converted to LEA.

We already do this for 16/32/64 as well as 8-bit add with register/immediate. Might as well do it for 8-bit INC/DEC too.

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

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

6 years ago[X86] Enable 8-bit OR with disjoint bits to convert to LEA
Craig Topper [Tue, 5 Mar 2019 18:37:33 +0000 (18:37 +0000)]
[X86] Enable 8-bit OR with disjoint bits to convert to LEA

We already support 8-bits adds in convertToThreeAddress. But we can also support 8-bit OR if the bits are disjoint. We already do this for 16/32/64.

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

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

6 years ago[SLP] Fix invalid triple in X86 tests
Florian Hahn [Tue, 5 Mar 2019 17:56:35 +0000 (17:56 +0000)]
[SLP] Fix invalid triple in X86 tests

x86-64 is an invalid architecture in triples. Changing it to the correct
triple (x86_64) changes some tests, because SLP is not deemed profitable
any more.

Reviewers: ABataev, RKSimon, spatel

Reviewed By: RKSimon

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

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

6 years agoTableGen: Allow lists to be concatenated through '#'
Javed Absar [Tue, 5 Mar 2019 17:16:07 +0000 (17:16 +0000)]
TableGen:  Allow lists to be concatenated through '#'

Currently one can concatenate strings using hash(#),
but not lists, although that would be a natural thing to do.

This patch allows one to write something like:
def : A<!listconcat([1,2], [3,4])>;
simply as :
def : A<[1,2] # [3,4]>;

This was missing feature was highlighted by Nicolai
at FOSDEM talk.

Reviewed by: nhaehnle, hfinkel

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

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

6 years ago[X86][SSE] Regenerate vector zero tests
Simon Pilgrim [Tue, 5 Mar 2019 16:52:14 +0000 (16:52 +0000)]
[X86][SSE] Regenerate vector zero tests

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

6 years ago[SDAG] move FP constant folding to helper function; NFC
Sanjay Patel [Tue, 5 Mar 2019 16:42:33 +0000 (16:42 +0000)]
[SDAG] move FP constant folding to helper function; NFC

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

6 years agoRevert "[GlobalISel][AArch64] Add selection support for G_EXTRACT_VECTOR_ELT"
Jessica Paquette [Tue, 5 Mar 2019 15:47:00 +0000 (15:47 +0000)]
Revert "[GlobalISel][AArch64] Add selection support for G_EXTRACT_VECTOR_ELT"

This broke test-suite::aarch64_neon_intrinsics.test

Reverting while I look into it.

Example failure:
http://lab.llvm.org:8011/builders/clang-cmake-aarch64-quick/builds/17740

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

6 years ago[X86] Add SMULO/UMULO combine tests
Simon Pilgrim [Tue, 5 Mar 2019 15:36:45 +0000 (15:36 +0000)]
[X86] Add SMULO/UMULO combine tests

Include scalar and vector test variants covering the folds in DAGCombiner (vector isn't currently supported - PR40442)

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

6 years agoFix typo in constant vector
Simon Pilgrim [Tue, 5 Mar 2019 15:06:01 +0000 (15:06 +0000)]
Fix typo in constant vector

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

6 years ago[X86] Add SADDO/UADDO and SSUBO/USUBO combine tests
Simon Pilgrim [Tue, 5 Mar 2019 14:52:42 +0000 (14:52 +0000)]
[X86] Add SADDO/UADDO and SSUBO/USUBO combine tests

Include scalar and vector test variants covering the folds in DAGCombiner (vector isn't currently supported - PR40442)

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

6 years ago[X86] Add test cases for D58874
Simon Pilgrim [Tue, 5 Mar 2019 13:52:09 +0000 (13:52 +0000)]
[X86] Add test cases for D58874

Add scalar and vector test cases for missing (add (add (xor a, -1), b), 1) -> (sub b, a) fold

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

6 years ago[llvm-objcopy] - Simplify `isCompressable` and fix the issue relative.
George Rimar [Tue, 5 Mar 2019 13:07:43 +0000 (13:07 +0000)]
[llvm-objcopy] - Simplify `isCompressable` and fix the issue relative.

When --compress-debug-sections is given, llvm-objcopy do not compress
sections that have "ZLIB" header in data. Normally this signature is used
in zlib-gnu compression format. But if zlib-gnu used then the name of the compressed
section should start from .z* (e.g .zdebug_info). If it does not, then it is not
a zlib-gnu format and section should be treated as a normal uncompressed section.

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

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

6 years ago[AMDGPU] Fix DPP operand order in atomic optimizer
Carl Ritson [Tue, 5 Mar 2019 12:21:44 +0000 (12:21 +0000)]
[AMDGPU] Fix DPP operand order in atomic optimizer

Summary:
Ensure order of operands in DPP atomic optimizer final WWM step is appropriate for sub instructions.

Change-Id: I631d050e1c00a3b4bc7c11a90437064403c4cf30

Reviewers: sheredom, tpr

Reviewed By: sheredom

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

Tags: #llvm

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

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

6 years ago[SCEV] Ensure that isHighCostExpansion takes into account what is being divided
David Green [Tue, 5 Mar 2019 12:12:18 +0000 (12:12 +0000)]
[SCEV] Ensure that isHighCostExpansion takes into account what is being divided

A SCEV is not low-cost just because you can divide it by a power of 2. We need to also
check what we are dividing to make sure it too is not a high-code expansion. This helps
to not expand the exit value of certain loops, helping not to bloat the code.

The change in no-iv-rewrite.ll is reverting back to what it was testing before rL194116,
and looks a lot like the other tests in replace-loop-exit-folds.ll.

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

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

6 years ago[llvm-objcopy] - Report "no zlib available" error properly when --compress-debug...
George Rimar [Tue, 5 Mar 2019 11:32:14 +0000 (11:32 +0000)]
[llvm-objcopy] - Report "no zlib available" error properly when --compress-debug-sections is used.

If zlib is not available, and --compress-debug-sections is passed,
we want to report an error. Currently, it is only reported for
--compress_debug_sections= form of the option.

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

I do not think there is a way to write a test for this.

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

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

6 years ago[SCEV] Add some extra tests for IndVarSimplifys loop exit values. NFC.
David Green [Tue, 5 Mar 2019 11:18:55 +0000 (11:18 +0000)]
[SCEV] Add some extra tests for IndVarSimplifys loop exit values. NFC.

Add some tests for various loops of the form:
  while(S >= 32) {
    S -= 32;
    something();
  };
  return S;

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

6 years ago[WebAssembly] Rename a variable in LateEHPrepare (NFC)
Heejin Ahn [Tue, 5 Mar 2019 11:11:34 +0000 (11:11 +0000)]
[WebAssembly] Rename a variable in LateEHPrepare (NFC)

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

6 years agoAdd wildcard support to all update_*_test_checks.py scripts (PR37500)
Simon Pilgrim [Tue, 5 Mar 2019 10:44:37 +0000 (10:44 +0000)]
Add wildcard support to all update_*_test_checks.py scripts (PR37500)

We can already update multiple files in each update call, this extends it to work with wildcards as well in the same way as update_mca_test_checks.py (to support shells that won't do this for us - windows command prompt etc.)

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

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

6 years ago[ARM] Fix select_cc lowering for fp16
Oliver Stannard [Tue, 5 Mar 2019 10:42:34 +0000 (10:42 +0000)]
[ARM] Fix select_cc lowering for fp16

When lowering a select_cc node where the true and false values are of type f16,
we can't use a general conditional move because the FP16 instructions do not
support conditional execution. Instead, we must ensure that the condition code
is one of the four supported by the VSEL instruction.

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

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

6 years ago[AMDGPU] Omit KILL instructions from hazard recognizer
David Stuttard [Tue, 5 Mar 2019 10:25:16 +0000 (10:25 +0000)]
[AMDGPU] Omit KILL instructions from hazard recognizer

Summary:
In some cases the KILL was causing a hazard to be introduced as these were
scheduled into hazard slots, but don't result in an instruction.

KILL shouldn't be considered for hazard recognition.

Change-Id: Ib6d2a2160f8c94cd0ce611ab198c7e4f46aeffcf

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

Tags: #llvm

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

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

6 years ago[LangRef] Add 'callbr' instruction to the 'blockaddress' section.
Craig Topper [Tue, 5 Mar 2019 05:23:37 +0000 (05:23 +0000)]
[LangRef] Add 'callbr' instruction to the 'blockaddress' section.

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

6 years ago[PowerPC] fix killed/dead flag after convert x-form to d-form tranformation.
Chen Zheng [Tue, 5 Mar 2019 04:56:54 +0000 (04:56 +0000)]
[PowerPC] fix killed/dead flag after convert x-form to d-form tranformation.
Differential Revision: https://reviews.llvm.org/D58428

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

6 years ago[ARM][MC] Update one test case in 'test/MC/Disassembler/ARM/invalid-armv7.txt'
Xing GUO [Tue, 5 Mar 2019 03:07:56 +0000 (03:07 +0000)]
[ARM][MC] Update one test case in 'test/MC/Disassembler/ARM/invalid-armv7.txt'

Summary:
Instruction `[0xfe 0xf0 0x20 0xe3]` is a valid instruction on ARM-v7, which is `dbg #14`. See:
https://www.cl.cam.ac.uk/research/srg/han/ACS-P35/zynq/ARMv7-A-R-manual.pdf
(Page: 377)

```
Encoding A1:
DBG<c> #<option>

|31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16|15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00|
|      cond | 0  0  1  1  0| 0| 1  0| 0  0  0  0| 1  1  1  1| 0  0  0  0| 1  1  1  1|    option |
```

Reviewers: fhahn, efriedma

Reviewed By: efriedma

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

Tags: #llvm

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

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

6 years ago[AMDGPU] Implement AMDGPUMCInstrAnalysis
Scott Linder [Tue, 5 Mar 2019 03:02:00 +0000 (03:02 +0000)]
[AMDGPU] Implement AMDGPUMCInstrAnalysis

Implement MCInstrAnalysis for AMDGPU, with default implementations save
for `evaluateBranch`.

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

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

6 years agoPHI nodes are not `FPMathOperator` s
Sanjoy Das [Tue, 5 Mar 2019 01:15:08 +0000 (01:15 +0000)]
PHI nodes are not `FPMathOperator` s

Reviewers: chandlerc, arsenm

Reviewed By: arsenm

Subscribers: wdng, arsenm, mcrosier, jlebar, bixia, llvm-commits

Tags: #llvm

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

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

6 years ago[X86] Reduce some patterns by using FP instructions for integer types even when AVX2...
Craig Topper [Tue, 5 Mar 2019 01:14:25 +0000 (01:14 +0000)]
[X86] Reduce some patterns by using FP instructions for integer types even when AVX2 is available and execution domain fixing will do the right thing

We have quite a few cases of using FP instructions for integer operations when only AVX1 is available. Then we switch to integer instructions with AVX2. In a lot of these cases execution domain fixing will take care of turning FP instructions into integer if its profitable.

With this patch we just keep on using the FP instructions even with AVX2. I've only handled some cases that don't require messing with patterns that are defined in the instruction definition. Those will require more subtle multiclass work possibly involving null_frag, hasSideEffects = 0, etc.

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

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

6 years ago[BPF] Do not generate BTF sections unnecessarily
Yonghong Song [Tue, 5 Mar 2019 01:01:21 +0000 (01:01 +0000)]
[BPF] Do not generate BTF sections unnecessarily

If There is no types/non-empty strings, do not generate
.BTF section. If there is no func_info/line_info, do
not generate .BTF.ext section.

Signed-off-by: Yonghong Song <yhs@fb.com>
Differential Revision: https://reviews.llvm.org/D58936

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

6 years ago[cmake] Create exports for umbrella library targets
Shoaib Meenai [Tue, 5 Mar 2019 00:38:32 +0000 (00:38 +0000)]
[cmake] Create exports for umbrella library targets

When using the umbrella llvm-libraries and clang-libraries targets, we
should export all library targets, otherwise they'll be part of our
distribution but not usable from the CMake package.

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

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

6 years agoFix invalid target triples in tests. (NFC)
Florian Hahn [Mon, 4 Mar 2019 23:37:41 +0000 (23:37 +0000)]
Fix invalid target triples in tests. (NFC)

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

6 years ago[msan] Instrument x86 BMI intrinsics.
Evgeniy Stepanov [Mon, 4 Mar 2019 22:58:20 +0000 (22:58 +0000)]
[msan] Instrument x86 BMI intrinsics.

Summary:
They simply shuffle bits. MSan needs to do the same with shadow bits,
after making sure that the shuffle mask is fully initialized.

Reviewers: pcc, vitalybuka

Subscribers: hiraditya, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

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

6 years ago[NFC] Fix PGO link error in shared libs build
Jordan Rupprecht [Mon, 4 Mar 2019 22:54:44 +0000 (22:54 +0000)]
[NFC] Fix PGO link error in shared libs build

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

6 years ago[CodeGenPrepare] avoid crashing on non-canonical/degenerate code
Sanjay Patel [Mon, 4 Mar 2019 22:47:13 +0000 (22:47 +0000)]
[CodeGenPrepare] avoid crashing on non-canonical/degenerate code

The test is reduced from an example in the post-commit thread for:
rL354746
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20190304/632396.html

While we must avoid dying here, the real question should be:
Why is non-canonical and/or degenerate code making it to CGP when
using the new pass manager?

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

6 years ago[GlobalISel][AArch64] Add selection support for G_EXTRACT_VECTOR_ELT
Jessica Paquette [Mon, 4 Mar 2019 22:35:32 +0000 (22:35 +0000)]
[GlobalISel][AArch64] Add selection support for G_EXTRACT_VECTOR_ELT

This adds instruction selection support for G_EXTRACT_VECTOR_ELT for cases
where the index is defined by a G_CONSTANT.

It also factos out the lane copy opcode selection part into its own function,
`getLaneCopyOpcode`. This is used by both `selectUnmergeValues` and
`selectExtractElt`.

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

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

6 years ago[build] Rename clang-headers to clang-resource-headers
Shoaib Meenai [Mon, 4 Mar 2019 21:19:53 +0000 (21:19 +0000)]
[build] Rename clang-headers to clang-resource-headers

Summary:
The current install-clang-headers target installs clang's resource
directory headers. This is different from the install-llvm-headers
target, which installs LLVM's API headers. We want to introduce the
corresponding target to clang, and the natural name for that new target
would be install-clang-headers. Rename the existing target to
install-clang-resource-headers to free up the install-clang-headers name
for the new target, following the discussion on cfe-dev [1].

I didn't find any bots on zorg referencing install-clang-headers. I'll
send out another PSA to cfe-dev to accompany this rename.

[1] http://lists.llvm.org/pipermail/cfe-dev/2019-February/061365.html

Reviewers: beanz, phosek, tstellar, rnk, dim, serge-sans-paille

Subscribers: mgorny, javed.absar, jdoerfert, #sanitizers, openmp-commits, lldb-commits, cfe-commits, llvm-commits

Tags: #clang, #sanitizers, #lldb, #openmp, #llvm

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

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

6 years ago[GlobalISel][AArch64] Legalize vector G_SELECT
Jessica Paquette [Mon, 4 Mar 2019 21:12:46 +0000 (21:12 +0000)]
[GlobalISel][AArch64] Legalize vector G_SELECT

Just scalarize it, and add a test showing it works.

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

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

6 years agoFix wrong enum value in switch.
Evgeniy Stepanov [Mon, 4 Mar 2019 21:00:28 +0000 (21:00 +0000)]
Fix wrong enum value in switch.

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

6 years ago[ConstantHoisting] avoid hang/crash from unreachable blocks (PR40930)
Sanjay Patel [Mon, 4 Mar 2019 20:57:14 +0000 (20:57 +0000)]
[ConstantHoisting] avoid hang/crash from unreachable blocks (PR40930)

I'm not too familiar with this pass, so there might be a better
solution, but this appears to fix the degenerate:
PR40930
PR40931
PR40932
PR40934
...without affecting any real-world code.

As we've seen in several other passes, when we have unreachable blocks,
they can contain semi-bogus IR and/or cause unexpected conditions. We
would not typically expect these patterns to make it this far, but we
have to guard against them anyway.

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

6 years ago[PGO] Context sensitive PGO (part 3)
Rong Xu [Mon, 4 Mar 2019 20:21:27 +0000 (20:21 +0000)]
[PGO] Context sensitive PGO (part 3)

Part 3 of CSPGO changes (mostly related to PassMananger).

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

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

6 years ago[InstCombine] Add tests for add nsw + sadd.with.overflow; NFC
Nikita Popov [Mon, 4 Mar 2019 19:35:46 +0000 (19:35 +0000)]
[InstCombine] Add tests for add nsw + sadd.with.overflow; NFC

Baseline tests for D58881, which fixes part of PR38146.

Patch by Dan Robertson.

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

6 years ago[Subtarget] Follow up to r355167, add another set of curly braces to FeatureBitArray...
Craig Topper [Mon, 4 Mar 2019 19:23:37 +0000 (19:23 +0000)]
[Subtarget] Follow up to r355167, add another set of curly braces to FeatureBitArray initialization to satisfy older versions of clang.

Apparently older versions of clang like 3.6 require an extra set of curly braces around std::array initializations. I'm told the C++ language was changed regarding this by CWG 1270.

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

6 years agoRe-commit r355104: "[AArch64][GlobalISel] Add support for 64 bit vector shuffle using...
Amara Emerson [Mon, 4 Mar 2019 19:16:00 +0000 (19:16 +0000)]
Re-commit r355104: "[AArch64][GlobalISel] Add support for 64 bit vector shuffle using TBL1."

The code to materialize a mask from a constant pool load tried to use a 128 bit
LDR to load a 64 bit constant pool entry, which was 8 byte aligned. This resulted
in a link failure in the NEON tests in the test suite since the LDR address was
unaligned. This change fixes that to instead emit a 64 bit LDR if the entry is
64 bit, before converting back to a 128 bit register for the TBL.

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

6 years ago[MC] Teach ELFObjectWriter that parse-time variables do not appear in
Nirav Dave [Mon, 4 Mar 2019 19:12:56 +0000 (19:12 +0000)]
[MC] Teach ELFObjectWriter that parse-time variables do not appear in
symbol table.

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

6 years ago[DAGCombiner][X86][SystemZ][AArch64] Combine some cases of (bitcast (build_vector...
Craig Topper [Mon, 4 Mar 2019 19:12:16 +0000 (19:12 +0000)]
[DAGCombiner][X86][SystemZ][AArch64] Combine some cases of (bitcast (build_vector constants)) between legalize types and legalize dag.

This patch enables combining integer bitcasts of integer build vectors when the new scalar type is legal. I've avoided floating point because the implementation bitcasts float to int along the way and we would need to check the intermediate types for legality

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

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

6 years ago[WebAssembly] Add support for data sections in the assembler.
Wouter van Oortmerssen [Mon, 4 Mar 2019 17:18:04 +0000 (17:18 +0000)]
[WebAssembly] Add support for data sections in the assembler.

Summary:
This is quite minimal so far, introduce them with .section,
fill them with .int8 or .asciz, end with .size

Reviewers: dschuff, sbc100, aheejin

Subscribers: jgravelle-google, sunfish, llvm-commits

Tags: #llvm

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

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

6 years agoRevert duplicate check for DragonFly BSD
Kamil Rytarowski [Mon, 4 Mar 2019 15:51:02 +0000 (15:51 +0000)]
Revert duplicate check for DragonFly BSD

Summary: Revert duplicate check for DragonFly BSD

Submitted by tuxillo.

Reviewers: krytarowski

Reviewed By: krytarowski

Subscribers: mgorny, llvm-commits

Tags: #llvm

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

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

6 years ago[X86] Regenerate illegal type load test with non-undef load address.
Simon Pilgrim [Mon, 4 Mar 2019 14:49:02 +0000 (14:49 +0000)]
[X86] Regenerate illegal type load test with non-undef load address.

This would be affected by an upcoming patch without undoing some of the bugpoint reduction.

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

6 years agoUnbreak shared library linkage on DragonFlyBSD.
Kamil Rytarowski [Mon, 4 Mar 2019 14:36:43 +0000 (14:36 +0000)]
Unbreak shared library linkage on DragonFlyBSD.

Patch submitted by rimvydas.

Reviewers: llvm-commits, krytarowski, mgorny

Reviewed By: krytarowski, mgorny

Subscribers: mgorny

Tags: #llvm

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

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

6 years ago[MCA] Remove unused methods. NFC
Andrea Di Biagio [Mon, 4 Mar 2019 13:34:56 +0000 (13:34 +0000)]
[MCA] Remove unused methods. NFC

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

6 years ago[AMDGPU][MC] Enable lds_direct operand for v_readfirstlane_b32, v_readlane_b32 and...
Dmitry Preobrazhensky [Mon, 4 Mar 2019 12:48:32 +0000 (12:48 +0000)]
[AMDGPU][MC] Enable lds_direct operand for v_readfirstlane_b32, v_readlane_b32 and v_writelane_b32

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

Reviewers: artem.tamazov, arsenm, rampitec

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

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

6 years ago[MCA] Correctly initialize struct SummaryView::BackPressureInfo.
Andrea Di Biagio [Mon, 4 Mar 2019 12:23:05 +0000 (12:23 +0000)]
[MCA] Correctly initialize struct SummaryView::BackPressureInfo.

This should appease the buildbots.

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

6 years ago[MCA] Highlight kernel bottlenecks in the summary view.
Andrea Di Biagio [Mon, 4 Mar 2019 11:52:34 +0000 (11:52 +0000)]
[MCA] Highlight kernel bottlenecks in the summary view.

This patch adds a new flag named -bottleneck-analysis to print out information
about throughput bottlenecks.

MCA knows how to identify and classify dynamic dispatch stalls. However, it
doesn't know how to analyze and highlight kernel bottlenecks.  The goal of this
patch is to teach MCA how to correlate increases in backend pressure to backend
stalls (and therefore, the loss of throughput).

From a Scheduler point of view, backend pressure is a function of the scheduler
buffer usage (i.e. how the number of uOps in the scheduler buffers changes over
time). Backend pressure increases (or decreases) when there is a mismatch
between the number of opcodes dispatched, and the number of opcodes issued in
the same cycle.  Since buffer resources are limited, continuous increases in
backend pressure would eventually leads to dispatch stalls. So, there is a
strong correlation between dispatch stalls, and how backpressure changed over
time.

This patch teaches how to identify situations where backend pressure increases
due to:
 - unavailable pipeline resources.
 - data dependencies.

Data dependencies may delay execution of instructions and therefore increase the
time that uOps have to spend in the scheduler buffers. That often translates to
an increase in backend pressure which may eventually lead to a bottleneck.
Contention on pipeline resources may also delay execution of instructions, and
lead to a temporary increase in backend pressure.

Internally, the Scheduler classifies instructions based on whether register /
memory operands are available or not.

An instruction is marked as "ready to execute" only if data dependencies are
fully resolved.
Every cycle, the Scheduler attempts to execute all instructions that are ready
to execute. If an instruction cannot execute because of unavailable pipeline
resources, then the Scheduler internally updates a BusyResourceUnits mask with
the ID of each unavailable resource.

ExecuteStage is responsible for tracking changes in backend pressure. If backend
pressure increases during a cycle because of contention on pipeline resources,
then ExecuteStage sends a "backend pressure" event to the listeners.
That event would contain information about instructions delayed by resource
pressure, as well as the BusyResourceUnits mask.

Note that ExecuteStage also knows how to identify situations where backpressure
increased because of delays introduced by data dependencies.

The SummaryView observes "backend pressure" events and prints out a "bottleneck
report".

Example of bottleneck report:

```
Cycles with backend pressure increase [ 99.89% ]
Throughput Bottlenecks:
  Resource Pressure       [ 0.00% ]
  Data Dependencies:      [ 99.89% ]
   - Register Dependencies [ 0.00% ]
   - Memory Dependencies   [ 99.89% ]
```

A bottleneck report is printed out only if increases in backend pressure
eventually caused backend stalls.

About the time complexity:

Time complexity is linear in the number of instructions in the
Scheduler::PendingSet.

The average slowdown tends to be in the range of ~5-6%.
For memory intensive kernels, the slowdown can be significant if flag
-noalias=false is specified. In the worst case scenario I have observed a
slowdown of ~30% when flag -noalias=false was specified.

We can definitely recover part of that slowdown if we optimize class LSUnit (by
doing extra bookkeeping to speedup queries). For now, this new analysis is
disabled by default, and it can be enabled via flag -bottleneck-analysis. Users
of MCA as a library can enable the generation of pressure events through the
constructor of ExecuteStage.

This patch partially addresses https://bugs.llvm.org/show_bug.cgi?id=37494

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

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

6 years ago[X86] Avoid codegen changes when DBG_VALUE appears between lowered selects
Jeremy Morse [Mon, 4 Mar 2019 10:56:02 +0000 (10:56 +0000)]
[X86] Avoid codegen changes when DBG_VALUE appears between lowered selects

X86TargetLowering::EmitLoweredSelect presently detects sequences of CMOV pseudo
instructions without accounting for debug intrinsics. This leads to different
codegen with and without option -g, if a DBG_VALUE instruction lands in the
middle of several lowered selects.

Work around this by skipping over debug instructions when looking for CMOV
sequences, and sinking those debug insts into the EmitLoweredSelect sunk block.
This might slightly shift where variables appear in the instruction sequence,
but won't re-order assignments.

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

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

6 years ago[ARM] Fix selection of VLDR.16 instruction with imm offset
Oliver Stannard [Mon, 4 Mar 2019 09:17:38 +0000 (09:17 +0000)]
[ARM] Fix selection of VLDR.16 instruction with imm offset

The isScaledConstantInRange function takes upper and lower bounds which are
checked after dividing by the scale, so the bounds checks for half, single and
double precision should all be the same. Previously, we had wrong bounds checks
for half precision, so selected an immediate the instructions can't actually
represent.

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

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

6 years ago[AArch64/ARM] Fix two compiler warnings in InstructionSelector, NFCI
Jonas Hahnfeld [Mon, 4 Mar 2019 08:51:32 +0000 (08:51 +0000)]
[AArch64/ARM] Fix two compiler warnings in InstructionSelector, NFCI

1) GCC complains that KnownValid is set but not used.
2) In ARMInstructionSelector::selectGlobal() the code is mixing "enumeral
   and non-enumeral type in conditional expression". Solve this by casting
   to unsigned which is the final type anyway.

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

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

6 years ago[DebugInfo] Construct nested types on behalf of owner CU
Eugene Leviant [Mon, 4 Mar 2019 07:15:36 +0000 (07:15 +0000)]
[DebugInfo] Construct nested types on behalf of owner CU

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

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

6 years ago[llvm] [Support] Revert "Reimplement getMainExecutable() using sysctl on NetBSD"
Michal Gorny [Mon, 4 Mar 2019 04:53:50 +0000 (04:53 +0000)]
[llvm] [Support] Revert "Reimplement getMainExecutable() using sysctl on NetBSD"

This apparently does not work reliably after all (non-reentrant?)
and causes test failures such as:

http://lab.llvm.org:8011/builders/netbsd-amd64/builds/19254/steps/run%20unit%20tests/logs/FAIL%3A%20libc%2B%2B%3A%3Asize.pass.cpp

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

6 years ago[InstCombine] Mark debug values as unavailable after DCE.
Davide Italiano [Mon, 4 Mar 2019 04:38:58 +0000 (04:38 +0000)]
[InstCombine] Mark debug values as unavailable after DCE.

Fixes PR40838.

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

6 years ago[SubtargetFeatures] Add operator< for comparing SubtargetInfoKV objects. NFCI
Craig Topper [Mon, 4 Mar 2019 04:26:31 +0000 (04:26 +0000)]
[SubtargetFeatures] Add operator< for comparing SubtargetInfoKV objects. NFCI

Use instead of passing a lambda to std::is_sorted. This is more consistent with SubtargetFeatureKV.

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

6 years ago[SubtargetFeatures] Don't call ApplyFeatureFlag if the feature name is '+help'
Craig Topper [Mon, 4 Mar 2019 02:02:24 +0000 (02:02 +0000)]
[SubtargetFeatures] Don't call ApplyFeatureFlag if the feature name is '+help'

Just print the help and stop. Otherwise we'll print a message about it not being a real feature name after printing the help text.

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

6 years ago[SubtargetFeatuers] Simplify the code used to imply features from CPU name.
Craig Topper [Mon, 4 Mar 2019 02:02:22 +0000 (02:02 +0000)]
[SubtargetFeatuers] Simplify the code used to imply features from CPU name.

If we make SetImpliedBits OR features outside of its loop, we can reuse it for the first round of implying features for CPUs.

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

6 years ago[WebAssembly] Delete ThrowUnwindDest map from WasmEHFuncInfo
Heejin Ahn [Sun, 3 Mar 2019 22:35:56 +0000 (22:35 +0000)]
[WebAssembly] Delete ThrowUnwindDest map from WasmEHFuncInfo

Summary:
Before when we implemented the first EH proposal, 'catch <tag>'
instruction may not catch an exception so there were multiple EH pads an
exception can unwind to. That means a BB could have multiple EH pad
successors.

Now after we switched to the new proposal, every 'catch' instruction
catches an exception, and there is only one catchpad per catchswitch, so
we at most have one EH pad successor, making `ThrowUnwindDest` map in
`WasmEHInfo` unnecessary.

Keeping `ThrowUnwindDest` map in `WasmEHInfo` has its own problems,
because other optimization passes can split a BB that contains possibly
throwing calls (previously invokes), and we have to update the map every
time that happens, which is not easy for common CodeGen passes.

This also correctly updates successor info in LateEHPrepare when we add
a rethrow instruction.

Reviewers: dschuff

Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits

Tags: #llvm

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

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

6 years ago[X86] Regenerate test to get the full FP operands printed. NFC
Craig Topper [Sun, 3 Mar 2019 20:28:52 +0000 (20:28 +0000)]
[X86] Regenerate test to get the full FP operands printed. NFC

Missed when I updated the printer to print implicit %st operand on binops.

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

6 years ago[InstCombine] remove stale FIXME comment from test; NFC
Sanjay Patel [Sun, 3 Mar 2019 19:08:54 +0000 (19:08 +0000)]
[InstCombine] remove stale FIXME comment from test; NFC

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

6 years ago[ValueTracking] do not try to peek through bitcasts in computeKnownBitsFromAssume()
Sanjay Patel [Sun, 3 Mar 2019 18:59:33 +0000 (18:59 +0000)]
[ValueTracking] do not try to peek through bitcasts in computeKnownBitsFromAssume()

There are no tests for this case, and I'm not sure how it could ever work,
so I'm just removing this option from the matcher. This should fix PR40940:
https://bugs.llvm.org/show_bug.cgi?id=40940

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

6 years agoAdd extra ops in add to sub transform test in order to enforce proper operand orderin...
Amaury Sechet [Sun, 3 Mar 2019 15:11:13 +0000 (15:11 +0000)]
Add extra ops in add to sub transform test in order to enforce proper operand ordering. NFC

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

6 years ago[DemandedBits] Remove some redundancy in the work list
Fangrui Song [Sun, 3 Mar 2019 14:50:01 +0000 (14:50 +0000)]
[DemandedBits] Remove some redundancy in the work list

InputIsKnownDead check is shared by all operands. Compute it once.

For non-integer instructions, use Visited.insert(I).second to replace a
find() and an insert().

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

6 years agoRemove unused variable. NFCI.
Simon Pilgrim [Sun, 3 Mar 2019 14:23:07 +0000 (14:23 +0000)]
Remove unused variable. NFCI.

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

6 years ago[X86] getShuffleScalarElt - peek through insert/extract subvector nodes.
Simon Pilgrim [Sun, 3 Mar 2019 14:11:05 +0000 (14:11 +0000)]
[X86] getShuffleScalarElt - peek through insert/extract subvector nodes.

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