Commit Graph

147958 Commits

Author SHA1 Message Date
Zachary Turner
2a7d654e64 Resubmit "[BitVector] Add operator<<= and operator>>=."
This was failing due to the use of assigning a Mask to an
unsigned, rather than to a BitWord.  But most systems do not
have sizeof(unsigned) == sizeof(unsigned long), so the mask
was getting truncated.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300857 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 16:56:54 +00:00
Craig Topper
54f0462d2b [APInt] Rename getSignBit to getSignMask
getSignBit is a static function that creates an APInt with only the sign bit set. getSignMask seems like a better name to convey its functionality. In fact several places use it and then store in an APInt named SignMask.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300856 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 16:56:25 +00:00
Amara Emerson
3e9c4ea1fe [SVE] Fix mismatched sign comparison warning in unit test from r300842.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300855 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 16:54:49 +00:00
Sanjay Patel
f3c6d22768 [DAGCombiner] fix variable names in isAlias(); NFCI
We started with zero-based params and switched to one-based locals...
Also, variables start with a capital and functions do not.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300854 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 16:36:37 +00:00
Zachary Turner
154c0ad769 Revert "[BitVector] Add operator<<= and operator>>=."
This is causing test failures on Linux / BSD systems.  Reverting
while I investigate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300852 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 16:35:22 +00:00
Craig Topper
b52e0e4247 [APInt] Add isSubsetOf method that can check if one APInt is a subset of another without creating temporary APInts
This question comes up in many places in SimplifyDemandedBits. This makes it easy to ask without allocating additional temporary APInts.

The BitVector class provides a similar functionality through its (IMHO badly named) test(const BitVector&) method. Though its output polarity is reversed.

I've provided one example use case in this patch. I plan to do more as a follow up.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300851 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 16:17:13 +00:00
Sanjay Patel
40c9368f4d [DAGCombiner] give names to repeated calcs in isAlias(); NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300850 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 16:15:08 +00:00
Craig Topper
1772e90779 In SimplifyDemandedUseBits, use computeKnownBits directly to handle Constants
Currently we don't explicitly process ConstantDataSequential, ConstantAggregateZero, or ConstantVector, or Undef before applying the Depth limit. Instead they occur after the depth check in the non-instruction path.

For the constant types that we do handle, the code is replicated from computeKnownBits.

This patch fixes the missing constant handling and the reduces the amount of code by just using computeKnownBits directly for any type of Constant.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300849 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 16:14:58 +00:00
Zachary Turner
503ce9f8c1 [BitVector] Add operator<<= and operator>>=.
Differential Revision: https://reviews.llvm.org/D32244

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300848 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 15:57:58 +00:00
Daniel Sanders
42e519ed10 [globalisel] Enable tracing the legalizer with --debug-only=legalize-mir
Reviewers: t.p.northover, ab, qcolombet, aditya_nandakumar, rovka, kristof.beyls

Reviewed By: kristof.beyls

Subscribers: dberris, igorb, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300847 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 15:46:12 +00:00
Amaury Sechet
98dfa5e49d Introduce LLVMDIBuilderRef
Summary:
This patch adds a definition of `LLVMDIBuilderRef` that represents an `llvm::DIBuilder`.

Authored by Harlan Haskins

Reviewers: deadalnix, aprantl, probinson, dblaikie, echristo, whitequark

Reviewed By: deadalnix, whitequark

Subscribers: CodaFi, loladiro

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300843 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 14:22:47 +00:00
Amara Emerson
0f69ba8243 [MVT][SVE] Scalable vector MVTs (3/3)
Adds MVT::ElementCount to represent the length of a
vector which may be scalable, then adds helper functions
that work with it.

Patch by Graham Hunter.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300842 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 13:54:09 +00:00
Amara Emerson
0e3700625d [MVT][SVE] Scalable vector MVTs (2/3)
Adds scalable vector machine value types, and updates
the switch statements required for tablegen.

Patch by Graham Hunter.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300840 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 13:36:58 +00:00
Petar Jovanovic
51d7cb91e6 [mips][msa] Mask vectors holding shift amounts
Masked vectors which hold shift amounts when creating the following nodes:
ISD::SHL, ISD::SRL or ISD::SRA.
Instructions that use said nodes, which have had their arguments altered are
sll, srl, sra, bneg, bclr and bset.

For said instructions, the shift amount or the bit position that is
specified in the corresponding vector elements will be interpreted as the
shift amount/bit position modulo the size of the element in bits.

The problem lies in compiling with -O2 enabled, where the instructions for
formats .w and .d are not generated, but are instead optimized away.
In this case, having shift amounts that are either negative or greater than
the element bit size results in generation of incorrect results when
constant folding.

We remedy this by masking the operands for the nodes mentioned above before
actually creating them, so that the final result is correct before placed
into the constant pool.

Patch by Stefan Maksimovic.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300839 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 13:26:46 +00:00
Amara Emerson
780f89d961 [MVT][SVE] Scalable vector MVTs (1/3)
This patch adds a few helper functions to obtain new vector
value types based on existing ones without needing to care
about whether they are scalable or not.

I've confined their use to a few common locations right now,
and targets that don't have scalable vectors should never
need to care about these.

Patch by Graham Hunter.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300838 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 13:08:17 +00:00
John Brawn
4d16adb187 [ARM] Fix handling of mapping symbols when changing sections
ChangeSection incorrectly registers LastEMSInfo as belonging to the previous
section, not the current section. This happens to work when changing sections
using .section, as the previous section is set to the current section before
the call to ChangeSection, but not when using .popsection.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300831 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 10:18:13 +00:00
John Brawn
82afafa944 [AArch64] Fix handling of zero immediate in fmov instructions
Currently fmov #0 with a vector destination is handle incorrectly and results in
fmov #-1.9375 being emitted but should instead give an error. This is due to the
way we cope with fmov #0 with a scalar destination being an alias of fmov zr, so
fix this by actually doing it through an alias.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300830 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 10:13:54 +00:00
John Brawn
f805a0cc2d [AArch64] Fix handling of integer fp immediates
When an integer is used as an fp immediate we're failing to check the return
value of getFP64Imm, so invalid values are silently permitted. Fix this by
merging together the integer and real handling.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300828 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 10:10:10 +00:00
Diana Picus
6a1c705057 [ARM] Rename HW div feature to HW div Thumb. NFCI.
The hardware div feature refers only to Thumb, but because of its name
it is tempting to use it to check for hardware division in general,
which may cause problems in ARM mode. See https://reviews.llvm.org/D32005.

This patch adds "Thumb" to its name, to make its scope clear. One
notable place where I haven't made the change is in the feature flag
(used with -mattr), which is still hwdiv. Changing it would also require
changes in a lot of tests, including clang tests, and it doesn't seem
like it's worth the effort.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300827 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 09:38:25 +00:00
Craig Topper
6366ebb69b [APInt] In slt/sgt(uint64_t), only call getMinSignedBits if the APInt is not a single word.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300824 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 06:04:03 +00:00
Craig Topper
63d7ef8671 [APInt] Call the slow case counting methods directly in isMask/isShiftedMask. We already handled the single word case. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300823 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 06:04:01 +00:00
Craig Topper
524526f783 [SelectionDAG] Fix another place that was passing a large value to APInt::lshrInPlace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300821 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 04:55:01 +00:00
Craig Topper
bb107535ba [SelectionDAG] Use getActiveBits() and countTrailingZeros() to avoid creating temporary APInts with lshr and trunc. NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300819 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 04:23:43 +00:00
Craig Topper
5649a8228b Recommit "[APInt] Add back the asserts that check that the APInt shift methods aren't called with values larger than BitWidth."
This includes a fix to clamp a right shift of larger than BitWidth in DAG combining.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300816 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 03:49:18 +00:00
Craig Topper
b3443b3378 Revert r300811 "[APInt] Add back the asserts that check that the APInt shift methods aren't called with values larger than BitWidth."
This is failing a self host debug build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300813 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 02:46:21 +00:00
Craig Topper
be583f25e0 [APInt] Implement APInt::intersects without creating a temporary APInt in the multiword case
Summary: This is a simple question we should be able to answer without creating a temporary to hold the AND result. We can also get an early out as soon as we find a word that intersects.

Reviewers: RKSimon, hans, spatel, davide

Reviewed By: hans, davide

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300812 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 02:11:27 +00:00
Craig Topper
69a88f72e9 [APInt] Add back the asserts that check that the APInt shift methods aren't called with values larger than BitWidth.
The underlying tcShiftRight/tcShiftLeft functions support the larger bit widths but the APInt interface shouldn't rely on that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300811 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 02:03:09 +00:00
Serge Pavlov
ff09ea4e98 Do not run frame verification if target does not use frame instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300807 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 01:34:04 +00:00
Ahmed Bougacha
786ac2097e Revert "[libFuzzer] XFAIL fuzzer-oom.test on Darwin."
This reverts commit r300127.

r300759 implemented StopTheWorld for Darwin, so the test passes again.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300801 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 00:16:13 +00:00
Kostya Serebryany
7634af30c1 [libFuzzer] extend help for -minimize_crash to cover ASAN_OPTIONS=dedup_token_length=3
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300800 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 23:58:05 +00:00
Craig Topper
ba583aa026 [APInt] Implement operator==(uint64_t) similar to ugt/ult(uint64_t) to remove one of the out of line EqualsSlowCase methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300799 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 23:57:51 +00:00
Craig Topper
25d6dbfc6a [APInt] Don't call getActiveBits() in ult/ugt(uint64_t) if its a single word.
The compiled code already needs to check single/multi word for the countLeadingZeros call inside of getActiveBits, but it isn't able to optimize out the leadingZeros call in the single word case that can't produce a value larger than 64.

This shrank the opt binary by about 5-6k on my local x86-64 build.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300798 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 23:55:48 +00:00
Sanjoy Das
ef5181372f Statepoint Docs: fix incorrect uses of it's
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300797 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 23:55:03 +00:00
Craig Topper
29c6d769ca [APInt] Use ugt(uint64_t) for the compare in getLimitedValue(uint64_t) since the code is identical to it. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300796 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 23:52:59 +00:00
Reid Kleckner
ae23971d1e [DAE] Simplify attribute list creation, NFC
Removes a use of getSlotAttributes, which I intend to change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300795 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 23:45:45 +00:00
Kuba Mracek
d92618f322 Revert r300789: There are Windows bot failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300794 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 23:44:33 +00:00
Adrian Prantl
ffa4b4378e Fix bug that caused DwarfExpression to drop DW_OP_deref from FI locations
- introduced in r300522 and found via the Swift LLDB testsuite.

The fix is to set the location kind to memory whenever an FrameIndex
location is emitted.

rdar://problem/31707602

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300793 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 23:42:25 +00:00
Adrian Prantl
113bca21d3 Revert "Fix bug that caused DwarfExpression to drop DW_OP_deref from FI locations"
This reverts commit r300790.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300792 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 23:42:17 +00:00
Kannan Narayanan
453ce6b718 Revert earlier change. ds permute operations affect lgkm counter.
Differential Revision: https://reviews.llvm.org/D32254



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300791 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 23:39:19 +00:00
Adrian Prantl
0c5a2b47dc Fix bug that caused DwarfExpression to drop DW_OP_deref from FI locations
- introduced in r300522 and found via the Swift LLDB testsuite.

The fix is to set the location kind to memory whenever an FrameIndex
location is emitted.

rdar://problem/31707602

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300790 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 23:34:14 +00:00
Kuba Mracek
d3e13b9862 [libFuzzer] Always build libFuzzer
There are two reasons why users might want to build libfuzzer:
- To fuzz LLVM itself
- To get the libFuzzer.a archive file, so that they can attach it to their code
This change always builds libfuzzer, and supports the second use case if the specified flag is set.

The point of this patch is to have something that can potentially be shipped with the compiler, and this also ensures that the version of libFuzzer is correct to use with that compiler.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300789 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 23:34:08 +00:00
Reid Kleckner
6a6847fd69 [GlobalOpt] Simplify attribute code stripping nest, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300787 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 23:26:44 +00:00
Reid Kleckner
e7cb3935c6 Simplify test for sret attribute in instcombine
This change is correct because the verifier requires that at most one
argument be marked 'sret'.

NFC, removes a use of AttributeList slot APIs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300784 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 23:17:47 +00:00
Galina Kistanova
6b92d164d6 Temporarily revert r299221 to fix nondeterminism in ThinLTO builder.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300783 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 23:16:14 +00:00
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