Commit Graph

149427 Commits

Author SHA1 Message Date
Adrian Prantl
14a1dd11de Don't generate line&scope debug info for meta-instructions.
MachineInstructions that don't generate any code (such as
IMPLICIT_DEFs) should not generate any debug info either.

Fixes PR33107.

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

This reapplies r303566 without any modifications. The stage2 build
failures persisted even after reverting this patch, and looking back
through history, it looks like these tests are flaky.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303575 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-22 20:47:09 +00:00
Teresa Johnson
f850fed8c8 Fix update VP metadata after inlining for instrumentation PGO
Summary:
With instrumentation profiling, when updating the VP metadata after
an inline, VP metadata on the inlined copy was inadvertantly having
all counts zeroed out. This was causing indirect calls from code inlined
during the call step to be marked as cold in the ThinLTO summaries and
not imported.

The CallerBFI needs to be passed down so that the CallSiteCount can be
computed from the profile summary info. With Sample PGO this was working
since the count is extracted from the branch weight metadata on the
call being inlined (even before we stopped looking at metadata for
non-sample PGO in r302844 this largely wasn't working for instrumentation
PGO since only promoted indirect calls would be getting inlined and have
the metadata).

Added an instrumentation PGO test and renamed the sample PGO test.

Reviewers: danielcdh, eraman

Subscribers: mehdi_amini, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303574 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-22 20:28:18 +00:00
Krzysztof Parzyszek
edce84feff [Hexagon] Fix definitions of vector predicate loads and stores
This fixes http://llvm.org/PR33048.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303572 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-22 20:02:53 +00:00
Craig Topper
326f38ff72 [DataLayout] Add llvm_unreachable to the default of a nested switch statement that covers all values given to it by the outer switch. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303571 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-22 19:28:36 +00:00
Adrian Prantl
5afff89c9e Revert "Don't generate line&scope debug info for meta-instructions."
This reverts commit r303566 while investigating a stage2 buildbot failure.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303570 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-22 18:50:12 +00:00
Stanislav Mekhanoshin
69edad7913 [AMDGPU] Narrow lshl from 64 to 32 bit if possible
Turn expensive 64 bit shift into 32 bit if shift does not overflow int:
shl (ext x) => zext (shl x)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303569 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-22 16:58:10 +00:00
Xinliang David Li
b9e0915b58 [PartialInlining] Add internal options to enable partial inlining in pass pipeline (off by default)
1. Legacy: -mllvm -enable-partial-inlining
2. New:  -mllvm -enable-npm-partial-inlining -fexperimental-new-pass-manager

Differential Revision: http://reviews.llvm.org/D33382


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303567 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-22 16:41:57 +00:00
Adrian Prantl
f21b185054 Don't generate line&scope debug info for meta-instructions.
MachineInstructions that don't generate any code (such as
IMPLICIT_DEFs) should not generate any debug info either.

Fixes PR33107.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303566 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-22 16:21:02 +00:00
Nirav Dave
40b1e969f9 [DAG] Rework store merge to loop on load candidates. NFCI.
Continue to consider remaining candidate merges until all possible
merges have been considered.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303560 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-22 15:33:47 +00:00
Nirav Dave
15f641428c [X86] Remove target feature info from mul-i256.ll test. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303558 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-22 15:04:08 +00:00
Valery Pykhtin
95b4ca6d1b [AMDGPU] Fix incorrect register usage tracking in GCNUpwardTracker
Differential revision: https://reviews.llvm.org/D33289

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303548 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-22 13:09:40 +00:00
Simon Atanasyan
0f6d52d964 [mips] Support micromips attribute passed by front-end
This patch adds handling of the `micromips` and `nomicromips` attributes
passed by front-end. The patch depends on D33363.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303545 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-22 12:47:41 +00:00
Artur Pilipenko
63e5aa71e0 [LoopPredication] NFC. Add extra debug output in case we fail to parse the range check
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303544 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-22 12:06:57 +00:00
Artur Pilipenko
73576b5741 [LoopPredication] NFC. Move a nested struct declaration before the fields, clang-format a bit
This will simplify the diff for an upcoming review.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303543 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-22 12:01:32 +00:00
Daniel Sanders
32e52f525a Revert r303259 - [globalisel][tablegen] Import rules containing intrinsic_wo_chain.
It's causing some buildbots to timeout whenever tablegen needs re-compilation,
particularly those with -fsanitize=memory but not only them. A compile time
regression was expected since it triples the amount of SelectionDAG rules we
are able to import but it's currently too high.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303542 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-22 10:14:33 +00:00
James Molloy
11824fc3b4 Re-apply r302416: [ARM] Clear the constant pool cache on explicit .ltorg directives
Re-applying now that PR32825 which was raised on the commit this fixed up is now known to have also been fixed by this commit.

Original commit message:
    Multiple ldr pseudoinstructions with the same constant value will
    reuse the same constant pool entry. However, if the constant pool
    is explicitly flushed with a .ltorg directive, we should not try
    to reference constants in the previous pool any longer, since they
    may be out of range.

    This fixes assembling hand-written assembler source which repeatedly
    loads the same constant value, across a binary size larger than the
    pc-relative fixup range for ldr instructions (4096 bytes). Such
    assembler source already uses explicit .ltorg instructions to emit
    constant pools with regular intervals. However if we try to reuse
    constants emitted in earlier pools, they end up out of range.

    This makes the output of the testcase match what binutils gas does
    (prior to this patch, it would fail to assemble).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303540 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-22 09:42:07 +00:00
James Molloy
4e5148cbb4 Re-apply r286006: Fix 24560: assembler does not share constant pool for same constants
Re-applying now that the open bug on this commit, PR32825, is known to be fixed.

Original commit message:
    Summary: This patch returns the same label if the CP entry with the same value has been created.

    Reviewers: eli.friedman, rengolin, jmolloy

    Subscribers: majnemer, jmolloy, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303539 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-22 09:42:01 +00:00
Strahinja Petrovic
3c94f1d059 [MIPS] Add support to match more patterns for DINS instruction
This patch adds support for recognizing patterns to match
DINS instruction.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303537 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-22 09:06:44 +00:00
James Molloy
7ff1c268d6 Revert "[ARM] Clear the constant pool cache on explicit .ltorg directives"
This reverts commit r302416. This was a fixup for r286006, which has now been reverted so this doesn't apply (either in concept or in code).

This commit itself has no problems, but the underlying issue it was fixing has now disappeared from the codebase.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303536 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-22 08:49:28 +00:00
James Molloy
9d3d965348 Revert "Fix 24560: assembler does not share constant pool for same constants"
This reverts commit r286006. It caused PR32825 and wasn't fixed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303535 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-22 08:42:47 +00:00
Amaury Sechet
405d07a3a6 Regenerate expected result for test constant-combines.ll . NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303533 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-22 07:49:16 +00:00
David Blaikie
9031fd9199 libDebugInfo/DWARF: Apply relocations for debug_addr addresses in object files
llvm-symbolizer would fail to symbolize addresses in unlinked object
files when handling .dwo file data because the addresses would not be
relocated in the same way as the ranges in the skeleton CU in the object
file.

Fix that so object files can be symbolized the same as executables.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303532 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-22 07:02:47 +00:00
Sanjoy Das
c83e065234 [SCEV] Clarify behavior around max backedge taken count
This is a re-application of a r303497 that was reverted in r303498.
I thought it had broken a bot when it had not (the breakage did not
go away with the revert).

This change makes the split between the "exact" backedge taken count
and the "maximum" backedge taken count a bit more obvious.  Both of
these are upper bounds on the number of times the loop header
executes (since SCEV does not account for most kinds of abnormal
control flow), but the latter is guaranteed to be a constant.

There were a few places where the max backedge taken count *was* a
non-constant; I've changed those to compute constants instead.

At this point, I'm not sure if the constant max backedge count can be
computed by calling `getUnsignedRange(Exact).getUnsignedMax()` without
losing precision.  If it can, we can simplify even further by making
`getMaxBackedgeTakenCount` a thin wrapper around
`getBackedgeTakenCount` and `getUnsignedRange`.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303531 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-22 06:46:04 +00:00
Zvi Rackover
c13111a6fd [X86] Add (ix bitcast(vsetcc)) test cases with illegal types. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303530 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-22 06:39:12 +00:00
Craig Topper
80b8691318 [InstCombine] Cleanup the interface for overflow checks
Summary:
Fix naming conventions and const correctness.
This completes the changes made in rL303029.

Patch by Yoav Ben-Shalom.

Reviewers: craig.topper

Reviewed By: craig.topper

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303529 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-22 06:25:31 +00:00
Amaury Sechet
ba7c7e397f Add a test case for large integer subtraction via subcarry. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303528 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-22 06:06:45 +00:00
Amaury Sechet
7184d2e1ad Add test case for subcarry optimization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303525 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-22 02:31:42 +00:00
Craig Topper
63270bdd55 [SimplifyCFG] Prevent a few APInt copies on method calls that return const reference. NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303523 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-22 00:49:35 +00:00
Craig Topper
eb118f2981 [KnownBits] Use isNegative/isNonNegative to shorten some code. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303522 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-22 00:49:33 +00:00
Daniel Berlin
cc24c88dcf NewGVN: Fix PR 33116, the memoryphi version of bug 32838.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303521 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-21 23:41:58 +00:00
Daniel Berlin
06366afa19 NewGVN: Cleanup some repeated code using some templated helpers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303520 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-21 23:41:56 +00:00
Daniel Berlin
efa684722e NewGVN: Fix printing of simplified expression
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303519 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-21 23:41:53 +00:00
Daniel Berlin
5dcdd10cbc SmallPtrSetImpl/SmallPtrSet: Add a public value_type and key_type
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303518 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-21 23:41:51 +00:00
Davide Italiano
5d18059ccf [NewGVN] Actually check the NewGVN output.
Apparently I messed up squashing two consecutive commits.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303516 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-21 20:55:53 +00:00
Davide Italiano
96cb8145e1 [NewGVN] Add a test for non most dominating leader.
Taken from PR32845. Dan removed the most dominating leader check
in r303443, but we check this test anyway to make sure things
don't regress.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303515 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-21 20:50:16 +00:00
Davide Italiano
4276950084 [InstCombine] Take in account the size in sext->lshr->trunc patterns.
Otherwise we end up miscompiling, transforming:

define i8 @tinky() {
  %sext = sext i1 1 to i16
  %hibit = lshr i16 %sext, 15
  %tr = trunc i16 %hibit to i8
  ret i8 %tr
}

into:

  %sext = sext i1 1 to i8
  ret i8 %sext

and the first get folded to ret i8 1, while the second gets folded
to ret i8 -1.

Eventually we should get rid of this transform entirely, but for now,
this at least fixes a know correctness bug.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303513 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-21 20:30:27 +00:00
Sanjay Patel
68ac6769cc [InstCombine] add tests for potential (lshr(sext X), C) folds; NFC
As discussed in:
https://reviews.llvm.org/D33338
...we may be able to remove a wider pattern match by doing these more
basic canonicalizations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303504 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-21 15:18:52 +00:00
Igor Breger
a3d2650741 [GlobalISel][X86] Fix G_TRUNC instruction selection.
Updated tests with -verify-machineinstrs flag.
It fixes 3 tests failed with machine verifier enabled and listed
in PR27481

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303502 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-21 11:13:56 +00:00
Hiroshi Inoue
4d0494d621 Summary
PPC backend eliminates compare instructions by using record-form instructions in PPCInstrInfo::optimizeCompareInstr, which is called from peephole optimization pass.
This patch improves this optimization to eliminate more compare instructions in two types of common case.


- comparison against a constant 1 or -1

The record-form instructions set CR bit based on signed comparison against 0. So, the current implementation does not exploit the record-form instruction for comparison against a non-zero constant.
This patch enables record-form optimization for constant of 1 or -1 if possible; it changes the condition "greater than -1" into "greater than or equal to 0" and "less than 1" into "less than or equal to 0".
With this patch, compare can be eliminated in the following code sequence, as an example.

uint64_t a, b;
if ((a | b) & 0x8000000000000000ull) { ... }
else { ... }


- andi for 32-bit comparison on PPC64

Since record-form instructions execute 64-bit signed comparison and so we have limitation in eliminating 32-bit comparison, i.e. with cmplwi, using the record-form. The original implementation already has such checks but andi. is not recognized as an instruction which executes implicit zero extension and hence safe to convert into record-form if used for equality check.

%1 = and i32 %a, 10
%2 = icmp ne i32 %1, 0
br i1 %2, label %foo, label %bar

In this simple example, LLVM generates andi. + cmplwi + beq on PPC64.
This patch make it possible to eliminate the cmplwi for this case.
I added andi. for optimization targets if it is safe to do so.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303500 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-21 06:00:05 +00:00
George Burgess IV
cd631cca05 [Docs] Fix LangRef links referred in GetElementPtr.rst
Patch by chenwj!

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303499 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-21 05:31:29 +00:00
Sanjoy Das
9870934154 Revert "[SCEV] Clarify behavior around max backedge taken count"
This reverts commit r303497 since it breaks the msan bootstrap bot:
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap/builds/1379/

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303498 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-21 05:02:12 +00:00
Sanjoy Das
67c14497b1 [SCEV] Clarify behavior around max backedge taken count
This change makes the split between the "exact" backedge taken count
and the "maximum" backedge taken count a bit more obvious.  Both of
these are upper bounds on the number of times the loop header
executes (since SCEV does not account for most kinds of abnormal
control flow), but the latter is guaranteed to be a constant.

There were a few places where the max backedge taken count *was* a
non-constant; I've changed those to compute constants instead.

At this point, I'm not sure if the constant max backedge count can be
computed by calling `getUnsignedRange(Exact).getUnsignedMax()` without
losing precision.  If it can, we can simplify even further by making
`getMaxBackedgeTakenCount` a thin wrapper around
`getBackedgeTakenCount` and `getUnsignedRange`.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303497 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-21 01:47:50 +00:00
Xin Tong
a9ee0160e6 Revert "Add pthread_self function prototype and make it speculatable."
This reverts commit 143d7445b5.

Build breaking

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303496 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-21 00:37:55 +00:00
Xin Tong
143d7445b5 Add pthread_self function prototype and make it speculatable.
Summary: This allows pthread_self to be pulled out of a loop by LICM.

Reviewers: hfinkel, arsenm, davide

Reviewed By: davide

Subscribers: davide, wdng, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303495 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-20 22:40:25 +00:00
Martell Malone
445f6b560d COFF: Fix another StringRef return error
This should appease the lld build bot regression
Following up on rL303493

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303494 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-20 21:54:15 +00:00
Martell Malone
69f0d8825b COFF: Fix single StringRef return error
This should appease the lld build bot regression
Intrroduced by rL303490

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303493 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-20 21:00:36 +00:00
Martell Malone
ec718cbf10 COFF: migrate def parser from LLD to LLVM [1/2]
This is split up into two commits.
The will create the DEF parser in LLVM.
Check the following commit to see the removal from LLD

Reviewers: ruiu

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303490 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-20 19:56:29 +00:00
Xin Tong
fcebfdfa41 Fix test typo. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303489 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-20 19:40:24 +00:00
Duncan P. N. Exon Smith
40549e6094 Docs: Fix pluralization in CMake docs
Fixed "most platform" to read "most platforms", and changed "are not
using the same" to "use different" as a drive-by.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303487 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-20 05:25:19 +00:00
George Burgess IV
fb8d01efbe [docs] Small style nits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303486 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-20 04:52:29 +00:00