OSDN Git Service

android-x86/external-llvm.git
7 years agoSupport: Don't set RLIMIT_AS on child processes when applying a memory limit
David Blaikie [Mon, 12 Jun 2017 22:16:49 +0000 (22:16 +0000)]
Support: Don't set RLIMIT_AS on child processes when applying a memory limit

It doesn't seem relevant to set an address space limit - this isn't
important in any sense that I'm aware & it gets in the way of things
that use a lot of address space, like llvm-symbolizer.

This came up when I realized that bugpoint regression tests were much
slower with -gsplit-dwarf than plain -g. Turned out that bugpoint
subprocesses (opt, etc) were crashing and doing symbolization - but
bugpoint runs those subprocesses with a 400MB memory limit. So with
plain -g, mmaping the opt binary would exceed the memory limit, fail,
and thus be really fast - no symbolization occurred. Whereas with
-gsplit-dwarf, comically, having less to map in, it would succeed and
then spend lots of time symbolizing.

I've fixed at least the critical part of bugpoint's perf problem there
by adding an option to allow bugpoint to disable symbolization. Thus
improving the perfromance for -gsplit-dwarf and making the -g-esque
speed available without this quirk/accidental benefit.

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

7 years ago[ADT] Add type-safe methods to FoldingSetImpl; NFC.
George Burgess IV [Mon, 12 Jun 2017 22:08:08 +0000 (22:08 +0000)]
[ADT] Add type-safe methods to FoldingSetImpl; NFC.

Thankfully, this hasn't uncovered any new bugs. With this, issues like
the one fixed in r305207 (hopefully) shouldn't happen again.

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

7 years agoFix printing error.
Zachary Turner [Mon, 12 Jun 2017 22:08:03 +0000 (22:08 +0000)]
Fix printing error.

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

7 years ago[llvm-pdbutil] Fix one more issue with no-id-stream PDBs.
Zachary Turner [Mon, 12 Jun 2017 21:57:41 +0000 (21:57 +0000)]
[llvm-pdbutil] Fix one more issue with no-id-stream PDBs.

This one occurred when we were dumping symbols, we have code
that is prepared to dump many different types of symbols,
including symbols which reference an ID stream.  So when creating
the dumper object, we assume that there is an ID stream.  Fix
this assumption.

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

7 years agoSlightly better fix for dealing with no-id-stream PDBs.
Zachary Turner [Mon, 12 Jun 2017 21:46:51 +0000 (21:46 +0000)]
Slightly better fix for dealing with no-id-stream PDBs.

The last fix required the user to manually add the required
feature.  This caused an LLD test to fail because I failed to
update LLD.  In practice we can hide this logic so it can just
be transparently added when we write the PDB.

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

7 years ago[llvm-pdbdump] Don't fail on PDBs with no ID stream.
Zachary Turner [Mon, 12 Jun 2017 21:34:53 +0000 (21:34 +0000)]
[llvm-pdbdump] Don't fail on PDBs with no ID stream.

Older PDBs don't have this.  Its presence is detected by using
the various "feature" flags that come at the end of the PDB
Stream.  Detect this, and don't try to dump the ID stream if the
features tells us it's not present.

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

7 years ago[RS4GC] Drop invalid metadata after pointers are relocated
Anna Thomas [Mon, 12 Jun 2017 21:26:53 +0000 (21:26 +0000)]
[RS4GC] Drop invalid metadata after pointers are relocated

Summary:
After RS4GC, we should drop metadata that is no longer valid. These metadata
is used by optimizations scheduled after RS4GC, and can cause a miscompile.
One such metadata is invariant.load which is used by LICM sinking transform.
After rewriting statepoints, the address of a load maybe relocated. With
invariant.load metadata on a load instruction, LICM sinking assumes the
loaded value (from a dererenceable address) to be invariant, and
rematerializes the load operand and the load at the exit block.
This transforms the IR to have an unrelocated use of the
address after a statepoint, which is incorrect.
Other metadata we conservatively remove are related to
dereferenceability and noalias metadata.

This patch drops such metadata on store and load instructions after
rewriting statepoints.

Reviewers: reames, sanjoy, apilipenko

Reviewed by: reames

Subscribers: llvm-commits

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

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

7 years agoAMDGPU/GlobalISel: Mark 32-bit G_ADD as legal
Tom Stellard [Mon, 12 Jun 2017 20:54:56 +0000 (20:54 +0000)]
AMDGPU/GlobalISel: Mark 32-bit G_ADD as legal

Reviewers: arsenm

Reviewed By: arsenm

Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, rovka, kristof.beyls, igorb, dstuttard, tpr, llvm-commits, t-tye

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

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

7 years ago[ADT] Reduce duplication between {Contextual,}FoldingSet; NFC
George Burgess IV [Mon, 12 Jun 2017 20:52:53 +0000 (20:52 +0000)]
[ADT] Reduce duplication between {Contextual,}FoldingSet; NFC

This is a precursor to another change (coming soon) that aims to make
FoldingSet's API more type-safe. Without this, the type-safety change
would just duplicate 4 more public methods between the already very
similar classes.

This renames FoldingSetImpl to FoldingSetBase so it's consistent with
the FooBase -> FooImpl<T> -> Foo<T> convention we seem to have with
other containers.

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

7 years agoAArch64: don't try to emit an add (shifted reg) for SP.
Tim Northover [Mon, 12 Jun 2017 20:49:53 +0000 (20:49 +0000)]
AArch64: don't try to emit an add (shifted reg) for SP.

The "Add/sub (shifted reg)" instructions use the 31 encoding for xzr and wzr
rather than the SP, so we need to use different variants.

Situations where this actually comes up are rare enough (see test-case) that I
think falling back to DAG is fine.

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

7 years agoFix a null pointer dereference in llvm-pdbutil pretty.
Zachary Turner [Mon, 12 Jun 2017 20:46:35 +0000 (20:46 +0000)]
Fix a null pointer dereference in llvm-pdbutil pretty.

Static data members were causing a problem because I mistakenly
assumed all members would affect a class's layout and so the
Layout member would be non-null.

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

7 years agoSplitKit: Fix partially live subreg splitting
Matthias Braun [Mon, 12 Jun 2017 20:30:52 +0000 (20:30 +0000)]
SplitKit: Fix partially live subreg splitting

Fix thinko/typo in subreg aware liverange splitting logic. I'm not sure
how to write a proper testcase for this. The original problem only
happens on an out-of-tree target. Forcing subreg enabled targets to
spill and split in a predictable way is near impossible.

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

7 years agoIR: Replace the "Linker Options" module flag with "llvm.linker.options" named metadata.
Peter Collingbourne [Mon, 12 Jun 2017 20:10:48 +0000 (20:10 +0000)]
IR: Replace the "Linker Options" module flag with "llvm.linker.options" named metadata.

The new metadata is easier to manipulate than module flags.

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

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

7 years agoRemove unneeded conditionals - the code is already conditional on the same condition
David Blaikie [Mon, 12 Jun 2017 20:09:53 +0000 (20:09 +0000)]
Remove unneeded conditionals - the code is already conditional on the same condition

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

7 years agoAdd EOL at EOF to appease source utils like unifdef
Tim Hammerquist [Mon, 12 Jun 2017 20:08:55 +0000 (20:08 +0000)]
Add EOL at EOF to appease source utils like unifdef

<rdar://problem/32511256>

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

7 years ago[llvm-ar] Make llvm-lib behave more like the MSVC archiver
Reid Kleckner [Mon, 12 Jun 2017 19:45:35 +0000 (19:45 +0000)]
[llvm-ar] Make llvm-lib behave more like the MSVC archiver

Summary:
Use the filepath used to open the archive member as the archive member
name instead of the file basename. This path might be absolute or
relative.  This is important because the archive member name will show
up in the PDB, and we want our PDBs to look as much like MSVC's as
possible.

This also helps avoid an issue in our PDB module descriptor writing
code, which assumes that all module names are unique. Relative paths
still aren't guaranteed to be unique, but they're much better than
basenames, which definitely aren't unique.

Reviewers: ruiu, zturner

Subscribers: llvm-commits

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

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

7 years agoAddressed Takumi's comment about redundancy.
Galina Kistanova [Mon, 12 Jun 2017 19:17:55 +0000 (19:17 +0000)]
Addressed Takumi's comment about redundancy.

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

7 years ago[DWARF] Added a blank line in llvm-dwarfdump to test commit access.
Spyridoula Gravani [Mon, 12 Jun 2017 19:04:28 +0000 (19:04 +0000)]
[DWARF] Added a blank line in llvm-dwarfdump to test commit access.

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

7 years agoSame expressions on both sides of the return
Sylvestre Ledru [Mon, 12 Jun 2017 18:53:46 +0000 (18:53 +0000)]
Same expressions on both sides of the return

Summary:
I guess we want PointerToMemberFunction & PointerToDataMember

Fix coverity cid 1376038

Reviewers: zturner

Reviewed By: zturner

Subscribers: llvm-commits

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

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

7 years ago[PowerPC] Match vec_revb builtins to P9 instructions.
Tony Jiang [Mon, 12 Jun 2017 18:24:36 +0000 (18:24 +0000)]
[PowerPC] Match vec_revb builtins to P9 instructions.

Power9 has instructions that will reverse the bytes within an element for all
sizes (half-word, word, double-word and quad-word). These can be used for the
vec_revb builtins in altivec.h. However, we implement these to match vector
shuffle nodes as that will cover both the builtins and vector shuffles that
occur in the SDAG through other means.

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

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

7 years ago[Power9] Added support for the modsw, moduw, modsd, modud hardware instructions.
Tony Jiang [Mon, 12 Jun 2017 17:58:42 +0000 (17:58 +0000)]
[Power9] Added support for the modsw, moduw, modsd, modud hardware instructions.

Note that if we need the result of both the divide and the modulo then we
compute the modulo based on the result of the divide and not using the new
hardware instruction.

Commit on behalf of STEFAN PINTILIE.
Differential Revision: https://reviews.llvm.org/D33940

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

7 years ago[llvm-ar] Fix AddNewMember typo in enum
Reid Kleckner [Mon, 12 Jun 2017 17:44:42 +0000 (17:44 +0000)]
[llvm-ar] Fix AddNewMember typo in enum

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

7 years ago[utils] remove ability to generate llc check lines from update_test_checks.py
Sanjay Patel [Mon, 12 Jun 2017 17:44:30 +0000 (17:44 +0000)]
[utils] remove ability to generate llc check lines from update_test_checks.py

The dream of a unified check-line auto-generator for all phases of compilation is dead.
The llc script has already diverged to be better at its goal, so having 2 scripts that
do almost the same thing just causes confusion. Now, this script will only work with
opt to produce check lines for IR transforms.

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

7 years ago[x86] regenerate checks with update_llc_test_checks.py
Sanjay Patel [Mon, 12 Jun 2017 17:31:36 +0000 (17:31 +0000)]
[x86] regenerate checks with update_llc_test_checks.py

The dream of a unified check-line auto-generator for all phases of compilation is dead.
The llc script has already diverged to be better at its goal, so having 2 scripts that
do almost the same thing is just causing confusion.

We can rip out the llc ability in update_test_checks.py next and rename it, so it will
be clear that we have one script for llc check auto-generation and another for opt.

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

7 years agoAMDGPU: Don't add same implicit use multiple times
Matt Arsenault [Mon, 12 Jun 2017 17:19:20 +0000 (17:19 +0000)]
AMDGPU: Don't add same implicit use multiple times

For the last component, the same register use
was added as an implicit use and another implicit kill use.

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

7 years ago[SelectionDAG] Allow sin/cos -> sincos optimization on GNU triples w/ just -fno-math...
Geoff Berry [Mon, 12 Jun 2017 17:15:41 +0000 (17:15 +0000)]
[SelectionDAG] Allow sin/cos -> sincos optimization on GNU triples w/ just -fno-math-errno

Summary:
This change enables the sin(x) cos(x) -> sincos(x) optimization on GNU
target triples.  This optimization was being inhibited when -ffast-math
wasn't set because sincos in GLibC does not set errno, while sin and cos
do.  However, this optimization will only run if the attributes on the
sin/cos calls include readnone, which is how clang represents the fact
that it doesn't care about the errno values set by these functions (via
the -fno-math-errno flag).

Reviewers: hfinkel, bogner

Subscribers: mcrosier, javed.absar, llvm-commits, paul.redmond

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

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

7 years agoAMDGPU: Teach isLegalAddressingMode about flat offsets
Matt Arsenault [Mon, 12 Jun 2017 17:06:35 +0000 (17:06 +0000)]
AMDGPU: Teach isLegalAddressingMode about flat offsets

Also fix reporting r+r as a valid addressing mode without
offsets.

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

7 years ago[x86] regenerate checks with update_llc_test_checks.py
Sanjay Patel [Mon, 12 Jun 2017 17:05:43 +0000 (17:05 +0000)]
[x86] regenerate checks with update_llc_test_checks.py

The dream of a unified check-line auto-generator for all phases of compilation is dead.
The llc script has already diverged to be better at its goal, so having 2 scripts that
do almost the same thing is just causing confusion for newcomers. I plan to fix up more
x86 tests in a next commit. We can rip out the llc ability in update_test_checks.py after
that.

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

7 years agoAMDGPU: Start selecting flat instruction offsets
Matt Arsenault [Mon, 12 Jun 2017 16:53:51 +0000 (16:53 +0000)]
AMDGPU: Start selecting flat instruction offsets

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

7 years agoAMDGPU: Verify that flat offsets aren't used pre-GFX9
Matt Arsenault [Mon, 12 Jun 2017 16:37:55 +0000 (16:37 +0000)]
AMDGPU: Verify that flat offsets aren't used pre-GFX9

For convenience the operand is always present in the instruction,
but it isn't valid to use except on GFX9.

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

7 years ago[Falkor] Enable SW Prefetch.
Haicheng Wu [Mon, 12 Jun 2017 16:34:19 +0000 (16:34 +0000)]
[Falkor] Enable SW Prefetch.

SW prefetch is good for Falkor.

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

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

7 years agoAMDGPU: Start adding offset fields to flat instructions
Matt Arsenault [Mon, 12 Jun 2017 15:55:58 +0000 (15:55 +0000)]
AMDGPU: Start adding offset fields to flat instructions

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

7 years agoStackColoring: smarter check for slot overlap
Than McIntosh [Mon, 12 Jun 2017 14:56:02 +0000 (14:56 +0000)]
StackColoring: smarter check for slot overlap

Summary:
The old check for slot overlap treated 2 slots `S` and `T` as
overlapping if there existed a CFG node in which both of the slots could
possibly be active. That is overly conservative and caused stack blowups
in Rust programs. Instead, check whether there is a single CFG node in
which both of the slots are possibly active *together*.

Fixes PR32488.

Patch by Ariel Ben-Yehuda <ariel.byd@gmail.com>

Reviewers: thanm, nagisa, llvm-commits, efriedma, rnk

Reviewed By: thanm

Subscribers: dotdash

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

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

7 years ago[DAG] add helper to bind memop chains; NFCI
Sanjay Patel [Mon, 12 Jun 2017 14:41:48 +0000 (14:41 +0000)]
[DAG] add helper to bind memop chains; NFCI

This step is just intended to reduce code duplication rather than change any functionality.

A follow-up would be to replace PPCTargetLowering::spliceIntoChain() usage with this new helper.

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

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

7 years ago[InstCombine] lshr (sext iM X to iN), N-M --> zext (ashr X, min(N-M, M-1)) to iN
Sanjay Patel [Mon, 12 Jun 2017 14:23:43 +0000 (14:23 +0000)]
[InstCombine] lshr (sext iM X to iN), N-M --> zext (ashr X, min(N-M, M-1)) to iN

This is a follow-up to https://reviews.llvm.org/D33879 / https://reviews.llvm.org/rL304939 ,
and was discussed in https://reviews.llvm.org/D33338.

We prefer this form because a narrower shift may be cheaper, and we can more easily fold a
zext than a sext.

http://rise4fun.com/Alive/slVe

Name: shz
%s = sext i8 %x to i12
%r = lshr i12 %s, 4
=>
%a = ashr i8 %x, 4
%r = zext i8 %a to i12

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

7 years agoConst correctness for TTI::getRegisterBitWidth
Daniel Neilson [Mon, 12 Jun 2017 14:22:21 +0000 (14:22 +0000)]
Const correctness for TTI::getRegisterBitWidth

Summary: The method TargetTransformInfo::getRegisterBitWidth() is declared const, but the type erasing implementation classes (TargetTransformInfo::Concept & TargetTransformInfo::Model) that were introduced by Chandler in https://reviews.llvm.org/D7293 do not have the method declared const. This is an NFC to tidy up the const consistency between TTI and its implementation.

Reviewers: chandlerc, rnk, reames

Reviewed By: reames

Subscribers: reames, jfb, arsenm, dschuff, nemanjai, nhaehnle, javed.absar, sbc100, jgravelle-google, llvm-commits

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

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

7 years ago[ADT] Don't use __used__ attribute on struct members in unit test
Francis Ricci [Mon, 12 Jun 2017 14:19:25 +0000 (14:19 +0000)]
[ADT] Don't use __used__ attribute on struct members in unit test

On some compilers, __used__ can only be applied to variables
or functions.

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

7 years ago[X86][SSE] Change memop fragment to inherit from vec128load with local alignment...
Simon Pilgrim [Mon, 12 Jun 2017 10:01:27 +0000 (10:01 +0000)]
[X86][SSE] Change memop fragment to inherit from vec128load with local alignment controls

First possible step towards merging SSE/AVX memory folding pattern fragments.

Also allows us to remove the duplicate non-temporal load logic.

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

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

7 years agoExport the required symbol from DynamicLibraryTests
Roger Ferrer Ibanez [Mon, 12 Jun 2017 07:22:15 +0000 (07:22 +0000)]
Export the required symbol from DynamicLibraryTests

Running unittests/Support/DynamicLibrary/DynamicLibraryTests fails
when LLVM is configured with -DLLVM_EXPORT_SYMBOLS_FOR_PLUGINS=ON, because
the test's version script only contains symbols extracted from the static libraries,
that the test links with, but not those from the main object/executable itself.

The patch moves the one symbol, needed by the test, to a static library.

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

Patch by Momchil Velikov.

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

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

7 years ago[AVX-512] Add VPCONFLICT and VPLZCNT to load folding tables.
Craig Topper [Mon, 12 Jun 2017 04:57:31 +0000 (04:57 +0000)]
[AVX-512] Add VPCONFLICT and VPLZCNT to load folding tables.

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

7 years agoAddress http://bugs.llvm.org/pr32207 by making BannerPrinted local to runOnSCC and...
Yaron Keren [Mon, 12 Jun 2017 02:18:50 +0000 (02:18 +0000)]
Address bugs.llvm.org/pr32207 by making BannerPrinted local to runOnSCC and skipping banner for function declarations.

Reviewed By: Mehdi AMINI

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

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

7 years agoInitialize SubArch in class Triple
Kamil Rytarowski [Mon, 12 Jun 2017 00:28:14 +0000 (00:28 +0000)]
Initialize SubArch in class Triple

Summary:
LLDB built with asan on NetBSD detected issues in the following code:

```
void ArchSpec::Clear() {
  m_triple = llvm::Triple();
  m_core = kCore_invalid;
  m_byte_order = eByteOrderInvalid;
  m_distribution_id.Clear();
  m_flags = 0;
}
```

  --- lldb/source/Core/ArchSpec.cpp

Runtime error messages:

/public/pkgsrc-tmp/wip/lldb-netbsd/work/.buildlink/include/llvm/ADT/Triple.h:44:7: runtime error: load of value 32639, which is not a valid value for type 'SubArchType'
/public/pkgsrc-tmp/wip/lldb-netbsd/work/.buildlink/include/llvm/ADT/Triple.h:44:7: runtime error: load of value 3200171710, which is not a valid value for type 'SubArchType'
/public/pkgsrc-tmp/wip/lldb-netbsd/work/.buildlink/include/llvm/ADT/Triple.h:44:7: runtime error: load of value 3200171710, which is not a valid value for type 'SubArchType'

Correct this issue with initialization of SubArch() in the class Triple constructor.

Sponsored by <The NetBSD Foundation>

Reviewers: chandlerc, zturner

Reviewed By: zturner

Subscribers: llvm-commits, zturner

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

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

7 years ago[x86] use vperm2f128 rather than vinsertf128 when there's a chance to fold a 32-byte...
Sanjay Patel [Sun, 11 Jun 2017 21:18:58 +0000 (21:18 +0000)]
[x86] use vperm2f128 rather than vinsertf128 when there's a chance to fold a 32-byte load

I was looking closer at the x86 test diffs in D33866, and the first change seems like it
shouldn't happen in the first place. So this patch will resolve that.

Using Agner's tables and AMD docs, vperm2f128 and vinsertf128 have identical timing for
any given CPU model, so we should be able to interchange those without affecting perf.
But as we can see in some of the diffs here, using vperm2f128 allows load folding, so
we should take that opportunity to reduce code size and register pressure.

A secondary advantage is making AVX1 and AVX2 codegen more similar. Given that vperm2f128
was introduced with AVX1, we should be selecting it in all of the same situations that we
would with AVX2. If there's some reason that an AVX1 CPU would not want to use this
instruction, that should be fixed up in a later pass.

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

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

7 years ago[PartialInlining] Support shrinkwrap life_range markers
Xinliang David Li [Sun, 11 Jun 2017 20:46:05 +0000 (20:46 +0000)]
[PartialInlining] Support shrinkwrap life_range markers

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

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

7 years ago[ADT] Use LLVM_ATTRIBUTE_USED instead of __attribute__ for unit test
Francis Ricci [Sun, 11 Jun 2017 19:28:21 +0000 (19:28 +0000)]
[ADT] Use LLVM_ATTRIBUTE_USED instead of __attribute__ for unit test

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

7 years ago[ADT] Suppress unused attribute warning in unit test
Francis Ricci [Sun, 11 Jun 2017 18:52:25 +0000 (18:52 +0000)]
[ADT] Suppress unused attribute warning in unit test

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

7 years agoFix unused variable warning on non-debug EXPENSIVE_CHECKS builds
Simon Pilgrim [Sun, 11 Jun 2017 12:49:29 +0000 (12:49 +0000)]
Fix unused variable warning on non-debug EXPENSIVE_CHECKS builds

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

7 years ago[DAGCombine] Make sure we check the ResNo from UADDO before combining
Amaury Sechet [Sun, 11 Jun 2017 11:36:38 +0000 (11:36 +0000)]
[DAGCombine] Make sure we check the ResNo from UADDO before combining

Summary: UADDO has 2 result, and one must check the result no before doing any kind of combine. Without it, the transform is invalid.

Reviewers: joerg

Subscribers: llvm-commits

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

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

7 years ago[MemorySSA] preservesAll() implies preserves<MemorySSA>(). NFCI.
Davide Italiano [Sun, 11 Jun 2017 01:05:45 +0000 (01:05 +0000)]
[MemorySSA] preservesAll() implies preserves<MemorySSA>(). NFCI.

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

7 years agoTableGen.cmake: Try to fix build breakage introduce in r305142.
NAKAMURA Takumi [Sun, 11 Jun 2017 00:57:30 +0000 (00:57 +0000)]
TableGen.cmake: Try to fix build breakage introduce in r305142.

LLVM_TABLEGEN_TARGET is undefined in clang standalone build.
STREQUAL cannot omit LHS. Then I saw an error;

  CMake Error at /path/to/install/llvm/lib/cmake/llvm/TableGen.cmake:40 (if):
      if given arguments:
        "STREQUAL" "/path/to/install/llvm/bin/llvm-tblgen.exe"
      Unknown arguments specified

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

7 years ago[SmallVector] Reinstate the typedefs.
Davide Italiano [Sat, 10 Jun 2017 23:18:32 +0000 (23:18 +0000)]
[SmallVector] Reinstate the typedefs.

They're unused with recent versions of libstdc++ but older ones
(e.g. libstdc++ 4.9 still requires them). Maybe we should bump
the requirements on the minimum version to make GCC 7 happy, but
in the meanwhile we need to live with the warning.

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

7 years ago[SmallVector] Remove unused typedefs, spotted by GCC 7. NFCI.
Davide Italiano [Sat, 10 Jun 2017 23:00:23 +0000 (23:00 +0000)]
[SmallVector] Remove unused typedefs, spotted by GCC 7. NFCI.

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

7 years ago[opt-viewer] Include default values in help output
Brian Gesiak [Sat, 10 Jun 2017 21:33:27 +0000 (21:33 +0000)]
[opt-viewer] Include default values in help output

Summary:
Python's argparse module includes a `%(default)s` format specifier that
can be used to print the default value of an option in its help text.
Use this for opt-viewer utilities' `--jobs` arguments.

Reviewers: anemet

Reviewed By: anemet

Subscribers: llvm-commits, fhahn

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

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

7 years ago[X86][SSE] Extended PR32368 to SSE/AVX1/AVX2
Simon Pilgrim [Sat, 10 Jun 2017 21:13:01 +0000 (21:13 +0000)]
[X86][SSE] Extended PR32368 to SSE/AVX1/AVX2

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

7 years ago[X86][AVX512] Added test case for PR32368
Simon Pilgrim [Sat, 10 Jun 2017 20:58:43 +0000 (20:58 +0000)]
[X86][AVX512] Added test case for PR32368

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

7 years agodwarfdump: Handle relocs to zlib (.zdebug*) compressed sections
David Blaikie [Sat, 10 Jun 2017 19:32:50 +0000 (19:32 +0000)]
dwarfdump: Handle relocs to zlib (.zdebug*) compressed sections

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

7 years ago[X86][SLM] Add SLM arithmetic vectorization tests
Simon Pilgrim [Sat, 10 Jun 2017 19:16:09 +0000 (19:16 +0000)]
[X86][SLM] Add SLM arithmetic vectorization tests

As discussed on D33983, as SLM has so many custom costs its worth testing as well.

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

7 years agoBreak seems serve better here.
Galina Kistanova [Sat, 10 Jun 2017 18:26:19 +0000 (18:26 +0000)]
Break seems serve better here.

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

7 years agoFix a ubsan failure introduced by r305092
Vedant Kumar [Sat, 10 Jun 2017 18:07:24 +0000 (18:07 +0000)]
Fix a ubsan failure introduced by r305092

lib/Object/WindowsResource.cpp:578:3: runtime error: store to
misaligned address 0x7fa09aedebbe for type 'unsigned int', which
requires 4 byte alignment
0x7fa09aedebbe: note: pointer points here
00 00 03 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00  00 00
            ^

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

7 years ago[EarlyCSE] Add option to use MemorySSA for function simplification run of EarlyCSE...
Geoff Berry [Sat, 10 Jun 2017 15:20:03 +0000 (15:20 +0000)]
[EarlyCSE] Add option to use MemorySSA for function simplification run of EarlyCSE (off by default).

Summary:
Use MemorySSA for memory dependency checking in the EarlyCSE pass at the
start of the function simplification portion of the pipeline.  We rely
on the fact that GVNHoist runs just after this pass of EarlyCSE to
amortize the MemorySSA construction cost since GVNHoist uses MemorySSA
and EarlyCSE preserves it.

This is turned off by default.  A follow-up change will turn it on to
allow for easier reversion in case it breaks something.

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

7 years agoAdded llvm_unreachable to address warning: this statement may fall through. NFC.
Galina Kistanova [Sat, 10 Jun 2017 08:04:51 +0000 (08:04 +0000)]
Added llvm_unreachable to address warning: this statement may fall through. NFC.

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

7 years agoAdded llvm_unreachable as ReportError cannot be specified as noreturn.
Galina Kistanova [Sat, 10 Jun 2017 07:50:14 +0000 (07:50 +0000)]
Added llvm_unreachable as ReportError cannot be specified as noreturn.

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

7 years agoAdded dependency on the TableGen executable file.
Galina Kistanova [Sat, 10 Jun 2017 07:48:49 +0000 (07:48 +0000)]
Added dependency on the TableGen executable file.

For the case when LLVM_OPTIMIZED_TABLEGEN is ON (enables LLVM_USE_HOST_TOOLS),
we need both _TABLEGEN_TARGET and _TABLEGEN_EXE in the  DEPENDS list
to have .inc files rebuilt on a tablegen change, as cmake does not propagate
file-level dependencies of custom targets.

We could always have just one dependency on both the target and
the file, but the 2 cases would produce cleaner cmake files.

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

7 years ago[IR] Remove stale comment from HungoffOperandTraits. NFC
Craig Topper [Sat, 10 Jun 2017 06:58:26 +0000 (06:58 +0000)]
[IR] Remove stale comment from HungoffOperandTraits. NFC

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

7 years ago[IR] Delete operator new(size_t, unsigned) for ShuffleVector making it consistent...
Craig Topper [Sat, 10 Jun 2017 06:58:24 +0000 (06:58 +0000)]
[IR] Delete operator new(size_t, unsigned) for ShuffleVector making it consistent with other instructions that declare another operator new with a different signature. NFC

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

7 years ago[IR] Put a comment back on a function it belongs to. NFC
Craig Topper [Sat, 10 Jun 2017 06:58:22 +0000 (06:58 +0000)]
[IR] Put a comment back on a function it belongs to. NFC

Looks like the function was moved to a different part of the class in December, but the comment didn't move with it.

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

7 years ago[IR] Remove unnecessary override of operator new in ExtractValueInst. It's already...
Craig Topper [Sat, 10 Jun 2017 06:58:19 +0000 (06:58 +0000)]
[IR] Remove unnecessary override of operator new in ExtractValueInst. It's already inherited from UnaryInstruction. NFC

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

7 years agoAMDGPU : Fix ISA Version Definitions.
Wei Ding [Sat, 10 Jun 2017 03:53:19 +0000 (03:53 +0000)]
AMDGPU : Fix ISA Version Definitions.

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

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

7 years ago[InstSimplify] Don't constant fold or DCE calls that are marked nobuiltin
Andrew Kaylor [Fri, 9 Jun 2017 23:18:11 +0000 (23:18 +0000)]
[InstSimplify] Don't constant fold or DCE calls that are marked nobuiltin

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

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

7 years ago[PowerPC] add memcmp test with one constant operand and equality cmp; NFC
Sanjay Patel [Fri, 9 Jun 2017 23:15:14 +0000 (23:15 +0000)]
[PowerPC] add memcmp test with one constant operand and equality cmp; NFC

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

7 years ago[CGP] add a reference to DataLayout in MemCmpExpansion; NFCI
Sanjay Patel [Fri, 9 Jun 2017 23:01:05 +0000 (23:01 +0000)]
[CGP] add a reference to DataLayout in MemCmpExpansion; NFCI

We're currently passing endian-ness around as a param (and not uniformly),
so this eliminates the need for that. I'd like to add a constant fold
call too, and that requires a DL.

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

7 years ago[AArch64] Add fallback in FastISel fp16 conversions
I-Jui (Ray) Sung [Fri, 9 Jun 2017 22:40:50 +0000 (22:40 +0000)]
[AArch64] Add fallback in FastISel fp16 conversions

Summary:
- Fix assertion failures on F16 to/from int types in FastISel by falling
  back to regular ISel
- Add a testcase of various conversion cases with FastISel (-O0)

Reviewers: kristof.beyls, jmolloy, SjoerdMeijer

Reviewed By: SjoerdMeijer

Subscribers: SjoerdMeijer, llvm-commits, srhines, pirama, aemerson, rengolin, javed.absar, kristof.beyls

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

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

7 years agoEnable c++1z experimental builds.
Vassil Vassilev [Fri, 9 Jun 2017 22:09:57 +0000 (22:09 +0000)]
Enable c++1z experimental builds.

Patch by David Abdurachmanov!

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

7 years ago[Support] Fix some Clang-tidy modernize-use-using and Include What You Use warnings...
Eugene Zelenko [Fri, 9 Jun 2017 21:41:54 +0000 (21:41 +0000)]
[Support] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC).

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

7 years ago[LVI] Fix spelling error in comment. NFC
Craig Topper [Fri, 9 Jun 2017 21:21:17 +0000 (21:21 +0000)]
[LVI] Fix spelling error in comment. NFC

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

7 years ago[LVI] Const correct and rename the LVILatticeVal parameter to getPredicateResult...
Craig Topper [Fri, 9 Jun 2017 21:18:16 +0000 (21:18 +0000)]
[LVI] Const correct and rename the LVILatticeVal parameter to getPredicateResult. NFC

Previously it was non-const reference named Result which would tend to make someone think that it was an outparam when really its an input.

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

7 years ago[pdb] Support CoffSymbolRVA debug subsection.
Zachary Turner [Fri, 9 Jun 2017 20:46:52 +0000 (20:46 +0000)]
[pdb] Support CoffSymbolRVA debug subsection.

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

7 years ago[SROA] Fix APInt size when load/store have different address space
Yaxun Liu [Fri, 9 Jun 2017 20:46:29 +0000 (20:46 +0000)]
[SROA] Fix APInt size when load/store have different address space

Currently there is a bug in SROA::presplitLoadsAndStores which causes assertion in
GEPOperator::accumulateConstantOffset.

Basically it does not consider the situation that the pointer operand of load or store
may be in a non-zero address space and its size may be different from the size of
a pointer in address space 0.

This patch fixes assertion when compiling Blender Cycles kernels for amdgpu backend.

Diffferential Revision: https://reviews.llvm.org/D33298

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

7 years agoRename llvm-pdbdump -> llvm-pdbutil.
Zachary Turner [Fri, 9 Jun 2017 20:46:17 +0000 (20:46 +0000)]
Rename llvm-pdbdump -> llvm-pdbutil.

This is to reflect the evolving nature of the tool as being
useful for more than just dumping PDBs, as it can do many other
things.

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

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

7 years ago[ADT] Make iterable SmallVector template overrides more specific
Francis Ricci [Fri, 9 Jun 2017 20:31:53 +0000 (20:31 +0000)]
[ADT] Make iterable SmallVector template overrides more specific

Summary:
This prevents the iterator overrides from being selected in
the case where non-iterator types are used as arguments, which
is of particular importance in cases where other overrides with
identical types exist.

Reviewers: dblaikie, bkramer, rafael

Subscribers: llvm-commits, efriedma

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

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

7 years ago[Sink] Fix predicate in legality check
Keno Fischer [Fri, 9 Jun 2017 19:31:10 +0000 (19:31 +0000)]
[Sink] Fix predicate in legality check

Summary:
isSafeToSpeculativelyExecute is the wrong predicate to use here.
All that checks for is whether it is safe to hoist a value due to
unaligned/un-dereferencable accesses. However, not only are we doing
sinking rather than hoisting, our concern is that the location
we're loading from may have been modified. Instead forbid sinking
any load across a critical edge.

Reviewers: majnemer

Subscribers: davide, llvm-commits

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

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

7 years agoI guess /dev/null is a bad idea on windows. Use a temp file instead.
Benjamin Kramer [Fri, 9 Jun 2017 19:18:07 +0000 (19:18 +0000)]
I guess /dev/null is a bad idea on windows. Use a temp file instead.

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

7 years ago[AMDGPU] Add intrinsics for alignbit and alignbyte instructions
Stanislav Mekhanoshin [Fri, 9 Jun 2017 19:03:00 +0000 (19:03 +0000)]
[AMDGPU] Add intrinsics for alignbit and alignbyte instructions

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

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

7 years ago[llvm-cvtres] Don't polute the test directory.
Benjamin Kramer [Fri, 9 Jun 2017 18:44:10 +0000 (18:44 +0000)]
[llvm-cvtres] Don't polute the test directory.

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

7 years agoFix -Wreorder-fields warning.
Zachary Turner [Fri, 9 Jun 2017 18:04:02 +0000 (18:04 +0000)]
Fix -Wreorder-fields warning.

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

7 years agoAllow VarStreamArray to use stateful extractors.
Zachary Turner [Fri, 9 Jun 2017 17:54:36 +0000 (17:54 +0000)]
Allow VarStreamArray to use stateful extractors.

Previously extractors tried to be stateless with any additional
context information needed in order to parse items being passed
in via the extraction method.  This led to quite cumbersome
implementation challenges and awkwardness of use.  This patch
brings back support for stateful extractors, making the
implementation and usage simpler.

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

7 years agoImplement COFF emission for parsed Windows Resource ( .res) files.
Eric Beckmann [Fri, 9 Jun 2017 17:34:30 +0000 (17:34 +0000)]
Implement COFF emission for parsed Windows Resource ( .res) files.

Summary: Add the WindowsResourceCOFFWriter class for producing the final COFF after all parsing is done.

Reviewers: hiraditya!, zturner, ruiu

Subscribers: llvm-commits

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

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

7 years ago[X86][SSE] Add support for PACKSS nodes to faux shuffle extraction
Simon Pilgrim [Fri, 9 Jun 2017 17:29:52 +0000 (17:29 +0000)]
[X86][SSE] Add support for PACKSS nodes to faux shuffle extraction

If the inputs won't saturate during packing then we can treat the PACKSS as a truncation shuffle

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

7 years agoWe do not need google test utils if we disabled LLVM_INCLUDE_TESTS
Vassil Vassilev [Fri, 9 Jun 2017 16:37:39 +0000 (16:37 +0000)]
We do not need google test utils if we disabled LLVM_INCLUDE_TESTS

Fixes embedded uses of llvm where google testing framework is provided outside.

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

7 years ago[LazyValueInfo] Don't run the more complex predicate handling code for EQ and NE...
Craig Topper [Fri, 9 Jun 2017 16:16:20 +0000 (16:16 +0000)]
[LazyValueInfo] Don't run the more complex predicate handling code for EQ and NE in getPredicateResult

Summary:
Unless I'm mistaken, the special handling for EQ/NE should cover everything and there is no reason to fallthrough to the more complex code. For that matter I'm not sure there's any reason to special case EQ/NE other than avoiding creating temporary ConstantRanges.

This patch moves the complex code into an else so we only do it when we are handling a predicate other than EQ/NE.

Reviewers: anna, reames, resistor, Farhana

Reviewed By: anna

Subscribers: llvm-commits

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

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

7 years ago[Hexagon] Fixes and updates to the selection patterns
Krzysztof Parzyszek [Fri, 9 Jun 2017 15:26:21 +0000 (15:26 +0000)]
[Hexagon] Fixes and updates to the selection patterns

- Add some missing patterns.
- Use C4_cmplte in branch patterns.
- Fix signedness of immediate operand in M2_accii.

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

7 years agoSelectionDAG: Remove deleted nodes from legalized set to avoid clash with newly creat...
Zvi Rackover [Fri, 9 Jun 2017 14:53:45 +0000 (14:53 +0000)]
SelectionDAG: Remove deleted nodes from legalized set to avoid clash with newly created nodes

Summary:
During DAG legalization loop in SelectionDAG::Legalize(),
bookkeeping of the SDNodes that were already legalized is implemented
with SmallPtrSet (LegalizedNodes). This kind of set stores only pointers
to objects, not the objects themselves. Unfortunately, if SDNode is
deleted during legalization for some reason, LegalizedNodes set is not
informed about this fact. This wouldn’t be so bad, if SelectionDAG wouldn’t reuse
space deallocated after deletion of unused nodes, for creation of new
ones. Because of this, new nodes, created during legalization often can
have pointers identical to ones that have been previously legalized,
added to the LegalizedNodes set, and deleted afterwards. This in turn
causes, that newly created nodes, sharing the same pointer as deleted
old ones, are present in LegalizedNodes *already at the moment of
creation*, so we never call Legalize on them.
The fix facilitates the fact, that DAG notifies listeners about each
modification. I have registered DAGNodeDeletedListener inside
SelectionDAG::Legalize, with a callback function that removes any
pointer of any deleted SDNode from the LegalizedNodes set. With this
modification, LegalizeNodes set does not contain pointers to nodes that
were deleted, so newly created nodes can always be inserted to it, even
if they share pointers with old deleted nodes.

Patch by pawel.szczerbuk@intel.com

The issue this patch addresses causes failures in an out-of-tree target,
and i was not able to create a reproducer for an in-tree target, hence
there is no test-case.

Reviewers: delena, spatel, RKSimon, hfinkel, davide, qcolombet

Reviewed By: delena

Subscribers: llvm-commits

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

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

7 years agoReland "[SelectionDAG] Enable target specific vector scalarization of calls and returns"
Simon Dardis [Fri, 9 Jun 2017 14:37:08 +0000 (14:37 +0000)]
Reland "[SelectionDAG] Enable target specific vector scalarization of calls and returns"

By target hookifying getRegisterType, getNumRegisters, getVectorBreakdown,
backends can request that LLVM to scalarize vector types for calls
and returns.

The MIPS vector ABI requires that vector arguments and returns are passed in
integer registers. With SelectionDAG's new hooks, the MIPS backend can now
handle LLVM-IR with vector types in calls and returns. E.g.
'call @foo(<4 x i32> %4)'.

Previously these cases would be scalarized for the MIPS O32/N32/N64 ABI for
calls and returns if vector types were not legal. If vector types were legal,
a single 128bit vector argument would be assigned to a single 32 bit / 64 bit
integer register.

By teaching the MIPS backend to inspect the original types, it can now
implement the MIPS vector ABI which requires a particular method of
scalarizing vectors.

Previously, the MIPS backend relied on clang to scalarize types such as "call
@foo(<4 x float> %a) into "call @foo(i32 inreg %1, i32 inreg %2, i32 inreg %3,
i32 inreg %4)".

This patch enables the MIPS backend to take either form for vector types.

The previous version of this patch had a "conditional move or jump depends on
uninitialized value".

Reviewers: zoran.jovanovic, jaydeep, vkalintiris, slthakur

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

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

7 years ago[SimplifyLibCalls] fix formatting; NFC
Sanjay Patel [Fri, 9 Jun 2017 14:22:03 +0000 (14:22 +0000)]
[SimplifyLibCalls] fix formatting; NFC

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

7 years ago[ValueTracking] fix typo; NFC
Sanjay Patel [Fri, 9 Jun 2017 14:21:18 +0000 (14:21 +0000)]
[ValueTracking] fix typo; NFC

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

7 years ago[AMDGPU] Fix for issue in alloca to vector promotion pass
David Stuttard [Fri, 9 Jun 2017 14:16:22 +0000 (14:16 +0000)]
[AMDGPU] Fix for issue in alloca to vector promotion pass

Summary:
Alloca promotion pass not dealing with non-canonical input

Added some additional checks so the pass simply backs-off forms it can't deal with (non-canonical)

Also added some test cases in non-canonical form to check that it no longer crashes

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

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

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

7 years ago[ARM] Custom machine-scheduler. NFCI.
Javed Absar [Fri, 9 Jun 2017 14:07:21 +0000 (14:07 +0000)]
[ARM] Custom machine-scheduler. NFCI.

This patch creates a customised machine-scheduler for ARM targets,
so that subsequently DAG mutations etc can be added.
Reviewed by: hahn, rengolin, rovka.
Differential Revision: https://reviews.llvm.org/D34039

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

7 years ago[MC] Fix compiler crash in AsmParser::Lex
Nirav Dave [Fri, 9 Jun 2017 14:04:03 +0000 (14:04 +0000)]
[MC] Fix compiler crash in AsmParser::Lex

When an empty comment is present in an assembly file, the compiler will crash because it checks the first character for '\n' or '\r'.
The fix consists of also checking if the string is empty before accessing the *front* method of the StringRef.
A test is included for the x86 target, but this issue is reproducible with other targets as well.

Patch by Alexandru Guduleasa!

Reviewers: niravd, grosbach, llvm-commits

Reviewed By: niravd

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

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

7 years ago[Hexagon] Add LLVM header to HexagonPatterns.td
Krzysztof Parzyszek [Fri, 9 Jun 2017 13:30:58 +0000 (13:30 +0000)]
[Hexagon] Add LLVM header to HexagonPatterns.td

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

7 years ago[XRay] Fix computation of function size subject to XRay threshold
Serge Rogatch [Fri, 9 Jun 2017 13:23:23 +0000 (13:23 +0000)]
[XRay] Fix computation of function size subject to XRay threshold

Summary:
Currently XRay compares its threshold against `Function::size()` . However, `Function::size()` returns the number of basic blocks (as I understand, such as cycle bodies, if/else bodies, switch-case bodies, etc.), rather than the number of instructions.

The name of the parameter `-fxray-instruction-threshold=N`, as well as XRay documentation at http://llvm.org/docs/XRay.html , suggests that instructions should be counted, rather than the number of basic blocks.

I see two options:
1. Count the number of MachineInstr`s in MachineFunction : this gives better  estimate for the number of assembly instructions on the target. So a user can check in disassembly that the threshold works more or less correctly.
2. Count the number of Instruction`s in a Function : AFAIK, this gives correct number of IR instructions, which the user can check in IR listing. However, this number may be far (several times for small functions) from the number of assembly instructions finally emitted.

Option 1 is implemented in this patch because I think that having the closer estimate for the number of assembly instructions emitted is more important than to have a clear definition of the metric.

Reviewers: dberris, rengolin

Reviewed By: dberris

Subscribers: llvm-commits, iid_iunknown

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

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