Commit Graph

148036 Commits

Author SHA1 Message Date
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
Krzysztof Parzyszek
cfaa15d905 [Hexagon] Cache reached blocks in bit tracker instead of scanning list
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300701 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 15:08:31 +00:00
Sanjay Patel
f60747136e [PowerPC] add test and auto-generate checks; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300700 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 14:58:09 +00:00
Sanjay Patel
78415aba70 [ARM] add test and auto-generate checks; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300698 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 14:55:50 +00:00
Dehao Chen
2d19a45863 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@300697 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 14:50:57 +00:00
Davide Italiano
c99545d60a [InstSimplify] Deduce correct type for vector GEP.
InstSimplify returned the wrong type when simplifying a vector GEP
and we ended up crashing when trying to replace all uses with the
new value. Fixes PR32697.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300693 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 14:23:42 +00:00
Nirav Dave
e874e43854 [DAG] Loop over remaining candidates on successful merge of stores of
extracted vectors types. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300688 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 13:52:38 +00:00
Dylan McKay
a7de5df7fd [AVR] Remove the 'multibyte' asm test
It tests registers which are not actually used on AVR.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300684 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 12:13:45 +00:00
Simon Pilgrim
83479b7405 Regenerate test. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300683 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 12:06:40 +00:00
Dylan McKay
4c9576b0d2 [AVR] Fix the test suite
A bunch of tests failed because memory operations have been reordered.

I am unsure which commit changed this behaviour as the AVR build was
failing at that point with an unrelated error.

This commit just reoders some of the CHECK lines in some tests to suit
current llc output.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300682 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 12:02:52 +00:00
Igor Breger
c0199e4844 [GlobalIsel][X86] support G_TRUNC selection.
Summary:
[GlobalIsel][X86] support G_TRUNC selection.
Add regbank-select and legalizer tests. Currently legalization of trunc i64 on 32bit platform not supported.

Reviewers: ab, zvi, rovka

Reviewed By: zvi

Subscribers: dberris, kristof.beyls, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300678 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 11:34:59 +00:00
Simon Pilgrim
85e6b8c8b9 [X86] Add D32039/PR31357 tests to show current BSWAP codegen
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300672 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 11:06:22 +00:00
Simon Pilgrim
e9d3d132ce [X86][SSE] Add scheduling latency/throughput tests for (most) SSE2 instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300671 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 10:52:09 +00:00
Renato Golin
e6eaf3dfe6 Revert "ARMFrameLowering: Reserve emergency spill slot for large arguments"
This reverts commit r300639, as it broke self-hosting on ARM. PR32709.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300668 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 09:02:52 +00:00
Igor Breger
f85765dc4f [GlobalISel][X86] Split select tests. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300666 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 08:40:44 +00:00
Diana Picus
909758a6a6 [ARM] GlobalISel: Add support for G_MUL
Support G_MUL, very similar to G_ADD and G_SUB. The only difference is
in the instruction selector, where we have to select either MUL or MULv5
depending on the target.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300665 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 07:29:46 +00:00
Kristof Beyls
bece65fd18 [GlobalISel] Support vector-of-pointers in LLT
This fixes PR32471.

As comment 10 on that bug report highlights
(https://bugs.llvm.org//show_bug.cgi?id=32471#c10), there are quite a
few different defendable design tradeoffs that could be made, including
not representing pointers at all in LLT.

I decided to go for representing vector-of-pointer as a concept in LLT,
while keeping the size of the LLT type 64 bits (this is an increase from
48 bits before). My rationale for keeping pointers explicit is that on
some targets probably it's very handy to have the distinction between
pointer and non-pointer (e.g. 68K has a different register bank for
pointers IIRC). If we keep a scalar pointer, it probably is easiest to
also have a vector-of-pointers to keep LLT relatively conceptually clean
and orthogonal, while we don't have a very strong reason to break that
orthogonality.  Once we gain more experience on the use of LLT, we can
of course reconsider this direction.

Rejecting vector-of-pointer types in the IRTranslator is also an option
to avoid the crash reported in PR32471, but that is only a very
short-term solution; also needs quite a bit of code tweaks in places,
and is probably fragile. Therefore I didn't consider this the best
option.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300664 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 07:23:57 +00:00
Kristof Beyls
ec70be0eaf [GlobalISel] Remove non-determinism from IRTranslator.
This showed up in r300535/r300537, which were reverted in r300538 due to
some of the introduced tests in there failing on some bots, due to the
non-determinism fixed in this commit.

Re-committing r300535/r300537 will add 2 tests for the change in this
commit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300663 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 06:38:37 +00:00
Chandler Carruth
c1b4c393a3 Revert r300657 due to crashes in stage2 of bootstraps:
http://lab.llvm.org:8011/builders/clang-with-lto-ubuntu/builds/2476/steps/build-stage2-LLVMgold.so/logs/stdio
http://bb.pgr.jp/builders/clang-3stage-x86_64-linux/builds/15036/steps/build_llvmclang/logs/stdio

I've updated the commit thread, reverting to get the bots back to green.

Original commit summary:
[JumpThread] We want to fold (not thread) when all predecessor go to single BB's successor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300662 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 06:23:20 +00:00
Xin Tong
b9fe533b26 [JumpThread] We want to fold (not thread) when all predecessor go to single BB's successor. .
Summary: In case all predecessor go to a single successor of current BB. We want to fold (not thread).

Reviewers: efriedma, sanjoy

Reviewed By: sanjoy

Subscribers: dberlin, majnemer, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300657 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 05:15:57 +00:00
Tim Shen
97b95a7b72 Cleanup some GraphTraits iteration code
Use children<> and nodes<> in appropriate places to cleanup the code.

Also, as part of the cleanup,
change the signature of DominatorTreeBase's Split.
It is a protected non-virtual member function called only twice,
both from within the class,
and the removed passed argument in both cases is '*this'.
The reason for the existence of that argument seems to be that
back before r43115 Split was a free function,
so an argument to get '*this' was needed - but now that is no longer the
case.

Patch by Yoav Ben-Shalom!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300656 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 03:22:50 +00:00
Serge Pavlov
4b58a5066b ARM: Use methods to access data stored with frame instructions
In r300196 several methods were added to TarfetInstrInfo to access
data stored with call frame setup/destroy instructions. This change
replaces calls to getOperand with calls to such special methods in
ARM target.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300655 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 03:12:05 +00:00
Reid Kleckner
4bc9eb623d Remove buggy 'addAttributes(unsigned, AttrBuilder)' overload
The 'addAttributes(unsigned, AttrBuilder)' overload delegated to 'get'
instead of 'addAttributes'.

Since we can implicitly construct an AttrBuilder from an AttributeSet,
just standardize on AttrBuilder.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300651 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 01:51:13 +00:00
Kostya Serebryany
d4cfbc56b1 [libFuzzer] update -help: mention -exact_artifact_path in help for -minimize_crash and -cleanse_crash
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300642 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 01:22:04 +00:00
Leslie Zhai
afe170774a [AVR] Migrate to new MCAsmInfo CodePointerSize
Reviewers: dylanmckay, rengolin, kzhuravl, jroelofs

Reviewed By: kzhuravl, jroelofs

Subscribers: kzhuravl, llvm-commits

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300641 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 01:20:43 +00:00
Matthias Braun
c03abe83a3 ARMFrameLowering: Reserve emergency spill slot for large arguments
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@300639 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 01:16:07 +00:00
Craig Topper
fb21a1a779 [DataLayout] Removed default value from a variable that isn't used without being overwritten. Make variable an enum instead of an int to avoid a cast later. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300634 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 00:31:38 +00:00
Dean Michael Berris
d007524faa [XRay][tools] Fix yaml matching to be more permissive
Account for a potentially empty function name.

Follow-up to D32153.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300631 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 00:10:09 +00:00
Xin Tong
35e5e58dc5 Allow suppressing host and target info in VersionPrinter
Summary:
VersionPrinter by default outputs information about the Host CPU
and Default target. Printing this information requires linking in
a large amount of data, such as supported target triples as C
strings, which in turn bloats the binary size.

Enable a new CMake option LLVM_VERSION_PRINTER_SHOW_HOST_TARGET_INFO
which controls printing of the host and target info. This allows
the target triple names to be dead-code stripped. This is a nice
win for LLVM clients that wish to minimize their binary size, such
as graphics drivers.

By default this is ON, so there is no change in the default behavior.
Clients who wish to suppress this printing can do so by setting this
option to off via CMake.

A test app on Linux that uses ParseCommandLineOptions() shows a binary
size reduction of 23KB (from 149K to 126K) for a Release build, and 24KB
(from 135K to 111K) in a MinSizeRel build.

Reviewers: klimek, beanz, bogner, chandlerc, compnerd

Reviewed By: compnerd

Patch by pammon (Peter Ammon) !

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300630 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 00:03:36 +00:00