148665 Commits

Author SHA1 Message Date
Zvi Rackover
778f5177f0 InstructionSimplify: Simplify a shuffle with a undef mask to undef
Summary:
Following the discussion in pr32486, adding the simplification:
 shuffle %x, %y, undef -> undef

Reviewers: spatel, RKSimon, andreadb, davide

Reviewed By: spatel

Subscribers: jroelofs, davide, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301764 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-30 06:06:26 +00:00
Simon Atanasyan
258bb897bd [mips] Emit R_MICROMIPS_TLS_GOTTPREL relocation for %gottprel in case of microMIPS
In case of microMIPS mode %gottprel operator should emit microMIPS
relocation R_MICROMIPS_TLS_GOTTPREL, not R_MIPS_TLS_GOTTPREL.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301763 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-30 04:27:23 +00:00
Craig Topper
70629e6c18 [ConstantRange] Fix a couple cases where we were possibly throwing away an APInt allocation we could reuse. NFC
This uses setAllBits to replace getMaxValue and operator=(uint64_t) instead of constructing an APInt from uint64_t.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301761 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-30 00:44:05 +00:00
Dimitry Andric
99767332b8 Include <cstdio> in PrettyStackTrace.cpp, since it uses vsnprintf(3).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301760 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-29 23:45:30 +00:00
Daniel Sanders
02628bea16 [globalisel][tablegen] Fix the test after silencing the unused variable warning in r301755.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301756 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-29 19:46:27 +00:00
Daniel Sanders
bb8d1d09bc [globalisel][tablegen] Silence unused variable warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301755 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-29 19:10:19 +00:00
Craig Topper
8f3c59afe4 [ConstantRange] Use APInt::getOneBitSet to shorten some code. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301753 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-29 17:59:41 +00:00
Craig Topper
ecc4d6088d [ConstantRange] Replace getMaxValue+zext with getLowBitsSet. Replace zero-init+setBit with getOneBitSet. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301752 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-29 17:46:13 +00:00
Craig Topper
0427e63e86 [ConstantRange] Use APInt::operator-= to remove temporary APInts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301751 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-29 17:46:11 +00:00
Daniel Sanders
f31ac9d1e8 [globalisel][tablegen] Compute available feature bits correctly.
Summary:
Predicate<> now has a field to indicate how often it must be recomputed.
Currently, there are two frequencies, per-module (RecomputePerFunction==0)
and per-function (RecomputePerFunction==1). Per-function predicates are
currently recomputed more frequently than necessary since the only predicate
in this category is cheap to test. Per-module predicates are now computed in
getSubtargetImpl() while per-function predicates are computed in selectImpl().

Tablegen now manages the PredicateBitset internally. It should only be
necessary to add the required includes.

Also fixed a problem revealed by the test case where
constrainSelectedInstRegOperands() would attempt to tie operands that
BuildMI had already tied.

Reviewers: ab, qcolombet, t.p.northover, rovka, aditya_nandakumar

Reviewed By: rovka

Subscribers: kristof.beyls, igorb, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301750 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-29 17:30:09 +00:00
Simon Pilgrim
6c030ac85c [X86][AVX] Added codegen tests for _mm256_zext* helper intrinsics (PR32839)
Not great codegen, especially as VEX moves support implicit zeroing of upper bits....

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301748 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-29 17:15:12 +00:00
Craig Topper
8b69610574 [KnownBits] Add methods for determining if the known bits represent a negative/nonnegative number and add methods for changing the negative/nonnegative state
Summary: This patch adds isNegative, isNonNegative for querying whether the sign bit is known. It also adds makeNegative and makeNonNegative for controlling the sign bit.

Reviewers: RKSimon, spatel, davide

Reviewed By: RKSimon

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301747 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-29 16:43:11 +00:00
Simon Dardis
d9e74d6d4a [mips][FastISel] Fix a nullptr deference.
r301392 introduced a potential nullptr deference causing compilation
failures.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301746 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-29 16:31:40 +00:00
Simon Pilgrim
e71cfb99bb [X86][SSE] Add initial <2 x half> tests for PR31088
As discussed on D32391, test X86/X64 SSE2 and X64 F16C.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301744 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-29 14:29:06 +00:00
Craig Topper
5529b11227 [ConstantRange] Use ternary operator instead of 'if' to avoid copying an APInt and then possibly copying over it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301741 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-29 07:24:13 +00:00
Craig Topper
9a418e88ed [ConstantRange] Add std::move to a bunch of places that pass local APInts to ConstantRange constructor.
The ConstantRange constructor takes APInt by value so without these moves we are making copies.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301740 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-29 06:40:47 +00:00
Zachary Turner
e85efcfd88 Remove unused private field.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301738 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-29 05:30:19 +00:00
Craig Topper
c8cc907e2b [ConstantRange] Remove a temporary APInt I meant to delete in r300621. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301737 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-29 05:24:34 +00:00
Craig Topper
8c828d31ce [ConstantRange] Improve the efficiency of one of the ConstantRange constructors.
We were default constructing the Lower/Upper APInts. Then creating min or max value, then doing a move assignment to Lower and copy assignment to upper. The copy assignment operator in particular has an out of line function call that has to examine whether or not a previous allocation exists that can be reused which of course it can't in this case.

The new code creates the min/max value first, move constructs Lower from it then copy constructs Upper from Lower.

This also seems to have convinced a self host build that this constructor can be inlined more readily into other methods in ConstantRange.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301736 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-29 05:08:52 +00:00
Matt Arsenault
23450e5997 AMDGPU: Fix copies from physical registers in SIFixSGPRCopies
This would assert when there were multiple defs of
a physical register.

We just need to move all of the users of it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301730 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-29 01:26:34 +00:00
Zachary Turner
40d2ca9f43 [llvm-pdbdump] Abstract some of the YAML/Raw printing code.
There is a lot of duplicate code for printing line info between
YAML and the raw output printer.  This introduces a base class
that can be shared between the two, and makes some minor
cleanups in the process.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301728 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-29 01:13:21 +00:00
Akira Hatanaka
e85d77f956 [ObjCARC] Do not move a release between a call and a
retainAutoreleasedReturnValue that retains the returned value.

This commit fixes a bug in ARC optimizer where it moves a release
between a call and a retainAutoreleasedReturnValue, causing the returned
object to be released before the retainAutoreleasedReturnValue can
retain it.

This commit accomplishes that by doing a lookahead and checking whether
the call prevents the release from moving upwards. In the long term, we
should treat the region between the retainAutoreleasedReturnValue and
the call as a critical section and disallow moving anything there
(possibly using operand bundles).

rdar://problem/20449878

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301724 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-29 00:23:11 +00:00
Davide Italiano
4917282645 [LoopUnswitch] Make DEBUG output more readable (part 2).
I fixed my miscompile in r301722 and I hope I don't have to take
a look at this code again now that Chandler has a new LoopUnswitch
pass, but maybe this could be of use for somebody else in the
meanwhile.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301723 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-29 00:18:26 +00:00
Davide Italiano
bbc33ba775 [LoopUnswitch] Don't remove instructions with side effects.
This fixes PR32818.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301722 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-29 00:12:18 +00:00
Zachary Turner
3d4cc16e3a [llvm-readobj] Fix incorrect printing of CV column info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301720 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-29 00:03:32 +00:00
Duncan P. N. Exon Smith
acacdfca61 Fuzzer: Mark test/cxxstring.test UNSUPPORTED: windows
This has been mysteriously failing since r301593, which cleaned up the
types of things like size_t and SIZE_MAX for freestanding targets.  Reid
and Kostya suggested marking it as UNSUPPORTED on windows, given that no
one has been able to reproduce locally.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301719 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-28 23:59:53 +00:00
Zachary Turner
a769999502 [llvm-readobj] Use LLVMDebugInfoCodeView to parse line tables.
The llvm-readobj parsing code currently exists in our CodeView
library, so we use that to parse instead of re-writing the logic
in the tool.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301718 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-28 23:41:36 +00:00
Zachary Turner
bb47accc21 [Support] Provide unsafe random access for VarStreamArray.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301716 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-28 23:29:33 +00:00
Sanjay Patel
337942b20a [InstCombine] add tests to show potentially bogus application of DeMorgan (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301714 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-28 23:14:33 +00:00
Hans Wennborg
acde1f9265 Remove set but unused variable in BitcodeReader.cpp. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301713 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-28 23:11:16 +00:00
Hans Wennborg
dfc1ffb1c9 Revert r301697 "[IR] Make add/remove Attributes use AttrBuilder instead of AttributeList"
This broke the Clang build. (Clang-side patch missing?)

Original commit message:

> [IR] Make add/remove Attributes use AttrBuilder instead of
> AttributeList
>
> This change cleans up call sites and avoids creating temporary
> AttributeList objects.
>
> NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301712 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-28 23:01:32 +00:00
Matt Arsenault
754511fb00 InferAddressSpaces: Search constant expressions for addrspacecasts
These are pretty common when using local memory, and the 64-bit generic
addressing is much more expensive to compute.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301711 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-28 22:52:41 +00:00
Adrian Prantl
841400b968 Remove line and file from DINamespace.
Fixes the issue highlighted in
http://lists.llvm.org/pipermail/cfe-dev/2014-June/037500.html.

The DW_AT_decl_file and DW_AT_decl_line attributes on namespaces can
prevent LLVM from uniquing types that are in the same namespace. They
also don't carry any meaningful information.

rdar://problem/17484998
Differential Revision: https://reviews.llvm.org/D32648

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301706 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-28 22:25:46 +00:00
Matt Arsenault
e91b6db85f InferAddressSpaces: Avoid looking up deleted values
While looking at pure addressing expressions, it's possible
for the value to appear later in Postorder.

I haven't been able to come up with a testcase where this
exhibits an actual issue, but if you insert a dump before
the value map lookup, a few testcases crash.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301705 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-28 22:18:19 +00:00
Matt Arsenault
afc9030f67 InferAddressSpaces: Infer from just addrspacecasts
Eliminates some more cases where some subset of the addressing
computation remains flat. Some cases with addrspacecasts
in nested constant expressions are still left behind however.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301704 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-28 22:18:08 +00:00
Michael Zolotukhin
3456f7f5be [SCEV] Use early exit in createAddRecFromPHI. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301703 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-28 22:14:27 +00:00
Daniel Berlin
3df4f544fe LoopRotate: Fix use after scope bug
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301702 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-28 22:05:55 +00:00
Krzysztof Parzyszek
737d3b6aab [RDF] Correctly calculate lane masks for defs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301700 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-28 21:57:53 +00:00
Krzysztof Parzyszek
013513893f Properly handle PHIs with subregisters in UnreachableBlockElim
When a PHI operand has a subregister, create a COPY instead of simply
replacing the PHI output with the input it.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301699 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-28 21:56:33 +00:00
Krzysztof Parzyszek
653d636507 [Hexagon] Do not move a block if it is on a fall-through path
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301698 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-28 21:54:11 +00:00
Reid Kleckner
fde3916ada [IR] Make add/remove Attributes use AttrBuilder instead of AttributeList
This change cleans up call sites and avoids creating temporary
AttributeList objects.

NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301697 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-28 21:48:28 +00:00
Craig Topper
e490ed5993 [ConstantRange] Use APInt::isNullValue rather than APInt::isMinValue where it would make more sense to thing of 0 as 0 rather than the minimum unsigned value. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301696 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-28 21:48:09 +00:00
Craig Topper
242ed359a8 [APInt] Add an isNullValue method to check for all bits being zero. Use it in a couple internal methods where it makes more sense than isMinValue or !getBoolValue. NFC
I used Null rather than Zero to match the getNullValue method name.

There are some other places outside APInt where isNullValue would be more readable than isMinValue even though they do the same thing. I'll update those in future patches.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301695 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-28 21:48:06 +00:00
Craig Topper
00cdeeedba [ConstantRange] Use const references to prevent a couple APInt copies. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301694 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-28 21:48:03 +00:00
Davide Italiano
50ddb71dad [LoopUnswitch] Make DEBUG output more readable.
While debugging a miscompile I realized loopunswitch doesn't
put newlines when printing the instruction being replacement.
Ending up with a single line with many instruction replaced isn't
the best for readability and/or mental sanity.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301692 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-28 21:30:50 +00:00
Sam Clegg
e4f76f4742 [WebAssembly] Add size of section header to data relocation offsets.
Also, add test for data relocations and fix addend to
be signed.

Subscribers: jfb, dschuff

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301690 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-28 21:22:38 +00:00
Matt Arsenault
ba657060a1 [ValueTracking] Teach isSafeToSpeculativelyExecute() about the speculatable attribute
Patch by Tom Stellard

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301688 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-28 21:13:09 +00:00
Sam Clegg
649003c411 [WebAssembly] Write initial memory in pages not bytes
Subscribers: jfb, dschuff

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301687 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-28 21:12:09 +00:00
Matt Arsenault
8c9ed246f2 TableGen: Add IntrHasSideEffects property for intrinsics
The IntrNoMem, IntrReadMem, IntrWriteMem, and IntrArgMemOnly intrinsic
properties differ from their corresponding LLVM IR attributes by specifying
that the intrinsic, in addition to its memory properties, has no other side
effects.

The IntrHasSideEffects flag used in combination with one of the memory flags
listed above, makes it possible to define an intrinsic such that its
properties at the CodeGen layer match its properties at the IR layer.

Patch by Tom Stellard

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301685 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-28 21:01:46 +00:00
Reid Kleckner
52b0228949 Make getParamAlignment use argument numbers
The method is called "get *Param* Alignment", and is only used for
return values exactly once, so it should take argument indices, not
attribute indices.

Avoids confusing code like:
  IsSwiftError = CS->paramHasAttr(ArgIdx, Attribute::SwiftError);
  Alignment  = CS->getParamAlignment(ArgIdx + 1);

Add getRetAlignment to handle the one case in Value.cpp that wants the
return value alignment.

This is a potentially breaking change for out-of-tree backends that do
their own call lowering.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301682 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-28 20:34:27 +00:00