OSDN Git Service

android-x86/external-llvm.git
7 years ago[AMDGPU] Add INDIRECT_BASE_ADDR to R600_Reg32 class (PR33045)
Simon Pilgrim [Tue, 23 May 2017 21:27:15 +0000 (21:27 +0000)]
[AMDGPU] Add INDIRECT_BASE_ADDR to R600_Reg32 class (PR33045)

This fixes 17 of the 41 -verify-machineinstrs test failures identified in PR33045

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

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

7 years agoAsmPrinter: mark the beginning and the end of a function in verbose mode
Francis Visoiu Mistrih [Tue, 23 May 2017 21:22:16 +0000 (21:22 +0000)]
AsmPrinter: mark the beginning and the end of a function in verbose mode

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

7 years agomerge-request.sh: Use https url for bugzilla
Tom Stellard [Tue, 23 May 2017 20:35:38 +0000 (20:35 +0000)]
merge-request.sh: Use https url for bugzilla

With the http url, the script fails with:

Connection lost/failed: 411 Client Error: Length Required

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

7 years agoAMDGPU/SI: Move the local memory usage related checking after calling convention...
Changpeng Fang [Tue, 23 May 2017 20:25:41 +0000 (20:25 +0000)]
AMDGPU/SI: Move the local memory usage related checking after calling convention checking in PromoteAlloca

Summary:
  Promoting Alloca to Vector and Promoting Alloca to LDS are two independent handling of Alloca and should not affect each other.
As a result, we should not give up promoting to vector if there is not enough LDS. This patch factors out the local memory usage
related checking out and replace it after the calling convention checking.

Reviewer:
  arsenm

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

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

7 years agoFix unused variable warnings after r303678
Daniel Sanders [Tue, 23 May 2017 20:02:48 +0000 (20:02 +0000)]
Fix unused variable warnings after r303678

This should fix lld-x86_64-darwin13

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

7 years ago[AArch64][Falkor] Refine sched details for LSLfast/ASRfast.
Geoff Berry [Tue, 23 May 2017 19:57:45 +0000 (19:57 +0000)]
[AArch64][Falkor] Refine sched details for LSLfast/ASRfast.

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

7 years ago[AMDGPU] Combine and (srl) into shl (bfe)
Stanislav Mekhanoshin [Tue, 23 May 2017 19:54:48 +0000 (19:54 +0000)]
[AMDGPU] Combine and (srl) into shl (bfe)

Perform DAG combine:
and (srl x, c), mask => shl (bfe x, nb + c, mask >> nb), nb
Where nb is a number of trailing zeroes in mask.

It replaces two instructions with two and BFE is generally a more
expensive one. However this is only done if we are selecting a byte
or word at an aligned boundary which results in a proper SDWA
operand pattern. It is only done if SDWA is supported.

TODO: improve SDWA pass to actually convert this pattern. It is not
done now because we have an immediate in the instruction, which has
be moved into a VGPR.

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

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

7 years ago[AArch64][Falkor] Fix sched details for FMOV of WZR/XZR.
Geoff Berry [Tue, 23 May 2017 19:54:28 +0000 (19:54 +0000)]
[AArch64][Falkor] Fix sched details for FMOV of WZR/XZR.

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

7 years ago[ARM] Temporarily disable globals promotion to constant pools to prevent miscompilation
Oleg Ranevskyy [Tue, 23 May 2017 19:38:37 +0000 (19:38 +0000)]
[ARM] Temporarily disable globals promotion to constant pools to prevent miscompilation

Summary:
A temporary workaround for PR32780 - rematerialized instructions accessing the same promoted global through different constant pool entries.

The patch turns off the globals promotion optimization leaving all its code in place, so that it can be easily turned on once PR32780 is fixed.

Since this is a miscompilation issue causing generation of misbehaving code, and the problem is very subtle, the patch might be valuable enough to get into 4.0.1.

Reviewers: efriedma, jmolloy

Reviewed By: efriedma

Subscribers: aemerson, javed.absar, llvm-commits, rengolin, asl, tstellar

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

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

7 years ago[globalisel][tablegen] Add support for (set $dst, 1) and test X86's OptForSize predicate.
Daniel Sanders [Tue, 23 May 2017 19:33:16 +0000 (19:33 +0000)]
[globalisel][tablegen] Add support for (set $dst, 1) and test X86's OptForSize predicate.

Summary:
It's rare but a small number of patterns use IntInit's at the root of the match.
On X86, one such rule is enabled by the OptForSize predicate and causes the
compiler to use the smaller:
%0 = MOV32r1
instead of the usual:
%0 = MOV32ri 1

This patch adds support for matching IntInit's at the root and uses this as a
test case for the optsize attribute that was implemented in r301750

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

Reviewed By: qcolombet

Subscribers: igorb, llvm-commits

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

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

7 years ago[CodeView] Eliminate redundant hashes and allocations.
Zachary Turner [Tue, 23 May 2017 18:56:23 +0000 (18:56 +0000)]
[CodeView] Eliminate redundant hashes and allocations.

When writing field list records, we would construct a temporary
type serializer that shared a bump ptr allocator with the rest
of the application, so anything allocated from here would live
forever.  Furthermore, this temporary serializer had all the
properties of a full blown serializer including record hashing
and de-duplication.

These features are required when you're merging multiple type
streams into each other, because different streams may contain
identical records, but records from the same type stream will
never collide with each other.  So all of this hashing was
unnecessary.

To solve this, two fixes are made:

1) The temporary serializer keeps its own bump ptr allocator
instead of sharing a global one.  When it's finished, all of
its memory is freed.

2) Instead of using the same temporary serializer for the life
of an entire type stream, we use it only for the life of a single
field list record and delete it when the field list record is
completed.  This way the hash table will not grow as other
records from the same type stream get inserted.  Further improvements
could eliminate hashing entirely from this codepath.

This reduces the link time by 85% in my test, from 1 minute to 9
seconds.

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

7 years ago[DAG] Add AddressSpace parameter to canMergeStoresTo. NFC.
Nirav Dave [Tue, 23 May 2017 18:53:02 +0000 (18:53 +0000)]
[DAG] Add AddressSpace parameter to canMergeStoresTo. NFC.

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

7 years ago[InstSimplify] Add more tests for undef inputs and multiplying by 0 for the add/sub...
Craig Topper [Tue, 23 May 2017 18:42:58 +0000 (18:42 +0000)]
[InstSimplify] Add more tests for undef inputs and multiplying by 0 for the add/sub/mul with overflow intrinsics. NFC

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

7 years ago[GSoC] Shell autocompletion for clang
Yuka Takahashi [Tue, 23 May 2017 18:39:08 +0000 (18:39 +0000)]
[GSoC] Shell autocompletion for clang

Summary:
This is a first patch for GSoC project, bash-completion for clang.
To use this on bash, please run `source clang/utils/bash-autocomplete.sh`.
bash-autocomplete.sh is code for bash-completion.

Simple flag completion and path completion is available in this patch.

Reviewers: teemperor, v.g.vassilev, ruiu, Bigcheese, efriedma

Subscribers: llvm-commits

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

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

7 years agoFix DIEHash refactoring that dropped the DW_AT_name from the hash
David Blaikie [Tue, 23 May 2017 18:36:07 +0000 (18:36 +0000)]
Fix DIEHash refactoring that dropped the DW_AT_name from the hash

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

7 years ago[DAG] Add canMergeStoresTo predicate checks. NFCI.
Nirav Dave [Tue, 23 May 2017 18:33:09 +0000 (18:33 +0000)]
[DAG] Add canMergeStoresTo predicate checks. NFCI.

Propagate canMergeStoresTo checks to missing cases in StoreMerge.

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

7 years agoSpeculative build fix for non-Windows
Reid Kleckner [Tue, 23 May 2017 18:28:13 +0000 (18:28 +0000)]
Speculative build fix for non-Windows

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

7 years agoRefactor DWARF hashing to use a .def file to avoid repetition
David Blaikie [Tue, 23 May 2017 18:27:09 +0000 (18:27 +0000)]
Refactor DWARF hashing to use a .def file to avoid repetition

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

7 years ago[PDB] Hash types up front when merging types instead of using StringMap
Reid Kleckner [Tue, 23 May 2017 18:23:59 +0000 (18:23 +0000)]
[PDB] Hash types up front when merging types instead of using StringMap

Summary:
First, StringMap uses llvm::HashString, which is only good for short
identifiers and really bad for large blobs of binary data like type
records. Moving to `DenseMap<StringRef, TypeIndex>` with some tricks for
memory allocation fixes that.

Unfortunately, that didn't buy very much performance. Profiling showed
that we spend a long time during DenseMap growth rehashing existing
entries. Also, in general, DenseMap is faster when the keys are small.
This change takes that to the logical conclusion by introducing a small
wrapper value type around a pointer to key data. The key data contains a
precomputed hash, the original record data (pointer and size), and the
type index, which is the "value" of our original map.

This reduces the time to produce llvm-as.exe and llvm-as.pdb from ~15s
on my machine to 3.5s, which is about a 4x improvement.

Reviewers: zturner, inglorion, ruiu

Subscribers: llvm-commits

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

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

7 years ago[InstSimplify] auto-generate test checks. NFC
Craig Topper [Tue, 23 May 2017 17:57:36 +0000 (17:57 +0000)]
[InstSimplify] auto-generate test checks. NFC

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

7 years ago[InstCombine] auto-generate test checks; NFC
Sanjay Patel [Tue, 23 May 2017 17:51:22 +0000 (17:51 +0000)]
[InstCombine] auto-generate test checks; NFC

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

7 years ago[InstCombine] allow icmp-xor folds for vectors (PR33138)
Sanjay Patel [Tue, 23 May 2017 17:29:58 +0000 (17:29 +0000)]
[InstCombine] allow icmp-xor folds for vectors (PR33138)

This fixes the first part of:
https://bugs.llvm.org/show_bug.cgi?id=33138

More work is needed for the bitcasted variant.

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

7 years ago[InstCombine] Use update_test_checks to regenerate the ctpop test. NFC
Craig Topper [Tue, 23 May 2017 17:20:18 +0000 (17:20 +0000)]
[InstCombine] Use update_test_checks to regenerate the ctpop test. NFC

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

7 years agoAMDGPU: Fold CI-specific complex SMRD patterns into existing complex patterns
Marek Olsak [Tue, 23 May 2017 17:14:34 +0000 (17:14 +0000)]
AMDGPU: Fold CI-specific complex SMRD patterns into existing complex patterns

This is just a cleanup. Also, it adds checking that ByteCount is aligned to 4.

Reviewers: arsenm, nhaehnle, tstellarAMD

Subscribers: kzhuravl, wdng, yaxunl, tony-tye

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

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

7 years agoCommit AttributeList change that was supposed to be part of r303654
Reid Kleckner [Tue, 23 May 2017 17:03:28 +0000 (17:03 +0000)]
Commit AttributeList change that was supposed to be part of r303654

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

7 years ago[RuntimeDyld, PowerPC] Fix regression from r303637
Ulrich Weigand [Tue, 23 May 2017 17:03:23 +0000 (17:03 +0000)]
[RuntimeDyld, PowerPC] Fix regression from r303637

Actually, to identify external symbols, we need to check for
*either* non-null Value.SymbolName *or* a SymType of
Symbol::ST_Unknown.

The former may happen for symbols not known to the JIT at all
(e.g. defined in a native library), while the latter happens
for symbols known to the JIT, but defined in a different module.

Fixed several regressions on big-endian ppc64.

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

7 years ago[IR] Switch AttributeList to use an array for O(1) access
Reid Kleckner [Tue, 23 May 2017 17:01:48 +0000 (17:01 +0000)]
[IR] Switch AttributeList to use an array for O(1) access

Summary:
Before this change, AttributeLists stored a pair of index and
AttributeSet. This is memory efficient if most arguments do not have
attributes. However, it requires doing a search over the pairs to test
an argument or function attribute. Profiling shows that this loop was
0.76% of the time in 'opt -O2' of sqlite3.c, because LLVM constantly
tests values for nullability.

This was worth about 2.5% of mid-level optimization cycles on the
sqlite3 amalgamation. Here are the full perf results:
https://reviews.llvm.org/P7995

Here are just the before and after cycle counts:
```
$ perf stat -r 5 ./opt_before -O2 sqlite3.bc -o /dev/null
    13,274,181,184      cycles                    #    3.047 GHz                      ( +-  0.28% )
$ perf stat -r 5 ./opt_after -O2 sqlite3.bc -o /dev/null
    12,906,927,263      cycles                    #    3.043 GHz                      ( +-  0.51% )
```

This patch *does not* change the indices used to query attributes, as
requested by reviewers. Tracking whether an index is usable for array
indexing is a huge pain that affects many of the internal APIs, so it
would be good to come back later and do a cleanup to remove this
internal adjustment.

Reviewers: pete, chandlerc

Subscribers: javed.absar, llvm-commits

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

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

7 years ago[InstCombine] add icmp-xor tests to show vector neglect; NFC
Sanjay Patel [Tue, 23 May 2017 16:53:05 +0000 (16:53 +0000)]
[InstCombine] add icmp-xor tests to show vector neglect; NFC

Also, rename the tests and the file, add comments, and add more tests
because there are no existing tests for some of these folds.

These patterns are particularly important for crippled vector ISAs that
have limited compare predicates (PR33138).

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

7 years ago[AMDGPU] Convert shl (add) into add (shl)
Stanislav Mekhanoshin [Tue, 23 May 2017 15:59:58 +0000 (15:59 +0000)]
[AMDGPU] Convert shl (add) into add (shl)

shl (or|add x, c2), c1 => or|add (shl x, c1), (c2 << c1)
This allows to fold a constant into an address in some cases as
well as to eliminate second shift if the expression is used as
an address and second shift is a result of a GEP.

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

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

7 years agoRevert "Make TypeSerializer's StringMap use the same allocator."
Zachary Turner [Tue, 23 May 2017 15:50:37 +0000 (15:50 +0000)]
Revert "Make TypeSerializer's StringMap use the same allocator."

This reverts commit e34ccb7b57da25cc89ded913d8638a2906d1110a.

This is causing failures on the ASAN bots.

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

7 years ago[mips] Remove unused class field. NFC
Simon Atanasyan [Tue, 23 May 2017 15:00:30 +0000 (15:00 +0000)]
[mips] Remove unused class field. NFC

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

7 years ago[mips] Change type of MipsSubtarget ctor arguments s/std::string/StringRef/. NFC
Simon Atanasyan [Tue, 23 May 2017 15:00:26 +0000 (15:00 +0000)]
[mips] Change type of MipsSubtarget ctor arguments s/std::string/StringRef/. NFC

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

7 years ago[RuntimeDyld, PowerPC] Fix check for external symbols when detecting reloction overflow
Ulrich Weigand [Tue, 23 May 2017 14:51:18 +0000 (14:51 +0000)]
[RuntimeDyld, PowerPC] Fix check for external symbols when detecting reloction overflow

The PowerPC part of processRelocationRef currently assumes that external
symbols can be identified by checking for SymType == SymbolRef::ST_Unknown.
This is actually incorrect in some cases, causing relocation overflows to
be mis-detected. The correct check is to test whether Value.SymbolName
is null.

Includes test case. Note that it is a bit tricky to replicate the exact
condition that triggers the bug in a test case. The one included here
seems to fail reliably (before the fix) across different operating
system versions on Power, but it still makes a few assumptions (called
out in the test case comments).

Also add ppc64le platform name to the supported list in the lit.local.cfg
files for the MCJIT and OrcMCJIT directories, since those tests were
currently not run at all.

Fixes PR32650.

Reviewer: hfinkel

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

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

7 years ago[JumpThreading] Safely replace uses of condition
Anna Thomas [Tue, 23 May 2017 13:36:25 +0000 (13:36 +0000)]
[JumpThreading] Safely replace uses of condition

This patch builds over https://reviews.llvm.org/rL303349 and replaces
the use of the condition only if it is safe to do so.

We should not blindly RAUW the condition if experimental.guard or assume
is a use of that
condition. This is because LVI may have used the guard/assume to
identify the
value of the condition, and RUAWing will fold the guard/assume and uses
before the guards/assumes.

Reviewers: sanjoy, reames, trentxintong, mkazantsev

Reviewed by: sanjoy, reames

Subscribers: llvm-commits

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

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

7 years ago[RuntimeDyld, PowerPC] Fix relocation detection overflow
Ulrich Weigand [Tue, 23 May 2017 12:43:57 +0000 (12:43 +0000)]
[RuntimeDyld, PowerPC] Fix relocation detection overflow

Code in RuntimeDyldELF currently uses 32-bit temporaries to detect
whether a PPC64 relocation target is out of range. This is incorrect,
and can mis-detect overflow where the distance between relocation site
and target is close to a multiple of 4GB. Fixed by using 64-bit
temporaries.

Noticed while debugging PR32650.

Reviewer: hfinkel

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

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

7 years ago[AMDGPU] SDWA: Add assembler support for GFX9
Sam Kolton [Tue, 23 May 2017 10:08:55 +0000 (10:08 +0000)]
[AMDGPU] SDWA: Add assembler support for GFX9

Summary:
Added separate pseudo and real instruction for GFX9 SDWA instructions.
Currently supports only in assembler.
Depends D32493

Reviewers: vpykhtin, artem.tamazov

Subscribers: arsenm, kzhuravl, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye

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

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

7 years ago[AArch64] Make instruction fusion more aggressive.
Florian Hahn [Tue, 23 May 2017 09:33:34 +0000 (09:33 +0000)]
[AArch64] Make instruction fusion more aggressive.

Summary:
This patch makes instruction fusion more aggressive by
* adding artificial edges between the successors of FirstSU and
  SecondSU, similar to BaseMemOpClusterMutation::clusterNeighboringMemOps.
* updating PostGenericScheduler::tryCandidate to keep clusters together,
   similar to GenericScheduler::tryCandidate.

This change increases the number of AES instruction pairs generated on
 Cortex-A57 and Cortex-A72. This doesn't change code at all in
 most benchmarks or general code, but we've seen improvement on kernels
 using AESE/AESMC and AESD/AESIMC.

Reviewers: evandro, kristof.beyls, t.p.northover, silviu.baranga, atrick, rengolin, MatzeB

Reviewed By: evandro

Subscribers: aemerson, rengolin, MatzeB, javed.absar, llvm-commits

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

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

7 years ago[GlobalISel][X86] G_LOAD/G_STORE vec256/512 support
Igor Breger [Tue, 23 May 2017 08:23:51 +0000 (08:23 +0000)]
[GlobalISel][X86] G_LOAD/G_STORE vec256/512 support

Summary: mark G_LOAD/G_STORE vec256/512 legal for AVX/AVX512. Implement instruction selection.

Reviewers: zvi, guyblank

Reviewed By: zvi

Subscribers: rovka, llvm-commits, kristof.beyls

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

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

7 years ago[KnownBits] Use !hasConflict() in asserts in place of Zero & One == 0 or similar...
Craig Topper [Tue, 23 May 2017 07:18:37 +0000 (07:18 +0000)]
[KnownBits] Use !hasConflict() in asserts in place of Zero & One == 0 or similar. NFC

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

7 years ago[LV] Report multiple reasons for not vectorizing under allowExtraAnalysis
Ayal Zaks [Tue, 23 May 2017 07:08:02 +0000 (07:08 +0000)]
[LV] Report multiple reasons for not vectorizing under allowExtraAnalysis

The default behavior of -Rpass-analysis=loop-vectorizer is to report only the
first reason encountered for not vectorizing, if one is found, at which time the
vectorizer aborts its handling of the loop. This patch allows multiple reasons
for not vectorizing to be identified and reported, at the potential expense of
additional compile-time, under allowExtraAnalysis which can currently be turned
on by Clang's -fsave-optimization-record and opt's -pass-remarks-missed.

Removed from LoopVectorizationLegality::canVectorize() the redundant checking
and reporting if we CantComputeNumberOfIterations, as LAI::canAnalyzeLoop() also
does that. This redundancy is caught by a lit test once multiple reasons are
reported.

Patch initially developed by Dror Barak.

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

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

7 years agolibDebugInfo: Support symbolizing using DWP files
David Blaikie [Tue, 23 May 2017 06:48:53 +0000 (06:48 +0000)]
libDebugInfo: Support symbolizing using DWP files

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

7 years ago[AArch64] Fix PRR33100.
Akira Hatanaka [Tue, 23 May 2017 06:08:37 +0000 (06:08 +0000)]
[AArch64] Fix PRR33100.

This commit fixes a bug introduced in r301019 where optimizeLogicalImm
would replace a logical node's immediate operand that was CSE'd and
was also an operand of another node.

This commit fixes the bug by replacing the logical node instead of its
immediate operand.

rdar://problem/32295276

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

7 years agoUpdate expected result for or-branch.ll . NFC
Amaury Sechet [Tue, 23 May 2017 05:42:54 +0000 (05:42 +0000)]
Update expected result for or-branch.ll . NFC

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

7 years agoCosmetic. Added braces to address gcc warning: suggest explicit braces to avoid ambig...
Galina Kistanova [Tue, 23 May 2017 05:00:10 +0000 (05:00 +0000)]
Cosmetic. Added braces to address gcc warning: suggest explicit braces to avoid ambiguous 'else' [-Wdangling-else].

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

7 years agoTypeStreamMerger.h: Fix a \param in r303577. [-Wdocumentation]
NAKAMURA Takumi [Tue, 23 May 2017 04:49:24 +0000 (04:49 +0000)]
TypeStreamMerger.h: Fix a \param in r303577. [-Wdocumentation]

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

7 years agoAdded LLVM_FALLTHROUGH to address gcc warning: this statement may fall through.
Galina Kistanova [Tue, 23 May 2017 01:20:52 +0000 (01:20 +0000)]
Added LLVM_FALLTHROUGH to address gcc warning: this statement may fall through.

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

7 years agoAdded LLVM_FALLTHROUGH to address gcc warning: this statement may fall through.
Galina Kistanova [Tue, 23 May 2017 01:07:19 +0000 (01:07 +0000)]
Added LLVM_FALLTHROUGH to address gcc warning: this statement may fall through.

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

7 years agoFIX: Remove debugging assert left in previous commit
David Blaikie [Tue, 23 May 2017 00:31:24 +0000 (00:31 +0000)]
FIX: Remove debugging assert left in previous commit

Sorry for the bot noise.

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

7 years agolibDebugInfo: Avoid independently parsing the same .dwo file for two separate CUs...
David Blaikie [Tue, 23 May 2017 00:30:42 +0000 (00:30 +0000)]
libDebugInfo: Avoid independently parsing the same .dwo file for two separate CUs residing there

NFC, just an optimization. Will be building on this for DWP support
shortly.

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

7 years agoSupport for taking the max of module flags when linking, use for PIE/PIC
Teresa Johnson [Tue, 23 May 2017 00:08:00 +0000 (00:08 +0000)]
Support for taking the max of module flags when linking, use for PIE/PIC

Summary:
Add Max ModFlagBehavior, which can be used to take the max of two
module flag values when merging modules. Use it for the PIE and PIC
levels.

This avoids an error when we try to import from a module built -fpic
into a module built -fPIC, for example. For both PIE and PIC levels,
this will be legal, since the code generation gets more conservative
as the level is increased. Therefore we can take the max instead of
somehow trying to block importing between modules compiled with
different levels.

Reviewers: tmsriram, pcc

Subscribers: llvm-commits

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

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

7 years ago[InstSimplify] Fix the indentation throughout the interface header file.
Craig Topper [Mon, 22 May 2017 23:50:40 +0000 (23:50 +0000)]
[InstSimplify] Fix the indentation throughout the interface header file.

The forward declarations and the SimplifyQuery class at the beginning of the namespace weren't indented. But the closing brace for SimplifyQuery and everything after it were indented.

This commit makes the whole file consistent to no identation per coding standards. The signature of every function in this file changed a few weeks ago so this isn't a big disturbance to the revision history.

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

7 years ago[NewPM] Fix an innocent but silly typo. Reported by Craig Topper.
Davide Italiano [Mon, 22 May 2017 23:47:11 +0000 (23:47 +0000)]
[NewPM] Fix an innocent but silly typo. Reported by Craig Topper.

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

7 years ago[NewPM] Add a temporary cl::opt() to test NewGVN.
Davide Italiano [Mon, 22 May 2017 23:41:40 +0000 (23:41 +0000)]
[NewPM] Add a temporary cl::opt() to test NewGVN.

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

7 years agoAdded LLVM_FALLTHROUGH to address gcc warning: this statement may fall through.
Galina Kistanova [Mon, 22 May 2017 22:46:31 +0000 (22:46 +0000)]
Added LLVM_FALLTHROUGH to address gcc warning: this statement may fall through.

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

7 years ago[CodeGen] Fix uninitialized variables exposed by r303084
Vitaly Buka [Mon, 22 May 2017 21:33:54 +0000 (21:33 +0000)]
[CodeGen] Fix uninitialized variables exposed by r303084

All other calls of analyzeBranch reset PredTBB and PredFBB, so I assume it's
expected behavior.

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

7 years agoInstructionSimplify: don't speculate about Constants changing.
Tim Northover [Mon, 22 May 2017 21:28:08 +0000 (21:28 +0000)]
InstructionSimplify: don't speculate about Constants changing.

When presented with an icmp/select pair, we can end up asking what would happen
if we replaced one constant with another in an instruction. This is a mistake,
while non-constant Values could become a constant, constants cannot change and
trying to do so can lead to completely invalid IR (a GEP referencing a
non-existant field in the original case).

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

7 years agoInfer relocation model from module flags in relocatable LTO link.
Evgeniy Stepanov [Mon, 22 May 2017 21:11:35 +0000 (21:11 +0000)]
Infer relocation model from module flags in relocatable LTO link.

Fix for PR33096.

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

7 years agoImplement various flavors of type merging.
Zachary Turner [Mon, 22 May 2017 21:07:43 +0000 (21:07 +0000)]
Implement various flavors of type merging.

Previous algotirhm assumed that types and ids are in a single
unified stream.  For inputs that come from object files, this
is the case.  But if the input is already a PDB, or is the result
of a previous merge, then the types and ids will already have
been split up, in which case we need an algorithm that can
accept operate on independent streams of types and ids that
refer across stream boundaries to each other.

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

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

7 years agoMake TypeSerializer's StringMap use the same allocator.
Zachary Turner [Mon, 22 May 2017 21:07:14 +0000 (21:07 +0000)]
Make TypeSerializer's StringMap use the same allocator.

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

7 years agoDon't generate line&scope debug info for meta-instructions.
Adrian Prantl [Mon, 22 May 2017 20:47:09 +0000 (20:47 +0000)]
Don't generate line&scope debug info for meta-instructions.

MachineInstructions that don't generate any code (such as
IMPLICIT_DEFs) should not generate any debug info either.

Fixes PR33107.

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

This reapplies r303566 without any modifications. The stage2 build
failures persisted even after reverting this patch, and looking back
through history, it looks like these tests are flaky.

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

7 years agoFix update VP metadata after inlining for instrumentation PGO
Teresa Johnson [Mon, 22 May 2017 20:28:18 +0000 (20:28 +0000)]
Fix update VP metadata after inlining for instrumentation PGO

Summary:
With instrumentation profiling, when updating the VP metadata after
an inline, VP metadata on the inlined copy was inadvertantly having
all counts zeroed out. This was causing indirect calls from code inlined
during the call step to be marked as cold in the ThinLTO summaries and
not imported.

The CallerBFI needs to be passed down so that the CallSiteCount can be
computed from the profile summary info. With Sample PGO this was working
since the count is extracted from the branch weight metadata on the
call being inlined (even before we stopped looking at metadata for
non-sample PGO in r302844 this largely wasn't working for instrumentation
PGO since only promoted indirect calls would be getting inlined and have
the metadata).

Added an instrumentation PGO test and renamed the sample PGO test.

Reviewers: danielcdh, eraman

Subscribers: mehdi_amini, llvm-commits

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

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

7 years ago[Hexagon] Fix definitions of vector predicate loads and stores
Krzysztof Parzyszek [Mon, 22 May 2017 20:02:53 +0000 (20:02 +0000)]
[Hexagon] Fix definitions of vector predicate loads and stores

This fixes http://llvm.org/PR33048.

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

7 years ago[DataLayout] Add llvm_unreachable to the default of a nested switch statement that...
Craig Topper [Mon, 22 May 2017 19:28:36 +0000 (19:28 +0000)]
[DataLayout] Add llvm_unreachable to the default of a nested switch statement that covers all values given to it by the outer switch. NFC

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

7 years agoRevert "Don't generate line&scope debug info for meta-instructions."
Adrian Prantl [Mon, 22 May 2017 18:50:12 +0000 (18:50 +0000)]
Revert "Don't generate line&scope debug info for meta-instructions."

This reverts commit r303566 while investigating a stage2 buildbot failure.

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

7 years ago[AMDGPU] Narrow lshl from 64 to 32 bit if possible
Stanislav Mekhanoshin [Mon, 22 May 2017 16:58:10 +0000 (16:58 +0000)]
[AMDGPU] Narrow lshl from 64 to 32 bit if possible

Turn expensive 64 bit shift into 32 bit if shift does not overflow int:
shl (ext x) => zext (shl x)

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

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

7 years ago[PartialInlining] Add internal options to enable partial inlining in pass pipeline...
Xinliang David Li [Mon, 22 May 2017 16:41:57 +0000 (16:41 +0000)]
[PartialInlining] Add internal options to enable partial inlining in pass pipeline (off by default)

1. Legacy: -mllvm -enable-partial-inlining
2. New:  -mllvm -enable-npm-partial-inlining -fexperimental-new-pass-manager

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

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

7 years agoDon't generate line&scope debug info for meta-instructions.
Adrian Prantl [Mon, 22 May 2017 16:21:02 +0000 (16:21 +0000)]
Don't generate line&scope debug info for meta-instructions.

MachineInstructions that don't generate any code (such as
IMPLICIT_DEFs) should not generate any debug info either.

Fixes PR33107.

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

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

7 years ago[DAG] Rework store merge to loop on load candidates. NFCI.
Nirav Dave [Mon, 22 May 2017 15:33:47 +0000 (15:33 +0000)]
[DAG] Rework store merge to loop on load candidates. NFCI.

Continue to consider remaining candidate merges until all possible
merges have been considered.

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

7 years ago[X86] Remove target feature info from mul-i256.ll test. NFC.
Nirav Dave [Mon, 22 May 2017 15:04:08 +0000 (15:04 +0000)]
[X86] Remove target feature info from mul-i256.ll test. NFC.

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

7 years ago[AMDGPU] Fix incorrect register usage tracking in GCNUpwardTracker
Valery Pykhtin [Mon, 22 May 2017 13:09:40 +0000 (13:09 +0000)]
[AMDGPU] Fix incorrect register usage tracking in GCNUpwardTracker

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

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

7 years ago[mips] Support micromips attribute passed by front-end
Simon Atanasyan [Mon, 22 May 2017 12:47:41 +0000 (12:47 +0000)]
[mips] Support micromips attribute passed by front-end

This patch adds handling of the `micromips` and `nomicromips` attributes
passed by front-end. The patch depends on D33363.

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

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

7 years ago[LoopPredication] NFC. Add extra debug output in case we fail to parse the range...
Artur Pilipenko [Mon, 22 May 2017 12:06:57 +0000 (12:06 +0000)]
[LoopPredication] NFC. Add extra debug output in case we fail to parse the range check

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

7 years ago[LoopPredication] NFC. Move a nested struct declaration before the fields, clang...
Artur Pilipenko [Mon, 22 May 2017 12:01:32 +0000 (12:01 +0000)]
[LoopPredication] NFC. Move a nested struct declaration before the fields, clang-format a bit

This will simplify the diff for an upcoming review.

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

7 years agoRevert r303259 - [globalisel][tablegen] Import rules containing intrinsic_wo_chain.
Daniel Sanders [Mon, 22 May 2017 10:14:33 +0000 (10:14 +0000)]
Revert r303259 - [globalisel][tablegen] Import rules containing intrinsic_wo_chain.

It's causing some buildbots to timeout whenever tablegen needs re-compilation,
particularly those with -fsanitize=memory but not only them. A compile time
regression was expected since it triples the amount of SelectionDAG rules we
are able to import but it's currently too high.

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

7 years agoRe-apply r302416: [ARM] Clear the constant pool cache on explicit .ltorg directives
James Molloy [Mon, 22 May 2017 09:42:07 +0000 (09:42 +0000)]
Re-apply r302416: [ARM] Clear the constant pool cache on explicit .ltorg directives

Re-applying now that PR32825 which was raised on the commit this fixed up is now known to have also been fixed by this commit.

Original commit message:
    Multiple ldr pseudoinstructions with the same constant value will
    reuse the same constant pool entry. However, if the constant pool
    is explicitly flushed with a .ltorg directive, we should not try
    to reference constants in the previous pool any longer, since they
    may be out of range.

    This fixes assembling hand-written assembler source which repeatedly
    loads the same constant value, across a binary size larger than the
    pc-relative fixup range for ldr instructions (4096 bytes). Such
    assembler source already uses explicit .ltorg instructions to emit
    constant pools with regular intervals. However if we try to reuse
    constants emitted in earlier pools, they end up out of range.

    This makes the output of the testcase match what binutils gas does
    (prior to this patch, it would fail to assemble).

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

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

7 years agoRe-apply r286006: Fix 24560: assembler does not share constant pool for same constants
James Molloy [Mon, 22 May 2017 09:42:01 +0000 (09:42 +0000)]
Re-apply r286006: Fix 24560:  assembler does not share constant pool for same constants

Re-applying now that the open bug on this commit, PR32825, is known to be fixed.

Original commit message:
    Summary: This patch returns the same label if the CP entry with the same value has been created.

    Reviewers: eli.friedman, rengolin, jmolloy

    Subscribers: majnemer, jmolloy, llvm-commits

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

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

7 years ago[MIPS] Add support to match more patterns for DINS instruction
Strahinja Petrovic [Mon, 22 May 2017 09:06:44 +0000 (09:06 +0000)]
[MIPS] Add support to match more patterns for DINS instruction

This patch adds support for recognizing patterns to match
DINS instruction.

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

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

7 years agoRevert "[ARM] Clear the constant pool cache on explicit .ltorg directives"
James Molloy [Mon, 22 May 2017 08:49:28 +0000 (08:49 +0000)]
Revert "[ARM] Clear the constant pool cache on explicit .ltorg directives"

This reverts commit r302416. This was a fixup for r286006, which has now been reverted so this doesn't apply (either in concept or in code).

This commit itself has no problems, but the underlying issue it was fixing has now disappeared from the codebase.

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

7 years agoRevert "Fix 24560: assembler does not share constant pool for same constants"
James Molloy [Mon, 22 May 2017 08:42:47 +0000 (08:42 +0000)]
Revert "Fix 24560:  assembler does not share constant pool for same constants"

This reverts commit r286006. It caused PR32825 and wasn't fixed.

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

7 years agoRegenerate expected result for test constant-combines.ll . NFC
Amaury Sechet [Mon, 22 May 2017 07:49:16 +0000 (07:49 +0000)]
Regenerate expected result for test constant-combines.ll . NFC

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

7 years agolibDebugInfo/DWARF: Apply relocations for debug_addr addresses in object files
David Blaikie [Mon, 22 May 2017 07:02:47 +0000 (07:02 +0000)]
libDebugInfo/DWARF: Apply relocations for debug_addr addresses in object files

llvm-symbolizer would fail to symbolize addresses in unlinked object
files when handling .dwo file data because the addresses would not be
relocated in the same way as the ranges in the skeleton CU in the object
file.

Fix that so object files can be symbolized the same as executables.

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

7 years ago[SCEV] Clarify behavior around max backedge taken count
Sanjoy Das [Mon, 22 May 2017 06:46:04 +0000 (06:46 +0000)]
[SCEV] Clarify behavior around max backedge taken count

This is a re-application of a r303497 that was reverted in r303498.
I thought it had broken a bot when it had not (the breakage did not
go away with the revert).

This change makes the split between the "exact" backedge taken count
and the "maximum" backedge taken count a bit more obvious.  Both of
these are upper bounds on the number of times the loop header
executes (since SCEV does not account for most kinds of abnormal
control flow), but the latter is guaranteed to be a constant.

There were a few places where the max backedge taken count *was* a
non-constant; I've changed those to compute constants instead.

At this point, I'm not sure if the constant max backedge count can be
computed by calling `getUnsignedRange(Exact).getUnsignedMax()` without
losing precision.  If it can, we can simplify even further by making
`getMaxBackedgeTakenCount` a thin wrapper around
`getBackedgeTakenCount` and `getUnsignedRange`.

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

7 years ago[X86] Add (ix bitcast(vsetcc)) test cases with illegal types. NFC.
Zvi Rackover [Mon, 22 May 2017 06:39:12 +0000 (06:39 +0000)]
[X86] Add (ix bitcast(vsetcc)) test cases with illegal types. NFC.

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

7 years ago[InstCombine] Cleanup the interface for overflow checks
Craig Topper [Mon, 22 May 2017 06:25:31 +0000 (06:25 +0000)]
[InstCombine] Cleanup the interface for overflow checks

Summary:
Fix naming conventions and const correctness.
This completes the changes made in rL303029.

Patch by Yoav Ben-Shalom.

Reviewers: craig.topper

Reviewed By: craig.topper

Subscribers: llvm-commits

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

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

7 years agoAdd a test case for large integer subtraction via subcarry. NFC
Amaury Sechet [Mon, 22 May 2017 06:06:45 +0000 (06:06 +0000)]
Add a test case for large integer subtraction via subcarry. NFC

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

7 years agoAdd test case for subcarry optimization.
Amaury Sechet [Mon, 22 May 2017 02:31:42 +0000 (02:31 +0000)]
Add test case for subcarry optimization.

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

7 years ago[SimplifyCFG] Prevent a few APInt copies on method calls that return const reference...
Craig Topper [Mon, 22 May 2017 00:49:35 +0000 (00:49 +0000)]
[SimplifyCFG] Prevent a few APInt copies on method calls that return const reference. NFCI

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

7 years ago[KnownBits] Use isNegative/isNonNegative to shorten some code. NFC
Craig Topper [Mon, 22 May 2017 00:49:33 +0000 (00:49 +0000)]
[KnownBits] Use isNegative/isNonNegative to shorten some code. NFC

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

7 years agoNewGVN: Fix PR 33116, the memoryphi version of bug 32838.
Daniel Berlin [Sun, 21 May 2017 23:41:58 +0000 (23:41 +0000)]
NewGVN: Fix PR 33116, the memoryphi version of bug 32838.

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

7 years agoNewGVN: Cleanup some repeated code using some templated helpers
Daniel Berlin [Sun, 21 May 2017 23:41:56 +0000 (23:41 +0000)]
NewGVN: Cleanup some repeated code using some templated helpers

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

7 years agoNewGVN: Fix printing of simplified expression
Daniel Berlin [Sun, 21 May 2017 23:41:53 +0000 (23:41 +0000)]
NewGVN: Fix printing of simplified expression

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

7 years agoSmallPtrSetImpl/SmallPtrSet: Add a public value_type and key_type
Daniel Berlin [Sun, 21 May 2017 23:41:51 +0000 (23:41 +0000)]
SmallPtrSetImpl/SmallPtrSet: Add a public value_type and key_type

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

7 years ago[NewGVN] Actually check the NewGVN output.
Davide Italiano [Sun, 21 May 2017 20:55:53 +0000 (20:55 +0000)]
[NewGVN] Actually check the NewGVN output.

Apparently I messed up squashing two consecutive commits.

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

7 years ago[NewGVN] Add a test for non most dominating leader.
Davide Italiano [Sun, 21 May 2017 20:50:16 +0000 (20:50 +0000)]
[NewGVN] Add a test for non most dominating leader.

Taken from PR32845. Dan removed the most dominating leader check
in r303443, but we check this test anyway to make sure things
don't regress.

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

7 years ago[InstCombine] Take in account the size in sext->lshr->trunc patterns.
Davide Italiano [Sun, 21 May 2017 20:30:27 +0000 (20:30 +0000)]
[InstCombine] Take in account the size in sext->lshr->trunc patterns.

Otherwise we end up miscompiling, transforming:

define i8 @tinky() {
  %sext = sext i1 1 to i16
  %hibit = lshr i16 %sext, 15
  %tr = trunc i16 %hibit to i8
  ret i8 %tr
}

into:

  %sext = sext i1 1 to i8
  ret i8 %sext

and the first get folded to ret i8 1, while the second gets folded
to ret i8 -1.

Eventually we should get rid of this transform entirely, but for now,
this at least fixes a know correctness bug.

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

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

7 years ago[InstCombine] add tests for potential (lshr(sext X), C) folds; NFC
Sanjay Patel [Sun, 21 May 2017 15:18:52 +0000 (15:18 +0000)]
[InstCombine] add tests for potential (lshr(sext X), C) folds; NFC

As discussed in:
https://reviews.llvm.org/D33338
...we may be able to remove a wider pattern match by doing these more
basic canonicalizations.

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

7 years ago[GlobalISel][X86] Fix G_TRUNC instruction selection.
Igor Breger [Sun, 21 May 2017 11:13:56 +0000 (11:13 +0000)]
[GlobalISel][X86] Fix G_TRUNC instruction selection.
Updated tests with -verify-machineinstrs flag.
It fixes 3 tests failed with machine verifier enabled and listed
in PR27481

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

7 years agoSummary
Hiroshi Inoue [Sun, 21 May 2017 06:00:05 +0000 (06:00 +0000)]
Summary

PPC backend eliminates compare instructions by using record-form instructions in PPCInstrInfo::optimizeCompareInstr, which is called from peephole optimization pass.
This patch improves this optimization to eliminate more compare instructions in two types of common case.

- comparison against a constant 1 or -1

The record-form instructions set CR bit based on signed comparison against 0. So, the current implementation does not exploit the record-form instruction for comparison against a non-zero constant.
This patch enables record-form optimization for constant of 1 or -1 if possible; it changes the condition "greater than -1" into "greater than or equal to 0" and "less than 1" into "less than or equal to 0".
With this patch, compare can be eliminated in the following code sequence, as an example.

uint64_t a, b;
if ((a | b) & 0x8000000000000000ull) { ... }
else { ... }

- andi for 32-bit comparison on PPC64

Since record-form instructions execute 64-bit signed comparison and so we have limitation in eliminating 32-bit comparison, i.e. with cmplwi, using the record-form. The original implementation already has such checks but andi. is not recognized as an instruction which executes implicit zero extension and hence safe to convert into record-form if used for equality check.

%1 = and i32 %a, 10
%2 = icmp ne i32 %1, 0
br i1 %2, label %foo, label %bar

In this simple example, LLVM generates andi. + cmplwi + beq on PPC64.
This patch make it possible to eliminate the cmplwi for this case.
I added andi. for optimization targets if it is safe to do so.

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

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

7 years ago[Docs] Fix LangRef links referred in GetElementPtr.rst
George Burgess IV [Sun, 21 May 2017 05:31:29 +0000 (05:31 +0000)]
[Docs] Fix LangRef links referred in GetElementPtr.rst

Patch by chenwj!

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

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

7 years agoRevert "[SCEV] Clarify behavior around max backedge taken count"
Sanjoy Das [Sun, 21 May 2017 05:02:12 +0000 (05:02 +0000)]
Revert "[SCEV] Clarify behavior around max backedge taken count"

This reverts commit r303497 since it breaks the msan bootstrap bot:
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap/builds/1379/

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