Commit Graph

147914 Commits

Author SHA1 Message Date
Philip Reames
a716933950 Refresh the statepoint docs a bit
The documentation had gotten a bit stale.  The revised one are by no means perfect, but I tried to remove the obvious incorrect or misleading statements.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300782 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 23:16:13 +00:00
Matthias Braun
0749000e14 X86FrameLowering: Fix getFrameIndexReference() for 'fixed' objects
Debug information is calculated with getFrameIndexReference() which was
missing some logic for the fixed object cases (= parameters on the stack).

rdar://24557797

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300781 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 23:10:43 +00:00
Eugene Zelenko
86bfc787f1 [Object] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300779 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 23:02:10 +00:00
Kostya Serebryany
d89a81f5c9 [sanitizer-coverage] remove some more stale code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300778 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 22:42:11 +00:00
Evgeniy Stepanov
11bae79f9c Remove two unused variables (-Werror).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300777 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 22:27:23 +00:00
Craig Topper
119d936828 [APInt] Cast more calls to add/sub/mul overflow functions to void. I missed the unittests in r300758.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300773 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 22:11:05 +00:00
Sanjay Patel
2aa6ae886a [DAG] add splat vector support for 'or' in SimplifyDemandedBits
I've changed one of the tests to not fold away, but we didn't and still don't do the transform
that the comment claims we do (and I don't know why we'd want to do that).

Follow-up to:
https://reviews.llvm.org/rL300725
https://reviews.llvm.org/rL300763


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300772 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 22:00:00 +00:00
Kostya Serebryany
06c0527072 [sanitizer-coverage] remove stale code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300769 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 21:48:09 +00:00
Kostya Serebryany
47ba2c1622 [libFuzzer] remove -output_csv option. It duplicates the default output and got out of sync
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300768 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 21:34:58 +00:00
Sanjay Patel
27b613382c [DAG] add splat vector support for 'xor' in SimplifyDemandedBits
This allows forming more 'not' ops, so we get improvements for ISAs that have and-not.

Follow-up to:
https://reviews.llvm.org/rL300725


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300763 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 21:23:09 +00:00
Matthias Braun
ed95c621a6 ARMFrameLowering: Reserve emergency spill slot for large arguments
Re-commit after revert in r300668. Changed getMaxFPOffset() to a
more conservative heuristic instead of trying to be clever and missing
for some exotic calling conventions.

We need to reserve an emergency spill slot in cases with large argument
types that could overflow immediate offsets for FP relative address
calculations.

rdar://31317893

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300761 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 21:11:44 +00:00
Craig Topper
3bebc1eb2e [APInt] Cast calls to add/sub/mul overflow methods to void if only their overflow bool out param is used.
This is preparation for a clang change to improve the [[nodiscard]] warning to not be ignored on methods that return a class marked [[nodiscard]] that are defined in the class itself. See D32207.

We should consider adding wrapper methods to APInt that return the overflow flag directly and discard the APInt result. This would eliminate the void casts and the need to create a bool before the call to pass to the out param.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300758 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 21:09:45 +00:00
Simon Pilgrim
6c2fd36052 [InstCombine] Add frem constant folding test (PR3316)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300757 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 21:09:19 +00:00
Matt Arsenault
ac9b651ab6 AMDGPU: Custom lower illegal small select types
Promote them to i32 vectors to avoid unpacking and re-packing
the vectors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300754 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 20:53:07 +00:00
Dehao Chen
074b06ad8d Code style change as suggested in https://reviews.llvm.org/D32177 (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300753 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 20:52:21 +00:00
Eli Friedman
3767f141eb [ARM] Remove redundant computeKnownBits helper.
Move the BFI logic to computeKnownBitsForTargetNode, and delete
the redundant CMOV logic.

This is intended as a cleanup, but it's probably possible to construct
a case where moving the BFI logic allows more combines.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300752 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 20:50:57 +00:00
Aditya Nandakumar
4925efae1f [GISEL]: Move getConstantVReg to Utils
NFCI

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300751 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 20:48:50 +00:00
Simon Pilgrim
2684aaead6 [InstCombine] Add frem constant folding test (PR32177)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300750 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 20:47:58 +00:00
Eli Friedman
89e89fb349 [ARM] Use TableGen patterns to select vtbl. NFC.
Differential Revision: https://reviews.llvm.org/D32103



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300749 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 20:39:39 +00:00
Craig Topper
a5ac74c297 [APInt] Use SignExtend64 instead of reinventing it. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300747 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 20:32:11 +00:00
Eli Friedman
b4afe9c79f [SCEV] Make SCEV or modeling more aggressive.
Use haveNoCommonBitsSet to figure out whether an "or" instruction
is equivalent to addition. This handles more cases than just
checking for a constant on the RHS.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300746 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 20:19:58 +00:00
Dehao Chen
fd134f768b Using address range map to speedup finding inline stack for address.
Summary:
In the current implementation, to find inline stack for an address incurs expensive linear search in 2 places:

* linear search for the top-level DIE
* recursive linear traverse the DIE tree to find the path to the leaf DIE

In this patch, a map is built from address to its corresponding leaf DIE. The inline stack is built by traversing from the leaf DIE up to the root DIE. This speeds up batch symbolization by ~10X without noticible memory overhead.

Reviewers: dblaikie

Reviewed By: dblaikie

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300742 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 20:09:38 +00:00
Dehao Chen
e708328af6 Update the madd.ll test with utils/update_llc_test_checks.py (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300740 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 20:08:14 +00:00
Dehao Chen
f0c95e1f1a PR32710: Disable using PMADDWD for unsigned short.
Summary: PMADDWD can only handle signed short.

Reviewers: mkuper, wmi

Reviewed By: mkuper

Subscribers: andreadb, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300737 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 19:50:34 +00:00
Matt Arsenault
0e1e60b73a AMDGPU: Don't emit amd_kernel_code_t for callable functions
This is inserted directly in the text section. The relocation
for the function ends up resolving to the beginning of the
amd_kernel_code_t header rather than the actual function
entry point.

Also skip some of the comments for initialization
that only makes sense for kernels.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300736 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 19:38:10 +00:00
Aditya Nandakumar
48c8dfd647 [tblgen] GCC/MS builtin to target intrisics map.
Patch by Ettore Speziale

Allow TableGen to generate static functions to perform GCC/MS builtin name to
target specific intrinsic ID mapping.

https://reviews.llvm.org/D31150

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300735 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 19:14:20 +00:00
Artem Tamazov
de213fd92a [AMDGPU][mc][tests][NFC] Update bulk ISA tests for Gfx7 and Gfx8
Added approx. 1100 gfx7 and 1040 gfx8 test cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300734 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 19:12:06 +00:00
Matt Arsenault
fe6b2045f8 StructurizeCFG: Directly invert cmp instructions
The most common case for a branch condition is
a single use compare. Directly invert the branch
predicate rather than adding a lot of xor i1 true
which the DAG will have to fold later.

This produces nicer to read structurizer output.

This produces some random changes in codegen
due to the DAG swapping branch conditions itself,
and then does a poor job of dealing with those
inverts.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300732 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 18:29:07 +00:00
Sanjoy Das
980a21c306 [GVN] Don't coerce non-integral pointers to integers or vice versa
Summary:
See http://llvm.org/docs/LangRef.html#non-integral-pointer-type

The NewGVN test does not fail without these changes (perhaps it does
try to coerce pointers <-> integers to begin with?), but I added the
test case anyway.

Reviewers: dberlin

Subscribers: mcrosier, llvm-commits, Prazek

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300730 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 18:21:09 +00:00
Richard Smith
eab85946c1 Update comment to match r300252.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300728 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 18:17:51 +00:00
Tim Northover
8a1f075c93 ARM: TLS calling convention doesn't preserve r9 or r12 on Darwin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300726 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 18:07:54 +00:00
Sanjay Patel
14ee3d3d79 [DAG] add splat vector support for 'and' in SimplifyDemandedBits
The patch itself is simple: stop discriminating against vectors in visitAnd() and again in 
SimplifyDemandedBits().

Some notes for reference:

1. We're not consistent about calls to SimplifyDemandedBits in the various visitXXX functions. 
   Sometimes, we check if the RHS is a constant first. Other times (like here), we just dive in.
2. I'd like to break the vector shackles in steps for the sake of risk minimization, but we could
    make similar simultaneous changes in other places if we think that would be better.
3. I don't know what the intent of the changed tests in this patch was supposed to be, but since 
   they wiggled in a positive way, I'm just going with that. :)
4. In the rotate tests, note that we can see through non-splat constants. This is a result of D24253.
5. My motivation for being here now is to make D31944 look better, so this is step 1 of N towards 
   improving the vector codegen in that patch without writing any actual new code.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300725 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 18:05:06 +00:00
Peter Collingbourne
f7fa9ffd08 IR: Remove some comments that are documenting the obvious. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300724 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 18:00:05 +00:00
Benjamin Kramer
5c42a4d473 [MathExtras] Fix undefined behavior (shift by bit width)
While there add some unit tests for uint64_t. Found by ubsan.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300721 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 17:46:15 +00:00
Matt Arsenault
902e7e59d1 AMDGPU: Don't align callable functions to 256
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300720 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 17:42:39 +00:00
Matt Arsenault
610621c4ba AMDGPU: Change DivergenceAnalysis for function arguments
Stop assuming all functions are kernels.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300719 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 17:42:34 +00:00
Reid Kleckner
d6b4b10a39 Prefer addAttr(Attribute::AttrKind) over the AttributeList overload
This should simplify the call sites, which typically want to tweak one
attribute at a time. It should also avoid creating ephemeral
AttributeLists that live forever.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300718 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 17:28:52 +00:00
Davide Italiano
8ccdc59458 [InstCombine] Reduce visitLoadInst() code duplication. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300717 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 17:26:57 +00:00
Craig Topper
51a8438801 [APInt] Move the 'return *this' from the slow cases of assignment operators inline. We should let the compiler see that the fast/slow cases both return *this.
I don't think we chain assignments together very often so this shouldn't matter much.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300715 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 17:01:58 +00:00
Sanjay Patel
19e4f8f1d9 [InstSimplify] fold identity shuffles (recursing if needed)
This patch simplifies the examples from D31509 and D31927 (PR30630) and catches 
the basic identity shuffle tests that Zvi recently added.

I'm not sure if we have something like this in DAGCombiner, but we should?

It's worth noting that "MaxRecurse / RecursionLimit" is only 3 on entry at the moment. 
We might want to bump that up if there are longer shuffle chains like this in the wild.

For now, we're ignoring shuffles that have undef mask elements because it's not
clear how those should be handled.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300714 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 16:48:22 +00:00
Sanjay Patel
af30bb9796 use 'auto' with 'dyn_cast' and fix formatting; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300713 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 16:22:19 +00:00
Zachary Turner
a036dbbac5 Add an #include for <climits> for CHAR_BIT.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300711 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 15:50:43 +00:00
Zachary Turner
dc88b88a05 [Support] Add some helpers to generate bitmasks.
Frequently you you want a bitmask consisting of a specified
number of 1s, either at the beginning or end of a word.

The naive way to do this is to write

template<typename T>
T leadingBitMask(unsigned N) {
  return (T(1) << N) - 1;
}

but using this function you cannot produce a word with every
bit set to 1 (i.e. leadingBitMask<uint8_t>(8)) because left
shift is undefined when N is greater than or equal to the
number of bits in the word.

This patch provides an efficient, branch-free implementation
that works for all values of N in [0, CHAR_BIT*sizeof(T)]

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300710 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 15:45:31 +00:00
Zachary Turner
f1e3a3638c Remove eol-style:native from MathExtras.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300709 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 15:43:23 +00:00
Dehao Chen
815d217552 Revert r300697 which causes buildbot failure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300708 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 15:28:58 +00:00
Krzysztof Parzyszek
d9552968c4 [Hexagon] Generate proper offset in opt-addr-mode
Also, make a few changes to allow using the pass in .mir testcases.
Among other things, change the abbreviation from opt-amode to amode-opt,
because otherwise lit would expand the "opt" part to the full path to
the opt binary.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300707 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 15:15:51 +00:00
Krzysztof Parzyszek
f6728e6d7d [Hexagon] Remove RDefMap, use Liveness:getNearestAliasedRef instead
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300706 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 15:14:30 +00:00
Krzysztof Parzyszek
ad6758286a [RDF] Switch NodeList to SmallVector from std::vector
The list has a single element 75+% of the time, reservation of 4 elements
is sufficient in 95% of cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300705 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 15:12:44 +00:00
Krzysztof Parzyszek
1896b7912b [RDF] Use faster version of findBlock
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300704 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 15:11:23 +00:00
Krzysztof Parzyszek
111ac46fe7 [RDF] Cache register units for reg masks instead of recalculating them
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300702 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 15:10:09 +00:00