OSDN Git Service

android-x86/external-llvm.git
7 years agoRevert "[PowerPC][ELFv2ABI] Allocate parameter area on-demand to reduce stack frame...
Tim Shen [Tue, 7 Mar 2017 07:40:10 +0000 (07:40 +0000)]
Revert "[PowerPC][ELFv2ABI] Allocate parameter area on-demand to reduce stack frame size"

This reverts commit r296771.

We found some wide spread test failures internally. I'm working on a
testcase. Politely revert the patch in the mean time. :)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297124 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[LoopUnrolling] Fix loop size check for peeling
Sanjoy Das [Tue, 7 Mar 2017 06:03:15 +0000 (06:03 +0000)]
[LoopUnrolling] Fix loop size check for peeling

Summary:
We should check if loop size allows us to peel at least one iteration
before we do so.

Patch by Max Kazantsev!

Reviewers: sanjoy, mkuper, efriedma

Reviewed By: mkuper

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297122 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[APInt] Add rvalue reference support to and, or, xor operations to allow their memory...
Craig Topper [Tue, 7 Mar 2017 05:36:19 +0000 (05:36 +0000)]
[APInt] Add rvalue reference support to and, or, xor operations to allow their memory allocation to be reused when possible

This extends an earlier change that did similar for add and sub operations.

With this first patch we lose the fastpath for the single word case as operator&= and friends don't support it. This can be added there if we think that's important.

I had to change some functions in the APInt class since the operator overloads were moved out of the class and can't be used inside the class now. The getBitsSet change collides with another outstanding patch to implement it with setBits. But I didn't want to make this patch dependent on that series.

I've also removed the Or, And, Xor functions which were rarely or never used. I already commited two changes to remove the only uses of Or that existed.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297121 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRevert "AMDGPU: Set MCAsmInfo::PointerSize"
Konstantin Zhuravlyov [Tue, 7 Mar 2017 04:44:33 +0000 (04:44 +0000)]
Revert "AMDGPU: Set MCAsmInfo::PointerSize"

It breaks line tables because the patch is not complete, working on a complete one at the moment

This reverts commit r294031.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297118 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoUse LLVM for all stat-related functionality.
Zachary Turner [Tue, 7 Mar 2017 03:43:17 +0000 (03:43 +0000)]
Use LLVM for all stat-related functionality.

This deletes LLDB's FileType enumeration and replaces all
users, and all calls to functions that check whether a file
exists etc with corresponding calls to LLVM.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297116 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[APInt] Fix test names in unittest to match functions being tested. NFC
Craig Topper [Tue, 7 Mar 2017 03:16:37 +0000 (03:16 +0000)]
[APInt] Fix test names in unittest to match functions being tested. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297115 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[APInt] Add getBitsSetFrom and setBitsFrom to set upper bits starting at a bit
Craig Topper [Tue, 7 Mar 2017 02:58:36 +0000 (02:58 +0000)]
[APInt] Add getBitsSetFrom and setBitsFrom to set upper bits starting at a bit

We currently have methods to set a specified number of low bits, a specified number of high bits, or a range of bits. But looking at some existing code it seems sometimes we want to set the high bits starting from a certain bit. Currently we do this with something like getHighBits(BitWidth, BitWidth - StartBit). Or once we start switching to setHighBits, setHighBits(BitWidth - StartBit) or setHighBits(getBitWidth() - StartBit).

Particularly for the latter case it would be better to have a convenience method like setBitsFrom(StartBit) so we don't need to mention the bit width that's already known to the APInt object.

I considered just making setBits have a default value of UINT_MAX for the hiBit argument and we would internally MIN it with the bit width. So if it wasn't specified it would be treated as bit width. This would require removing the assertion we currently have on the value of hiBit and may not be as readable.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297114 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAdd a testcase for r297072.
Adrian Prantl [Tue, 7 Mar 2017 02:49:57 +0000 (02:49 +0000)]
Add a testcase for r297072.

Check that missing debug locations on inlinable calls are a
recoverable error.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297113 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[APInt] Implement getLowBitsSet/getHighBitsSet/getBitsSet using setLowBits/setHighBit...
Craig Topper [Tue, 7 Mar 2017 02:19:45 +0000 (02:19 +0000)]
[APInt] Implement getLowBitsSet/getHighBitsSet/getBitsSet using setLowBits/setHighBits/setBits

This patch implements getLowBitsSet/getHighBitsSet/getBitsSet in terms of the new setLowBits/setHighBits/setBits methods by making an all 0s APInt and then calling the appropriate set method.

This also adds support to setBits to allow loBits/hiBits to be in the other order to match with getBitsSet behavior.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297112 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[APInt] Add setLowBits/setHighBits methods to APInt.
Craig Topper [Tue, 7 Mar 2017 01:56:01 +0000 (01:56 +0000)]
[APInt] Add setLowBits/setHighBits methods to APInt.

Summary:
There are quite a few places in the code base that do something like the following to set the high or low bits in an APInt.

KnownZero |= APInt::getHighBitsSet(BitWidth, BitWidth - 1);

For BitWidths larger than 64 this creates a short lived APInt with malloced storage. I think it might even call malloc twice. Its better to just provide methods that can set the necessary bits without the temporary APInt.

I'll update usages that benefit in a separate patch.

Reviewers: majnemer, MatzeB, davide, RKSimon, hans

Reviewed By: hans

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297111 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoUn-XFAIL Fuzzer/test/dump_coverage.test. This now passes on Darwin (after r297094).
Kuba Mracek [Tue, 7 Mar 2017 01:01:38 +0000 (01:01 +0000)]
Un-XFAIL Fuzzer/test/dump_coverage.test.  This now passes on Darwin (after r297094).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297110 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoremove Cmake option for LLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING
Bob Wilson [Tue, 7 Mar 2017 00:51:07 +0000 (00:51 +0000)]
remove Cmake option for LLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING

This is a follow-up to my change in r295090, which added support for
disabling these checks selectively based on setting the preprocessor
macro without relying on the Cmake setting. Swift has moved over to use
that approach, so we can clean up here and remove the Cmake setting.

https://reviews.llvm.org/D30578

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297109 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[SLP] Revert r296863 due to miscompiles.
Michael Kuperstein [Mon, 6 Mar 2017 23:54:51 +0000 (23:54 +0000)]
[SLP] Revert r296863 due to miscompiles.

Details and reproducer are on the email thread for r296863.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297103 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoGlobalISel: restrict G_EXTRACT instruction to just one operand.
Tim Northover [Mon, 6 Mar 2017 23:50:28 +0000 (23:50 +0000)]
GlobalISel: restrict G_EXTRACT instruction to just one operand.

A bit more painful than G_INSERT because it was more widely used, but this
should simplify the handling of extract operations in most locations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297100 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[libfuzzer] do not use xargs for shell expansion
Mike Aizatsky [Mon, 6 Mar 2017 23:42:14 +0000 (23:42 +0000)]
[libfuzzer] do not use xargs for shell expansion

Summary:
After https://reviews.llvm.org/rL296904 xargs shouldn't be necesssary.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297094 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[InstCombine] use dyn_cast instead of isa+cast; NFCI
Sanjay Patel [Mon, 6 Mar 2017 23:25:28 +0000 (23:25 +0000)]
[InstCombine] use dyn_cast instead of isa+cast; NFCI

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297092 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ObjectYAML] Support for DW_FORM_implicit_const DWARF5 form
Chris Bieneman [Mon, 6 Mar 2017 23:22:49 +0000 (23:22 +0000)]
[ObjectYAML] Support for DW_FORM_implicit_const DWARF5 form

This patch adds support to the DWARF YAML reader and writer for the new DWARF5 abbreviation form, DW_FORM_implicit_const.

The attribute was added in r291599.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297091 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[GlobalISel] Fix G_FPEXT’s description. NFC.
Volkan Keles [Mon, 6 Mar 2017 22:47:19 +0000 (22:47 +0000)]
[GlobalISel] Fix G_FPEXT’s description. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297088 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[DAG] refactor related div/rem folds; NFCI
Sanjay Patel [Mon, 6 Mar 2017 22:32:40 +0000 (22:32 +0000)]
[DAG] refactor related div/rem folds; NFCI

This is known incomplete and not called in the right order relative to
other folds, but that's the current behavior. I'm just trying to clean
this up before making actual functional changes to make the patch smaller.

The logic here should mimic the IR equivalents that are in InstSimplify's
simplifyDivRem().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297086 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[DWARFv5] Update definitions to match published spec.
Paul Robinson [Mon, 6 Mar 2017 22:20:03 +0000 (22:20 +0000)]
[DWARFv5] Update definitions to match published spec.

Some late additions to DWARF v5 were not in Dwarf.def; also one form
was redefined.  Add the new cases to relevant switches in different
parts of LLVM.  Replace DW_FORM_ref_sup with DW_FORM_ref_sup[4,8].

I did not add support for DW_FORM_strx3/addrx3 other that defining the
constants. We don't have any infrastructure to support these.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297085 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Outliner] Fixed Asan bot failure in r296418
Jessica Paquette [Mon, 6 Mar 2017 21:31:18 +0000 (21:31 +0000)]
[Outliner] Fixed Asan bot failure in r296418

Fixed the asan bot failure which led to the last commit of the outliner being reverted.
The change is in lib/CodeGen/MachineOutliner.cpp in the SuffixTree's constructor. LeafVector
is no longer initialized using reserve but just a standard constructor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297081 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[TableGen] Ensure proper ordering of subtarget feature names
Krzysztof Parzyszek [Mon, 6 Mar 2017 21:26:49 +0000 (21:26 +0000)]
[TableGen] Ensure proper ordering of subtarget feature names

Recommit r297039 without the testcase. The MIR testcase did not work
well with MC code emitter.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297080 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[AArch64][Redundant Copy Elim] Add support for CMN and shifted imm.
Chad Rosier [Mon, 6 Mar 2017 21:20:00 +0000 (21:20 +0000)]
[AArch64][Redundant Copy Elim] Add support for CMN and shifted imm.

This patch extends the current functionality of the AArch64 redundant copy
elimination pass to handle CMN instructions as well as a shifted
immediates.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297078 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoDisable gvn-hoist (PR32153)
Hans Wennborg [Mon, 6 Mar 2017 21:10:40 +0000 (21:10 +0000)]
Disable gvn-hoist (PR32153)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297075 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoVerifier: Change Assert to AssertDI.
Adrian Prantl [Mon, 6 Mar 2017 21:05:14 +0000 (21:05 +0000)]
Verifier: Change Assert to AssertDI.
This error can be recovered from by stripping debug info.
This is NFC for +asserts builds.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297072 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ObjectYAML] NFC. Refactor DWARFYAML CompileUnit dump code
Chris Bieneman [Mon, 6 Mar 2017 20:52:12 +0000 (20:52 +0000)]
[ObjectYAML] NFC. Refactor DWARFYAML CompileUnit dump code

Summary: This patch refactors the DWARFYAML code for dumping compile units to use a visitor pattern. Using this design will, in the future, enable the DWARF YAML code to perform analysis and mutations of the DWARF DIEs. An example of such mutations would be calculating the length of a compile unit and updating the CU's Length field before writing the DIE. This support will make it easier to craft or modify DWARF tests by hand.

Reviewers: lhames

Subscribers: mgorny, fhahn, jgosnell, aprantl, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297067 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoTest commit. Added a blank line.
Jessica Paquette [Mon, 6 Mar 2017 20:45:33 +0000 (20:45 +0000)]
Test commit. Added a blank line.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297064 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRevert r297039, it's causing some mysterious buildbot failures
Krzysztof Parzyszek [Mon, 6 Mar 2017 20:24:21 +0000 (20:24 +0000)]
Revert r297039, it's causing some mysterious buildbot failures

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297062 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAMDGPU/R600: Fix ALU clause markers use detection
Jan Vesely [Mon, 6 Mar 2017 20:10:05 +0000 (20:10 +0000)]
AMDGPU/R600: Fix ALU clause markers use detection

also exit early on kill instead of redefinition.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297060 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoNewGVN: We were not really failing this testcase, because the instructions it was...
Daniel Berlin [Mon, 6 Mar 2017 20:01:31 +0000 (20:01 +0000)]
NewGVN: We were not really failing this testcase, because the instructions it was looking for are unused. GVN value numbers unused instructions, NewGVN does not.  Fix the instructions to be used, so we eliminate the redundancies it's checking for, and un-XFAIL it

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297058 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[DWARF] NFC. A few bits of minor code cleanup.
Chris Bieneman [Mon, 6 Mar 2017 19:25:07 +0000 (19:25 +0000)]
[DWARF] NFC. A few bits of minor code cleanup.

David Blaikie pointed out that the `setForceChildren` API is no longer needed and should be removed from the DWARF Generator APIs.

Also the DWARFDebugInfoTest file had some copy pasted comments that are not relevant. I've removed them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297056 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[opt-diff] Fix the case when the script is invoked with directories
Adam Nemet [Mon, 6 Mar 2017 19:15:22 +0000 (19:15 +0000)]
[opt-diff] Fix the case when the script is invoked with directories

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297055 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[IfConversion] Only renormalize probabilities if branches are analyzable
Krzysztof Parzyszek [Mon, 6 Mar 2017 19:12:42 +0000 (19:12 +0000)]
[IfConversion] Only renormalize probabilities if branches are analyzable

If a block has non-analyzable branches, the listed successors don't need
to add up to one. For example, if a block has a conditional tail call,
that tail call will not have a corresponding successor in the successor
list, but will still be a possible branch.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297054 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[InstSimplify] refactor related div/rem folds; NFCI
Sanjay Patel [Mon, 6 Mar 2017 19:08:35 +0000 (19:08 +0000)]
[InstSimplify] refactor related div/rem folds; NFCI

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297052 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoGlobalISel: don't emit degenerate G_INSERT instructions.
Tim Northover [Mon, 6 Mar 2017 19:04:17 +0000 (19:04 +0000)]
GlobalISel: don't emit degenerate G_INSERT instructions.

Before, we were producing G_INSERT instructions that were actually closer to a
cast or even a COPY when both input and output sizes are the same. This doesn't
really make sense and means that everything interpreting a G_INSERT also has to
handle all these kinds of casts.

So now we detect these degenerate cases and emit real casts instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297051 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[InstSimplify] add tests for vector div/rem with UB potential; NFC
Sanjay Patel [Mon, 6 Mar 2017 18:45:39 +0000 (18:45 +0000)]
[InstSimplify] add tests for vector div/rem with UB potential; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297048 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoNewGVN: Remove DebugUnknownExprs, just mark the instructions as unused
Daniel Berlin [Mon, 6 Mar 2017 18:42:39 +0000 (18:42 +0000)]
NewGVN: Remove DebugUnknownExprs, just mark the instructions as unused

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297047 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoNewGVN: Only call isInstructionTrivially dead once per instruction.
Daniel Berlin [Mon, 6 Mar 2017 18:42:27 +0000 (18:42 +0000)]
NewGVN: Only call isInstructionTrivially dead once per instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297046 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[X86] Fix arg copy elision for illegal types
Reid Kleckner [Mon, 6 Mar 2017 18:39:39 +0000 (18:39 +0000)]
[X86] Fix arg copy elision for illegal types

Use the store size of the argument type, which will be a byte-sized
quantity, rather than dividing the size in bits by 8.

Fixes PR32136 and re-enables copy elision from i64 arguments.

Reverts the workaround in from r296950.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297045 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoGlobalISel: add buildUndef method to MachineIRBuilder. NFC.
Tim Northover [Mon, 6 Mar 2017 18:36:40 +0000 (18:36 +0000)]
GlobalISel: add buildUndef method to MachineIRBuilder. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297044 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoGlobalISel: refactor legalization of G_INSERT.
Tim Northover [Mon, 6 Mar 2017 18:23:04 +0000 (18:23 +0000)]
GlobalISel: refactor legalization of G_INSERT.

Now that G_INSERT instructions can only insert one register, this code was
overly general. In another direction it didn't handle registers that crossed
split boundaries properly, which needed to be fixed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297042 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[InstSimplify] regenerate checks; NFC
Sanjay Patel [Mon, 6 Mar 2017 18:13:01 +0000 (18:13 +0000)]
[InstSimplify] regenerate checks; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297040 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[TableGen] Ensure proper ordering of subtarget feature names
Krzysztof Parzyszek [Mon, 6 Mar 2017 18:08:37 +0000 (18:08 +0000)]
[TableGen] Ensure proper ordering of subtarget feature names

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297039 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRemove the sample pgo annotation heuristic that uses call count to annotate basic...
Dehao Chen [Mon, 6 Mar 2017 17:49:59 +0000 (17:49 +0000)]
Remove the sample pgo annotation heuristic that uses call count to annotate basic block count.

Summary: We do not need that special handling because the debug info is more accurate now. Performance testing shows no regression on google internal benchmarks.

Reviewers: davidxl, aprantl

Reviewed By: aprantl

Subscribers: llvm-commits, aprantl

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297038 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Hexagon] Early-if-convert branches that may exit the loop
Krzysztof Parzyszek [Mon, 6 Mar 2017 17:24:04 +0000 (17:24 +0000)]
[Hexagon] Early-if-convert branches that may exit the loop

Merge the tail block into the loop in cases where the main loop body
exits early, subject to profitability constraints. This will coalesce
the loop body into fewer blocks.

For example:
  loop:                           loop:
    // loop body                      // loop body
    if (...) jump exit      -->       // more body
  more:                               if (...) jump exit
    // more body                      jump loop
    jump loop

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297033 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Hexagon] Mark dead defs as <dead> in expand-condsets
Krzysztof Parzyszek [Mon, 6 Mar 2017 17:09:06 +0000 (17:09 +0000)]
[Hexagon] Mark dead defs as <dead> in expand-condsets

The code in updateDeadFlags removed unnecessary <dead> flags, but there
can be cases where such a flag is not set, and yet a register has become
dead. For example, if a mux with identical inputs is replaced with a COPY,
the predicate register may no longer be used after that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297032 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Hexagon] Pick a dot-old instruction that matches the architecture
Krzysztof Parzyszek [Mon, 6 Mar 2017 17:03:16 +0000 (17:03 +0000)]
[Hexagon] Pick a dot-old instruction that matches the architecture

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297031 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[InstSimplify] remove misleading comments; NFC
Sanjay Patel [Mon, 6 Mar 2017 16:49:35 +0000 (16:49 +0000)]
[InstSimplify] remove misleading comments; NFC

Div/rem-of-0 does not cause faults/undef (not the same as div/rem-by-0).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297029 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[DAGCombiner] simplify div/rem-by-0
Sanjay Patel [Mon, 6 Mar 2017 16:36:42 +0000 (16:36 +0000)]
[DAGCombiner] simplify div/rem-by-0

Refactoring of duplicated code and more fixes to follow.

This is motivated by the post-commit comments for r296699:
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20170306/435182.html

Ie, we can crash if we're missing obvious simplifications like this that
exist in the IR simplifier or if these occur later than expected.

The x86 change for non-splat division shows a potential opportunity to improve
vector codegen: we assumed that since only one lane had meaningful results, we
should do the math in scalar. But that means moving back and forth from vector
registers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297026 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[SLP] A test for vectorization of users of extractelement instructions,
Alexey Bataev [Mon, 6 Mar 2017 16:26:00 +0000 (16:26 +0000)]
[SLP] A test for vectorization of users of extractelement instructions,
NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297024 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix minor typo introduce in r297014
Tobias Grosser [Mon, 6 Mar 2017 16:03:26 +0000 (16:03 +0000)]
Fix minor typo introduce in r297014

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297020 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoSilence a warning "hiding virtual function".
Vassil Vassilev [Mon, 6 Mar 2017 15:50:59 +0000 (15:50 +0000)]
Silence a warning "hiding virtual function".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297018 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[x86] add tests to show missing div/rem simplifications; NFC
Sanjay Patel [Mon, 6 Mar 2017 15:50:07 +0000 (15:50 +0000)]
[x86] add tests to show missing div/rem simplifications; NFC

These are not x86-specific, but the problem is not visible for all targets
because it is masked by other transforms. These can lead to compiler crashes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297017 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[BasicBlockUtils] Check for nullptr before updating LoopInfo.
Michael Kruse [Mon, 6 Mar 2017 15:33:05 +0000 (15:33 +0000)]
[BasicBlockUtils] Check for nullptr before updating LoopInfo.

LoopInfo::getLoopFor returns nullptr if a BB is not in a loop and only
then can the loop be updated to contain the newly created BBs. Add the
missing nullptr check to SplitBlockAndInsertIfThen.

Within LLVM, the only user of this function that also passes a LoopInfo
to be updated is InnerLoopVectorizer::predicateInstructions().
As the method's name implies, the BB operataten on will always be within
a loop, but out-of-tree users may also use it differently (here: Polly).

All other uses of LoopInfo::getLoopFor in the file properly check its
return value for nullptr.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297016 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[DAG] fix formatting; NFC
Sanjay Patel [Mon, 6 Mar 2017 15:27:57 +0000 (15:27 +0000)]
[DAG] fix formatting; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297015 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoNew Test-Case for Region Analysis
Tobias Grosser [Mon, 6 Mar 2017 15:20:38 +0000 (15:20 +0000)]
New Test-Case for Region Analysis

While working on improvements to region info analysis, this test case caused an
incorrect region bb2 => bb3 to be detected.

Reviewers: grosser

Contributed-by: Nandini Singhal <cs15mtech01004@iith.ac.in>
Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297014 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[DAG] fix typo in comment; NFC
Sanjay Patel [Mon, 6 Mar 2017 15:07:43 +0000 (15:07 +0000)]
[DAG] fix typo in comment; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297011 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoCMake: Add a build target for generating a source RPM
Tom Stellard [Mon, 6 Mar 2017 14:26:50 +0000 (14:26 +0000)]
CMake: Add a build target for generating a source RPM

Summary:
'make srpm' or 'ninja srpm' will tar up the current source code and then
build a source RPM package.

By default it will use the llvm.spec file to generate the source RPM,
but you can specify your own custom spec file with the
LLVM_SRPM_USER_BINARY_SPECFILE option.  CMake will perform variable
substitution on your custom specfile, so you can reference CMake
variables in it.  For example:

Version:        @LLVM_RPM_SPEC_VERSION@

Note that everything in the source directory will be included in the
tarball so if you have a clang check out in tools/clang, then all
the clang source will end up in the tarball to.  It is recommended
to only use this build target with a clean source tree.

Reviewers: beanz

Reviewed By: beanz

Subscribers: mgorny, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297007 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[PowerPC] Fix failure with STBRX when store is narrower than the bswap
Nemanja Ivanovic [Mon, 6 Mar 2017 07:32:13 +0000 (07:32 +0000)]
[PowerPC] Fix failure with STBRX when store is narrower than the bswap

Fixes a crash caused by r296811 by truncating the input of the STBRX node
when the bswap is wider than i32.

Fixes https://bugs.llvm.org/show_bug.cgi?id=32140

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297001 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[XRay] Allow logging the first argument of a function call.
Dean Michael Berris [Mon, 6 Mar 2017 06:48:56 +0000 (06:48 +0000)]
[XRay] Allow logging the first argument of a function call.

Summary:
Functions with the "xray-log-args" attribute will have a special XRay sled kind
emitted, for compiler-rt to copy any call arguments to your logging handler.

For practical and performance reasons, only the first argument is supported, and
only up to 64 bits.

Reviewers: dberris

Reviewed By: dberris

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296998 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[APInt] Move operator~ out of line to make it better able to reused memory allocation...
Craig Topper [Mon, 6 Mar 2017 06:30:47 +0000 (06:30 +0000)]
[APInt] Move operator~ out of line to make it better able to reused memory allocation from temporary objects

Summary:
This makes operator~ take the APInt by value so if it came from a temporary APInt the move constructor will get invoked and it will be able to reuse the memory allocation from the temporary.

This is similar to what was already done for 2s complement negation.

Reviewers: hans, davide, RKSimon

Reviewed By: davide

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296997 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[APInt] Remove add and sub functions from APIntOps namespace.
Craig Topper [Mon, 6 Mar 2017 04:35:01 +0000 (04:35 +0000)]
[APInt] Remove add and sub functions from APIntOps namespace.

They aren't used in tree and using the overloaded operators has more optimization opportunities.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296995 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[APInt] Remove unused And/Or/Xor methods. They just forward to the corresponding...
Craig Topper [Mon, 6 Mar 2017 00:24:53 +0000 (00:24 +0000)]
[APInt] Remove unused And/Or/Xor methods. They just forward to the corresponding operator overload.

I plan to enhance the operator overloads to handle rvalues and these methods would not longer be optimal to use.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296993 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[SCEV] Decrease the recursion threshold for CompareValueComplexity
Sanjoy Das [Sun, 5 Mar 2017 23:49:17 +0000 (23:49 +0000)]
[SCEV] Decrease the recursion threshold for CompareValueComplexity

Fixes PR32142.

r287232 accidentally increased the recursion threshold for
CompareValueComplexity from 2 to 32.  This change reverses that change
by introducing a separate flag for CompareValueComplexity's threshold.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296992 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[APInt] Remove the And/Or/Xor/Not functions from the APIntOps namespace.
Craig Topper [Sun, 5 Mar 2017 16:41:11 +0000 (16:41 +0000)]
[APInt] Remove the And/Or/Xor/Not functions from the APIntOps namespace.

Summary:
They aren't used anywhere in tree and its preferable to use the &, |, ^, or ~ operators.

With my patch to add rvalue reference support to &, |, ^ operators it also becomes less performant to use these functions.

Reviewers: RKSimon, davide, hans

Reviewed By: RKSimon

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296990 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[SelectionDAG] Fix vector splitting for *_EXTEND_VECTOR_INREG instructions
Simon Pilgrim [Sun, 5 Mar 2017 15:52:18 +0000 (15:52 +0000)]
[SelectionDAG] Fix vector splitting for *_EXTEND_VECTOR_INREG instructions

Found by fuzz testing after rL296985 landed

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296989 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoNew Test-Case for Region Analysis
Tobias Grosser [Sun, 5 Mar 2017 14:08:28 +0000 (14:08 +0000)]
New Test-Case for Region Analysis

While working on improvements to the region info analysis, this test case caused
an incorrect region 1 => 2 to be detected.  It is incorrect because entry has an
outgoing edge to 3.  This is interesting because 1 dom 2 and 2 pdom 1, which
should have been enough to prevent incoming forward edges into the region and
outgoing forward edges from the region.

Reviewers: grosser

Subscribers: llvm-commits

Contributed-by: Nandini Singhal <cs15mtech01004@iith.ac.in>
Differential Revision: https://reviews.llvm.org/D30603

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296988 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[X86] Silence GCC enum compare warning.
Benjamin Kramer [Sun, 5 Mar 2017 12:53:20 +0000 (12:53 +0000)]
[X86] Silence GCC enum compare warning.

X86ISelLowering.cpp:26506:36: error: enumeral mismatch in conditional
expression: 'llvm::X86ISD::NodeType' vs 'llvm::ISD::NodeType'
[-Werror=enum-compare]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296986 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[X86][SSE] Lower 128-bit vectors to SIGN/ZERO_EXTEND_VECTOR_IN_REG ops
Simon Pilgrim [Sun, 5 Mar 2017 09:57:20 +0000 (09:57 +0000)]
[X86][SSE] Lower 128-bit vectors to SIGN/ZERO_EXTEND_VECTOR_IN_REG ops

As described on PR31712, we miss a variety of legalization combines because we lower these to X86ISD::VSEXT/VZEXT despite them having the same functionality. This patch makes 128-bit (SSE41) SIGN/ZERO_EXTEND_VECTOR_IN_REG ops legal, adds the necessary tablegen plumbing and uses a helper 'getExtendInVec' to decide when to use SIGN/ZERO_EXTEND_VECTOR_IN_REG or VSEXT/VZEXT.

We're missing a couple of shuffle combines that will be added in a future patch for review.

Later patches can then support the AVX2 cases as a mixture of SIGN/ZERO_EXTEND and SIGN/ZERO_EXTEND_VECTOR_IN_REG, and then finally deal with the AVX512 cases.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296985 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRevert commit r296967, no typo
Sylvestre Ledru [Sun, 5 Mar 2017 07:46:24 +0000 (07:46 +0000)]
Revert commit r296967, no typo

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296984 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[SimplifyCFG] Use APInt::operator| instead of APInt::Or. NFC
Craig Topper [Sun, 5 Mar 2017 01:08:19 +0000 (01:08 +0000)]
[SimplifyCFG] Use APInt::operator| instead of APInt::Or. NFC

I'm looking to improve operator| to support rvalue references and may remove APInt::Or.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296982 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[DAGCombine] Use APInt::operator|(uint64_t) instead of creating a temporary APInt...
Craig Topper [Sun, 5 Mar 2017 01:08:16 +0000 (01:08 +0000)]
[DAGCombine] Use APInt::operator|(uint64_t) instead of creating a temporary APInt and calling APInt::Or. NFC

This is more efficient by itself. But this is prep for a future patch that may remove APInt::Or while making operator| support rvalue references similar to add/sub.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296981 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[x86] don't require a zext when forming ADC/SBB
Sanjay Patel [Sat, 4 Mar 2017 20:35:19 +0000 (20:35 +0000)]
[x86] don't require a zext when forming ADC/SBB

The larger goal is to move the ADC/SBB transforms currently in
combineX86SetCC() to combineAddOrSubToADCOrSBB() because we're
creating ADC/SBB in lots of places where we shouldn't.

This was intended to be an NFC change, but avx-512 has something
strange going on. It doesn't seem like any of the affected tests
should really be using SET+TEST or ADC; a simple ADD could replace
several instructions. But that's another bug...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296978 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[DAGCombiner] allow transforming (select Cond, C +/- 1, C) to (add(ext Cond), C)
Sanjay Patel [Sat, 4 Mar 2017 19:18:09 +0000 (19:18 +0000)]
[DAGCombiner] allow transforming (select Cond, C +/- 1, C) to (add(ext Cond), C)

select Cond, C +/- 1, C --> add(ext Cond), C -- with a target hook.

This is part of the ongoing process to obsolete D24480.  The motivation is to
canonicalize to select IR in InstCombine whenever possible, so we need to have a way to
undo that easily in codegen.

PowerPC is an obvious winner for this kind of transform because it has fast and complete
bit-twiddling abilities but generally lousy conditional execution perf (although this might
have changed in recent implementations).

x86 also sees some wins, but the effect is limited because these transforms already mostly
exist in its target-specific combineSelectOfTwoConstants(). The fact that we see any x86
changes just shows that that code is a mess of special-case holes. We may be able to remove
some of that logic now.

My guess is that other targets will want to enable this hook for most cases. The likely
follow-ups would be to add value type and/or the constants themselves as parameters for the
hook. As the tests in select_const.ll show, we can transform any select-of-constants to
math/logic, but the general transform for any 2 constants needs one more instruction
(multiply or 'and').

ARM is one target that I think may not want this for most cases. I see infinite loops there
because it wants to use selects to enable conditionally executed instructions.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296977 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoTry to fix thread name truncation on non-Windows.
Zachary Turner [Sat, 4 Mar 2017 18:53:09 +0000 (18:53 +0000)]
Try to fix thread name truncation on non-Windows.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296976 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoImprove the Threading code on NetBSD
Kamil Rytarowski [Sat, 4 Mar 2017 17:42:46 +0000 (17:42 +0000)]
Improve the Threading code on NetBSD

Do not include <sys/user.h> on NetBSD. It's dead file and will be removed.

No need to include <sys/sysctl.h> in this code context on NetBSD.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296973 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoTruncate thread names if they're too long.
Zachary Turner [Sat, 4 Mar 2017 16:42:25 +0000 (16:42 +0000)]
Truncate thread names if they're too long.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296972 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoDebugCounter: Initialize skip to 0, not -1
Daniel Berlin [Sat, 4 Mar 2017 14:08:47 +0000 (14:08 +0000)]
DebugCounter: Initialize skip to 0, not -1

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296971 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix a typo. Patch by fcrick on github https://github.com/llvm-mirror/llvm/pull/23
Sylvestre Ledru [Sat, 4 Mar 2017 14:01:38 +0000 (14:01 +0000)]
Fix a typo. Patch by fcrick on github https://github.com/llvm-mirror/llvm/pull/23

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296969 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRemove redundant code block and update comment.
Sylvestre Ledru [Sat, 4 Mar 2017 14:00:44 +0000 (14:00 +0000)]
Remove redundant code block and update comment.
By patch zoren here: https://github.com/llvm-mirror/llvm/pull/20

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296968 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix a typo. Thanks to huangml. Reported here: https://github.com/llvm-mirror/llvm...
Sylvestre Ledru [Sat, 4 Mar 2017 13:56:11 +0000 (13:56 +0000)]
Fix a typo. Thanks to huangml. Reported here: https://github.com/llvm-mirror/llvm/pull/6

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296967 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[X86][SSE] Enable post-legalize vXi64 shuffle combining on 32-bit targets
Simon Pilgrim [Sat, 4 Mar 2017 12:50:47 +0000 (12:50 +0000)]
[X86][SSE] Enable post-legalize vXi64 shuffle combining on 32-bit targets

Long ago (2010 according to svn blame), combineShuffle probably needed to prevent the accidental creation of illegal i64 types but there doesn't appear to be any combines that can cause this any more as they all have their own legality checks.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296966 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[legalize-types] Remove stale entries from SoftenedFloats.
Florian Hahn [Sat, 4 Mar 2017 12:00:35 +0000 (12:00 +0000)]
[legalize-types] Remove stale entries from SoftenedFloats.

Summary:
When replacing a SDValue, we should remove the replaced value from
SoftenedFloats (and possibly the other maps as well?).

When we revisit a Node because it needs analyzing again, we have to
remove all result values from SoftenedFloats (and possibly other maps?).

This fixes the fp128 test failures with expensive checks for X86.

I think we probably should also remove the values from the other maps
(PromotedIntegers and so on), let me know what you think.

Reviewers: baldrick, bogner, davidxl, ab, arsenm, pirama, chh, RKSimon

Reviewed By: chh

Subscribers: danalbert, wdng, srhines, hfinkel, sepavloff, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296964 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAdd test missed in r296770.
Evgeny Stupachenko [Sat, 4 Mar 2017 05:20:02 +0000 (05:20 +0000)]
Add test missed in r296770.

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

From: Evgeny Stupachenko <evstupac@gmail.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296962 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix bug in bisect-skip-count not using passed-in arguments
Daniel Berlin [Sat, 4 Mar 2017 03:23:41 +0000 (03:23 +0000)]
Fix bug in bisect-skip-count not using passed-in arguments

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296961 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoSet option enabling LSR alternative way to resolve complex solution to false.
Evgeny Stupachenko [Sat, 4 Mar 2017 03:14:05 +0000 (03:14 +0000)]
Set option enabling LSR alternative way to resolve complex solution to false.

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

From: Evgeny Stupachenko <evstupac@gmail.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296959 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoX86ISelLowering: Only perform copy elision on legal types.
Matthias Braun [Sat, 4 Mar 2017 01:40:40 +0000 (01:40 +0000)]
X86ISelLowering: Only perform copy elision on legal types.

This fixes cases where i1 types were not properly legalized yet and lead
to the creating of 0-sized stack slots.

This fixes http://llvm.org/PR32136

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296950 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix build.
Peter Collingbourne [Sat, 4 Mar 2017 01:38:05 +0000 (01:38 +0000)]
Fix build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296949 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoWholeProgramDevirt: Implement exporting for uniform ret val opt.
Peter Collingbourne [Sat, 4 Mar 2017 01:34:53 +0000 (01:34 +0000)]
WholeProgramDevirt: Implement exporting for uniform ret val opt.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296948 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoWholeProgramDevirt: Implement exporting for single-impl devirtualization.
Peter Collingbourne [Sat, 4 Mar 2017 01:31:01 +0000 (01:31 +0000)]
WholeProgramDevirt: Implement exporting for single-impl devirtualization.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296945 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoWholeProgramDevirt: Add any unsuccessful llvm.type.checked.load devirtualizations...
Peter Collingbourne [Sat, 4 Mar 2017 01:23:30 +0000 (01:23 +0000)]
WholeProgramDevirt: Add any unsuccessful llvm.type.checked.load devirtualizations to the list of llvm.type.test users.

Any unsuccessful llvm.type.checked.load devirtualizations will be translated
into uses of llvm.type.test, so we need to add the resulting llvm.type.test
intrinsics to the function summaries so that the LowerTypeTests pass will
export them.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296939 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoNewGVN: Be consistent in what order we compare operands for swapping.
Daniel Berlin [Sat, 4 Mar 2017 00:44:43 +0000 (00:44 +0000)]
NewGVN: Be consistent in what order we compare operands for swapping.
NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296935 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[MISched] Remove unused arguments. NFC.
Eli Friedman [Sat, 4 Mar 2017 00:42:55 +0000 (00:42 +0000)]
[MISched] Remove unused arguments. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296934 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[x86] check for commuted add pattern to find ADC/SBB
Sanjay Patel [Sat, 4 Mar 2017 00:18:31 +0000 (00:18 +0000)]
[x86] check for commuted add pattern to find ADC/SBB

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296933 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[x86] add test to show failed recognition of commuted pattern; NFC
Sanjay Patel [Sat, 4 Mar 2017 00:06:37 +0000 (00:06 +0000)]
[x86] add test to show failed recognition of commuted pattern; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296931 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRegAllocGreedy: Follow-up to r296722
Matthias Braun [Fri, 3 Mar 2017 23:27:20 +0000 (23:27 +0000)]
RegAllocGreedy: Follow-up to r296722

We can now end up in situations where we initiate LiveIntervalUnion
queries with different SubRanges against the same register unit, so the
assert() no longer holds in all cases. Just recalculate now when we know
the cache is out of date.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296928 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRevert r296865 "[ARM] fpscr read/write intrinsics not aware of each other"
Hans Wennborg [Fri, 3 Mar 2017 23:19:31 +0000 (23:19 +0000)]
Revert r296865 "[ARM] fpscr read/write intrinsics not aware of each other"

It caused PR32134: "Cannot select: intrinsic %llvm.arm.get.fpscr".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296926 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoGlobalISel: constrain G_INSERT to inserting just one value per instruction.
Tim Northover [Fri, 3 Mar 2017 23:05:47 +0000 (23:05 +0000)]
GlobalISel: constrain G_INSERT to inserting just one value per instruction.

It's much easier to reason about single-value inserts and no-one was actually
using the variadic variants before.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296923 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoGlobalISel: add merge/unmerge nodes for legalization.
Tim Northover [Fri, 3 Mar 2017 22:46:09 +0000 (22:46 +0000)]
GlobalISel: add merge/unmerge nodes for legalization.

These are simplified variants of the current G_SEQUENCE and G_EXTRACT, which
assume the individual parts will be contiguous, homogeneous, and occupy the
entirity of the larger register. This makes reasoning about them much easer
since you only have to look at the first register being merged and the result
to know what the instruction is doing.

I intend to gradually replace all uses of the more complicated sequence/extract
with these (or single-element insert/extracts), and then remove the older
variants. For now we start with legalization.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296921 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[x86] refactor combineAddOrSubToADCOrSBB(); NFCI
Sanjay Patel [Fri, 3 Mar 2017 22:35:11 +0000 (22:35 +0000)]
[x86] refactor combineAddOrSubToADCOrSBB(); NFCI

The comments were wrong, and this is not an obvious transform.
This hopefully makes it clearer that we're missing the commuted
patterns for adds. It's less clear that this is actually a good
transform for all micro-arch.

This is prep work for trying to clean up the current adc/sbb
codegen because it's definitely not happening optimally.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296918 91177308-0d34-0410-b5e6-96231b3b80d8