Commit Graph

178414 Commits

Author SHA1 Message Date
Keno Fischer
f880a637c4 [LoopInfo] Faster implementation of setLoopID. NFC.
Summary:
This change was part of D46460. However, in the meantime rL341926 fixed the
correctness issue here. What remained was the performance issue in setLoopID
where it would iterate through all blocks in the loop and their successors,
rather than just the predecessor of the header (the later presumably being
much faster). We already have the `getLoopLatches` to compute precisely these
basic blocks in an efficient manner, so just use it (as the original commit
did for `getLoopID`).

Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D61215

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359684 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-01 14:39:11 +00:00
Simon Pilgrim
8dd2ffc9c5 [X86][SSE] Add SSE vector shift support to SimplifyDemandedVectorEltsForTargetNode vector splitting
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359680 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-01 13:51:09 +00:00
Nico Weber
9f35ee5b0f Wrap to 80 columns, no behavior change
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359679 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-01 13:04:44 +00:00
Simon Pilgrim
4d65e3204f [X86][SSE] Split 512-bit -> 128-bit vector directly in SimplifyDemandedVectorEltsForTargetNode
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359678 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-01 12:48:42 +00:00
Simon Pilgrim
2fca0afb56 [X86][SSE] Add 512-bit vector support to SimplifyDemandedVectorEltsForTargetNode vector splitting
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359677 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-01 12:37:41 +00:00
Tim Northover
32c7e441d6 DAG: allow DAG pointer size different from memory representation.
In preparation for supporting ILP32 on AArch64, this modifies the SelectionDAG
builder code so that pointers are allowed to have a larger type when "live" in
the DAG compared to memory.

Pointers get zero-extended whenever they are loaded, and truncated prior to
stores.  In addition, a few not quite so obvious locations need updating:

  * A GEP that has not been marked inbounds needs to enforce the IR-documented
    2s-complement wrapping at the memory pointer size. Inbounds GEPs are
    undefined if they overflow the address space, so no additional operations
    are needed.
  * Signed comparisons would give incorrect results if performed on the
    zero-extended values.

This shouldn't affect CodeGen for now, but will become active when the AArch64
ILP32 support is committed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359676 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-01 12:37:30 +00:00
Simon Pilgrim
789617d109 [X86][SSE] Add X86ISD::PACKSS\PACKUS to SimplifyDemandedVectorEltsForTargetNode vector splitting
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359673 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-01 11:29:36 +00:00
Simon Pilgrim
d99b5efaf0 [X86][SSE] Add scalar horizontal add/sub tests for element extractions from upper lanes
As suggested on D61263

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359671 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-01 11:17:11 +00:00
Simon Pilgrim
2514755c37 [X86][SSE] Add X86ISD::UNPCKL\UNPCK to SimplifyDemandedVectorEltsForTargetNode vector splitting
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359670 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-01 11:08:03 +00:00
Simon Pilgrim
10164fd0af [X86][SSE] Move extract_subvector(pshufb) fold to SimplifyDemandedVectorEltsForTargetNode
This lets us hit more cases than combineExtractSubvector and allows us reuse more code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359669 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-01 10:58:38 +00:00
Fangrui Song
2a774bf95f [llvm-objdump] Print newlines before and after "Disassembly of section ...:"
This improves readability and the behavior is consistent with GNU objdump.

The new test test/tools/llvm-objdump/X86/disassemble-section-name.s
checks we print newlines before and after "Disassembly of section ...:"

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359668 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-01 10:40:48 +00:00
Simon Pilgrim
dcae8cc305 [X86] SimplifyDemandedVectorEltsForTargetNode - pull out vector halving code. NFCI.
Pull out the HADD/HSUB code to halve vector widths if the upper half isn't used - prep work to adding support for other opcodes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359667 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-01 10:38:10 +00:00
Simon Pilgrim
7aac3dc1f7 [X86][SSE] Extract i1 elements from vXi1 bool vectors
This is an alternative to D59669 which more aggressively extracts i1 elements from vXi1 bool vectors using a MOVMSK.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359666 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-01 10:02:22 +00:00
George Rimar
7845a5f0b1 [yaml2obj] - Report when unknown section is referenced from program header declaration block.
Previously we did not report this.
Also this removes multiple lookups in the map
what cleanups the code.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359663 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-01 09:45:55 +00:00
Fangrui Song
fceaf762c0 [llvm-readobj] Change -t to --symbols in tests. NFC
-t is --symbols in llvm-readobj but --section-details (unimplemented) in readelf.
The confusing option should not be used since we aim for improving
compatibility.

Keep just one llvm-readobj -t use case in test/tools/llvm-readobj/symbols.test

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359661 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-01 09:28:24 +00:00
Fangrui Song
530166f538 [gold] Fix two readelf tests after rL359649
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359660 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-01 09:01:10 +00:00
Craig Topper
570034ca11 [X86FixupLEAs] Hoist the calls to isLEA out of the 3 separate functions and put it in the basic block instruction loop. NFC
Now need to check it 3 different times. Just do it once at the top of the loop.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359658 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-01 06:53:03 +00:00
Fangrui Song
6a1ce946d7 Fix test/tools/llvm-readobj/mips-plt.test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359657 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-01 06:46:34 +00:00
Fangrui Song
e15998ba20 [llvm-readobj] llvm-readobj --elf-output-style=GNU => llvm-readelf. NFC
The latter is much more common.

A dedicated --elf-output-style=GNU test demonstrating it is the same as
llvm-readelf is sufficient.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359652 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-01 05:55:22 +00:00
Fangrui Song
a60f216744 [llvm-readobj] Change -long-option to --long-option in tests. NFC
We use both -long-option and --long-option in tests. Switch to --long-option for consistency.

In the "llvm-readelf" mode, -long-option is discouraged as it conflicts with grouped short options and it is not accepted by GNU readelf.

While updating the tests, change llvm-readobj -s to llvm-readobj -S to reduce confusion ("s" is --section-headers in llvm-readobj but --symbols in llvm-readelf).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359649 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-01 05:27:20 +00:00
David L. Jones
9697ae39f6 Revert "[llvm] r359313 - [PowerPC] Update P9 vector costs for insert/extract element"
This causes segfaults during optimized builds. More details, including a reproducer, are on the llvm-commits thread for r359313.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359648 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-01 05:01:03 +00:00
Fangrui Song
4e8c482aa1 Delete outdated comment about DISubprogram. NFC
rL301501 deleted DisplayName and rearranged the operands.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359647 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-01 03:38:41 +00:00
Lang Hames
b78c93233b [JITLink] Make sure we explicitly deallocate memory on failure.
JITLinkGeneric phases 2 and 3 (focused on applying fixups and finalizing memory,
respectively) may fail for various reasons. If this happens, we need to
explicitly de-allocate the memory allocated in phase 1 (explicitly, because
deallocation may also fail and so is implemented as a method returning error).

No testcase yet: I am still trying to decide on the right way to test totally
platform agnostic code like this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359643 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-01 02:43:52 +00:00
Eric Christopher
b404cbffb3 Make some comments that were meant to be for public documentation
actually public documentation (i.e. // -> ///).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359640 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-01 01:28:12 +00:00
Fangrui Song
7912c3276c [llvm-objcopy] Simplify SHT_NOBITS -> SHT_PROGBITS promotion
GNU objcopy uses bfd_elf_get_default_section_type to decide the candidate section type,
which roughly translates to our [a] (I assume SEC_COMMON implies SHF_ALLOC):

  (!(Sec.Flags & ELF::SHF_ALLOC) || Flags & (SectionFlag::SecContents | SectionFlag::SecLoad)))

Then, it updates the section type in bfd/elf.c:elf_fake_sections if:

  if (this_hdr->sh_type == SHT_NULL)
    this_hdr->sh_type = sh_type; // common case
  else if (this_hdr->sh_type == SHT_NOBITS
           && sh_type == SHT_PROGBITS
           && (asect->flags & SEC_ALLOC) != 0)  // uncommon case
    ...
    this_hdr->sh_type = sh_type;

If the following condition is met the uncommon branch is executed:

  if (elf_section_type (osec) == SHT_NULL
      && (osec->flags == isec->flags
	  || (final_link
	      && ((osec->flags ^ isec->flags)
		  & ~(SEC_LINK_ONCE | SEC_LINK_DUPLICATES | SEC_RELOC)) == 0)))

I suggest we just ignore this clause and follow the common case
behavior, which is done in this patch. Rationales to do so:

If --set-section-flags is a no-op (osec->flags == isec->flags)
(corresponds to the "readonly" test in set-section-flags.test), GNU
objcopy will require (Sec.Flags & ELF::SHF_ALLOC). [a] is essentially:

  Flags & (SectionFlag::SecContents | SectionFlag::SecLoad)

This special case is not really useful. Non-SHF_ALLOC SHT_NOBITS
sections do not make much sense and it doesn't matter if they are
SHT_NOBITS or SHT_PROGBITS.

For all other RUN lines in set-section-flags.test, the new behavior
matches GNU objcopy, i.e. this patch improves compatibility.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359639 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-01 00:39:31 +00:00
Nico Weber
6afe82bf84 gn build: Fix build on macOS after r359570 / r359527
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359637 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-30 23:40:58 +00:00
Nico Weber
61fd3a9c04 gn build: Merge r359626
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359635 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-30 23:22:40 +00:00
Sam Clegg
f437a9d225 [WebAssembly] Update expectations for gcc torture tests
This is needed to make the wasm waterfall green again
after we land the update to WASI:
https://github.com/WebAssembly/waterfall/pull/492

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359634 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-30 23:10:28 +00:00
Philip Reames
93849fdc0d [InstCombine] Limit a vector demanded elts rule which was producing invalid IR.
The demanded elts rules introduced for GEPs in https://reviews.llvm.org/rL356293 replaced vector constants with undefs (by design).  It turns out that the LangRef disallows such cases when indexing structs.  The right fix is probably to relax the langref requirement, and update other passes to expect the result, but for the moment, limit the transform to avoid compiler crashes.

This should fix https://bugs.llvm.org/show_bug.cgi?id=41624.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359633 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-30 23:09:26 +00:00
Dan Gohman
15f67f93fc [WebAssembly] Test the "wasm32-wasi" triple
Add triple tests for "wasm32-wasi" and "wasm64-wasi", and also remove the
"-musl" component from the existing wasm triple tests as we're not using that
in practice (WASI libc is derived in part from musl, but it is not fully
musl-compatible).

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

Reviewer: sbc100


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359629 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-30 23:04:49 +00:00
Alina Sbirlea
c049743f98 [MemorySSA] Invalidate MemorySSA if AA or DT are invalidated.
Summary:
MemorySSA keeps internal pointers of AA and DT.
If these get invalidated, so should MemorySSA.

Reviewers: george.burgess.iv, chandlerc

Subscribers: jlebar, Prazek, llvm-commits

Tags: LLVM

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359627 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-30 22:43:55 +00:00
Lang Hames
4c1872ad8f [ORC] Move SimpleCompiler/ConcurrentIRCompiler definitions into a .cpp file.
SimpleCompiler is no longer templated, so there's no reason for this code to be
in a header any more.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359626 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-30 22:42:01 +00:00
Rong Xu
c88c740bf6 [llvm-profdata] Fix indentation error in docs. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359625 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-30 22:35:35 +00:00
Alina Sbirlea
ddcc2ba101 [AliasAnalysis/NewPassManager] Invalidate AAManager less often.
Summary:
This is a redo of D60914.

The objective is to not invalidate AAManager, which is stateless, unless
there is an explicit invalidate in one of the AAResults.

To achieve this, this patch adds an API to PAC, to check precisely this:
is this analysis not invalidated explicitly == is this analysis not abandoned == is this analysis stateless, so preserved without explicitly being marked as preserved by everyone

Reviewers: chandlerc

Subscribers: mehdi_amini, jlebar, george.burgess.iv, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359622 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-30 22:15:47 +00:00
Stanislav Mekhanoshin
0b378026ac [AMDGPU] gfx1010 VMEM and SMEM implementation
Differential Revision: https://reviews.llvm.org/D61330

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359621 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-30 22:08:23 +00:00
Rong Xu
664a9b1828 [llvm-profdata] Fix indentation error. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359619 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-30 22:05:11 +00:00
Eric Christopher
c4dc3aaa99 Add an include of Module since we actually access it now and remove
the forward declaration.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359618 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-30 21:55:15 +00:00
Eric Christopher
6696a873d8 Fix a few -Werror warnings:
- Remove a variable only used in an assert
 - Fix pessimizing move warning around copy elision

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359617 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-30 21:44:21 +00:00
Alina Sbirlea
1e33097313 [PassManagerBuilder] Add option for interleaved loops, for loop vectorize.
Summary:
Match NewPassManager behavior: add option for interleaved loops in the
old pass manager, and use that instead of the flag used to disable loop unroll.
No changes in the defaults.

Reviewers: chandlerc

Subscribers: mehdi_amini, jlebar, dmgreen, hsaito, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359615 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-30 21:29:20 +00:00
Lang Hames
ef6f977b4b [JITLink] Add debugging output to print resolved external atoms.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359614 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-30 21:28:07 +00:00
Lang Hames
7f26fc050a [ORC][JITLink] Name in-memory compiled objects after their source modules.
In-memory compiled object buffer identifiers will now be derived from the
identifiers of their source IR modules. This makes it easier to connect
in-memory objects with their source modules in debugging output.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359613 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-30 21:27:56 +00:00
Rong Xu
6967efe577 [llvm-profdata] Add overlap command to compute similarity b/w two profile files
Add overlap functionality to llvm-profdata tool to compute the similarity
between two profile files.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359612 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-30 21:19:12 +00:00
Fedor Sergeev
7266bfef68 [NFC][InlineCost] cleanup - comments, overflow handling.
Reviewed By: apilipenko
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D60751

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359609 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-30 20:44:53 +00:00
Simon Pilgrim
e575d78842 [X86][SSE] Fold extract_subvector(extend(x)) -> extend_vector_inreg(x)
This adds any extend support - folding to zero_extend_vector_inreg (PMOVZX) for legality

Minor improvement for PR39709

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359608 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-30 20:31:07 +00:00
Dan Gohman
555f5334af [WebAssembly] Fix test after r359602
Update the expected output for this test now that the EXPLICIT_NAME
flag is being printed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359605 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-30 19:58:56 +00:00
Nico Weber
bb327bcc1e Fix stack-use-after free after r359580
`Candidate` was a StringRef refering to a temporary string.
Instead, create a local variable for the string and use
a StringRef referring to that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359604 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-30 19:43:35 +00:00
Dan Gohman
f8e418c85a [WebAssembly] Support EXPLICIT_NAME symbols in llvm-readobj
Teach llvm-readobj about WASM_SYMBOL_EXPLICIT_NAME.

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

Reviewer: sbc100


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359602 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-30 19:30:24 +00:00
Dan Gohman
8171cf2106 [WebAssembly] Support f16 libcalls
Add support for f16 libcalls in WebAssembly. This entails adding signatures
for the remaining F16 libcalls, and renaming gnu_f2h_ieee/gnu_h2f_ieee to
truncsfhf2/extendhfsf2 for consistency between f32 and f64/f128 (compiler-rt
already supports this).

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

Reviewer: dschuff


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359600 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-30 19:17:59 +00:00
Craig Topper
65f4024cf2 [X86] Remove if that's always true
It's been like this since it was added in a refactor of this code.

Fixes PR41659

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359597 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-30 19:02:15 +00:00
Evandro Menezes
37c4380fae [SimplifyLibCalls] Clean up code (NFC)
Fix pointer check after dereferencing (PR41665).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359595 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-30 18:35:38 +00:00