oota-llvm.git
8 years agoFix add_llvm_external_project.
Manuel Klimek [Thu, 22 Oct 2015 08:31:46 +0000 (08:31 +0000)]
Fix add_llvm_external_project.

r250835 unintentionally discarded the optional parameter to the
add_llvm_external_project() macro that may point to a path when the said
path is different from ${name}. This should fix it by passing ${ARGN} on
to add_llvm_subdirectory(). The problem manifests itself with e.g.
add_llvm_external_project(clang-tools-extra extra) from
clang/tools/CMakeLists.txt

Patch by Luchesar V. Iliev.

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

8 years agoUse range-based for loop in sys::path::append(). NFC.
Pawel Bylica [Thu, 22 Oct 2015 08:12:15 +0000 (08:12 +0000)]
Use range-based for loop in sys::path::append(). NFC.

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

8 years agoAVX-512: Fixed a bug in select_cc for i1 type
Elena Demikhovsky [Thu, 22 Oct 2015 07:10:29 +0000 (07:10 +0000)]
AVX-512: Fixed a bug in select_cc for i1 type
Fixed faiure:
LLVM ERROR: Cannot select: t33: i1 = select_cc t25, Constant:i32<0>, t45, t42, seteq:ch

added a test

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

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

8 years agoPartially reverted changes from r250686
Elena Demikhovsky [Thu, 22 Oct 2015 06:20:29 +0000 (06:20 +0000)]
Partially reverted changes from r250686
Clang runtime failure was reported.
   Assertion failed: (isExtended() && "Type is not extended!"), function getTypeForEVT
I'll need to add a proper handling for PointerType in masked load/store intrinsics.

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

8 years ago[IR] Add a `makeNoWrapRegion` method to `ConstantRange`
Sanjoy Das [Thu, 22 Oct 2015 03:12:57 +0000 (03:12 +0000)]
[IR] Add a `makeNoWrapRegion` method to `ConstantRange`

Summary: This will be used in a future change to ScalarEvolution.

Reviewers: hfinkel, reames, nlewycky

Subscribers: llvm-commits

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

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

8 years ago[OperandBundles] Teach AliasAnalysis about operand bundles
Sanjoy Das [Thu, 22 Oct 2015 03:12:51 +0000 (03:12 +0000)]
[OperandBundles] Teach AliasAnalysis about operand bundles

Summary:
If a `CallSite` has operand bundles, then do not peek into the called
function to get a more precise `ModRef` answer.

This is tested using `argmemonly`, `-basicaa` and `-gvn`; but the
functionality is not specific to any of these.

Depends on D13961

Reviewers: reames, chandlerc

Subscribers: llvm-commits

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

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

8 years ago[OperandBundles] Make function attributes conservatively correct
Sanjoy Das [Thu, 22 Oct 2015 03:12:22 +0000 (03:12 +0000)]
[OperandBundles] Make function attributes conservatively correct

Summary:
This makes attribute accessors on `CallInst` and `InvokeInst` do the
(conservatively) right thing.  This essentially involves, in some
cases, *not* falling back querying the attributes on the called
`llvm::Function` when operand bundles are present.

Attributes locally present on the `CallInst` or `InvokeInst` will still
override operand bundle semantics.  The LangRef has been amended to
reflect this.  Note: this change does not do anything prevent
`-function-attrs` from inferring `CallSite` local attributes after
inspecting the called function -- that will be done as a separate
change.

I've used `-adce` and `-early-cse` to test these changes.  There is
nothing special about these passes (and they did not require any
changes) except that they seemed be the easiest way to write the tests.

This change does not add deal with `argmemonly`.  That's a later change
because alias analysis requires a related fix before `argmemonly` can be
tested.

Reviewers: reames, chandlerc

Subscribers: llvm-commits

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

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

8 years agoWebAssembly: fix more syntax
JF Bastien [Thu, 22 Oct 2015 02:32:50 +0000 (02:32 +0000)]
WebAssembly: fix more syntax

br_if shouldn't start with a dot.
div and rem went from prefix u/s to suffix.

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

8 years agoAdd missing load/store flags to thumb2 instructions.
Pete Cooper [Thu, 22 Oct 2015 01:48:57 +0000 (01:48 +0000)]
Add missing load/store flags to thumb2 instructions.

These were the cause of a verifier error when building 7zip with
-verify-machineinstrs.  Running 'make check' with the verifier
triggered the same error on the test here so i've updated the test
to run the verifier on one of its runs instead of adding a new one.

While looking at this code, there was a stale comment that these
instructions were only used for disassembly.  This probably used to
be the case, but they are now used in the 'ARM load / store optimization pass' too.

This reapplies r242300 which was reverted in r242428 due to bot failures.

Ultimately those failures were spurious and completely unrelated to this commit.  I reverted this
at the time because it was thought to be at fault.

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

8 years agoAttempt to fix formatting for operand bundles
David Majnemer [Thu, 22 Oct 2015 01:46:38 +0000 (01:46 +0000)]
Attempt to fix formatting for operand bundles

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

8 years agoUpdate LangRef for changes to the alias textual IR format to support typeless pointer...
David Blaikie [Thu, 22 Oct 2015 01:17:29 +0000 (01:17 +0000)]
Update LangRef for changes to the alias textual IR format to support typeless pointer work

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

8 years ago[WinEH] Remove extraneous call to emitEHRegistrationOffsetLabel
David Majnemer [Wed, 21 Oct 2015 23:20:39 +0000 (23:20 +0000)]
[WinEH] Remove extraneous call to emitEHRegistrationOffsetLabel

It's a relic from the earlier implementation, let's remove it.

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

8 years ago[PM]: Fix a doc typo. NFC
Justin Bogner [Wed, 21 Oct 2015 22:51:59 +0000 (22:51 +0000)]
[PM]: Fix a doc typo. NFC

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

8 years agoAMDGPU: Fix adding redundant m0 uses
Matt Arsenault [Wed, 21 Oct 2015 22:37:51 +0000 (22:37 +0000)]
AMDGPU: Fix adding redundant m0 uses

BuildMI already adds these since they are defined correctly now.

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

8 years agoAMDGPU: Fix verifier error in SIFoldOperands
Matt Arsenault [Wed, 21 Oct 2015 22:37:50 +0000 (22:37 +0000)]
AMDGPU: Fix verifier error in SIFoldOperands

There may be other use operands that also need their kill flags cleared.

This happens in a few tests when SIFoldOperands is moved after
PeepholeOptimizer.

PeepholeOptimizer rewrites cases that look like:
%vreg0 = ...
%vreg1 = COPY %vreg0
use %vreg1<kill>
%vreg2 = COPY %vreg0
use %vreg2<kill>

to use the earlier source to
%vreg0 = ...
use %vreg0
use %vreg0

Currently SIFoldOperands sees the copied registers, so there is
only one use. So far I haven't managed to come up with a test
that currently has multiple uses of a foldable VGPR -> VGPR copy.

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

8 years agoAMDGPU: Split DiagnosticInfoUnsupported into its own file
Matt Arsenault [Wed, 21 Oct 2015 22:37:46 +0000 (22:37 +0000)]
AMDGPU: Split DiagnosticInfoUnsupported into its own file

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

8 years ago[JIT] Towards a working small memory model.
Davide Italiano [Wed, 21 Oct 2015 22:12:03 +0000 (22:12 +0000)]
[JIT] Towards a working small memory model.

This commit introduces an option, --preallocate, so that we can get memory
upfront and use it in small memory model tests (in order to get
reliable results).

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

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

8 years agoAMDGPU: Simplify VOP3 operand legalization.
Matt Arsenault [Wed, 21 Oct 2015 21:51:02 +0000 (21:51 +0000)]
AMDGPU: Simplify VOP3 operand legalization.

This was checking for a variety of situations that should
never happen. This saves a tiny bit of compile time.

We should not be selecting instructions with invalid operands in the
first place. Most of the time for registers copys are inserted
to the correct operand register class.

For VOP3, since all operand types are supported and literal
constants never are, we just need to verify the constant bus
requirements (all immediates should be legal inline ones).

The only possibly tricky case to maybe worry about is if when
legalizing operands in moveToVALU with s_add_i32 and similar
instructions. If the original s_add_i32 had a literal constant
and we need to replace it with v_add_i32_e64 we would have an
unsupported literal operand.  However, I don't think we should worry
about that because SIFoldOperands should handle folding literal
constant operands into the SALU instructions based on the uses.
At SIFoldOperands time, the legality and profitability of
operand types is a bit different.

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

8 years ago[InstCombine] Revise the test case to match full sequene
Michael Liao [Wed, 21 Oct 2015 21:50:58 +0000 (21:50 +0000)]
[InstCombine] Revise the test case to match full sequene

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

8 years agoAMDGPU: Fix not checking implicit operands in verifyInstruction
Matt Arsenault [Wed, 21 Oct 2015 21:15:01 +0000 (21:15 +0000)]
AMDGPU: Fix not checking implicit operands in verifyInstruction

When verifying constant bus restrictions, this wasn't catching
uses in implicit operands.

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

8 years agoUse numeric_limits instead of LLONG_MAX
Matt Arsenault [Wed, 21 Oct 2015 21:10:12 +0000 (21:10 +0000)]
Use numeric_limits instead of LLONG_MAX

This is a build fix for configurations where LLONG_MAX is
not defined in system headers.

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

8 years agoLegalizeDAG: Implement promote for build_vector
Matt Arsenault [Wed, 21 Oct 2015 21:10:10 +0000 (21:10 +0000)]
LegalizeDAG: Implement promote for build_vector

This will be used in future commits for AMDGPU to promote
operations on i64 vectors into operations on 32-bit vector
components.

This will be used / tested in future AMDGPU commits.

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

8 years ago[Verifier] Minor comment update, NFC
Vedant Kumar [Wed, 21 Oct 2015 20:33:31 +0000 (20:33 +0000)]
[Verifier] Minor comment update, NFC

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

8 years ago[RuntimeDyld] Ignore ST_FILE symbols when constructing GlobalSymbolTable
Keno Fischer [Wed, 21 Oct 2015 20:22:04 +0000 (20:22 +0000)]
[RuntimeDyld] Ignore ST_FILE symbols when constructing GlobalSymbolTable

Summary: ELF's STT_File symbols may overlap with regular globals in
other files, so we should ignore them here in order to avoid having
bogus entries in the symbol table that confuse us when resolving relocations.

Reviewers: lhames

Subscribers: llvm-commits

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

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

8 years ago[Orc] Clean up a comment.
Lang Hames [Wed, 21 Oct 2015 20:13:41 +0000 (20:13 +0000)]
[Orc] Clean up a comment.

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

8 years agoDrop assert that a call with struct return goes to a function with sret
Joerg Sonnenberger [Wed, 21 Oct 2015 20:05:01 +0000 (20:05 +0000)]
Drop assert that a call with struct return goes to a function with sret
attribute. Clang incorrectly misses it on __muldc3 and friends and the
type system doesn't include it properly either.

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

8 years ago[WinEH] Add test for llvm.va.start in catchpad
Reid Kleckner [Wed, 21 Oct 2015 19:54:40 +0000 (19:54 +0000)]
[WinEH] Add test for llvm.va.start in catchpad

It already works, but we should have a test for it.

This used to be PR23094 in the old model.

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

8 years agoSilence Visual C++ warning in function summary parsing code (NFC)
Teresa Johnson [Wed, 21 Oct 2015 19:25:14 +0000 (19:25 +0000)]
Silence Visual C++ warning in function summary parsing code (NFC)

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

8 years ago[x86] move recursive add match for LEA to helper function; NFCI
Sanjay Patel [Wed, 21 Oct 2015 18:56:06 +0000 (18:56 +0000)]
[x86] move recursive add match for LEA to helper function; NFCI

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

8 years agoRevert r250923 as config.h is not an installed header.
Yaron Keren [Wed, 21 Oct 2015 18:36:52 +0000 (18:36 +0000)]
Revert r250923 as config.h is not an installed header.

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

8 years agoInclude llvm/Config/config.h in FileSystem.h as it depends upon HAVE_SYS_STAT_H which...
Yaron Keren [Wed, 21 Oct 2015 18:28:35 +0000 (18:28 +0000)]
Include llvm/Config/config.h in FileSystem.h as it depends upon HAVE_SYS_STAT_H which is defined (or not) in config.h.

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

8 years ago[SimplifyCFG] Don't use-after-free an SSA value
David Majnemer [Wed, 21 Oct 2015 18:22:24 +0000 (18:22 +0000)]
[SimplifyCFG] Don't use-after-free an SSA value

SimplifyTerminatorOnSelect didn't consider the possibility that the
condition might be related to one of PHI nodes.

This fixes PR25267.

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

8 years ago[OCaml] Expose Llvm.{set_,}unnamed_addr.
Peter Zotov [Wed, 21 Oct 2015 17:43:02 +0000 (17:43 +0000)]
[OCaml] Expose Llvm.{set_,}unnamed_addr.

Patch by Jacques-Pascal Deplaix <jp.deplaix@gmail.com>

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

8 years ago[X86] Add AMD mwaitx, monitorx, and clzero instructions to the assembly parser and...
Craig Topper [Wed, 21 Oct 2015 17:26:45 +0000 (17:26 +0000)]
[X86] Add AMD mwaitx, monitorx, and clzero instructions to the assembly parser and disassembler.

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

8 years ago[x86] add test case that shows holes in LEA isel
Sanjay Patel [Wed, 21 Oct 2015 17:24:00 +0000 (17:24 +0000)]
[x86] add test case that shows holes in LEA isel

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

8 years agoBacking out commit r250906 as it broke lld.
Kevin Enderby [Wed, 21 Oct 2015 17:13:20 +0000 (17:13 +0000)]
Backing out commit r250906 as it broke lld.

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

8 years agoThis removes the eating of the error in Archive::Child::getSize() when the characters
Kevin Enderby [Wed, 21 Oct 2015 16:59:24 +0000 (16:59 +0000)]
This removes the eating of the error in Archive::Child::getSize() when the characters
in the size field in the archive header for the member is not a number.  To do this we
have all of the needed methods return ErrorOr to push them up until we get out of lib.
Then the tools and can handle the error in whatever way is appropriate for that tool.

So the solution is to plumb all the ErrorOr stuff through everything that touches archives.
This include its iterators as one can create an Archive object but the first or any other
Child object may fail to be created due to a bad size field in its header.

Thanks to Lang Hames on the changes making child_iterator contain an
ErrorOr<Child> instead of a Child and the needed changes to ErrorOr.h to add
operator overloading for * and -> .

We don’t want to use llvm_unreachable() as it calls abort() and is produces a “crash”
and using report_fatal_error() to move the error checking will cause the program to
stop, neither of which are really correct in library code. There are still some uses of
these that should be cleaned up in this library code for other than the size field.

Also corrected the code where the size gets us to the “at the end of the archive”
which is OK but past the end of the archive will return object_error::parse_failed now.

The test cases use archives with text files so one can see the non-digit character,
in this case a ‘%’, in the size field.

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

8 years ago[Option] Use an ArrayRef to store the Option Infos in OptTable. NFC
Craig Topper [Wed, 21 Oct 2015 16:30:42 +0000 (16:30 +0000)]
[Option] Use an ArrayRef to store the Option Infos in OptTable. NFC

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

8 years ago[llvm-cov] Adjust column widths for function and file reports
Vedant Kumar [Wed, 21 Oct 2015 16:03:32 +0000 (16:03 +0000)]
[llvm-cov] Adjust column widths for function and file reports

Previously, we only expanded function and filename column widths when
rendering file reports. This commit makes the change for function
reports as well.

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

8 years ago[mips][mips16] Re-work the inline assembly stubs to work with IAS. NFC.
Daniel Sanders [Wed, 21 Oct 2015 12:44:14 +0000 (12:44 +0000)]
[mips][mips16] Re-work the inline assembly stubs to work with IAS. NFC.

Summary:
Previously, we were inserting an InlineAsm statement for each line of the
inline assembly. This works for GAS but it triggers prologue/epilogue
emission when IAS is in use. This caused:
    .set noreorder
    .cpload $25
to be emitted as:
    .set push
    .set reorder
    .set noreorder
    .set pop
    .set push
    .set reorder
    .cpload $25
    .set pop
which led to assembler errors and caused the test to fail.

The whitespace-after-comma changes included in this patch are necessary to
match the output when IAS is in use.

Reviewers: vkalintiris

Subscribers: rkotler, llvm-commits, dsanders

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

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

8 years ago[AA] Enhance the new AliasAnalysis infrastructure with an optional
Chandler Carruth [Wed, 21 Oct 2015 12:15:19 +0000 (12:15 +0000)]
[AA] Enhance the new AliasAnalysis infrastructure with an optional
"external" AA wrapper pass.

This is a generic hook that can be used to thread custom code into the
primary AAResultsWrapperPass for the legacy pass manager in order to
allow it to merge external AA results into the AA results it is
building. It does this by threading in a raw callback and so it is
*very* powerful and should serve almost any use case I have come up with
for extending the set of alias analyses used. The only thing not well
supported here is using a *different order* of alias analyses. That form
of extension *is* supportable with the new pass manager, and I can make
the callback structure here more elaborate to support it in the legacy
pass manager if this is a critical use case that people are already
depending on, but the only use cases I have heard of thus far should be
reasonably satisfied by this simpler extension mechanism.

It is hard to test this using normal facilities (the built-in AAs don't
use this for obvious reasons) so I've written a fairly extensive set of
custom passes in the alias analysis unit test that should be an
excellent test case because it models the out-of-tree users: it adds
a totally custom AA to the system. This should also serve as
a reasonably good example and guide for out-of-tree users to follow in
order to rig up their existing alias analyses.

No support in opt for commandline control is provided here however. I'm
really unhappy with the kind of contortions that would be required to
support that. It would fully re-introduce the analysis group
self-recursion kind of patterns. =/

I've heard from out-of-tree users that this will unblock their use cases
with extending AAs on top of the new infrastructure and let us retain
the new analysis-group-free-world.

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

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

8 years agoMasked Load/Store optimization for scalar code
Elena Demikhovsky [Wed, 21 Oct 2015 11:50:54 +0000 (11:50 +0000)]
Masked Load/Store optimization for scalar code
When we have to convert the masked.load, masked.store to scalar code, we generate a chain of conditional basic blocks.
I added optimization for constant mask vector.

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

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

8 years ago[mips][msa] Remove copy_u.d and move copy_u.w to MSA64.
Daniel Sanders [Wed, 21 Oct 2015 09:58:54 +0000 (09:58 +0000)]
[mips][msa] Remove copy_u.d and move copy_u.w to MSA64.

Summary:
The forwards compatibility strategy employed by MIPS is to consider registers
to be infinitely sign-extended. Then on ISA's with a wider register, the result
of existing instructions are sign-extended to register width and zero-extended
counterparts are added. copy_u.w on MSA32 and copy_u.w on MSA64 violate this
strategy and we have therefore corrected the MSA specs to fix this.

We still keep track of sign/zero-extension during legalization but we now
match copy_s.[wd] where required.

No change required to clang since __builtin_msa_copy_u_[wd] will map to
copy_s.[wd] where appropriate for the target.

Reviewers: vkalintiris

Subscribers: llvm-commits

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

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

8 years agoLet MachineVerifier be aware of mem-to-mem instructions.
Jonas Paulsson [Wed, 21 Oct 2015 07:39:47 +0000 (07:39 +0000)]
Let MachineVerifier be aware of mem-to-mem instructions.

A mem-to-mem instruction (that both loads and stores), which store to an
FI, cannot pass the verifier since it thinks it is loading from the FI.

For the mem-to-mem instruction, do a looser check in visitMachineOperand()
and only check liveness at the reg-slot while analyzing a frame index operand.

Needed to make CodeGen/SystemZ/xor-01.ll pass with -verify-machineinstrs,
which now runs with this flag.

Reviewed by Evan Cheng and Quentin Colombet.

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

8 years agoDo not use `dyn_cast<X>` after `isa<X>` (NFC)
Mehdi Amini [Wed, 21 Oct 2015 06:11:01 +0000 (06:11 +0000)]
Do not use `dyn_cast<X>` after `isa<X>` (NFC)

From: Mehdi Amini <mehdi.amini@apple.com>

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

8 years agoRevert "Add missing #include, found by modules build."
Mehdi Amini [Wed, 21 Oct 2015 06:10:55 +0000 (06:10 +0000)]
Revert "Add missing #include, found by modules build."

This reverts commit r250239.
It seems unwanted changes got committed here, and part of
the patch does not seem correct.
For instance RoundUpToAlignment() is called without its returned
value actually used.

From: Mehdi Amini <mehdi.amini@apple.com>

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

8 years agoTail duplication can mix incompatible registers in phi nodes
Krzysztof Parzyszek [Wed, 21 Oct 2015 02:40:06 +0000 (02:40 +0000)]
Tail duplication can mix incompatible registers in phi nodes

Do not tail duplicate blocks where the successor has a phi node,
and the corresponding value in that phi node uses a subregister.

http://reviews.llvm.org/D13922

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

8 years agoWebAssembly: support imports
JF Bastien [Wed, 21 Oct 2015 02:23:09 +0000 (02:23 +0000)]
WebAssembly: support imports

C/C++ code can declare an extern function, which will show up as an import in WebAssembly's output. It's expected that the linker will resolve these, and mark unresolved imports as call_import (I have a patch which does this in wasmate).

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

8 years agoTolerate negative offset when matching sample profile.
Dehao Chen [Wed, 21 Oct 2015 01:22:27 +0000 (01:22 +0000)]
Tolerate negative offset when matching sample profile.

In some cases (as illustrated in the unittest), lineno can be less than the heade_lineno because the function body are included from some other files. In this case, offset will be negative. This patch makes clang still able to match the profile to IR in this situation.

http://reviews.llvm.org/D13914

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

8 years ago[Hexagon] Bit-based instruction simplification
Krzysztof Parzyszek [Tue, 20 Oct 2015 22:57:13 +0000 (22:57 +0000)]
[Hexagon] Bit-based instruction simplification

Analyze bit patterns of operands and values of instructions to perform
various simplifications, dead/redundant code elimination, etc.

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

8 years ago[Hexagon] Fix isNVStorable flag in .td files
Krzysztof Parzyszek [Tue, 20 Oct 2015 22:40:57 +0000 (22:40 +0000)]
[Hexagon] Fix isNVStorable flag in .td files

An upper half and a double word cannot be used as value sources in a
new-value store.

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

8 years ago[MemorySanitizer] NFC. Do not use GET_INTRINSIC_MODREF_BEHAVIOR table.
Igor Laevsky [Tue, 20 Oct 2015 21:33:30 +0000 (21:33 +0000)]
[MemorySanitizer] NFC. Do not use GET_INTRINSIC_MODREF_BEHAVIOR table.

It is now possible to infer intrinsic modref behaviour purely from intrinsic attributes.
This change will allow to completely remove GET_INTRINSIC_MODREF_BEHAVIOR table.

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

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

8 years ago[X86][SSE] Add 256-bit vector bit rotation tests.
Simon Pilgrim [Tue, 20 Oct 2015 20:27:23 +0000 (20:27 +0000)]
[X86][SSE] Add 256-bit vector bit rotation tests.

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

8 years agobugpoint: Remove implicit ilist iterator conversions, NFC
Duncan P. N. Exon Smith [Tue, 20 Oct 2015 19:36:39 +0000 (19:36 +0000)]
bugpoint: Remove implicit ilist iterator conversions, NFC

This is the last of the implicit ilist iterator conversions in LLVM.
Still up for debate whether we let these bitrot back:
http://lists.llvm.org/pipermail/llvm-dev/2015-October/091617.html

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

8 years ago[Hexagon] Capture aggregate variables by reference, not value
Krzysztof Parzyszek [Tue, 20 Oct 2015 19:33:46 +0000 (19:33 +0000)]
[Hexagon] Capture aggregate variables by reference, not value

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

8 years ago[Hexagon] Do not fall-through if there is no CFG edge
Krzysztof Parzyszek [Tue, 20 Oct 2015 19:30:21 +0000 (19:30 +0000)]
[Hexagon] Do not fall-through if there is no CFG edge

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

8 years ago[Hexagon] Use symbolic name for subregister instead of hardcoded number
Krzysztof Parzyszek [Tue, 20 Oct 2015 19:26:36 +0000 (19:26 +0000)]
[Hexagon] Use symbolic name for subregister instead of hardcoded number

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

8 years ago[Hexagon] Change Based->Base in getBasedWithImmOffset
Krzysztof Parzyszek [Tue, 20 Oct 2015 19:21:05 +0000 (19:21 +0000)]
[Hexagon] Change Based->Base in getBasedWithImmOffset

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

8 years ago[Hexagon] Remove the remnants of isConstExtProfitable
Krzysztof Parzyszek [Tue, 20 Oct 2015 19:04:53 +0000 (19:04 +0000)]
[Hexagon] Remove the remnants of isConstExtProfitable

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

8 years agounittests: Remove implicit ilist iterator conversions, NFC
Duncan P. N. Exon Smith [Tue, 20 Oct 2015 18:30:20 +0000 (18:30 +0000)]
unittests: Remove implicit ilist iterator conversions, NFC

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

8 years agollvm-diff: Remove implicit ilist iterator conversions, NFC
Duncan P. N. Exon Smith [Tue, 20 Oct 2015 18:17:05 +0000 (18:17 +0000)]
llvm-diff: Remove implicit ilist iterator conversions, NFC

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

8 years ago[CMake] All the checks for if LLVM_VERSION_* variables are set need to be if(DEFINED...
Chris Bieneman [Tue, 20 Oct 2015 18:16:37 +0000 (18:16 +0000)]
[CMake] All the checks for if LLVM_VERSION_* variables are set need to be if(DEFINED ...)

This is because if you set one of the variables to 0, if(NOT ...) is true, which isn't what you actually want. Should have thought that through better the first time.

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

8 years ago[CMake] Refactor subdirectory inclusion code to take a project name.
Chris Bieneman [Tue, 20 Oct 2015 16:42:58 +0000 (16:42 +0000)]
[CMake] Refactor subdirectory inclusion code to take a project name.

Summary:
This refactoring makes some of the code used to control including subdirectories parameterized so it can be re-used elsewhere.

Specifically I want to re-use this code in clang to be able to turn off specific tool subdirectories.

Reviewers: chapuni, filcab, bogner, Bigcheese

Subscribers: emaste, llvm-commits

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

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

8 years agoTwo switch blocks in VectorLegalizer::LegalizeOp already have a
Artyom Skrobov [Tue, 20 Oct 2015 15:06:37 +0000 (15:06 +0000)]
Two switch blocks in VectorLegalizer::LegalizeOp already have a

  default: llvm_unreachable("This action is not supported yet!");

-- so I'm adding one to the third switch block, too.

This is a follow-up fix for http://reviews.llvm.org/D13862

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

8 years ago[SystemZ] Use LivePhysRegs helper class in SystemZShortenInst.cpp.
Jonas Paulsson [Tue, 20 Oct 2015 15:05:58 +0000 (15:05 +0000)]
[SystemZ] Use LivePhysRegs helper class in SystemZShortenInst.cpp.

Don't use home brewed liveness tracking code for phys regs, since
this class does the job.

Reviewed by Ulrich Weigand.

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

8 years ago[SystemZ] Comment fix in test/CodeGen/SystemZ/fp-cmp-05.ll
Jonas Paulsson [Tue, 20 Oct 2015 15:05:54 +0000 (15:05 +0000)]
[SystemZ] Comment fix in test/CodeGen/SystemZ/fp-cmp-05.ll

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

8 years agoAdding support for TargetLoweringBase::LibCall
Artyom Skrobov [Tue, 20 Oct 2015 13:14:52 +0000 (13:14 +0000)]
Adding support for TargetLoweringBase::LibCall

Summary:
TargetLoweringBase::Expand is defined as "Try to expand this to other ops,
otherwise use a libcall." For ISD::UDIV and ISD::SDIV, the choice between
the two possibilities was defined in a rather convoluted way:

- if DIVREM is legal, expand to DIVREM
- if DIVREM has a custom lowering, expand to DIVREM
- if DIVREM libcall is defined and a remainder from the same division is
  computed elsewhere, expand to a DIVREM libcall
- else, expand to a DIV libcall

This had the undesirable effect that if both DIV and DIVREM are implemented
as libcalls, then ISD::UDIV and ISD::SDIV are expanded to the heavier DIVREM
libcall, even when the remainder isn't used.

The new code adds a new LegalizeAction, TargetLoweringBase::LibCall, so that
backends can directly control whether they prefer an expansion or a conversion
to a libcall. This makes the generic lowering code even more generic,
allowing its reuse in a wider range of target-specific configurations.

The useful effect is that ARM backend will now generate a call
to __aeabi_{i,u}div rather than __aeabi_{i,u}divmod in cases where
it doesn't need the remainder. There's no functional change outside
the ARM backend.

Reviewers: t.p.northover, rengolin

Subscribers: t.p.northover, llvm-commits, aemerson

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

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

8 years agoCombining DIV+REM->DIVREM doesn't belong in LegalizeDAG; move it over into DAGCombiner.
Artyom Skrobov [Tue, 20 Oct 2015 13:06:02 +0000 (13:06 +0000)]
Combining DIV+REM->DIVREM doesn't belong in LegalizeDAG; move it over into DAGCombiner.

Summary:
In addition to moving the code over, this patch amends the DIV,REM -> DIVREM
combining to run on all affected nodes at once: if the nodes are converted
to DIVREM one at a time, then the resulting DIVREM may get legalized by the
backend into something target-specific that we won't be able to recognize
and correlate with the remaining nodes.

The motivation is to "prepare terrain" for D13862: when we set DIV and REM
to be legalized to libcalls, instead of the DIVREM, we otherwise lose the
ability to combine them together. To prevent this, we need to take the
DIV,REM -> DIVREM combining out of the lowering stage.

Reviewers: RKSimon, eli.friedman, rengolin

Subscribers: john.brawn, rengolin, llvm-commits

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

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

8 years agoAVX512: Implemented encoding and intrinsics for VPBROADCASTB/W/D/Q instructions.
Igor Breger [Tue, 20 Oct 2015 11:56:42 +0000 (11:56 +0000)]
AVX512: Implemented encoding and intrinsics for VPBROADCASTB/W/D/Q instructions.

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

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

8 years ago[x86] Fix AVX maskload/store intrinsic prototypes.
Andrea Di Biagio [Tue, 20 Oct 2015 11:20:13 +0000 (11:20 +0000)]
[x86] Fix AVX maskload/store intrinsic prototypes.

The mask value type for maskload/maskstore GCC builtins is never a vector of
packed floats/doubles.

This patch fixes the following issues:
1. The mask argument for builtin_ia32_maskloadpd and builtin_ia32_maskstorepd
   should be of type llvm_v2i64_ty and not llvm_v2f64_ty.
2. The mask argument for builtin_ia32_maskloadpd256 and
   builtin_ia32_maskstorepd256 should be of type llvm_v4i64_ty and not
   llvm_v4f64_ty.
3. The mask argument for builtin_ia32_maskloadps and builtin_ia32_maskstoreps
   should be of type llvm_v4i32_ty and not llvm_v4f32_ty.
4. The mask argument for builtin_ia32_maskloadps256 and
   builtin_ia32_maskstoreps256 should be of type llvm_v8i32_ty and not
   llvm_v8f32_ty.

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

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

8 years agoFix missing INITIALIZE_PASS_DEPENDENCY for AddressSanitizer
Keno Fischer [Tue, 20 Oct 2015 10:13:55 +0000 (10:13 +0000)]
Fix missing INITIALIZE_PASS_DEPENDENCY for AddressSanitizer

Summary: In r231241, TargetLibraryInfoWrapperPass was added to
`getAnalysisUsage` for `AddressSanitizer`, but the corresponding
`INITIALIZE_PASS_DEPENDENCY` was not added.

Reviewers: dvyukov, chandlerc, kcc

Subscribers: kcc, llvm-commits

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

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

8 years agoMake class final to pacify -Wnon-virtual-dtor.
Manuel Klimek [Tue, 20 Oct 2015 08:21:01 +0000 (08:21 +0000)]
Make class final to pacify -Wnon-virtual-dtor.

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

8 years agoAMDGPU: Add MachineInstr overloads for instruction format tests
Matt Arsenault [Tue, 20 Oct 2015 04:35:43 +0000 (04:35 +0000)]
AMDGPU: Add MachineInstr overloads for instruction format tests

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

8 years ago[Orc] Make CompileOnDemandLayer::findSymbol call BaseLayer::findSymbol if no
Lang Hames [Tue, 20 Oct 2015 04:35:02 +0000 (04:35 +0000)]
[Orc] Make CompileOnDemandLayer::findSymbol call BaseLayer::findSymbol if no
symbol definition is found in the logical dylibs.

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

8 years agoAMDGPU: Stop reserving v[254:255]
Matt Arsenault [Tue, 20 Oct 2015 03:59:58 +0000 (03:59 +0000)]
AMDGPU: Stop reserving v[254:255]

This wasn't doing anything useful. They weren't explicitly used
anywhere, and the RegScavenger ignores reserved registers.

This for some reason caused a random scheduling change in the test.
Getting the check lines to pass is too frustrating, and there's probably
not too much value in checking the vector case's operands N times.

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

8 years agoWebAssembly: fix call/return syntax.
JF Bastien [Tue, 20 Oct 2015 01:26:54 +0000 (01:26 +0000)]
WebAssembly: fix call/return syntax.

They are now typeless, unlike other operations.

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

8 years agoMSP430: Remove implicit ilist iterator conversions, NFC
Duncan P. N. Exon Smith [Tue, 20 Oct 2015 01:18:39 +0000 (01:18 +0000)]
MSP430: Remove implicit ilist iterator conversions, NFC

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

8 years agoAsmParser: Remove implicit ilist iterator conversions, NFC
Duncan P. N. Exon Smith [Tue, 20 Oct 2015 01:12:49 +0000 (01:12 +0000)]
AsmParser: Remove implicit ilist iterator conversions, NFC

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

8 years agoSystemZ: Remove implicit ilist iterator conversion, NFC
Duncan P. N. Exon Smith [Tue, 20 Oct 2015 01:12:46 +0000 (01:12 +0000)]
SystemZ: Remove implicit ilist iterator conversion, NFC

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

8 years agoXCore: Remove implicit ilist iterator conversions, NFC
Duncan P. N. Exon Smith [Tue, 20 Oct 2015 01:07:42 +0000 (01:07 +0000)]
XCore: Remove implicit ilist iterator conversions, NFC

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

8 years agoPowerPC: Remove implicit ilist iterator conversions, NFC
Duncan P. N. Exon Smith [Tue, 20 Oct 2015 01:07:37 +0000 (01:07 +0000)]
PowerPC: Remove implicit ilist iterator conversions, NFC

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

8 years ago[RS4GC] Remove a redundant linear search, NFCI
Sanjoy Das [Tue, 20 Oct 2015 01:06:31 +0000 (01:06 +0000)]
[RS4GC] Remove a redundant linear search, NFCI

Since LiveVariables is uniqued (we just created it from a `DenseSet`),
`FindIndex(LiveVariables, LiveVariables[i])` is always `i`.

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

8 years ago[RS4GC] Clean up `find_index`; NFC
Sanjoy Das [Tue, 20 Oct 2015 01:06:28 +0000 (01:06 +0000)]
[RS4GC] Clean up `find_index`; NFC

 - Bring it up to the LLVM Coding Style
 - Sink it inside `CreateGCRelocates`, which is its only user

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

8 years ago[RS4GC] Re-purpose `normalizeForInvokeSafepoint`; NFC.
Sanjoy Das [Tue, 20 Oct 2015 01:06:24 +0000 (01:06 +0000)]
[RS4GC] Re-purpose `normalizeForInvokeSafepoint`; NFC.

`normalizeForInvokeSafepoint` in RewriteStatepointsForGC.cpp, as it is
written today, deals with `gc.relocate` and `gc.result` uses of a
statepoint equally well.  This change documents this fact and adds a
test case.

There is no functional change here -- only documentation of existing
functionality.

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

8 years ago[RS4GC] Minor cleanup to `normalizeForInvokeSafepoint`; NFC
Sanjoy Das [Tue, 20 Oct 2015 01:06:17 +0000 (01:06 +0000)]
[RS4GC] Minor cleanup to `normalizeForInvokeSafepoint`; NFC

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

8 years agoSparc: Remove implicit ilist iterator conversions, NFC
Duncan P. N. Exon Smith [Tue, 20 Oct 2015 00:59:43 +0000 (00:59 +0000)]
Sparc: Remove implicit ilist iterator conversions, NFC

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

8 years agoNVPTX: Remove implicit ilist iterator conversions, NFC
Duncan P. N. Exon Smith [Tue, 20 Oct 2015 00:54:09 +0000 (00:54 +0000)]
NVPTX: Remove implicit ilist iterator conversions, NFC

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

8 years agoHexagon: Remove implicit ilist iterator conversions, NFC
Duncan P. N. Exon Smith [Tue, 20 Oct 2015 00:46:39 +0000 (00:46 +0000)]
Hexagon: Remove implicit ilist iterator conversions, NFC

There are two things out of the ordinary in this commit.  First, I made
a loop obviously "infinite" in HexagonInstrInfo.cpp.  After checking if
an instruction was at the beginning of a basic block (in which case,
`break`), the loop decremented and checked the iterator for `nullptr` as
the loop condition.  This has never been possible (the prev pointers are
always been circular, so even with the weird ilist/iplist
implementation, this isn't been possible), so I removed the condition.

Second, in HexagonAsmPrinter.cpp there was another case of comparing a
`MachineBasicBlock::instr_iterator` against `MachineBasicBlock::end()`
(which returns `MachineBasicBlock::iterator`).  While not incorrect,
it's fragile.  I switched this to `::instr_end()`.

All that said, no functionality change intended here.

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

8 years agoWebAssembly: fix syntax for br_if.
JF Bastien [Tue, 20 Oct 2015 00:37:42 +0000 (00:37 +0000)]
WebAssembly: fix syntax for br_if.

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

8 years agoAsmPrinter: Remove implicit ilist iterator conversion, NFC
Duncan P. N. Exon Smith [Tue, 20 Oct 2015 00:36:08 +0000 (00:36 +0000)]
AsmPrinter: Remove implicit ilist iterator conversion, NFC

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

8 years agoMips: Remove implicit ilist iterator conversions, NFC
Duncan P. N. Exon Smith [Tue, 20 Oct 2015 00:15:20 +0000 (00:15 +0000)]
Mips: Remove implicit ilist iterator conversions, NFC

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

8 years agoCppBackend: Remove implicit ilist iterator conversions, NFC
Duncan P. N. Exon Smith [Tue, 20 Oct 2015 00:06:41 +0000 (00:06 +0000)]
CppBackend: Remove implicit ilist iterator conversions, NFC

Mostly just converted to range-based for loops.  May have converted a
couple of extra loops as a drive-by (not sure).

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

8 years agoBPF: Remove implicit ilist iterator conversion, NFC
Duncan P. N. Exon Smith [Tue, 20 Oct 2015 00:02:50 +0000 (00:02 +0000)]
BPF: Remove implicit ilist iterator conversion, NFC

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

8 years agoARM: Remove implicit ilist iterator conversions, NFC
Duncan P. N. Exon Smith [Mon, 19 Oct 2015 23:25:57 +0000 (23:25 +0000)]
ARM: Remove implicit ilist iterator conversions, NFC

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

8 years ago[Orc] Fix MSVC bugs introduced in r250749.
Lang Hames [Mon, 19 Oct 2015 23:23:17 +0000 (23:23 +0000)]
[Orc] Fix MSVC bugs introduced in r250749.

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

8 years agoObjCARC: Remove implicit ilist iterator conversions, NFC
Duncan P. N. Exon Smith [Mon, 19 Oct 2015 23:20:14 +0000 (23:20 +0000)]
ObjCARC: Remove implicit ilist iterator conversions, NFC

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

8 years agoEnhance loop rotation with existence of profile data in MachineBlockPlacement pass.
Cong Hou [Mon, 19 Oct 2015 23:16:40 +0000 (23:16 +0000)]
Enhance loop rotation with existence of profile data in MachineBlockPlacement pass.

Currently, in MachineBlockPlacement pass the loop is rotated to let the best exit to be the last BB in the loop chain, to maximize the fall-through from the loop to outside. With profile data, we can determine the cost in terms of missed fall through opportunities when rotating a loop chain and select the best rotation. Basically, there are three kinds of cost to consider for each rotation:

1. The possibly missed fall through edge (if it exists) from BB out of the loop to the loop header.
2. The possibly missed fall through edges (if they exist) from the loop exits to BB out of the loop.
3. The missed fall through edge (if it exists) from the last BB to the first BB in the loop chain.

Therefore, the cost for a given rotation is the sum of costs listed above. We select the best rotation with the smallest cost. This is only for PGO mode when we have more precise edge frequencies.

Differential revision: http://reviews.llvm.org/D10717

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

8 years ago[Orc] Use '= default' for move constructor/assignment as per dblaikie's review.
Lang Hames [Mon, 19 Oct 2015 22:49:18 +0000 (22:49 +0000)]
[Orc] Use '= default' for move constructor/assignment as per dblaikie's review.

Thanks Dave!

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

8 years agoLinker: Remove implicit ilist iterator conversion, NFC
Duncan P. N. Exon Smith [Mon, 19 Oct 2015 22:23:36 +0000 (22:23 +0000)]
Linker: Remove implicit ilist iterator conversion, NFC

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

8 years agoFix -Wdeprecated regarding ORC copying ValueMaterializers
David Blaikie [Mon, 19 Oct 2015 22:15:55 +0000 (22:15 +0000)]
Fix -Wdeprecated regarding ORC copying ValueMaterializers

As usual, this is a polymorphic hierarchy without polymorphic ownership,
so simply make the dtor protected non-virtual, protected default copy
ctor/assign, and make derived classes final. The derived classes will
pick up correct default public copy ops (and dtor) implicitly.

(wish I could add -Wdeprecated to the build, but last time I tried it
triggered on some system headers I still need to look into/figure out)

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