149489 Commits

Author SHA1 Message Date
David Blaikie
ddfddd8ea5 FIX: Remove debugging assert left in previous commit
Sorry for the bot noise.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303592 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-23 00:31:24 +00:00
David Blaikie
9e47896c08 libDebugInfo: Avoid independently parsing the same .dwo file for two separate CUs residing there
NFC, just an optimization. Will be building on this for DWP support
shortly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303591 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-23 00:30:42 +00:00
Teresa Johnson
1fd5bb9c53 Support for taking the max of module flags when linking, use for PIE/PIC
Summary:
Add Max ModFlagBehavior, which can be used to take the max of two
module flag values when merging modules. Use it for the PIE and PIC
levels.

This avoids an error when we try to import from a module built -fpic
into a module built -fPIC, for example. For both PIE and PIC levels,
this will be legal, since the code generation gets more conservative
as the level is increased. Therefore we can take the max instead of
somehow trying to block importing between modules compiled with
different levels.

Reviewers: tmsriram, pcc

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303590 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-23 00:08:00 +00:00
Craig Topper
6135595faa [InstSimplify] Fix the indentation throughout the interface header file.
The forward declarations and the SimplifyQuery class at the beginning of the namespace weren't indented. But the closing brace for SimplifyQuery and everything after it were indented.

This commit makes the whole file consistent to no identation per coding standards. The signature of every function in this file changed a few weeks ago so this isn't a big disturbance to the revision history.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303588 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-22 23:50:40 +00:00
Davide Italiano
d88c7f02ee [NewPM] Fix an innocent but silly typo. Reported by Craig Topper.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303587 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-22 23:47:11 +00:00
Davide Italiano
efb6b10647 [NewPM] Add a temporary cl::opt() to test NewGVN.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303586 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-22 23:41:40 +00:00
Galina Kistanova
21282be93c Added LLVM_FALLTHROUGH to address gcc warning: this statement may fall through.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303585 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-22 22:46:31 +00:00
Vitaly Buka
766824e844 [CodeGen] Fix uninitialized variables exposed by r303084
All other calls of analyzeBranch reset PredTBB and PredFBB, so I assume it's
expected behavior.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303581 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-22 21:33:54 +00:00
Tim Northover
506a3c2598 InstructionSimplify: don't speculate about Constants changing.
When presented with an icmp/select pair, we can end up asking what would happen
if we replaced one constant with another in an instruction. This is a mistake,
while non-constant Values could become a constant, constants cannot change and
trying to do so can lead to completely invalid IR (a GEP referencing a
non-existant field in the original case).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303580 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-22 21:28:08 +00:00
Evgeniy Stepanov
49f70ccea4 Infer relocation model from module flags in relocatable LTO link.
Fix for PR33096.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303578 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-22 21:11:35 +00:00
Zachary Turner
0897ebf658 Implement various flavors of type merging.
Previous algotirhm assumed that types and ids are in a single
unified stream.  For inputs that come from object files, this
is the case.  But if the input is already a PDB, or is the result
of a previous merge, then the types and ids will already have
been split up, in which case we need an algorithm that can
accept operate on independent streams of types and ids that
refer across stream boundaries to each other.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303577 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-22 21:07:43 +00:00
Zachary Turner
1f0271a22b Make TypeSerializer's StringMap use the same allocator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303576 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-22 21:07:14 +00:00
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