137991 Commits

Author SHA1 Message Date
Gor Nishanov
6ff9c199ca [Coroutines] Part13: Handle single edge PHINodes across suspends
Summary:
If one of the uses of the value is a single edge PHINode, handle it.

Original:

    %val = something
    <suspend>
    %p = PHINode [%val]

After Spill + Part13:

    %val = something
    %slot = gep val.spill.slot
    store %val, %slot
    <suspend>
    %p = load %slot

Plus tiny fixes/changes:
   * use correct index for coro.free in CoroCleanup
   * fixup id parameter in coro.free to allow authoring coroutine in plain C with __builtins

Reviewers: majnemer

Subscribers: mehdi_amini, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281020 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-09 05:39:00 +00:00
Amaury Sechet
7f692c7e3e Rationalise the attribute getter/setter methods on Function and CallSite.
Summary:
While woring on mapping attributes in the C API, it clearly appeared that the recent changes in the API on the C++ side left Function and Call/Invoke with an attribute API that grew in an ad hoc manner. This makes it difficult to work with it, because one doesn't know which overloads exists and which do not.

Make sure that getter/setter function exists for both enum and string version. Remove inconsistent getter/setter, unless they have many callsites.

This should make it easier to work with attributes in the future.

This doesn't change how attribute works.

Reviewers: bkramer, whitequark, mehdi_amini, void

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281019 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-09 04:50:38 +00:00
Kostya Serebryany
4475d671c4 [libFuzzer] improve -print_pcs to not print new PCs coming from libFuzzer itself
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281016 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-09 02:38:28 +00:00
Kostya Serebryany
ddc2d44ce2 [libFuzzer] remove unneeded call
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281014 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-09 01:57:38 +00:00
Craig Topper
a1223781e3 [AVX-512] Add VPCMP instructions to the load folding tables and make them commutable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281013 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-09 01:36:10 +00:00
Craig Topper
beb82336a0 [AVX-512] Add more integer vector comparison tests with loads. Some of these show opportunities where we can commute to fold loads.
Commutes will be added in a followup commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281012 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-09 01:36:04 +00:00
Vedant Kumar
84dc7510c9 [llvm-cov] Emit a summary in the report directory's index
llvm-cov writes out an index file in '-output-dir' mode, albeit not a
very informative one. Try to fix that by using the CoverageReport API to
include some basic summary information in the index file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281011 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-09 01:32:55 +00:00
Vedant Kumar
85e096da4e [llvm-cov] Constify some methods (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281010 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-09 01:32:51 +00:00
Vedant Kumar
006e320c47 [llvm-cov] Add an API to prepare file reports (NFC)
It would be nice to prepare file reports (using the CoverageReport API)
without actually rendering them to the console. I plan on using this to
flesh out the 'index' files in the coverage views.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281009 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-09 01:32:49 +00:00
Vedant Kumar
f539109ae3 [llvm-cov] Speculate fix for a Windows-only test (NFC)
This test should have broken after r280896. Fix up the test case
speculatively, since I don't have a way to test it.

I wonder why I didn't get any angry bot emails about this. Maybe none of
the win32 bots test llvm-cov? That could explain it, since the test says
it 'REQUIRES: system-windows', which is restricted to win32 hosts.

Also: why is 'system-windows' not defined for non-win32 Windows bots?

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281008 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-09 01:32:47 +00:00
Kostya Serebryany
05e1dea79e [libFuzzer] remove use_traces=1 since use_value_profile seems to be strictly better
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281007 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-09 01:17:03 +00:00
David Majnemer
0f6a0eb5f3 [X86] Tighten up a comment which confused x64 ABI terminology.
The x64 ABI has two major function types:
 - frame functions
 - leaf functions

A frame function is one which requires a stack frame.  A leaf function
is one which does not.  A frame function may or may not have a frame
pointer.

A leaf function does not require a stack frame and may never modify SP
except via a return (RET, tail call via JMP).

A frame function which has a frame pointer is permitted to use the LEA
instruction in the epilogue, a frame function without which doesn't
establish a frame pointer must use ADD to adjust the stack pointer epilogue.

Fun fact: Leaf functions don't require a function table entry
(associated PDATA/XDATA).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281006 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-09 01:07:01 +00:00
Michael Kuperstein
74990a5bca [X86] Add more baseline tests for "irregular" shuffles. NFC.
This adds more tests for shuffles where the output width does not match
the input width and/or the output is generated from more than two inputs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281005 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-09 00:49:29 +00:00
Hans Wennborg
d837ce2087 Win64: Don't use REX prefix for direct tail calls
The REX prefix should be used on indirect jmps, but not direct ones.
For direct jumps, the unwinder looks at the offset to determine if
it's inside the current function.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281003 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-08 23:35:10 +00:00
Mike Aizatsky
e0cbb68b42 .clang-tidy: parameters and members should be CamelCased.
Summary: Not sure why is it missing.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281002 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-08 23:29:37 +00:00
Saleem Abdulrasool
8aad2917ed llvm-objdump: add missing ) in help output, NFC
Add a missing ')' in the help output.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281000 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-08 23:17:34 +00:00
Kostya Serebryany
10c8c3c91f [libFuzzer] add missing docs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280996 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-08 22:21:13 +00:00
Dehao Chen
539e8b4532 Remove debug info when hoisting instruction from then/else branch.
Summary: The hoisted instruction is executed speculatively. It could affect the debugging experience as user would see gdb go into code that may not be expected to execute. It will also affect sample profile accuracy by assigning incorrect frequency to source within then/else branch.

Reviewers: davidxl, dblaikie, chandlerc, kcc, echristo

Subscribers: mehdi_amini, probinson, eric_niebler, andreadb, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280995 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-08 21:53:33 +00:00
Sanjay Patel
53d514fc09 [InstCombine] regenerate checks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280993 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-08 21:40:21 +00:00
Matthew Simpson
97ea58ef28 [LV] Ensure proper handling of multi-use case when collecting uniforms
The test case included in r280979 wasn't checking what it was supposed to be
checking for the predicated store case. Fixing the test revealed that the
multi-use case (when a pointer is used by both vectorized and scalarized memory
accesses) wasn't being handled properly. We can't skip over
non-consecutive-like pointers since they may have looked consecutive-like with
a different memory access.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280992 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-08 21:38:26 +00:00
Sanjay Patel
92544c4104 [InstCombine] regenerate checks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280991 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-08 21:32:21 +00:00
Krzysztof Parzyszek
01b876d45e [RDF] Further improve handling of multiple phis reached from shadows
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280987 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-08 20:48:42 +00:00
Vedant Kumar
111f4fbf9a [llvm-cov] Fix issues with segment highlighting in the html view
The text and html coverage views take different approaches to emitting
highlighted regions. That's because this problem is easier in the text
view: there's no need to worry about escaping text or adding tooltip
content to a highlighted snippet.

Unfortunately, the html view didn't get region highlighting quite right.

This patch fixes the situation, bringing parity between the two views.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280981 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-08 19:18:23 +00:00
Matthew Simpson
99a1cd6e48 [LV] Don't mark pointers used by scalarized memory accesses uniform
Previously, all consecutive pointers were marked uniform after vectorization.
However, if a consecutive pointer is used by a memory access that is eventually
scalarized, the pointer won't remain uniform after all. An example is
predicated stores. Even though a predicated store may be consecutive, it will
still be scalarized, making it's pointer operand non-uniform.

This patch updates the logic in collectLoopUniforms to consider the cases where
a memory access may be scalarized. If a memory access may be scalarized, its
pointer operand is not marked uniform. The determination of whether a given
memory instruction will be scalarized or not has been moved into a common
function that is used by the vectorizer, cost model, and legality analysis.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280979 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-08 19:11:07 +00:00
Zachary Turner
3d9234aa0a [pdb] Make YamlTypeDumperCallbacks reuse *this.
Previously we were making new instances of YamlTypeDumperCallbacks
in order to recurse down and serialize / deserialize nested
records such as field lists.  This meant you could not pass
context from a higher operation to a lower operation because
it would be using a new instance of the visitor callback
delegate.

YAMLIO library was updated to support context-sensitive mappings,
so now we can reuse the same instance of the visitor callback
delegate even for nested operations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280978 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-08 18:36:55 +00:00
Zachary Turner
684da7277a [YAMLIO] Add the ability to map with context.
mapping a yaml field to an object in code has always been
a stateless operation.  You could still pass state by using the
`setContext` function of the YAMLIO object, but this represented
global state for the entire yaml input.  In order to have
context-sensitive state, it is necessary to pass this state in
at the granularity of an individual mapping.

This patch adds support for this type of context-sensitive state.
You simply pass an additional argument of type T to the
`mapRequired` or `mapOptional` functions, and provided you have
specialized a `MappingContextTraits<U, T>` class with the
appropriate mapping function, you can pass this context into
the mapping function.

Reviewed By: chandlerc
Differential Revision: https://reviews.llvm.org/D24162

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280977 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-08 18:22:44 +00:00
Matt Arsenault
1bc1003b7a AMDGPU: Sign extend constants when splitting them
This will confuse later passes which try to look at the
immediate value and don't truncate first.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280974 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-08 17:44:36 +00:00
Krzysztof Parzyszek
3358dc461b [Hexagon] Expand sext- and zextloads of vector types, not just extloads
Recent change exposed this issue, breaking the Hexagon buildbots.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280973 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-08 17:42:14 +00:00
Matt Arsenault
c0196eb442 AMDGPU: Try to commute when selecting s_addk_i32/s_mulk_i32
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280972 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-08 17:35:41 +00:00
Eric Christopher
a50ca9fdb6 AArch64 .arch directive - Include default arch attributes with extensions.
Fix the .arch asm parser to use the full set of features for the architecture
and any extensions on the command line. Add and update testcases accordingly
as well as add an extension that was used but not supported.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280971 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-08 17:27:03 +00:00
Matt Arsenault
d764af3c4e AMDGPU: Support commuting with immediate in src0
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280970 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-08 17:19:29 +00:00
Renato Golin
86159cb9be Revert "[XRay] ARM 32-bit no-Thumb support in LLVM"
And associated commits, as they broke the Thumb bots.

This reverts commit r280935.
This reverts commit r280891.
This reverts commit r280888.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280967 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-08 17:10:39 +00:00
Balaram Makam
b91e524cc6 [LoopDataPrefetch] Use range based for loop; NFCI
Switch to range based for loop.
No functional change, but more readable code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280966 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-08 17:08:20 +00:00
Sanjay Patel
e0563b1a6c [InstCombine] return a vector-safe true/false constant
I introduced this potential bug by missing this diff in:
https://reviews.llvm.org/rL280873

...however, I'm not sure how to reach this code path with a regression test.
We may be able to remove this code and assume that the transform to a constant
is always handled by InstSimplify?



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280964 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-08 16:54:02 +00:00
Dehao Chen
fcc57ae781 Add unittest for r280760
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280963 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-08 16:53:40 +00:00
Simon Pilgrim
f3c65245b1 [InstCombine][X86] Regenerate masked memory op combine tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280960 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-08 16:32:37 +00:00
Simon Pilgrim
2a7d3fa16a [InstCombine][X86] Regenerate vperm2f128/vperm2i128 combine tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280959 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-08 16:30:46 +00:00
Simon Pilgrim
0cd49c00e9 [InstCombine][X86] Regenerate insertps combine tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280957 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-08 16:15:21 +00:00
Vedant Kumar
c87eb166fc [Coverage] Delete some dead code (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280956 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-08 16:14:14 +00:00
Sam Kolton
e3aa0d989e [TableGen] AsmMatcher: Add AsmVariantName to Instruction class.
Summary:
This allows specifying instructions that are available only in specific assembler variant. If AsmVariantName is specified then instruction will be presented only in MatchTable for this variant. If not specified then assembler variants will be determined based on AsmString.
Also this allows splitting assembler match tables in same way as it is done in dissasembler.

Reviewers: ab, tstellarAMD, craig.topper, vpykhtin

Subscribers: wdng

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280952 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-08 15:50:52 +00:00
Reid Kleckner
88e07a9d10 Remove restriction that 'sret' must be on the first parameter
On Windows, it is often applied to the second parameter, and the x86
backend is prepared to deal with sret appearing on any parameter.

Other backends assume it only appears on parameter zero, but those are
target-specific requirements, and not an IR-level rule.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280951 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-08 15:45:27 +00:00
Reid Kleckner
1a53e071f4 Give an x86 assembler test a triple
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280950 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-08 15:40:43 +00:00
Dehao Chen
035ff49cd1 revert r280427
Refactor replaceDominatedUsesWith to have a flag to control whether to replace uses in BB itself.

Summary: This is in preparation for LoopSink pass which calls replaceDominatedUsesWith to update after sinking.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280949 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-08 15:25:12 +00:00
Renato Golin
08450b51cb [ARM XRay] Try to fix Thumb-only failure
I mised the check that it had to support ARM to work. This commit tries
to fix that, to make sure we don't emit ARM code in Thumb-only mode.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280935 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-08 13:45:10 +00:00
James Molloy
7442ca457d [SDAGBuilder] Don't create a binary tree for switches in minsize mode
This bloats codesize - all of the non-leaf nodes are extra code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280932 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-08 13:12:22 +00:00
James Molloy
ac84ac058a [Thumb1] AND with a constant operand can be converted into BIC
So model the cost of materializing the constant operand C as the minimum of
C and ~C.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280929 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-08 12:58:12 +00:00
James Molloy
210e77be29 [Thumb1] Fix cost calculation for complemented immediates
Materializing something like "-3" can be done as 2 instructions:
  MOV r0, #3
  MVN r0, r0

This has a cost of 2, not 3. It looks like we were already trying to detect this pattern in TII::getIntImmCost(), but were taking the complement of the zero-extended value instead of the sign-extended value which is unlikely to ever produce a number < 256.

There were no tests failing after changing this... :/

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280928 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-08 12:58:04 +00:00
Simon Pilgrim
d88990b028 [SelectionDAG] Add BUILD_VECTOR support to computeKnownBits and SimplifyDemandedBits
Add the ability to computeKnownBits and SimplifyDemandedBits to extract the known zero/one bits from BUILD_VECTOR, returning the known bits that are shared by every vector element.

This is an initial step towards determining the sign bits of a vector (PR29079).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280927 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-08 12:57:51 +00:00
Simon Pilgrim
707719e625 [DAGCombiner] Enable AND combines of splatted constant vectors
Allow AND combines to use a vector splatted constant as well as a constant scalar.

Preliminary part of D24253.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280926 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-08 12:36:39 +00:00
Pablo Barrio
ad84cf49dc Revert "[ARM] Lower UDIV+UREM to UDIV+MLS (and the same for SREM)"
This reverts commit r280808.

It is possible that this change results in an infinite loop. This
is causing timeouts in some tests on ARM, and a Chromebook bot is
failing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280918 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-08 10:05:57 +00:00