142522 Commits

Author SHA1 Message Date
Tim Shen
40059176bf [APFloat] Remove 'else' after return. NFC
Reviewers: kbarton, iteratee, hfinkel, echristo

Subscribers: mehdi_amini, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290232 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-21 02:39:21 +00:00
Lang Hames
1a6ed847ac [Orc][RPC] Actually specialize SerializationTraits and RPCTypeName in the right
namespace.

r290226 was a think-o - just qualifying the name doesn't count.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290230 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-21 02:08:23 +00:00
Sebastian Pop
0ed0bfd718 machine combiner: fix pretty printer
we used to print UNKNOWN instructions when the instruction to be printer was not
yet inserted in any BB: in that case the pretty printer would not be able to
compute a TII as the instruction does not belong to any BB or function yet.
This patch explicitly passes the TII to the pretty-printer.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290228 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-21 01:41:12 +00:00
Lang Hames
07fe2b0176 [Orc][RPC] Specialize RPCTypeName and SerializationTraits in the right namespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290226 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-21 01:17:19 +00:00
Antonio Maiorano
a7e8ae4b08 Improve natvis for llvm::SmallString so that it correctly displays only the valid portion of the string
The usual method, and the one employed before my change, of displaying strings in natvis is to make use of the "<variable>,s" format specifier; however, this method only works for null-terminated strings. My fix here is to use the "<pointer>,[size]" format specifier to display a bounded array, and then cast it to "const char*", which in the MSVC debugger has the desired effect of rendering the character array as a string.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290224 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-21 01:05:29 +00:00
Lang Hames
389d8dff49 [Orc] Add some static-assert checks to improve the error messages for RPC calls
and handler registrations.

Also add a unit test for alternate-type serialization/deserialization.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290223 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-21 00:59:33 +00:00
Peter Collingbourne
83179504e5 IPO: Remove the ModuleSummary argument to the FunctionImport pass. NFCI.
No existing client is passing a non-null value here. This will come back
in a slightly different form as part of the type identifier summary work.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290222 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-21 00:50:12 +00:00
George Burgess IV
1ced44b92a [Analysis] Centralize objectsize lowering logic.
We're currently doing nearly the same thing for @llvm.objectsize in
three different places: two of them are missing checks for overflow,
and one of them could subtly break if InstCombine gets much smarter
about removing alloc sites. Seems like a good idea to not do that.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290214 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-20 23:46:36 +00:00
Rui Ueyama
ca7371d975 Move GlobPattern class from LLD to llvm/Support.
GlobPattern is a class to handle glob pattern matching. Currently
only LLD is using that, but technically that feature is not specific
to linkers, so in this patch I move that file to LLVM.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290212 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-20 23:09:09 +00:00
Michael Zolotukhin
2f3327339d [SCEV] Be less conservative when extending bitwidths for computing ranges.
Summary:
In getRangeForAffineAR we compute ranges for affine exprs E = A + B*C,
where ranges for A, B, and C are known. To avoid overflow, we need to
operate on a bigger bitwidth, and originally we chose 2*x+1 for this
(x being the original bitwidth). However, it is safe to use just 2*x:

A+B*C <= (2^x - 1) + (2^x - 1)*(2^x - 1) =
       =  2^x - 1 + 2^2x - 2^x - 2^x + 1 =
       = 2^2x - 2^x <= 2^2x - 1

Unnecessary extending of bitwidths results in noticeable slowdowns: ranges
perform arithmetic operations using APInt, which are much slower when bitwidths
are bigger than 64.

Reviewers: sanjoy, majnemer, chandlerc

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290211 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-20 23:03:42 +00:00
Chris Bieneman
4138b67a0a Revert "[ObjectYAML] Support for DWARF debug_info section"
This reverts commit r290204.

Still breaking bots... In a meeting now, so I can't fix it immediately.

Bot URL:
http://lab.llvm.org:8011/builders/clang-s390x-linux/builds/2415

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290209 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-20 22:36:42 +00:00
Chris Bieneman
0ef22e255c [ObjectYAML] Support for DWARF debug_info section
This patch adds support for YAML<->DWARF for debug_info sections.

This re-lands r290147, after fixing the issue that caused bots to fail (thank you UBSan!).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290204 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-20 21:35:31 +00:00
Peter Collingbourne
36fc3f6000 IR: Eliminate non-determinism in the module summary analysis.
Also make the summary ref and call graph vectors immutable. This means
a smaller API surface and fewer places to audit for non-determinism.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290200 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-20 21:12:28 +00:00
Haicheng Wu
036647c99a [LoopUnroll] Modify a comment to clarify the usage of TripCount. NFC.
Make it clear that TripCount is the upper bound of the iteration on which
control exits LatchBlock.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290199 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-20 20:23:48 +00:00
Eli Friedman
1e77c707b7 [ARM] Implement isExtractSubvectorCheap.
See https://reviews.llvm.org/D6678 for the history of
isExtractSubvectorCheap. Essentially the same considerations apply
to ARM.

This temporarily breaks the formation of vpadd/vpaddl in certain cases;
AddCombineToVPADDL essentially assumes that we won't form VUZP shuffles.
See https://reviews.llvm.org/D27779 for followup fix.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290198 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-20 20:05:07 +00:00
Eli Friedman
967c9cbd8f [ARM] Generate checks for shuffle tests using update_llc_test_checks.py.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290196 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-20 19:33:24 +00:00
Matt Arsenault
96a2ab4222 Use MaxDepth instead of repeating its value
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290194 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-20 19:06:15 +00:00
Matt Arsenault
256f8018fa AMDGPU: Allow 16-bit types in inline asm constraints
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290193 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-20 19:06:12 +00:00
Matt Arsenault
4bcae756d4 AMDGPU: Run fp combine tests on VI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290192 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-20 18:55:11 +00:00
Matt Arsenault
44e57608d4 AMDGPU: Don't add same instruction multiple times to worklist
When the instruction is processed the first time, it may be
deleted resulting in crashes. While the new test adds the same
user to the worklist twice, this particular case doesn't crash
but I'm not sure why.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290191 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-20 18:55:06 +00:00
George Burgess IV
8a2cde8e71 Replace std::find_if with llvm::find_if. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290190 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-20 18:46:27 +00:00
Zachary Turner
33ae526547 Revert "Re-add the assert to StringRef's const char *, length constructor."
This reverts commit r290188, which is causing internal compiler errors
on GCC 4.8

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290189 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-20 18:05:47 +00:00
Zachary Turner
dba614135b Re-add the assert to StringRef's const char *, length constructor.
By putting the assert behind a conditional in the initializer list
we can ensure that it will still work in a constexpr context as
the else branch of the ternary operator won't be examined unless
the condition fails.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290188 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-20 17:57:56 +00:00
David Blaikie
b0d6793fd5 Fix missing '>' in docs (hopefully fixes bot error... )
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290187 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-20 17:43:48 +00:00
David Blaikie
bf89173855 Add some brief documentation about GDB pretty printers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290186 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-20 17:33:58 +00:00
Tom Stellard
f51b34f067 AMDGPU/SI: Make a function const
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290185 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-20 17:26:34 +00:00
Tom Stellard
38206ae07e AMDGPU/SI: Add a MachineMemOperand when lowering llvm.amdgcn.buffer.load.*
Reviewers: arsenm, nhaehnle, mareko

Subscribers: kzhuravl, wdng, yaxunl, llvm-commits, tony-tye

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290184 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-20 17:19:44 +00:00
Simon Pilgrim
5624de7d8d [X86][SSE] Ensure we're only combining shuffles with legal mask types.
I haven't managed to get this to fail yet but its technically possible for the AND -> shuffle decomposition to result in illegal types.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290183 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-20 17:09:52 +00:00
Tom Stellard
11d071bf72 AMDGPU/SI: Add a MachineMemOperand to MIMG instructions
Summary:
Without a MachineMemOperand, the scheduler was assuming MIMG instructions
were ordered memory references, so no loads or stores could be reordered
across them.

Reviewers: arsenm

Subscribers: arsenm, kzhuravl, wdng, nhaehnle, yaxunl, tony-tye

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290179 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-20 15:52:17 +00:00
Serge Pavlov
7f580b605b Fix build with expensive checks enabled
Include of llvm/IR/Verifier.h was removed from HexagonCommonGEP.cpp in r289604
as unused. In fact it is required when expensive checks are enabled, because
it declared function `verifyFunction`, which is called in conditionally compiled
part of the file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290170 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-20 08:48:51 +00:00
Rui Ueyama
ab968f698e Remove extraneous space.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290165 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-20 05:49:56 +00:00
Chandler Carruth
1c4b812941 [PM] Rework a loop in the CGSCC update logic to be more conservative and
clear. The current RefSCC can occur in exactly one position so we should
just enforce that and leverage the property rather than checking for it
anywhere.

This addresses review comments made on another patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290162 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-20 03:32:17 +00:00
Chandler Carruth
54cffa1811 [PM] Provide an initial, minimal port of the inliner to the new pass manager.
This doesn't implement *every* feature of the existing inliner, but
tries to implement the most important ones for building a functional
optimization pipeline and beginning to sort out bugs, regressions, and
other problems.

Notable, but intentional omissions:
- No alloca merging support. Why? Because it isn't clear we want to do
  this at all. Active discussion and investigation is going on to remove
  it, so for simplicity I omitted it.
- No support for trying to iterate on "internally" devirtualized calls.
  Why? Because it adds what I suspect is inappropriate coupling for
  little or no benefit. We will have an outer iteration system that
  tracks devirtualization including that from function passes and
  iterates already. We should improve that rather than approximate it
  here.
- Optimization remarks. Why? Purely to make the patch smaller, no other
  reason at all.

The last one I'll probably work on almost immediately. But I wanted to
skip it in the initial patch to try to focus the change as much as
possible as there is already a lot of code moving around and both of
these *could* be skipped without really disrupting the core logic.

A summary of the different things happening here:

1) Adding the usual new PM class and rigging.

2) Fixing minor underlying assumptions in the inline cost analysis or
   inline logic that don't generally hold in the new PM world.

3) Adding the core pass logic which is in essence a loop over the calls
   in the nodes in the call graph. This is a bit duplicated from the old
   inliner, but only a handful of lines could realistically be shared.
   (I tried at first, and it really didn't help anything.) All told,
   this is only about 100 lines of code, and most of that is the
   mechanics of wiring up analyses from the new PM world.

4) Updating the LazyCallGraph (in the new PM) based on the *newly
   inlined* calls and references. This is very minimal because we cannot
   form cycles.

5) When inlining removes the last use of a function, eagerly nuking the
   body of the function so that any "one use remaining" inline cost
   heuristics are immediately refined, and queuing these functions to be
   completely deleted once inlining is complete and the call graph
   updated to reflect that they have become dead.

6) After all the inlining for a particular function, updating the
   LazyCallGraph and the CGSCC pass manager to reflect the
   function-local simplifications that are done immediately and
   internally by the inline utilties. These are the exact same
   fundamental set of CG updates done by arbitrary function passes.

7) Adding a bunch of test cases to specifically target CGSCC and other
   subtle aspects in the new PM world.

Many thanks to the careful review from Easwaran and Sanjoy and others!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290161 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-20 03:15:32 +00:00
Adrian Prantl
c84e30c126 Reapply r289926: attempt to fix windows build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290158 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-20 02:33:30 +00:00
Adrian Prantl
7b500b4bdf [IR] Remove the DIExpression field from DIGlobalVariable.
This patch implements PR31013 by introducing a
DIGlobalVariableExpression that holds a pair of DIGlobalVariable and
DIExpression.

Currently, DIGlobalVariables holds a DIExpression. This is not the
best way to model this:

(1) The DIGlobalVariable should describe the source level variable,
    not how to get to its location.

(2) It makes it unsafe/hard to update the expressions when we call
    replaceExpression on the DIGLobalVariable.

(3) It makes it impossible to represent a global variable that is in
    more than one location (e.g., a variable with multiple
    DW_OP_LLVM_fragment-s).  We also moved away from attaching the
    DIExpression to DILocalVariable for the same reasons.

This reapplies r289902 with additional testcase upgrades and a change
to the Bitcode record for DIGlobalVariable, that makes upgrading the
old format unambiguous also for variables without DIExpressions.

<rdar://problem/29250149>
https://llvm.org/bugs/show_bug.cgi?id=31013
Differential Revision: https://reviews.llvm.org/D26769

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290153 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-20 02:09:43 +00:00
Chris Bieneman
23755c9509 Revert "[ObjectYAML] Support for DWARF debug_info section"
This reverts commit r290147.

This commit is breaking a bot (http://lab.llvm.org:8011/builders/clang-atom-d525-fedora-rel/builds/621). I don't have time to investigate at the moment, so I'll revert for now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290148 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-20 00:42:06 +00:00
Chris Bieneman
eca8f9afc6 [ObjectYAML] Support for DWARF debug_info section
This patch adds support for YAML<->DWARF for debug_info sections.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290147 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-20 00:26:24 +00:00
Eli Friedman
97cbb36487 Add ARM support to update_llc_test_checks.py
Just the minimal support to get it working at the moment.

Includes checks for test/CodeGen/ARM/vzip.ll as an example.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290144 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-19 23:09:51 +00:00
Michael Kuperstein
ab621d823b [LV] Sink tripcount query to where it's actually used. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290142 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-19 22:47:52 +00:00
Chris Bieneman
c2813d918a [ObjectYAML] Support for DWARF Pub Sections
This patch adds support for YAML<->DWARF round tripping for pub* section data. The patch supports both GNU and non-GNU style entries.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290139 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-19 22:22:12 +00:00
Mike Aizatsky
d576930959 [libfuzzer] dump_coverage command line flag
Reviewers: kcc, vitalybuka

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290138 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-19 22:18:08 +00:00
Michael LeMay
eaf3712d06 [TargetInstrInfo] replace redundant expression in getMemOpBaseRegImmOfs
Summary:
The expression for computing the return value of getMemOpBaseRegImmOfs has only
one possible value. The other value would result in a return earlier in the
function. This patch replaces the expression with its only possible value.

Reviewers: sanjoy

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290133 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-19 21:02:41 +00:00
Greg Clayton
655737aec3 Make a function to correctly extract the DW_AT_high_pc given the low pc value.
DWARF 4 and later supports encoding the PC as an address or as as offset from the low PC. Clients using DWARFDie should be insulated from how to extract the high PC value. This function takes care of extracting the form value and looking for the correct form.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290131 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-19 20:36:41 +00:00
Sanjay Patel
1fd371a473 [InstCombine] use commutative matcher for pattern with commutative operators
This is a case that was missed in:
https://reviews.llvm.org/rL290067
...and it would regress if we fix operand complexity (PR28296).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290127 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-19 18:35:37 +00:00
Sanjay Patel
63e1cbe0bb [InstCombine] add folds for icmp (umin|umax X, Y), X
This is a follow-up to:
https://reviews.llvm.org/rL289855 (https://reviews.llvm.org/D27531)
https://reviews.llvm.org/rL290111


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290118 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-19 17:32:37 +00:00
Florian Hahn
c8f0c8614b [LoopVersioning] Require loop-simplify form for loop versioning.
Summary:
Requiring loop-simplify form for loop versioning ensures that the
runtime check block always dominates the exit block.
    
This patch closes #30958 (https://llvm.org/bugs/show_bug.cgi?id=30958).

Reviewers: silviu.baranga, hfinkel, anemet, ashutosh.nema

Subscribers: ashutosh.nema, mzolotukhin, efriedma, hfinkel, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290116 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-19 17:13:37 +00:00
Konstantin Zhuravlyov
76d41d2938 [AMDGPU] When unifying metadata, add operands to named metadata individually
Differential Revision: https://reviews.llvm.org/D27725


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290114 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-19 16:54:24 +00:00
Sanjay Patel
21b74be87d [InstCombine] add folds for icmp (smax X, Y), X
This is a follow-up to:
https://reviews.llvm.org/rL289855 (D27531)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290111 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-19 16:28:53 +00:00
Daniel Jasper
d6878955b8 Silence unused warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290109 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-19 14:24:22 +00:00
Diana Picus
7678e12d91 [ARM] GlobalISel: Add more checks to test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290108 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-19 14:08:11 +00:00