Commit Graph

151938 Commits

Author SHA1 Message Date
Matt Arsenault
a20c1d0cec AMDGPU: Annotate call graph with used features
Previously this wouldn't detect used features indirectly
used in callee functions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307967 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-13 21:43:42 +00:00
Jakub Kuderski
40d67727c7 [Dominators] Add CFGBuilder testing utility
Summary:
This patch introduces a new testing utility for building and modifying CFG -- CFGBuilder. The primary use case for the utility is testing the upcoming incremental dominator tree update API.

The current design provides a simple mechanism of constructing arbitrary graphs and then applying series of updates to them. CFGBuilder takes care of creating empty functions, connecting and disconnecting basic blocks. Under the hood it uses SwitchInst and UnreachableInst.

It will be also possible to create a thin wrapper over CFGBuilder for parsing string input and to hook it up to other textual tools (e.g. opt used with FileCheck).

Reviewers: dberlin, sanjoy, grosser, dblaikie

Reviewed By: dblaikie

Subscribers: davide, mgorny, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307960 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-13 21:16:01 +00:00
Jakub Kuderski
1a2e7d2ddc [Dominators] Simplify templates
Summary: DominatorTreeBase and related classes used overcomplicated template machinery. This patch simplifies them and gets rid of DominatorTreeBaseTraits and DominatorTreeBaseByTraits, which weren't actually used outside the DomTree construction.

Reviewers: dberlin, sanjoy, davide, grosser

Reviewed By: dberlin, davide, grosser

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307953 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-13 20:45:32 +00:00
Lang Hames
1ff1f35f8b [Orc] Fix some Error-related fixmes in CompileOnDemandLayer now that the layer
interface has been errorized.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307952 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-13 20:44:46 +00:00
Sanjay Patel
0dea231950 [InstCombine] put tests for commuted variants of the same fold together; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307951 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-13 20:35:45 +00:00
Jakub Kuderski
b49a90071a [Dominators] Split SemiNCA into smaller functions
Summary:
This patch splits the SemiNCA algorithm into smaller functions. It also adds a new debug macro.

In order to perform incremental updates, we need to be able to refire SemiNCA on a subset of CFG nodes (determined by a DFS walk results). We also need to skip nodes that are not deep enough in a DomTree.

Reviewers: dberlin, davide, sanjoy, grosser

Reviewed By: dberlin, davide

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307950 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-13 20:35:01 +00:00
Jakub Kuderski
dbe558cf37 [NFC] Move DEBUG_TYPE below includes in Hexagon
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307947 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-13 20:26:45 +00:00
Reid Kleckner
fe30dbf0ab [PDB] Fix type server handling for archives
Summary:
This fixes type indices for SDK or CRT static archives. Previously we'd
try to look next to the archive object file path, which would not exist
on the local machine.

Also error out if we can't resolve a type server record. Hypothetically
we can recover from this error by discarding debug info for this object,
but that is not yet implemented.

Reviewers: ruiu, amccarth

Subscribers: aprantl, hiraditya, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307946 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-13 20:12:23 +00:00
Jakub Kuderski
14382189fa [NFC] Move DEBUG_TYPE macro below includes...
in MachineCombiner.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307940 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-13 19:30:52 +00:00
Simon Dardis
e603cb062f Revert "[mips][mt][6/7] Add support for mftr, mttr instructions."
This reverts r307836, it broke one of the buildbots. Reverting
while I investigate.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307939 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-13 19:27:41 +00:00
George Karpenkov
92aa19c981 [lit] add a -vv option to echo all executed commands.
Debugging LIT scripts can be rather painful, as LIT directly does not
specify which line has failed.
Rather, FileCheck is expected to report the failing location, but it can
be often ambiguous if multiple commands are tested against the same
prefix.  This change adds a -vv option, which echoes all output.
Then detecting the error becomes straightforward: last printed line is
the failing one.

Of course, it could be desired to try to get failing line number
directly from bash, but it involves excessive hacks on older bash
versions (cf.
https://stackoverflow.com/questions/24398691/how-to-get-the-real-line-number-of-a-failing-bash-command)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307938 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-13 19:26:27 +00:00
Andrew Zhogin
7201848465 [X86][tests] Added rotate_vec.ll CodeGen test. NFC precommit for bug 33691 fix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307937 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-13 18:57:40 +00:00
Jakub Kuderski
1745e246f8 [Dominators] Improve reachability verification
Summary:
This patch improves verification by making `verifyReachablility` look for CFG not found in the DomTree.
It also makes the verification work with postdominators by handling virtual root.

Reviewers: dberlin, davide, grosser, sanjoy

Reviewed By: dberlin

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307936 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-13 18:55:52 +00:00
Krzysztof Parzyszek
47999fef49 [Hexagon] Use VSPLAT instead of COMBINE for vectors of type v2i32, NFC
This cleans up the vector shift patterns.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307935 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-13 18:17:58 +00:00
Nemanja Ivanovic
35b282e0ac [PowerPC] Ensure displacements for DQ-Form instructions are multiples of 16
As outlined in the PR, we didn't ensure that displacements for DQ-Form
instructions are multiples of 16. Since the instruction encoding encodes
a quad-word displacement, a sub-16 byte displacement is meaningless and
ends up being encoded incorrectly.

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

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307934 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-13 18:17:10 +00:00
Sanjay Patel
4632cb1499 [InstCombine] add descriptive comments for tests; NFC
Also, remove unnecessary function attributes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307930 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-13 17:24:57 +00:00
Simon Pilgrim
a87a22c9e1 Fix unused variable warning on EXPENSIVE_CHECKS release builds. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307929 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-13 17:10:12 +00:00
Martin Storsjo
fec0c652bf [AArch64] Implement support for windows style vararg functions
Pass parameters properly in calls to such functions (pass all
floats in integer registers), and handle va_start properly (allocate
stack immediately below the arguments on the stack, to save the
register arguments into a single continuous array).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307928 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-13 17:03:12 +00:00
Martin Storsjo
5dbda1ece1 [llvm-objdump] Properly print MachO aarch64 addend relocations
Previously such relocations fell into the last case for local
symbols, using the relocation addend as symbol index, leading to
a crash.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307927 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-13 17:03:02 +00:00
Rafael Espindola
d7b55ebbd0 Documentation fix. NFC.
A MCFixup might not even be in an instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307926 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-13 17:00:30 +00:00
Reid Kleckner
f9cb6211cc Put std::mutex usage behind #ifdefs to pacify the sanitizer buildbot
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307925 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-13 16:56:24 +00:00
Frederich Munch
d6657666e9 Support: Add llvm::center_justify.
Summary: Completes the set.

Reviewers: ruiu

Reviewed By: ruiu

Subscribers: ruiu, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307922 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-13 16:11:08 +00:00
Davide Italiano
74479e8cb3 [GlobalOpt] Autogenerate checks for the test in PR33686.
Also fix a typo while here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307921 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-13 15:55:34 +00:00
Davide Italiano
32dcdb9570 Reapply [GlobalOpt] Remove unreachable blocks before optimizing a function.
This commit reapplies r307215 now that we found out and fixed
the cause of the cfi test failure (in r307871).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307920 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-13 15:40:59 +00:00
Sjoerd Meijer
4e536522a0 [AArch64] Enable the mnemonic spell checker
The AsmParser mnemonic spell checker was introduced in r307148 and enabled only
for ARM. This patch enables it for AArch64.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307918 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-13 15:29:13 +00:00
Amara Emerson
51a4b73703 [AArch64] Add an SVE target feature to the backend and TargetParser.
The feature will be used properly once assembler/disassembler support
begins to land.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307917 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-13 15:19:56 +00:00
Matthew Simpson
9a71cb8ce5 [AArch64] Add preliminary support for ARMv8.1 SUB/AND atomics
This patch is a follow-up to r305893 and adds preliminary support for the
fetch_sub and fetch_and operations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307913 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-13 15:01:23 +00:00
Anna Thomas
d9184f5e73 [RuntimeUnrolling] Update DomTree correctly when exit blocks have successors
Summary:
When we runtime unroll with multiple exit blocks, we also need to update the
immediate dominators of the immediate successors of the exit blocks.

Reviewers: reames, mkuper, mzolotukhin, apilipenko

Reviewed by: mzolotukhin

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307909 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-13 13:21:23 +00:00
Simon Dardis
892ccd7f07 Reland "[mips] Fix multiprecision arithmetic."
For multiprecision arithmetic on MIPS, rather than using ISD::ADDE / ISD::ADDC,
get SelectionDAG to break down the operation into ISD::ADDs and ISD::SETCCs.

For MIPS, only the DSP ASE has a carry flag, so in the general case it is not
useful to directly support ISD::{ADDE, ADDC, SUBE, SUBC} nodes.

Also improve the generation code in such cases for targets with
TargetLoweringBase::ZeroOrOneBooleanContent by directly using the result of the
comparison node rather than using it in selects. Similarly for ISD::SUBE /
ISD::SUBC.

Address optimization breakage by moving the generation of MIPS specific integer
multiply-accumulate nodes to before legalization.

This revolves PR32713 and PR33424.

Thanks to Simonas Kazlauskas and Pirama Arumuga Nainar for reporting the issue!

Reviewers: slthakur

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

The previous version of this patch was too aggressive in producing fused
integer multiple-addition instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307906 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-13 11:28:05 +00:00
Diana Picus
d4a91bbb19 [ARM] GlobalISel: Support G_BR
This boils down to not crashing in reg bank select due to the lack of
register operands on this instruction, and adding some tests. The
instruction selection is already covered by the TableGen'erated code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307904 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-13 11:09:34 +00:00
Florian Hahn
91acfe51d7 [PM] Use range-based for loops in LegacyPassManager.cpp (NFC).
Summary:
This patch replaces a bunch of iterator-based for loops with range-based
for loops. There are 2 iterator-based loops left in this file in
removeNotPreservedAnalysis, but I think those cannot be replaced by
range-based for loops as they modify the container they are iterating
over.

Unless I missed something, this schould be a NFC and I would appreciate
if someone could have a quick look to confirm that.

Reviewers: chandlerc, pcc, jhenderson

Reviewed By: jhenderson

Subscribers: llvm-commits, mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307902 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-13 10:52:00 +00:00
Simon Pilgrim
af4437ed7c [DAGCombiner] Fix issue with rotate combines asserting if the constant value types differ from the result type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307900 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-13 10:41:49 +00:00
Javed Absar
be09f2a71d [ARM] Tidy up and organise better ARM.td. NFC.
This patch tidies up and organises ARM.td
so that it is easier to understandand
and extend in the future.

Reviewed by: @hahn, @rovka
Differential Revision: https://reviews.llvm.org/D35248



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307897 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-13 10:24:30 +00:00
Diana Picus
c1f7b54cef Fixup r307893: Silence warning
Silence unused variable warning in release builds.
*sigh*

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307896 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-13 09:52:06 +00:00
Simon Pilgrim
5e20776d07 Use isNullConstantOrNullSplatConstant helper. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307895 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-13 09:39:00 +00:00
Simon Pilgrim
6255d2f0d1 Fix whitespace indentation. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307894 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-13 09:36:04 +00:00
Diana Picus
09f612a81f [ARM] GlobalISel: Move local variable. NFC
Move a local variable from outside a switch to inside every case that
needs it (which isn't all of the cases, of course).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307893 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-13 09:30:08 +00:00
Florian Hahn
e66c9a57ab [ARM] Fix typo in test added in r307889
This fixes the following test failure:
    LLVM :: Transforms/Inline/ARM/inline-target-attr.ll

Sorry for any inconenience.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307892 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-13 08:53:43 +00:00
Dylan McKay
56b430ad15 [AVR] Fix broken indentation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307891 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-13 08:40:59 +00:00
Dylan McKay
266135fc7a [AVR] Add a 'LLVM_FALLTHROUGH' statement to the AsmParser
Should fix warnings in the build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307890 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-13 08:39:46 +00:00
Florian Hahn
68f374b8d3 [ARM] Inline callee if its target-features are a subset of the caller
Summary:
Similar to X86, it should be safe to inline callees if their
target-features are a subset of the caller. As some subtarget features
provide different instructions depending on whether they are set or
unset (e.g. ThumbMode and ModeSoftFloat), we use a whitelist of
target-features describing hardware capabilities only.

Reviewers: kristof.beyls, rengolin, t.p.northover, SjoerdMeijer, peter.smith, silviu.baranga, efriedma

Reviewed By: SjoerdMeijer, efriedma

Subscribers: dschuff, efriedma, aemerson, sdardis, javed.absar, arichardson, eraman, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307889 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-13 08:26:17 +00:00
Dylan McKay
90904c693c [AVR] Fix indirect calls to function pointers
Patch by Carl Peto.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307888 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-13 08:09:36 +00:00
Mikael Holmen
3e55e45537 Add original reproducer for r307754 / PR33689
Apparently I managed to drop the test case between two revisions in
Phabricator: https://reviews.llvm.org/D35003

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307887 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-13 07:38:53 +00:00
Hiroshi Inoue
ff281e5fb6 fix typos in comments and error messges; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307885 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-13 06:48:39 +00:00
Craig Topper
719506a866 [X86] Simplify the getHostCPUName for AMD family 6 and 15.
As far as I can tell we can simply distinguish based on features rather than model number. Many of the strings we were previously using are treated the same by the backend.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307884 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-13 06:34:10 +00:00
Martin Storsjo
8ca723ae60 [llvm-objdump] Correctly distinguish between the MachO upper/lower16 relocations
All other code in MachODump.cpp uses the same comparison,
((r_length & 0x1) == 1), for distinguishing between the two,
while the code in llvm-objdump.cpp seemed to be incorrect.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307882 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-13 05:54:08 +00:00
Davide Italiano
54df34c168 [opt-viewer] Don't except when debug info is not available.
For records without DebugLoc we simply skip the caller location in
map_remarks.

Fixes PR33764.

Patch by Simon Whittaker!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307880 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-13 04:19:13 +00:00
Geoff Berry
cc6cfc778f [TargetLowering] Add hook for adding target MMO flags when doing ISel.
Summary: Add TargetLowering hook getMMOFlags() to add target specific
MMO flags to load/store instructions created by ISel.

Reviewers: bogner, hfinkel, qcolombet, MatzeB

Subscribers: mcrosier, javed.absar, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307879 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-13 03:49:42 +00:00
Geoff Berry
9bf66c730c [MIR] Add support for printing and parsing target MMO flags
Summary: Add target hooks for printing and parsing target MMO flags.
Targets may override getSerializableMachineMemOperandTargetFlags() to
return a mapping from string to flag value for target MMO values that
should be serialized/parsed in MIR output.

Add implementation of this hook for AArch64 SuppressPair MMO flag.

Reviewers: bogner, hfinkel, qcolombet, MatzeB

Subscribers: mcrosier, javed.absar, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307877 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-13 02:28:54 +00:00
Kostya Serebryany
a204f09272 [libFuzzer] make sure that -reduce_inputs=1 deletes redundant files in the corpus
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307875 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-13 01:56:37 +00:00