Commit Graph

151905 Commits

Author SHA1 Message Date
Sanjay Patel
f4058b98ae [x86] improve SBB optimizations for SETB/SETA with subtract
This is another step towards removing a combine that turns sext
into select of constants and preparing the backend for an IR
future where select is the canonical form.

Earlier commits in this area:
https://reviews.llvm.org/rL306040
https://reviews.llvm.org/rL306072
https://reviews.llvm.org/rL307404 (https://reviews.llvm.org/D34652)
https://reviews.llvm.org/rL307471



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307821 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-12 17:56:46 +00:00
Sanjay Patel
8751bf94c8 [x86] add tests for improving sbb transforms; NFC
We're subtracting X from X the hard way...



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307819 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-12 17:44:50 +00:00
Justin Bogner
356d2bfeba GlobalISel: Handle selection of G_IMPLICIT_DEF in AArch64
A generic variant of IMPLICIT_DEF was added in r306875, but this
survives to selection and hits a `Cannot Select`. Add handling that
converts the note to a regular IMPLICIT_DEF.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307817 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-12 17:32:32 +00:00
George Burgess IV
7c497afb63 Add a test for r307754
As promised in D35003.

Uses -codegenprepare instead of -instcombine since we hit the same
buggy path anyway, and CGP lets us keep this test really simple
(instcombine likes turning the alloca T, N into alloca [N x T], which
hides the bug this is testing for).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307811 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-12 16:30:37 +00:00
Simon Dardis
634bcaba6f [mips][mt][5/7] Add support for fork and yield instructions.
Reviewers: slthakur, atanasyan

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307808 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-12 16:23:57 +00:00
Rafael Espindola
ef7264b5e9 Add back a CHECK line.
I accidentally removed it in r307730.

Thanks to Martin Storsjö for noticing!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307801 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-12 16:14:00 +00:00
Evandro Menezes
0dedcfc77f [CodeGen] Add dependency printer
Add SDep printer to make debugging sessions more productive.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307799 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-12 15:30:59 +00:00
Davide Italiano
a48c85bbde [X86/FastIsel] Fall-back to SelectionDAG when lowering soft-floats.
FastIsel can't handle them, so we would end up crashing during
register class selection.
Fixes PR26522.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307797 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-12 15:26:06 +00:00
Daniel Neilson
c96acc5425 Add element atomic memmove intrinsic
Summary: Continuing the work from https://reviews.llvm.org/D33240, this change introduces an element unordered-atomic memmove intrinsic. This intrinsic is essentially memmove with the implementation requirement that all loads/stores used for the copy are done with unordered-atomic loads/stores of a given element size.

Reviewers: eli.friedman, reames, mkazantsev, skatkov

Reviewed By: reames

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307796 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-12 15:25:26 +00:00
Simon Dardis
36ae313830 [mips][mt][4/7] Add IAS support for dvpe, evpe instructions.
Reviewers: slthakur, atanasyan

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307793 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-12 14:48:27 +00:00
Simon Pilgrim
9435879900 [X86][SSE] Fix file check prefix warning breaking buildbots
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307790 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-12 13:41:13 +00:00
Kamil Rytarowski
103b8238dc Make shell redirection construct portable
Summary:
NetBSD shell sh(1) does not support ">& /dev/null" construct.
This is bashism. The portable and POSIX solution is to use:
"> /dev/null 2>&1".

This change fixes 22 Unexpected Failures on NetBSD/amd64
for the "check-llvm" target.

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, dim, rnk

Reviewed By: joerg, rnk

Subscribers: rnk, davide, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307789 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-12 13:24:46 +00:00
John Brawn
ec26641b79 [ARM] Adjust ifcvt heuristic for the diamond ifcvt case
When we have a diamond ifcvt the fallthough block will have a branch at the end
of it that disappears when predicated, so discount it from the predication cost.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307788 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-12 13:23:10 +00:00
Simon Pilgrim
1ca52a5bb6 [X86][SSE] Add 512-bit (iX bitcast(vXi1)) test cases
Improves test coverage for pre-AVX512 targets as well

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307783 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-12 12:44:10 +00:00
Simon Dardis
fea3236f0e [mips][mt] Add missing files from last commit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307779 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-12 12:33:40 +00:00
Hiroshi Inoue
2b4e72ee27 fix typo in document; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307775 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-12 12:16:22 +00:00
Simon Dardis
84aeab51db [mips][mt][3/7] Add IAS support for emt, dmt instructions.
Reviewers: slthakur, atanasyan

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307774 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-12 11:57:44 +00:00
Florian Hahn
dba40dd7a1 [Linker] Add directives to support mixing ARM/Thumb module-level inline asm.
Summary:
By prepending `.text .thumb .balign 2` to the module-level inline
assembly from a Thumb module, the assembler will generate the assembly
from that module as Thumb, even if the destination module uses an ARM
triple. Similar directives are used for module-level inline assembly in
ARM modules.

The alignment and instruction set are reset based on the target triple
before emitting the first function label.

Reviewers: olista01, tejohnson, echristo, t.p.northover, rafael

Reviewed By: echristo

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

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307772 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-12 11:52:28 +00:00
Diana Picus
a3db45981c [ARM] GlobalISel: Simplify inst selector code. NFC
Refactor CmpHelper into something simpler. It was overkill to use
templates for this - instead, use a simple CmpConstants structure to
hold the opcodes and other constants that are different when selecting
int / float / double comparisons. Also, extract some of the helpers that
were in CmpHelper into ARMInstructionSelector and make use of some of
them when selecting other things than just compares.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307766 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-12 10:31:16 +00:00
Chandler Carruth
3870ce243f [PM] Fix a silly bug in my recent update to the CG update logic.
I used the wrong variable to update. This was even covered by a unittest
I wrote, and the comments for the unittest were correct (if confusing)
but the test itself just matched the buggy behavior. =[

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307764 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-12 09:08:11 +00:00
Diana Picus
8577619105 [ARM] GlobalISel: Select s64 G_FCMP
Very similar to how we select s32 G_FCMP, the only thing that is
different is the exact opcodes that we use.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307763 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-12 09:01:54 +00:00
Serge Guelton
fbec1c990e Have Module::createRNG return a unique_ptr
Instead of a raw pointer, this makes memory management safer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307762 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-12 08:03:44 +00:00
Michael Zuckerman
1f56665b90 [X86][LLVM]Expanding Supports lowerInterleavedStore() in X86InterleavedAccess.
Adding base test for AVX512 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307761 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-12 08:01:44 +00:00
Craig Topper
b8cea18959 [X86] Synchronize the ProcessorFeatures enum used by getHostCPUName with the enum in libgcc and soon compiler-rt.
This adds all the feature bits libgcc has. They will soon be added to compiler-rt as well. This adds a second 32 bit feature variable to hold the bits that are needed by getHostCPUName that are not in libgcc. libgcc had already used 31 of the 32 bits in the existing variable and we needed 3 bits so at minimum 2 bits would spill over. I chose to move all 3.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307758 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-12 06:49:58 +00:00
Craig Topper
5d2f2672b6 [X86] Sync ProcessorTypes and ProcessorSubtypes enums used by getHostCPUName with the version proposed to for compiler-rt's cpu_model.c
This keeps the starting entries in the enums in sync with what's in gcc and in review D35214 for compiler-rt.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307757 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-12 06:49:57 +00:00
Craig Topper
0b0624a2ca [X86] Cleanup the switches in getHostCPUName to remove impossible combinations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307756 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-12 06:49:56 +00:00
Craig Topper
292490b104 [X86] Remove 'barcelona' string from getHostCPUName. Use 'amdfam10' instead. The x86 backend doesn't distinguish.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307755 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-12 06:49:55 +00:00
Mikael Holmen
97e16560aa [MemoryBuiltins] Allow truncation in visitAllocaInst()
Summary:
Solves PR33689.

If the pointer size is less than the size of the type used for the array
size in an alloca (the <ty> type below) then we could trigger the assert in
the PR. In that example we have pointer size i16 and <ty> is i32.

<result> = alloca [inalloca] <type> [, <ty> <NumElements>] [, align <alignment>]

Handle the situation by allowing truncation as well as zero extension in
ObjectSizeOffsetVisitor::visitAllocaInst().

Also, we now detect overflow in visitAllocaInst(), similar to how it was
already done in visitCallSite().

Reviewers: craig.topper, rnk, george.burgess.iv

Reviewed By: george.burgess.iv

Subscribers: davide, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307754 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-12 06:19:10 +00:00
Matthias Braun
4b013660b8 Specify complete target triple in test
This should fix the problems on the greendragon build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307747 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-12 01:16:50 +00:00
Don Hinton
831d1262d3 Fix minor typo introduced in r276404
Summary:
A space was added between '-' and 'help' when emitting help output.

See https://reviews.llvm.org/D22621 for details.

Reviewers: MaggieYi, vsk

Reviewed By: vsk

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307745 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-12 01:15:46 +00:00
Peter Collingbourne
8a1e60719d LowerTypeTests: When importing functions skip definitions where the summary contains a decl.
This normally indicates mixed CFI + non-CFI compilation, and will
result in us treating the function in the same way as a function
defined outside of the LTO unit.

Part of PR33752.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307744 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-12 00:39:12 +00:00
Jakub Kuderski
3b58ca74d3 [Dominators][NFC] Remove extra semicolon...
to silence a gcc warning.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307742 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-12 00:29:16 +00:00
Sam Clegg
c9c28d96fa [WebAssembly] Expose the offset of each data segment
Summary:
This allows tools like lld that process relocations
to apply data relocation correctly. This information
is required because relocation are stored as section
offset.

Subscribers: jfb, dschuff, jgravelle-google, aheejin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307741 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-12 00:24:54 +00:00
Konstantin Zhuravlyov
4cdc883934 Fix unused variable warnings
Differential Revision: https://reviews.llvm.org/D35280



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307740 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-12 00:15:53 +00:00
Rafael Espindola
210f522486 Simplify interface now that we don't need to pass IsPCRel. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307734 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-11 23:56:10 +00:00
Reid Kleckner
028eab103d [codeview] Change readobj symbol dumping format
Avoid duplicating DictScope with hand-written names everywhere.  Print
the S_-prefixed symbol kind for every record. This should make it easier
to search for certain kinds of records when debugging PDB linking.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307732 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-11 23:41:41 +00:00
Petr Hosek
39247cb1d1 [CMake] Support multi-target runtimes build
This changes adds support for building runtimes for multiple
different targets using LLVM runtimes directory.

The implementation follow the model used already by the builtins
build which already supports this option. To specify the runtimes
targets to be built, use the LLVM_RUNTIME_TARGETS variable, where
the valuae is the list of targets to build runtimes for. To pass
a per target variable to the runtimes build, you can set
RUNTIMES_<target>_<variable> where <variable> will be passed to the
runtimes build for <target>.

Each runtime target (except for the default one) will be installed
into lib/<target> subdirectory. Build targets will be suffixed with
the target name.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307731 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-11 23:41:15 +00:00
Rafael Espindola
4aebf83110 Fully fix the movw/movt addend.
The issue is not if the value is pcrel. It is whether we have a
relocation or not.

If we have a relocation, the static linker will select the upper
bits. If we don't have a relocation, we have to do it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307730 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-11 23:18:25 +00:00
Davide Italiano
dd0b140c37 [IPO] Temporarily rollback r307215.
[GlobalOpt] Remove unreachable blocks before optimizing a function.
While the change is presumably correct, it exposes a latent bug
in DI which breaks on of the CFI checks. I'll analyze it further
and try to understand what's going on.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307729 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-11 23:10:17 +00:00
Jakub Kuderski
3f91c64c16 [Dominators] Use a custom DFS implementation
Summary:
Custom DFS implementation allows us to skip over certain nodes without adding them to the visited map, which is not easily doable with llvm's dfs iterators. What's more, caching predecessors becomes easy.

This patch implements a single DFS function (template) for both forward and reverse DFS, which should be easier to maintain then separate two ones.

Skipping over nodes based on a predicate will be necessary later to implement incremental updates.

There also seems to be a very slight performance improved when bootstrapping clang with this patch on my machine (3:28s -> 3:26s) .

Reviewers: dberlin, sanjoy, davide, grosser

Reviewed By: dberlin

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307727 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-11 22:55:04 +00:00
Reid Kleckner
c80f62248b [codeview] Fix type index discovery for four symbol records
I encountered these when linking LLD, which uses atls.lib. Those objects
appear to use these uncommon symbol records:

  0x115E S_HEAPALLOCSITE
  0x113D S_ENVBLOCK
  0x1113 S_GTHREAD32
  0x1153 S_FILESTATIC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307725 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-11 22:37:25 +00:00
Konstantin Zhuravlyov
8f85685860 Enhance synchscope representation
OpenCL 2.0 introduces the notion of memory scopes in atomic operations to
  global and local memory. These scopes restrict how synchronization is
  achieved, which can result in improved performance.

  This change extends existing notion of synchronization scopes in LLVM to
  support arbitrary scopes expressed as target-specific strings, in addition to
  the already defined scopes (single thread, system).

  The LLVM IR and MIR syntax for expressing synchronization scopes has changed
  to use *syncscope("<scope>")*, where <scope> can be "singlethread" (this
  replaces *singlethread* keyword), or a target-specific name. As before, if
  the scope is not specified, it defaults to CrossThread/System scope.

  Implementation details:
    - Mapping from synchronization scope name/string to synchronization scope id
      is stored in LLVM context;
    - CrossThread/System and SingleThread scopes are pre-defined to efficiently
      check for known scopes without comparing strings;
    - Synchronization scope names are stored in SYNC_SCOPE_NAMES_BLOCK in
      the bitcode.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307722 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-11 22:23:00 +00:00
Evandro Menezes
fdda7ea9d5 [CodeGen] Rename DEBUG_TYPE to match passnames
Rename missing DEBUG_TYPE "machine-scheduler" from backend files, which were
absent from https://reviews.llvm.org/rL303921.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307719 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-11 22:08:28 +00:00
Sanjay Patel
b6cfd1a79f [x86] auto-generate full checks; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307718 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-11 22:04:36 +00:00
Simon Dardis
c5da2fdc53 [mips][mt] Correct spelling error in comment. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307717 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-11 21:36:58 +00:00
Simon Dardis
0ce5e219d5 [mips][mt][2/7] Implement .module and .set directives for the MT ASE.
This patch implements the .module and .set directives for the MT ASE,
notably that .module sets the relevant flags in .MIPS.abiflags and .set
doesn't.

Reviewers: slthakur, atanasyan

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307716 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-11 21:28:36 +00:00
Martin Storsjo
847573ba4e [ARM, ELF] Don't shift movt relocation offsets
For ELF, a movw+movt pair is handled as two separate relocations.
If an offset should be applied to the symbol address, this offset is
stored as an immediate in the instruction (as opposed to stored as an
offset in the relocation itself).

Even though the actual value stored in the movt immediate after linking
is the top half of the value, we need to store the unshifted offset
prior to linking. When the relocation is made during linking, the offset
gets added to the target symbol value, and the upper half of the value
is stored in the instruction.

This makes sure that movw+movt with offset symbols get properly
handled, in case the offset addition in the lower half should be
carried over to the upper half.

This makes the output from the additions to the test case match
the output from GNU binutils.

For COFF and MachO, the movw/movt relocations are handled as a pair,
and the overflow from the lower half gets carried over to the movt,
so they should keep the shifted offset just as before.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307713 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-11 21:07:10 +00:00
Florian Hahn
827143c4df [AArch64] Remove unused IsDarwin & IsNotDarwin predicates (NFCI).
Reviewers: t.p.northover, rengolin

Reviewed By: t.p.northover

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

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307706 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-11 20:56:24 +00:00
Anna Thomas
849a2b0558 [LoopUnrollRuntime] NFC: Add some debugging trace messages for why loop wasn't unrolled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307705 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-11 20:44:37 +00:00
Xinliang David Li
dcb98bd9b0 [ProfileData] Add new option to dump topn hottest functions
Differential Revision: http://reviews.llvm.org/D35155


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307702 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-11 20:30:43 +00:00