148341 Commits

Author SHA1 Message Date
George Rimar
0fcdd9ba05 [llvm-dwarfdump] - Change format for .gdb_index dump.
It is useful to output size of ranges when address ranges
section of .gdb_index is dumped.

It helps to compare outputs produced by different linkers,
for example. In that case address ranges can look very different,
when they are the same at fact. Difference comes from different 
low address because of different address of .text.

Differential revision: https://reviews.llvm.org/D32492

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301527 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-27 10:00:13 +00:00
Igor Breger
39e6fd3cd6 [GlobalISel][X86] handle not symmetric G_COPY
Summary: handle not symmetric G_COPY

Reviewers: zvi, guyblank

Reviewed By: guyblank

Subscribers: rovka, llvm-commits, kristof.beyls

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301523 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-27 08:02:03 +00:00
Clement Courbet
54b949daeb [CodeGen][NFC] Rename 'Src' to 'Val'.
'Src' looks like it was borrowed from memcpy, 'Val' makes more sense for
memset and is consistent with naming within the function.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301521 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-27 07:22:30 +00:00
Sanjoy Das
9f5bf2cd28 Use accessors for ValueHandleBase::V; NFC
This changes code that touches ValueHandleBase::V to go through
getValPtr and (newly added) setValPtr.  This functionality will be
used later, but also seemed like a generally good cleanup.

I also renamed the field to Val, but that's just to make it obvious
that I fixed all the uses.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301518 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-27 06:02:18 +00:00
Craig Topper
e5cb2e5840 [Metadata] Fix typos in comments. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301517 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-27 05:48:29 +00:00
Craig Topper
8025bd61c5 [InstCombine] Use APInt bit counting methods to avoid a temporary APInt. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301516 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-27 04:51:25 +00:00
Rui Ueyama
53d587ee03 Make StringSaver::save less ambiguous.
Previously, an expression such as Saver.save(std::string("foo") + "bar")
didn't compile because there is an ambiguity as to whether the argument
is of const Twine& or StringRef.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301512 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-27 03:45:33 +00:00
Konstantin Zhuravlyov
51ff1d79cd AMDGPU: Fix assert in scheduler
Assert is triggered if DBG_VALUE is first instruction in BB

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301511 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-27 03:22:44 +00:00
Ahmed Bougacha
aca7b7d243 [Support] Fix overflow in SLEB128 decoding.
decodeULEB128 was fixed in r216268, but decodeSLEB128 always had the
same issue, which is now exposed in r301369.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301510 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-27 02:09:44 +00:00
Ahmed Bougacha
89fc611b77 [Support] clang-format LEB128.h. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301509 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-27 02:09:42 +00:00
Chandler Carruth
bde56a9699 Disable GVN Hoist due to still more bugs being found in it. There is
also a discussion about exactly what we should do prior to re-enabling
it.

The current bug is http://llvm.org/PR32821 and the discussion about this
is in the review thread for r300200.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301505 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-27 00:28:03 +00:00
Adrian Prantl
9d291ed9ad Turn DISubprogram into a variable-length node.
DISubprogram currently has 10 pointer operands, several of which are
often nullptr. This patch reduces the amount of memory allocated by
DISubprogram by rearranging the operands such that containing type,
template params, and thrown types come last, and are only allocated
when they are non-null (or followed by non-null operands).

This patch also eliminates the entirely unused DisplayName operand.

This saves up to 4 pointer operands per DISubprogram. (I tried
measuring the effect on peak memory usage on an LTO link of an X86
llc, but the results were very noisy).

This reapplies r301498 with an attempted workaround for g++.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301501 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 23:59:52 +00:00
Adrian Prantl
589155c2d7 Revert "Turn DISubprogram into a variable-length node."
This reverts commit r301498 while investigating bot breakage.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301499 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 23:49:30 +00:00
Adrian Prantl
6c938e5225 Turn DISubprogram into a variable-length node.
DISubprogram currently has 10 pointer operands, several of which are
often nullptr. This patch reduces the amount of memory allocated by
DISubprogram by rearranging the operands such that containing type,
template params, and thrown types come last, and are only allocated
when they are non-null (or followed by non-null operands).

This patch also eliminates the entirely unused DisplayName operand.

This saves up to 4 pointer operands per DISubprogram. (I tried
measuring the effect on peak memory usage on an LTO link of an X86
llc, but the results were very noisy).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301498 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 23:44:54 +00:00
Matthias Braun
3e8c96253a MachineFrameInfo.h: Remove unnecessary forward declarations; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301496 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 23:37:04 +00:00
Matthias Braun
7c2792bdea Lanai: Remove unnecessary canRealignStack() override; NFC
It was doing the same as the base implementation and was irritating me
when I was searching for backends that have custom behavior for
canRealignStack.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301495 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 23:37:01 +00:00
Matthias Braun
a596026865 MachineFrameInfo: Move implementation to an own file; NFC
Move implementation of the MachineFrameInfo class into
MachineFrameInfo.cpp

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301494 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 23:36:58 +00:00
Rui Ueyama
089cd2cb50 Revert r301487: Replace HashString algorithm with xxHash64
This reverts commit r301487 to make buildbots green.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301491 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 23:15:10 +00:00
Adrian Prantl
1bf6297ee8 Add support for DW_TAG_thrown_type.
For Swift we would like to be able to encode the error types that a
function may throw, so the debugger can display them alongside the
function's return value when finish-ing a function.

DWARF defines DW_TAG_thrown_type (intended to be used for C++ throw()
declarations) that is a perfect fit for this purpose. This patch wires
up support for DW_TAG_thrown_type in LLVM by adding a list of thrown
types to DISubprogram.

To offset the cost of the extra pointer, there is a follow-up patch
that turns DISubprogram into a variable-length node.

rdar://problem/29481673

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301489 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 22:56:44 +00:00
Rui Ueyama
2db23b3bbe Replace HashString algorithm with xxHash64
The previous algorithm processed one character at a time, which is very
painful on a modern CPU. Replace it with xxHash64, which both already
exists in the codebase and is fairly fast.

Patch from Scott Smith!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301487 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 22:45:04 +00:00
Eugene Zelenko
f49f90e97b [MC] Fix some Clang-tidy modernize-use-using warnings; other minor fixes (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301485 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 22:31:39 +00:00
Davide Italiano
2f1bbeb63f [LibCallsShrinkWrap] Remove an unnecessary class member variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301477 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 21:28:40 +00:00
Davide Italiano
65e17c010c [LibCallsShrinkWrap] More descriptive assertion messages.
Fix a typo while I'm here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301474 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 21:21:02 +00:00
Davide Italiano
1b1163841f [LibCallsShrinkWrap] Remove some temporary cl::opt(s).
The pass has been on and working for a while.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301473 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 21:19:05 +00:00
Davide Italiano
c1543360c2 [LibCallsShrinkWrap] Teach the pass how to preserve the dominator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301471 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 21:05:40 +00:00
Daniel Berlin
988e599a02 Kill the old Simplify* APIs, leave SimplifyInstruction for the moment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301467 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 20:56:17 +00:00
Daniel Berlin
2b0666738c NewGVN: Use new SimplifyQuery based API
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301466 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 20:56:14 +00:00
Daniel Berlin
5c3bf01e34 PHITransAddr: Use new SimplifyQuery based API.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301465 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 20:56:13 +00:00
Daniel Berlin
516ca41d78 InstCombine: Use the new SimplifyQuery versions of Simplify*. Use AssumptionCache, DominatorTree, TargetLibraryInfo everywhere.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301464 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 20:56:07 +00:00
Sanjay Patel
8253e24b39 [DAGCombiner] add (sext i1 X), 1 --> zext (not i1 X)
Besides better codegen, the motivation is to be able to canonicalize this pattern 
in IR (currently we don't) knowing that the backend is prepared for that.

This may also allow removing code for special constant cases in 
DAGCombiner::foldSelectOfConstants() that was added in D30180.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301457 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 20:26:46 +00:00
Dmitry Preobrazhensky
559cd48144 [AMDGPU][MC] Added arg checks for vmcnt, expcnt, lgkmcnt helpers
Summary of changes:
- corrected vmcnt, expcnt, lgkmcnt helpers to checks their argument for truncation;
- added saturated versions of these helpers.

See bug 32711 for details: https://bugs.llvm.org//show_bug.cgi?id=32711

Reviewers: artem.tamazov, vpykhtin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301439 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 17:55:50 +00:00
Peter Collingbourne
052412f4f5 LTO: Mark undefined module asm symbols as used.
Marking them as used causes them to be considered visible outside of LTO. This
prevents the symbols from being internalized or discarded, either by GlobalDCE
or by summary-based dead stripping in ThinLTO.

This change makes it unnecessary to add these symbols to llvm.compiler.used
in the backend, as the symbols are kept alive by virtue of being external,
so remove the backend code that handles that.

Fixes PR32798.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301438 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 17:53:39 +00:00
Daniel Berlin
86c47581d6 CorrelatedValuePropagation: Rename a variable for consistency
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301435 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 17:41:46 +00:00
Craig Topper
58c7fe69d0 [ValueTracking] Introduce a KnownBits struct to wrap the two APInts for computeKnownBits
This patch introduces a new KnownBits struct that wraps the two APInt used by computeKnownBits. This allows us to treat them as more of a unit.

Initially I've just altered the signatures of computeKnownBits and InstCombine's simplifyDemandedBits to pass a KnownBits reference instead of two separate APInt references. I'll do similar to the SelectionDAG version of computeKnownBits/simplifyDemandedBits as a separate patch.

I've added a constructor that allows initializing both APInts to the same bit width with a starting value of 0. This reduces the repeated pattern of initializing both APInts. Once place default constructed the APInts so I added a default constructor for those cases.

Going forward I would like to add more methods that will work on the pairs. For example trunc, zext, and sext occur on both APInts together in several places. We should probably add a clear method that can be used to clear both pieces. Maybe a method to check for conflicting information. A method to return (Zero|One) so we don't write it out everywhere. Maybe a method for (Zero|One).isAllOnesValue() to determine if all bits are known. I'm sure there are many other methods we can come up with.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301432 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 16:39:58 +00:00
Sanjoy Das
263da12ab2 Reverts commit r301424, r301425 and r301426
Commits were:

"Use WeakVH instead of WeakTrackingVH in AliasSetTracker's UnkownInsts"
"Add a new WeakVH value handle; NFC"
"Rename WeakVH to WeakTrackingVH; NFC"

The changes assumed pointers are 8 byte aligned on all architectures.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301429 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 16:37:05 +00:00
Matthew Simpson
86197951a0 [LV] Handle external uses of floating-point induction variables
Reference: https://bugs.llvm.org/show_bug.cgi?id=32758
Differential Revision: https://reviews.llvm.org/D32445

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301428 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 16:23:02 +00:00
Sanjoy Das
a7ff6d36af Use WeakVH instead of WeakTrackingVH in AliasSetTracker's UnkownInsts
Summary:
In cases where an instruction (a call site, say) is RAUW'ed with some
other value (this is possible via the `returned` attribute, amongst
other things), we want the slot in UnknownInsts to point to the
original Instruction we wanted to track, not the value it got replaced
by.

Fixes PR32587.

Reviewers: davide

Subscribers: mcrosier, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301426 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 16:21:02 +00:00
Sanjoy Das
147a8edb1b Add a new WeakVH value handle; NFC
Summary:
WeakVH nulls itself out if the value it was tracking gets deleted, but
it does not track RAUW.

Reviewers: dblaikie, davide

Subscribers: mcrosier, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301425 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 16:20:59 +00:00
Sanjoy Das
d0cf26e443 Rename WeakVH to WeakTrackingVH; NFC
Summary:
I plan to use WeakVH to mean "nulls itself out on deletion, but does
not track RAUW" in a subsequent commit.

Reviewers: dblaikie, davide

Reviewed By: davide

Subscribers: arsenm, mehdi_amini, mcrosier, mzolotukhin, jfb, llvm-commits, nhaehnle

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301424 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 16:20:52 +00:00
Igor Breger
a620093752 [globalisel][tablegen] Fix vector element size
Summary: Fix vector element size.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: rovka, llvm-commits, kristof.beyls

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301421 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 15:59:05 +00:00
Vedant Kumar
86d385f5e5 [sampleprof] Drop test dependency on the string hash func (NFC)
The SampleProfWriter emits function information in an order determined
by the string hash function. The situation is a bit brittle, because
changing the hash function can break the tests.

Instead of sorting the function samples to get a relaible ordering (that
might be too expensive), make the tests not depend on a particular
ordering of function samples.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301419 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 15:39:53 +00:00
Dmitry Preobrazhensky
5cc9392ddb [AMDGPU][MC] Added check for truncation of SOPK imm operand
See bug 30827: https://bugs.llvm.org//show_bug.cgi?id=30827

Reviewers: artem.tamazov, vpykhtin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301418 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 15:34:19 +00:00
Dylan McKay
180ce98a0d [AVR] Remove an unused local variable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301413 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 14:47:27 +00:00
Sanjay Patel
c36b154061 [x86] change tests to use sext, not zext; NFC
These are intended to exercise D31944, so we need sexts.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301412 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 14:35:54 +00:00
Haojian Wu
f2ba970438 Fix unused-variable warning caused by r301407.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301411 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 14:31:05 +00:00
Sanjay Patel
553bcb5841 [TargetLowering] fix isConstTrueVal to account for build vector truncation
Build vectors have magical truncation powers, so we have things like this:

v4i1 = BUILD_VECTOR Constant:i32<1>, Constant:i32<1>, Constant:i32<1>, Constant:i32<1>
v4i16 = BUILD_VECTOR Constant:i32<1>, Constant:i32<1>, Constant:i32<1>, Constant:i32<1>

If we don't truncate the splat node returned by getConstantSplatNode(), then we won't find 
truth when ZeroOrNegativeOneBooleanContent is the rule.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301408 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 14:05:42 +00:00
Daniel Berlin
4c814e62fc Convert LoopRotation to use SimplifyQuery version of SimplifyInstruction. Add AssumptionCache, DominatorTree, TLI if available.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301407 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 13:52:18 +00:00
Daniel Berlin
b7f0325d21 Convert SimplifyInstructions to use the SimplifyQuery version of SimplifyInstruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301406 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 13:52:16 +00:00
Daniel Berlin
c303d331b4 Convert CVP to use SimplifyQuery version of SimplifyInstruction. Add AssumptionCache, DominatorTree, TLI if available.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301405 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 13:52:13 +00:00
Ranjeet Singh
d530427b4a Fix signed multiplication with overflow fallback.
For targets that don't have ISD::MULHS or ISD::SMUL_LOHI for the type
and the double width type is illegal, then the two operands are
sign extended to twice their size then multiplied to check for overflow.
The extended upper halves were mismatched causing an incorrect result.
This fixes the mismatch.

A test was added for ARM V6-M where the bug was detected.

Patch by James Duley.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301404 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 13:41:43 +00:00