104768 Commits

Author SHA1 Message Date
Max Kazantsev
a9a5cb971f [IRCE] Fix corner case with Start = INT_MAX
When iterating through loop

  for (int i = INT_MAX; i > 0; i--)

We fail to generate the pre-loop for it. It happens because we use the
overflown value in a comparison predicate when identifying whether or not
we need it.

In old logic, we used SLE predicate against Greatest value which exceeds all
seen values of the IV and might be overflown. Now we use the GreatestSeen
value of this IV with SLT predicate.

Also added a test that ensures that a pre-loop is generated for such loops.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308001 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-14 06:35:03 +00:00
Eric Christopher
66d21bb6ce Add a set of comments explaining why getSubtargetImpl() is deleted on these targets.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307999 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-14 04:33:43 +00:00
Dinar Temirbulatov
4cbfb4282b [SLPVectorizer] Add an extra parameter to alreadyVectorized function, NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307996 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-14 03:48:29 +00:00
Eric Christopher
1b2c114227 Remove set but not used variables from the debug info verifier code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307987 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-14 01:40:47 +00:00
Kostya Serebryany
ac4ebc9acc [libFuzzer] update the comments in afl/afl_driver.cpp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307981 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-14 00:18:37 +00:00
Kostya Serebryany
12ab215732 [libFuzzer] remove stale code; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307980 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-14 00:16:23 +00:00
Matt Arsenault
f9915c27c2 AMDGPU: Detect kernarg segment pointer
This is necessary to pass the kernarg segment pointer
to callee functions. Also don't unconditionally enable
for kernels.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307978 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-14 00:11:13 +00:00
Kostya Serebryany
06e0ac200b [libFuzzer] simplify the handling of memmem/strstr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307977 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-14 00:06:27 +00:00
Stanislav Mekhanoshin
9fc15af9b2 [AMDGPU] fcaninicalize optimization for GFX9+
Since GFX9 supports denorm modes for v_min_f32/v_max_f32 that
is possible to further optimize fcanonicalize and remove it
if applied to min/max given their operands are known not to be
an sNaN or that sNaNs are not supported.

Additionally we can remove fcanonicalize if denorms are supported
for the VT and we know that its argument is never a NaN.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307976 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-13 23:59:15 +00:00
Spyridoula Gravani
e302dc70dd [DWARF] Introduce verification for the unit header chain in .debug_info section to llvm-dwarfdump.
This patch adds verification checks for the unit header chain in the .debug_info section.
Specifically, for each unit in the .debug_info section, the verifier checks that:

The unit length is valid (i.e. the unit can actually fit in the .debug_info section)
The dwarf version of the unit is valid
The address size is valid (4 or 8)
The unit type (if the unit is in dwarf5) is valid
The debug_abbrev_offset is valid

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307975 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-13 23:25:24 +00:00
Kostya Serebryany
2ead42c658 [libFuzzer] move code around; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307973 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-13 22:30:23 +00:00
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
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
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
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
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
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
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
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
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
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
Kostya Serebryany
bb9605f1d6 [libFuzzer] experimental feature -reduce_inputs (off by default) that tries to replace elements in the corpus with smaller ones that have the same feature set. Still needs tuning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307873 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-13 01:08:53 +00:00
Wolfgang Pieb
95621c2165 [DWARF] Fixing a bug with processing of DWARF v5 indexed strings in Mach-O objects.
Code to convert MachO - specific section debug section names to standard DWARF v5
section names was in the wrong place.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307872 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-13 01:03:28 +00:00
Eli Friedman
dd70def46c [CodeGenPrepare] Don't create dead instructions in addrmode sinking
When we fail to sink an instruction, we must make sure not to modify
the function; otherwise, we end up in an infinite loop because
CodeGenPrepare iterates until it doesn't make any changes.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307866 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-12 23:30:02 +00:00
Xinliang David Li
7bac219fe1 [PGO] Enhance pgo counter promotion
This is an incremental change to the promotion feature.

There are two problems with the current behavior:
1) loops with multiple exiting blocks are totally disabled
2) a counter update can only be promoted one level up in
  the loop nest -- which does help much for short trip
  count inner loops inside a high trip-count outer loops.

Due to this limitation, we still saw very large profile
count fluctuations from run to run for the affected loops
which are usually very hot.

This patch adds the support for promotion counters iteratively
across the loop nest. It also turns on the promotion for
loops with multiple exiting blocks (with a limit).

For single-threaded applications, the performance impact is flat
on average. For instance, dealII improves, but povray regresses.





git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307863 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-12 23:27:44 +00:00