OSDN Git Service

android-x86/external-llvm.git
7 years ago[Hexagon] Check for .cur def without use without using a map data structure
Krzysztof Parzyszek [Tue, 2 May 2017 17:51:14 +0000 (17:51 +0000)]
[Hexagon] Check for .cur def without use without using a map data structure

Patch by Colin LeMahieu.

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

7 years agoBitcode: Simplify how we enumerate summaries in the index. NFCI.
Peter Collingbourne [Tue, 2 May 2017 17:48:39 +0000 (17:48 +0000)]
Bitcode: Simplify how we enumerate summaries in the index. NFCI.

Instead of defining a custom iterator class, just use a function with a
callback, which is much easier to understand and less error prone.

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

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

7 years ago[lit] Try to exit more cleanly
Reid Kleckner [Tue, 2 May 2017 17:45:16 +0000 (17:45 +0000)]
[lit] Try to exit more cleanly

If all jobs complete successfully, use pool.close() instead of
pool.terminate() before waiting for the workers. Zach Turner reported
that he was getting "access denied" exceptions from pool.terminate().

Make the workers abort immediately without printing to stderr when they
are interrupted.

Finally, catch exceptions when attempting to remove our temporary
testing directory. On abnormal exit, there can often be open handles
that haven't been cleaned up yet.

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

7 years agoMake DWARFDebugLine use StringRef for directory/file tables. NFC
Paul Robinson [Tue, 2 May 2017 17:37:32 +0000 (17:37 +0000)]
Make DWARFDebugLine use StringRef for directory/file tables. NFC

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

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

7 years agoRemove "_NC" suffix and semantics from TLSDESC_LD{64,32}_LO12 and
Joel Jones [Tue, 2 May 2017 17:14:31 +0000 (17:14 +0000)]
Remove "_NC" suffix and semantics from TLSDESC_LD{64,32}_LO12 and
  TLSDESC_ADD_LO12 relocations
Rearrange ordering in AArch64.def to follow relocation encoding
Fix name:
  R_AARCH64_P32_LD64_GOT_LO12_NC => R_AARCH64_P32_LD32_GOT_LO12_NC
Add support for several "TLS", "TLSGD", and "TLSLD" relocations for
  ILP32
Fix return values from isNonILP32reloc
Add implementations for
  R_AARCH64_ADR_PREL_PG_HI21_NC, R_AARCH64_P32_LD32_GOT_LO12_NC,
  R_AARCH64_P32_TLSIE_LD32_GOTTPREL_LO12_NC,
  R_AARCH64_P32_TLSDESC_LD32_LO12, R_AARCH64_LD64_GOT_LO12_NC,
  *TLSLD_LDST128_DTPREL_LO12, *TLSLD_LDST128_DTPREL_LO12_NC,
  *TLSLE_LDST128_TPREL_LO12, *TLSLE_LDST128_TPREL_LO12_NC
Modify error messages to give name of equivalent relocation in the
  ABI not being used, along with better checking for non-existent
  requested relocations.
Added assembler support for "pg_hi21_nc"
Relocation definitions added without implementations:
  R_AARCH64_P32_TLSDESC_ADR_PREL21, R_AARCH64_P32_TLSGD_ADR_PREL21,
  R_AARCH64_P32_TLSGD_ADD_LO12_NC, R_AARCH64_P32_TLSLD_ADR_PREL21,
  R_AARCH64_P32_TLSLD_ADR_PAGE21, R_AARCH64_P32_TLSLD_ADD_LO12_NC,
  R_AARCH64_P32_TLSLD_LD_PREL19, R_AARCH64_P32_TLSDESC_LD_PREL19,
  R_AARCH64_P32_TLSGD_ADR_PAGE21, R_AARCH64_P32_TLS_DTPREL,
  R_AARCH64_P32_TLS_DTPMOD, R_AARCH64_P32_TLS_TPREL,
  R_AARCH64_P32_TLSDESC
Fix encoding:
  R_AARCH64_P32_TLSDESC_ADR_PAGE21

Reviewers: Peter Smith

Patch by: Joel Jones (jjones@cavium.com)

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

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

7 years agoAMDGPU: Refactor AsmPrinter
Matt Arsenault [Tue, 2 May 2017 17:14:00 +0000 (17:14 +0000)]
AMDGPU: Refactor AsmPrinter

Avoid analyzing functions multiple times. This allows
asserting that each function is only analyzed once.

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

7 years agoAMDGPU: Make intrinsics speculatable
Matt Arsenault [Tue, 2 May 2017 16:57:44 +0000 (16:57 +0000)]
AMDGPU: Make intrinsics speculatable

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

7 years ago[PDB/CodeView] Read/write codeview inlinee line information.
Zachary Turner [Tue, 2 May 2017 16:56:09 +0000 (16:56 +0000)]
[PDB/CodeView] Read/write codeview inlinee line information.

Previously we wrote line information and file checksum
information, but we did not write information about inlinee
lines and functions.  This patch adds support for that.

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

7 years agoCMake: Silence more stderr when running git.
Tim Northover [Tue, 2 May 2017 16:37:37 +0000 (16:37 +0000)]
CMake: Silence more stderr when running git.

It can confuse bots collecting errors.

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

7 years agoAdd new test case for addcarry. NFC.
Amaury Sechet [Tue, 2 May 2017 16:07:32 +0000 (16:07 +0000)]
Add new test case for addcarry. NFC.

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

7 years agoAMDGPU: Add AMDGPU_HS calling convention
Marek Olsak [Tue, 2 May 2017 15:41:10 +0000 (15:41 +0000)]
AMDGPU: Add AMDGPU_HS calling convention

Reviewers: arsenm, nhaehnle

Subscribers: mehdi_amini, kzhuravl, wdng, yaxunl, dstuttard, tpr, llvm-commits, t-tye

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

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

7 years ago[InstCombine] don't use DeMorgan's Law on integer constants (2nd try)
Sanjay Patel [Tue, 2 May 2017 15:31:40 +0000 (15:31 +0000)]
[InstCombine] don't use DeMorgan's Law on integer constants (2nd try)

This was originally checked in here:
https://reviews.llvm.org/rL301923

And reverted here:
https://reviews.llvm.org/rL301924

Because there's a clang test that would fail after this. I fixed/removed the
offending CHECK lines in:
https://reviews.llvm.org/rL301928

So let's try this again. Original commit message:

This is the fold that causes the infinite loop in BoringSSL
(https://github.com/google/boringssl/blob/master/crypto/cipher/e_rc2.c)
when we fix instcombine demanded bits to prefer 'not' ops as in https://reviews.llvm.org/D32255.

There are 2 or 3 problems with dyn_castNotVal, and I don't think we can
reinstate https://reviews.llvm.org/D32255 until dyn_castNotVal is completely eliminated.

1. As shown here, it transforms 'not' into random xor. This transform is harmful to SCEV and codegen because 'not' can often be folded while random xor cannot.
2. It does not transform vector constants. This is actually a good thing, but if you don't believe the above argument, then we shouldn't have excluded vectors.
3. It tries to avoid transforming not(not(X)). That's nice, but it doesn't match the greedy nature of instcombine. If we DeMorganize a pattern that has an extra 'not' in it: ~(~(~X) & Y) --> (~X | ~Y)

  That's just another case of DeMorgan, so we should trust that we'll fold that pattern too: (~X | ~ Y) --> ~(X & Y)

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

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

7 years agorevert r301923 : [InstCombine] don't use DeMorgan's Law on integer constants
Sanjay Patel [Tue, 2 May 2017 14:48:23 +0000 (14:48 +0000)]
revert r301923 : [InstCombine] don't use DeMorgan's Law on integer constants

There's a clang test that is wrongly using -O1 and failing after this commit.

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

7 years ago[InstCombine] don't use DeMorgan's Law on integer constants
Sanjay Patel [Tue, 2 May 2017 14:31:30 +0000 (14:31 +0000)]
[InstCombine] don't use DeMorgan's Law on integer constants

This is the fold that causes the infinite loop in BoringSSL
(https://github.com/google/boringssl/blob/master/crypto/cipher/e_rc2.c)
when we fix instcombine demanded bits to prefer 'not' ops as in D32255.

There are 2 or 3 problems with dyn_castNotVal, and I don't think we can
reinstate D32255 until dyn_castNotVal is completely eliminated.
1. As shown here, it transforms 'not' into random xor. This transform is
   harmful to SCEV and codegen because 'not' can often be folded while
   random xor cannot.
2. It does not transform vector constants. This is actually a good thing,
   but if you don't believe the above argument, then we shouldn't have
   excluded vectors.
3. It tries to avoid transforming not(not(X)). That's nice, but it doesn't
   match the greedy nature of instcombine. If we DeMorganize a pattern
   that has an extra 'not' in it:
   ~(~(~X) & Y) --> (~X | ~Y)

   That's just another case of DeMorgan, so we should trust that we'll fold
   that pattern too:
   (~X | ~ Y) --> ~(X & Y)

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

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

7 years ago[DAGCombine] (uaddo X, (addcarry Y, 0, Carry)) -> (addcarry X, Y, Carry)
Amaury Sechet [Tue, 2 May 2017 14:15:48 +0000 (14:15 +0000)]
[DAGCombine] (uaddo X, (addcarry Y, 0, Carry)) -> (addcarry X, Y, Carry)

Summary: This is a common pattern that arise when legalizing large integers operations. Only do it when Y + 1 cannot overflow as this would change the carry behavior of uaddo .

Reviewers: jyknight, nemanjai, mkuper, spatel, RKSimon, zvi, bkramer

Subscribers: llvm-commits

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

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

7 years agoAdd llvm::object::getELFSectionTypeName().
Rafael Espindola [Tue, 2 May 2017 14:04:52 +0000 (14:04 +0000)]
Add llvm::object::getELFSectionTypeName().

This is motivated by https://reviews.llvm.org/D32488 where I am trying
to add printing of the section type for incompatible sections to LLD
error messages. This patch allows us to use the same code in
llvm-readobj and LLD instead of duplicating the function inside LLD.

Patch by Alexander Richardson!

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

7 years agoImprovements to TableGen/LangIntro.rst
Alex Bradbury [Tue, 2 May 2017 13:47:10 +0000 (13:47 +0000)]
Improvements to TableGen/LangIntro.rst

Document the 'code' data type, and that value{15-17} is different to
value{17-15}.

Patch by @chenwj (Wei-Ren Chen).

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

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

7 years ago[DAGCombine] (add X, (addcarry Y, 0, Carry)) -> (addcarry X, Y, Carry)
Amaury Sechet [Tue, 2 May 2017 13:34:25 +0000 (13:34 +0000)]
[DAGCombine] (add X, (addcarry Y, 0, Carry)) -> (addcarry X, Y, Carry)

Summary: Common pattern when legalizing large integers operations. Similar to D32687, when the carry isn't used.

Reviewers: jyknight, nemanjai, mkuper, spatel, RKSimon, zvi, bkramer

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

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

7 years ago[X86][SSE] Add test for PR30264 (combining multiple constants inputs in a shuffle)
Simon Pilgrim [Tue, 2 May 2017 12:25:17 +0000 (12:25 +0000)]
[X86][SSE] Add test for PR30264 (combining multiple constants inputs in a shuffle)

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

7 years ago[X86] Tidyup subvector insert/extract helpers. NFCI.
Simon Pilgrim [Tue, 2 May 2017 11:08:15 +0000 (11:08 +0000)]
[X86] Tidyup subvector insert/extract helpers. NFCI.

Use getConstantOperandVal where possible.

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

7 years agoFix typo in comment. NFCI.
Simon Pilgrim [Tue, 2 May 2017 10:43:33 +0000 (10:43 +0000)]
Fix typo in comment. NFCI.

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

7 years ago[SelectionDAG] Improve support for promotion of <1 x fX> floating point argument...
Simon Pilgrim [Tue, 2 May 2017 10:33:08 +0000 (10:33 +0000)]
[SelectionDAG] Improve support for promotion of <1 x fX> floating point argument types (PR31088)

PR31088 demonstrated that we were assuming that only integers require promotion from <1 x iX> types, when in fact float types may require it as well - in this case half floats.

This patch adds support for extension/truncation for both integer and float types.

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

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

7 years ago[DAGCombiner] Improve MatchBswapHword logic (PR31357)
Simon Pilgrim [Tue, 2 May 2017 10:16:19 +0000 (10:16 +0000)]
[DAGCombiner] Improve MatchBswapHword logic (PR31357)

The existing code only looks at half of the tree when matching bswap + rol patterns ending in an OR tree (as opposed to a cascade).

Patch originally introduced by Jim Lewis.

Submitted on the behalf of Dinar Temirbulatov.

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

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

7 years ago[ARM] GlobalISel: Use TableGen instruction selector
Diana Picus [Tue, 2 May 2017 09:40:49 +0000 (09:40 +0000)]
[ARM] GlobalISel: Use TableGen instruction selector

Emit and use the TableGen instruction selector for ARM. At the moment,
this allows us to remove the hand-written code for selecting G_SDIV and
G_UDIV.

Future commits will focus on increasing the code coverage for it and
removing more dead code from the current instruction selector.

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

7 years ago[APInt] Move APInt::getSplat out of line.
Craig Topper [Tue, 2 May 2017 06:32:27 +0000 (06:32 +0000)]
[APInt] Move APInt::getSplat out of line.

I think this method is probably too complex to be inlined.

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

7 years ago[APInt] Move the setBit and clearBit methods inline.
Craig Topper [Tue, 2 May 2017 05:49:40 +0000 (05:49 +0000)]
[APInt] Move the setBit and clearBit methods inline.

This makes setBit/clearBit more consistent with setBits which is already inlined.

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

7 years agoRefactor callsite cost computation into a helper function /NFC
Xinliang David Li [Tue, 2 May 2017 05:38:41 +0000 (05:38 +0000)]
Refactor callsite cost computation into a helper function /NFC

Makes code more readable. The function will also be used
by the partial inlining's cost analysis.

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

7 years ago[PartialInlining] Hook up inline cost analysis
Xinliang David Li [Tue, 2 May 2017 02:44:14 +0000 (02:44 +0000)]
[PartialInlining] Hook up inline cost analysis

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

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

7 years ago[AVR] Save/restore the frame pointer for all functions
Dylan McKay [Tue, 2 May 2017 01:57:48 +0000 (01:57 +0000)]
[AVR] Save/restore the frame pointer for all functions

A recent commit I made made it so that we only did this for signal or
interrupt handlers. This broke normal functions.

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

7 years ago[PowerPC] Emit VMX loads/stores for aligned ops to avoid adding swaps on LE
Nemanja Ivanovic [Tue, 2 May 2017 01:47:34 +0000 (01:47 +0000)]
[PowerPC] Emit VMX loads/stores for aligned ops to avoid adding swaps on LE

Fixes PR30730.
This is a re-commit of a pulled commit. The commit was pulled because some
software projects contained uses of Altivec vectors that violated alignment
requirements. Known issues have now been fixed.

Committing on behalf of Lei Huang.

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

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

7 years ago[AArch64] armv8-A doesn't have LSE.
Ahmed Bougacha [Tue, 2 May 2017 00:45:01 +0000 (00:45 +0000)]
[AArch64] armv8-A doesn't have LSE.

r288279 mistakenly added it to all arches, but it's only available
from v8.1 onwards.

The testcase is awkward, because (I suspect) of PR32873.

Spotted by inspection.

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

7 years ago[AVR] Fix a bug where the frame pointer is clobbered
Dylan McKay [Tue, 2 May 2017 00:11:34 +0000 (00:11 +0000)]
[AVR] Fix a bug where the frame pointer is clobbered

Because it was a callee-saved register, we automatically generated code
to spill and unspill its original value so that it is restored after the
function returns.

The problem is that this code was being generated before the epilogue.
The epilogue itself uses the Y register, which could be prematurely
restored by the CSR restoration process.

This removes R29R28 from the CSR list and changes the prologue/epilogue
code to handle it explicitly.

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

7 years agoRevert r301880
George Burgess IV [Mon, 1 May 2017 23:54:41 +0000 (23:54 +0000)]
Revert r301880

This change caused buildbot failures, apparently because we're not
passing around types that InstSimplify is used to seeing. I'm not overly
familiar with InstSimplify, so I'm reverting this until I can figure out
what exactly is wrong.

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

7 years agoStylistic makeover of DWARFDebugLine before working on it. NFC
Paul Robinson [Mon, 1 May 2017 23:27:55 +0000 (23:27 +0000)]
Stylistic makeover of DWARFDebugLine before working on it. NFC

Rename parameters and locals to CamelCase, doxygenize the header, and
run clang-format on the whole thing.

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

7 years ago[CodeView] Write CodeView line information.
Zachary Turner [Mon, 1 May 2017 23:27:42 +0000 (23:27 +0000)]
[CodeView] Write CodeView line information.

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

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

7 years ago[AVR] Enable the frame pointer for all functions
Dylan McKay [Mon, 1 May 2017 23:16:59 +0000 (23:16 +0000)]
[AVR] Enable the frame pointer for all functions

This is a temporary measure while we figure out a way to get the frame
pointer working correctly.

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

7 years ago[InstSimplify] Handle selects of GEPs with 0 offset
George Burgess IV [Mon, 1 May 2017 23:12:08 +0000 (23:12 +0000)]
[InstSimplify] Handle selects of GEPs with 0 offset

In particular (since it wouldn't fit nicely in the summary):
(select (icmp eq V 0) P (getelementptr P V)) -> (getelementptr P V)

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

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

7 years ago[X86] Reduce code for setting operations actions by merging into loops across multipl...
Simon Pilgrim [Mon, 1 May 2017 23:09:01 +0000 (23:09 +0000)]
[X86] Reduce code for setting operations actions by merging into loops across multiple types/ops. NFCI.

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

7 years agoEmpty Space. NFC
Xin Tong [Mon, 1 May 2017 23:08:19 +0000 (23:08 +0000)]
Empty Space. NFC

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

7 years ago[IR] Garbage collect unused variants. NFCI.
Davide Italiano [Mon, 1 May 2017 23:04:33 +0000 (23:04 +0000)]
[IR] Garbage collect unused variants. NFCI.

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

7 years agoFix a pessimising move warning.
Peter Collingbourne [Mon, 1 May 2017 22:48:10 +0000 (22:48 +0000)]
Fix a pessimising move warning.

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

7 years agoMachineFrameInfo: Track whether MaxCallFrameSize is computed yet; NFC
Matthias Braun [Mon, 1 May 2017 22:32:25 +0000 (22:32 +0000)]
MachineFrameInfo: Track whether MaxCallFrameSize is computed yet; NFC

This tracks whether MaxCallFrameSize is computed yet. Ideally we would
assert and fail when the value is queried before it is computed, however
this fails various targets that need to be fixed first.

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

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

7 years agollvm-link: Add BitReader to deps corresponding to r301832.
NAKAMURA Takumi [Mon, 1 May 2017 22:31:43 +0000 (22:31 +0000)]
llvm-link: Add BitReader to deps corresponding to r301832.

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

7 years ago[NewGVN] Don't derive incorrect implications.
Davide Italiano [Mon, 1 May 2017 22:26:28 +0000 (22:26 +0000)]
[NewGVN] Don't derive incorrect implications.

In the testcase attached,  we believe %tmp1 implies %tmp4.
where:
  br i1 %tmp1, label %bb2, label %bb7
  br i1 %tmp4, label %bb5, label %bb7

because Wwhile looking at PredicateInfo stuffs we end up calling
isImpliedTrueByMatchingCmp() with the arguments backwards.

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

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

7 years ago[InstCombine] check one-use before applying DeMorgan nor/nand folds
Sanjay Patel [Mon, 1 May 2017 22:25:42 +0000 (22:25 +0000)]
[InstCombine] check one-use before applying DeMorgan nor/nand folds

If we have ~(~X & Y), it only makes sense to transform it to (X | ~Y) when we do not need
the intermediate (~X & Y) value. In that case, we would need an extra instruction to
generate ~Y + 'or' (as shown in the test changes).

It's ok if we have multiple uses of ~X or Y, however. In those cases, we may not reduce the
instruction count or critical path, but we might improve throughput because we can generate
~X and ~Y in parallel. Whether that actually makes perf sense or not for a target is something
we can't answer in IR.

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

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

7 years agoAdds initial llvm-dwarfdump --verify support with unit tests.
Greg Clayton [Mon, 1 May 2017 22:07:02 +0000 (22:07 +0000)]
Adds initial llvm-dwarfdump --verify support with unit tests.

lldb-dwarfdump gets a new "--verify" option that will verify a single file's DWARF debug info and will print out any errors that it finds. It will return an non-zero exit status if verification fails, and a zero exit status if verification succeeds. Adding the --quiet option will suppress any output the STDOUT or STDERR.

The first part of the verify does the following:

- verifies that all CU relative references (DW_FORM_ref1, DW_FORM_ref2, DW_FORM_ref4, DW_FORM_ref8, DW_FORM_ref_udata) have valid CU offsets
- verifies that all DW_FORM_ref_addr references have valid .debug_info offsets
- verifies that all DW_AT_ranges attributes have valid .debug_ranges offsets
- verifies that all DW_AT_stmt_list attributes have valid .debug_line offsets
- verifies that all DW_FORM_strp attributes have valid .debug_str offsets

Unit tests were added for each of the above cases.

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

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

7 years agoBitcode: Make the summary reader responsible for merging. NFCI.
Peter Collingbourne [Mon, 1 May 2017 22:04:36 +0000 (22:04 +0000)]
Bitcode: Make the summary reader responsible for merging. NFCI.

This is to prepare for an upcoming change which uses pointers instead of
GUIDs to represent references.

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

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

7 years ago[APInt] In operator!, handle single word case by comparing VAL to 0 directly and...
Craig Topper [Mon, 1 May 2017 21:56:05 +0000 (21:56 +0000)]
[APInt] In operator!, handle single word case by comparing VAL to 0 directly and handle multiword case by comparing countLeadingZerosSlowCase() to BitWidth.

We were using operator=(0) which implicitly calls countLeadingZeros but only to compare with 64 to determine if we can compare VAL or pVal[0] to uint64_t. By handling the multiword case with countLeadingZerosSlowCase==BitWidth we can prevent a load of pVal[0] from being inserted inline at each call site. This saves a little bit of code size.

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

7 years ago[AArch64] Move GISel accessor initialization from TargetMachine to Subtarget.
Quentin Colombet [Mon, 1 May 2017 21:53:19 +0000 (21:53 +0000)]
[AArch64] Move GISel accessor initialization from TargetMachine to Subtarget.

NFC

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

7 years ago[APInt] Fix copy/paste mistake in comment for isNullValue. NFC
Craig Topper [Mon, 1 May 2017 21:16:44 +0000 (21:16 +0000)]
[APInt] Fix copy/paste mistake in comment for isNullValue. NFC

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

7 years agoIPO: Add missing build dep.
Peter Collingbourne [Mon, 1 May 2017 20:57:20 +0000 (20:57 +0000)]
IPO: Add missing build dep.

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

7 years ago[X86][AVX] Rename LowerVectorBroadcast to lowerBuildVectorAsBroadcast. NFCI.
Simon Pilgrim [Mon, 1 May 2017 20:56:35 +0000 (20:56 +0000)]
[X86][AVX] Rename LowerVectorBroadcast to lowerBuildVectorAsBroadcast. NFCI.

Since the shuffle refactor, this is only used during BUILD_VECTOR lowering.

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

7 years agoObject: Remove ModuleSummaryIndexObjectFile class.
Peter Collingbourne [Mon, 1 May 2017 20:42:32 +0000 (20:42 +0000)]
Object: Remove ModuleSummaryIndexObjectFile class.

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

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

7 years ago[Hexagon] Replace CVI_VM_CUR_LD type with CVI_VM_LD
Krzysztof Parzyszek [Mon, 1 May 2017 20:16:35 +0000 (20:16 +0000)]
[Hexagon] Replace CVI_VM_CUR_LD type with CVI_VM_LD

A .cur instruction can be identified by checking isCVINew() && mayLoad().

Patch by Colin LeMahieu.

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

7 years ago[Hexagon] Improving error reporting for writing to read only registers
Krzysztof Parzyszek [Mon, 1 May 2017 20:10:41 +0000 (20:10 +0000)]
[Hexagon] Improving error reporting for writing to read only registers

Patch by Colin LeMahieu.

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

7 years ago[Hexagon] Give better error messages for solo instruction errors
Krzysztof Parzyszek [Mon, 1 May 2017 20:06:01 +0000 (20:06 +0000)]
[Hexagon] Give better error messages for solo instruction errors

Patch by Colin LeMahieu.

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

7 years ago[Hexagon] Improve shuffle error reporting
Krzysztof Parzyszek [Mon, 1 May 2017 19:41:43 +0000 (19:41 +0000)]
[Hexagon] Improve shuffle error reporting

Patch by Colin LeMahieu.

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

7 years agoX86: initialize a few subtarget variables.
Tim Northover [Mon, 1 May 2017 17:50:15 +0000 (17:50 +0000)]
X86: initialize a few subtarget variables.

Otherwise an indeterminate value gets read, causing a bunch of UBSan failures.

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

7 years agoUse a 2 bit pointer in ValueHandleBase::PrevPair; NFC
Sanjoy Das [Mon, 1 May 2017 17:36:12 +0000 (17:36 +0000)]
Use a 2 bit pointer in ValueHandleBase::PrevPair; NFC

This was an omission in r301813.  I had made the supporting changes to
make this happen, but I forgot to actually update the PrevPair
declaration.

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

7 years agoTake indirect branch into account as well when folding.
Xin Tong [Mon, 1 May 2017 17:15:37 +0000 (17:15 +0000)]
Take indirect branch into account as well when folding.

We may not be able to rewrite indirect branch target, but we also want to take it into
account when folding, i.e. if it and all its successor's predecessors go to the same
destination, we can fold, i.e. no need to thread.

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

7 years agoUse WeakVH instead of WeakTrackingVH in AliasSetTracker's UnkownInsts
Sanjoy Das [Mon, 1 May 2017 17:07:56 +0000 (17:07 +0000)]
Use WeakVH instead of WeakTrackingVH in AliasSetTracker's UnkownInsts

In cases where an instruction (a call site, say) is RAUW'ed with some
other value (this is possible via the `returned` attribute, for
instance), 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.

This relands r301426.

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

7 years agoAdd a new WeakVH value handle; NFC
Sanjoy Das [Mon, 1 May 2017 17:07:54 +0000 (17:07 +0000)]
Add a new WeakVH value handle; NFC

This relands r301425.

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

7 years agoRename WeakVH to WeakTrackingVH; NFC
Sanjoy Das [Mon, 1 May 2017 17:07:49 +0000 (17:07 +0000)]
Rename WeakVH to WeakTrackingVH; NFC

This relands r301424.

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

7 years ago[WebAssembly] Fix use of SDNodeFlags after API change in r301803
Derek Schuff [Mon, 1 May 2017 16:49:39 +0000 (16:49 +0000)]
[WebAssembly] Fix use of SDNodeFlags after API change in r301803

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

7 years ago[PDB/CodeView] Rename some classes.
Zachary Turner [Mon, 1 May 2017 16:46:39 +0000 (16:46 +0000)]
[PDB/CodeView] Rename some classes.

In preparation for introducing writing capabilities for each of
these classes, I would like to adopt a Foo / FooRef naming
convention, where Foo indicates that the class can manipulate and
serialize Foos, and FooRef indicates that it is an immutable view of
an existing Foo.  In other words, Foo is a writer and FooRef is a
reader.  This patch names some existing readers to conform to the
FooRef convention, while offering no functional change.

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

7 years agoEmulate TrackingVH using WeakVH
Sanjoy Das [Mon, 1 May 2017 16:28:58 +0000 (16:28 +0000)]
Emulate TrackingVH using WeakVH

Summary:
This frees up one slot in the HandleBaseKind enum, which I will use
later to add a new kind of value handle.  The size of the
HandleBaseKind enum is important because we store a HandleBaseKind in
the low two bits of a (in the worst case) 4 byte aligned pointer.

Reviewers: davide, chandlerc

Subscribers: mcrosier, llvm-commits

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

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

7 years ago[JumpThread] Add some assertions for expected ConstantInt/BlockAddress
Xin Tong [Mon, 1 May 2017 16:19:59 +0000 (16:19 +0000)]
[JumpThread] Add some assertions for expected ConstantInt/BlockAddress

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

7 years agoRemove unnecessary conditions as suggested by clang-tidy. NFC
Gabor Horvath [Mon, 1 May 2017 16:18:42 +0000 (16:18 +0000)]
Remove unnecessary conditions as suggested by clang-tidy. NFC

Patch by: Gergely Angeli!

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

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

7 years ago[SelectionDAG] Use known ones to provide a better bound for the known zeros for CTTZ...
Craig Topper [Mon, 1 May 2017 16:08:06 +0000 (16:08 +0000)]
[SelectionDAG] Use known ones to provide a better bound for the known zeros for CTTZ/CTLZ operations.

This is the SelectionDAG version of D32521. If know where at least one 1 is located in the input to these intrinsics we can place an upper bound on the number of bits needed to represent the count and thus increase the number of known zeros in the output.

I think we can also refine this further for CTTZ_UNDEF/CTLZ_UNDEF by assuming that the answer will never be BitWidth. I've left this out for now because it caused other test failures across multiple targets. Usually because of turning ADD into OR based on this new information.

I'll fix CTPOP in a future patch.

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

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

7 years ago[JumpThread] Do RAUW in case Cond folds to a constant in the CFG
Xin Tong [Mon, 1 May 2017 15:34:17 +0000 (15:34 +0000)]
[JumpThread] Do RAUW in case Cond folds to a constant in the CFG

Summary: [JumpThread] Do RAUW in case Cond folds to a constant in the CFG

Reviewers: sanjoy

Reviewed By: sanjoy

Subscribers: llvm-commits

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

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

7 years agoGeneralize the specialized flag-carrying SDNodes by moving flags into SDNode.
Amara Emerson [Mon, 1 May 2017 15:17:51 +0000 (15:17 +0000)]
Generalize the specialized flag-carrying SDNodes by moving flags into SDNode.

This removes BinaryWithFlagsSDNode, and flags are now all passed by value.

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

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

7 years ago[InstCombine] add multi-use variants for DeMorgan folds; NFC
Sanjay Patel [Mon, 1 May 2017 14:52:17 +0000 (14:52 +0000)]
[InstCombine] add multi-use variants for DeMorgan folds; NFC

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

7 years ago[InstCombine] use FileCheck and auto-generate checks; NFC
Sanjay Patel [Mon, 1 May 2017 14:20:30 +0000 (14:20 +0000)]
[InstCombine] use FileCheck and auto-generate checks; NFC

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

7 years ago[InstCombine] consolidate more DeMorgan tests; NFC
Sanjay Patel [Mon, 1 May 2017 14:10:59 +0000 (14:10 +0000)]
[InstCombine] consolidate more DeMorgan tests; NFC

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

7 years agoFix test for altmacro
Michael Zuckerman [Mon, 1 May 2017 14:00:54 +0000 (14:00 +0000)]
Fix test for altmacro

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

7 years ago[LLVM][inline-asm] Altmacro absolute expression '%' feature
Michael Zuckerman [Mon, 1 May 2017 13:20:12 +0000 (13:20 +0000)]
[LLVM][inline-asm] Altmacro absolute expression '%' feature

In this patch, I introduce a new alt macro feature.
This feature adds meaning for the % when using it as a prefix to the calling macro arguments.

In the altmacro mode, the percent sign '%' before an absolute expression convert the expression first to a string.
As described in the https://sourceware.org/binutils/docs-2.27/as/Altmacro.html
"Expression results as strings
You can write `%expr' to evaluate the expression expr and use the result as a string."

expression assumptions:

1. '%' can only evaluate an absolute expression.
2. Altmacro '%' must be the first character of the evaluated expression.
3. If no '%' is located before the expression, a regular module operation is expected.
4. The result of Absolute Expressions can be only integer.

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

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

7 years ago[AVR] Implement non-constant bit rotations
Dylan McKay [Mon, 1 May 2017 09:48:55 +0000 (09:48 +0000)]
[AVR] Implement non-constant bit rotations

This lets us do bit rotations of variable amount.

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

7 years ago[GlobalISel][X86] rename test file. NFC.
Igor Breger [Mon, 1 May 2017 08:11:02 +0000 (08:11 +0000)]
[GlobalISel][X86] rename test file. NFC.

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

7 years ago[GlobalISel][X86] Prioritize Tablegen-erated instruction selection. NFC
Igor Breger [Mon, 1 May 2017 07:06:08 +0000 (07:06 +0000)]
[GlobalISel][X86] Prioritize Tablegen-erated instruction selection. NFC

Summary:
Prioritizes Tablegen-erated instruction selection over C++ instruction selection.
Remove G_ADD/G_SUB C++ selection - implemented by Tablegen.

Reviewers: dsanders, zvi, guyblank

Reviewed By: guyblank

Subscribers: rovka, llvm-commits, kristof.beyls

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

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

7 years ago[X86] Add tests for opportunities to improve known bits for CTTZ and CTLZ.
Craig Topper [Mon, 1 May 2017 06:33:17 +0000 (06:33 +0000)]
[X86] Add tests for opportunities to improve known bits for CTTZ and CTLZ.

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

7 years ago[GlobalISel][X86] G_SEXT/G_ZEXT support.
Igor Breger [Mon, 1 May 2017 06:30:16 +0000 (06:30 +0000)]
[GlobalISel][X86] G_SEXT/G_ZEXT support.

Reviewers: zvi, guyblank

Reviewed By: zvi

Subscribers: rovka, llvm-commits, kristof.beyls

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

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

7 years ago[GlobalISel][X86] G_LOAD/G_STORE pointer selection support.
Igor Breger [Mon, 1 May 2017 06:08:32 +0000 (06:08 +0000)]
[GlobalISel][X86] G_LOAD/G_STORE pointer selection support.

Summary: [GlobalISel][X86] G_LOAD/G_STORE pointer selection support.

Reviewers: zvi, guyblank

Reviewed By: zvi, guyblank

Subscribers: dberris, rovka, kristof.beyls, llvm-commits

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

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

7 years ago[AVR] Fix a bug so that we now emit R_AVR_16 fixups with the correct offset
Dylan McKay [Sun, 30 Apr 2017 23:33:52 +0000 (23:33 +0000)]
[AVR] Fix a bug so that we now emit R_AVR_16 fixups with the correct offset

Before this, the LDS/STS instructions would have their opcodes
overwritten while linking.

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

7 years ago[DAGCombiner] shrink/widen a vselect to match its condition operand size (PR14657)
Sanjay Patel [Sun, 30 Apr 2017 22:44:51 +0000 (22:44 +0000)]
[DAGCombiner] shrink/widen a vselect to match its condition operand size (PR14657)

We discussed shrinking/widening of selects in IR in D26556, and I'll try to get back to that
patch eventually. But I'm hoping that this transform is less iffy in the DAG where we can check
legality of the select that we want to produce.

A few things to note:

1. We can't wait until after legalization and do this generically because (at least in the x86
   tests from PR14657), we'll have PACKSS and bitcasts in the pattern.
2. This might benefit more of the SSE codegen if we lifted the legal-or-custom requirement, but
   that requires a closer look to make sure we don't end up worse.
3. There's a 'vblendv' opportunity that we're missing that results in andn/and/or in some cases.
   That should be fixed next.
4. I'm assuming that AVX1 offers the worst of all worlds wrt uneven ISA support with multiple
   legal vector sizes, but if there are other targets like that, we should add more tests.
5. There's a codegen miracle in the multi-BB tests from PR14657 (the gcc auto-vectorization tests):
   despite IR that is terrible for the target, this patch allows us to generate the optimal loop
   code because something post-ISEL is hoisting the splat extends above the vector loops.

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

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

7 years agoRename isKnownNotFullPoison to programUndefinedIfPoison; NFC
Sanjoy Das [Sun, 30 Apr 2017 19:41:19 +0000 (19:41 +0000)]
Rename isKnownNotFullPoison to programUndefinedIfPoison; NFC

Summary:
programUndefinedIfPoison makes more sense, given what the function
does; and I'm about to add a function with a name similar to
isKnownNotFullPoison (so do the rename to avoid confusion).

Reviewers: broune, majnemer, bjarke.roune

Reviewed By: broune

Subscribers: mcrosier, llvm-commits, mzolotukhin

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

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

7 years agoDo not legalize large add with addc/adde, introduce addcarry and do it with uaddo...
Amaury Sechet [Sun, 30 Apr 2017 19:24:09 +0000 (19:24 +0000)]
Do not legalize large add with addc/adde, introduce addcarry and do it with uaddo/addcarry

Summary: As per discution on how to get better codegen an large int legalization, it became clear that using a glue for the carry was preventing several desirable optimizations. Passing the carry down as a value allow for more flexibility.

Reviewers: jyknight, nemanjai, mkuper, spatel, RKSimon, zvi, bkramer

Subscribers: igorb, llvm-commits

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

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

7 years ago[InstCombine] consolidate tests for DeMorgan folds; NFC
Sanjay Patel [Sun, 30 Apr 2017 18:57:12 +0000 (18:57 +0000)]
[InstCombine] consolidate tests for DeMorgan folds; NFC

I'm proposing to add tests and change behavior in D32665.

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

7 years ago[docs] Simplify some language for Error/cantFail in the programmer's manual.
Lang Hames [Sun, 30 Apr 2017 17:24:52 +0000 (17:24 +0000)]
[docs] Simplify some language for Error/cantFail in the programmer's manual.

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

7 years ago[MVT] fix typo in size of v1i8 MVT.
Guy Blank [Sun, 30 Apr 2017 12:47:57 +0000 (12:47 +0000)]
[MVT] fix typo in size of v1i8 MVT.

Ths issue was found in the review of another patch https://reviews.llvm.org/D32540

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

7 years ago[APInt] Remove support for wrapping from APInt::setBits.
Craig Topper [Sun, 30 Apr 2017 07:45:01 +0000 (07:45 +0000)]
[APInt] Remove support for wrapping from APInt::setBits.

This features isn't used anywhere in tree. It's existence seems to be preventing selfhost builds from inlining any of the setBits methods including setLowBits, setHighBits, and setBitsFrom. This is because the code makes the method recursive.

If anyone needs this feature in the future we could consider adding a setBitsWithWrap method. This way only the calls that need it would pay for it.

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

7 years ago[APInt] Replace calls to setBits with more specific calls to setBitsFrom and setLowBi...
Craig Topper [Sun, 30 Apr 2017 07:44:58 +0000 (07:44 +0000)]
[APInt] Replace calls to setBits with more specific calls to setBitsFrom and setLowBits where possible.

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

7 years ago[X86] Clear KnownBits instead of reconstructing it. NFC
Craig Topper [Sun, 30 Apr 2017 07:44:55 +0000 (07:44 +0000)]
[X86] Clear KnownBits instead of reconstructing it. NFC

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

7 years agoInstructionSimplify: Canonicalize shuffle operands. NFC-ish.
Zvi Rackover [Sun, 30 Apr 2017 06:25:04 +0000 (06:25 +0000)]
InstructionSimplify: Canonicalize shuffle operands. NFC-ish.

Summary:
 Apply canonicalization rules:
    1. Input vectors with no elements selected from can be replaced with undef.
    2. If only one input vector is constant it shall be the second one.

This allows constant-folding to cover more ad-hoc simplifications that
were in place and avoid duplication for RHS and LHS checks.

There are more rules we may want to add in the future when we see a
justification. e.g. mask elements that select undef elements can be
replaced with undef.

Reviewers: spatel, RKSimon, andreadb, davide

Reviewed By: spatel, RKSimon

Subscribers: llvm-commits

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

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

7 years agoInstructionSimplify: One getShuffleMask() replacing multiple getMaskValue(). NFC.
Zvi Rackover [Sun, 30 Apr 2017 06:10:54 +0000 (06:10 +0000)]
InstructionSimplify: One getShuffleMask() replacing multiple getMaskValue(). NFC.

Summary: This is a preparatory step for D32338.

Reviewers: RKSimon, spatel

Reviewed By: RKSimon, spatel

Subscribers: spatel, llvm-commits

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

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

7 years agoInstructionSimplify: Simplify a shuffle with a undef mask to undef
Zvi Rackover [Sun, 30 Apr 2017 06:06:26 +0000 (06:06 +0000)]
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

7 years ago[mips] Emit R_MICROMIPS_TLS_GOTTPREL relocation for %gottprel in case of microMIPS
Simon Atanasyan [Sun, 30 Apr 2017 04:27:23 +0000 (04:27 +0000)]
[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

7 years ago[ConstantRange] Fix a couple cases where we were possibly throwing away an APInt...
Craig Topper [Sun, 30 Apr 2017 00:44:05 +0000 (00:44 +0000)]
[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

7 years agoInclude <cstdio> in PrettyStackTrace.cpp, since it uses vsnprintf(3).
Dimitry Andric [Sat, 29 Apr 2017 23:45:30 +0000 (23:45 +0000)]
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

7 years ago[globalisel][tablegen] Fix the test after silencing the unused variable warning in...
Daniel Sanders [Sat, 29 Apr 2017 19:46:27 +0000 (19:46 +0000)]
[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

7 years ago[globalisel][tablegen] Silence unused variable warning.
Daniel Sanders [Sat, 29 Apr 2017 19:10:19 +0000 (19:10 +0000)]
[globalisel][tablegen] Silence unused variable warning.

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