oota-llvm.git
9 years agoRefreshed tests.
Simon Pilgrim [Sat, 18 Jul 2015 16:53:51 +0000 (16:53 +0000)]
Refreshed tests.

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

9 years agoRefreshed tests and reordered in descending integer size.
Simon Pilgrim [Sat, 18 Jul 2015 16:14:56 +0000 (16:14 +0000)]
Refreshed tests and reordered in descending integer size.

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

9 years agoTidyup shufflevector calls - don't repeat inputs if you can avoid it.
Simon Pilgrim [Sat, 18 Jul 2015 15:56:33 +0000 (15:56 +0000)]
Tidyup shufflevector calls - don't repeat inputs if you can avoid it.

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

9 years ago[PM/AA] Remove the addEscapingUse update API that won't be easy to
Chandler Carruth [Sat, 18 Jul 2015 03:26:46 +0000 (03:26 +0000)]
[PM/AA] Remove the addEscapingUse update API that won't be easy to
directly model in the new PM.

This also was an incredibly brittle and expensive update API that was
never fully utilized by all the passes that claimed to preserve AA, nor
could it reasonably have been extended to all of them. Any number of
places add uses of values. If we ever wanted to reliably instrument
this, we would want a callback hook much like we have with ValueHandles,
but doing this for every use addition seems *extremely* expensive in
terms of compile time.

The only user of this update mechanism is GlobalsModRef. The idea of
using this to keep it up to date doesn't really work anyways as its
analysis requires a symmetric analysis of two different memory
locations. It would be very hard to make updates be sufficiently
rigorous to *guarantee* symmetric analysis in this way, and it pretty
certainly isn't true today.

However, folks have been using GMR with this update for a long time and
seem to not be hitting the issues. The reported issue that the update
hook fixes isn't even a problem any more as other changes to
GetUnderlyingObject worked around it, and that issue stemmed from *many*
years ago. As a consequence, a prior patch provided a flag to control
the unsafe behavior of GMR, and this patch removes the update mechanism
that has questionable compile-time tradeoffs and is causing problems
with moving to the new pass manager. Note the lack of test updates --
not one test in tree actually requires this update, even for a contrived
case.

All of this was extensively discussed on the dev list, this patch will
just enact what that discussion decides on. I'm sending it for review in
part to show what I'm planning, and in part to show the *amazing* amount
of work this avoids. Every call to the AA here is something like three
to six indirect function calls, which in the non-LTO pipeline never do
any work! =[

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

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

9 years ago[libFuzzer] require the files and directories passed to the fuzzer to exist
Kostya Serebryany [Sat, 18 Jul 2015 00:03:37 +0000 (00:03 +0000)]
[libFuzzer] require the files and directories passed to the fuzzer to exist

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

9 years ago[asan] Fix shadow mapping on Android/AArch64.
Evgeniy Stepanov [Fri, 17 Jul 2015 23:51:18 +0000 (23:51 +0000)]
[asan] Fix shadow mapping on Android/AArch64.

Instrumentation and the runtime library were in disagreement about
ASan shadow offset on Android/AArch64.

This fixes a large number of existing tests on Android/AArch64.

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

9 years agoARM: Enable MachineScheduler and disable PostRAScheduler for swift.
Matthias Braun [Fri, 17 Jul 2015 23:18:30 +0000 (23:18 +0000)]
ARM: Enable MachineScheduler and disable PostRAScheduler for swift.

Reapply r242500 now that the swift schedmodel includes LDRLIT.

This is mostly done to disable the PostRAScheduler which optimizes for
instruction latencies which isn't a good fit for out-of-order
architectures. This also allows to leave out the itinerary table in
swift in favor of the SchedModel ones.

This change leads to performance improvements/regressions by as much as
10% in some benchmarks, in fact we loose 0.4% performance over the
llvm-testsuite for reasons that appear to be unknown or out of the
compilers control. rdar://20803802 documents the investigation of
these effects.

While it is probably a good idea to perform the same switch for the
other ARM out-of-order CPUs, I limited this change to swift as I cannot
perform the benchmark verification on the other CPUs.

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

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

9 years agoARM: Add scheduling information for LDRLIT instructions to swift scheduling model
Matthias Braun [Fri, 17 Jul 2015 23:18:26 +0000 (23:18 +0000)]
ARM: Add scheduling information for LDRLIT instructions to swift scheduling model

These pseudo instructions are only lowered after register allocation and
are therefore still present when the machine scheduler runs.
Add a run: line to a testcase that uses the uncommon flags necessary to
actually produce a LDRLIT instruction on swift.

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

9 years ago[RAGreedy] Add an experimental deferred spilling feature.
Quentin Colombet [Fri, 17 Jul 2015 23:04:06 +0000 (23:04 +0000)]
[RAGreedy] Add an experimental deferred spilling feature.

The idea of deferred spilling is to delay the insertion of spill code until the
very end of the allocation. A "candidate" to spill variable might not required
to be spilled because of other evictions that happened after this decision was
taken. The spirit is similar to the optimistic coloring strategy implemented in
Preston and Briggs graph coloring algorithm.

For now, this feature is highly experimental. Although correct, it would require
much more modification to properly model the effect of spilling.

Anyway, this early patch helps prototyping this feature.

Note: The test case cannot unfortunately be reduced and is probably fragile.

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

9 years agoMIR Parser: Allow the dollar characters in all of the identifier tokens.
Alex Lorenz [Fri, 17 Jul 2015 22:48:04 +0000 (22:48 +0000)]
MIR Parser: Allow the dollar characters in all of the identifier tokens.

This commit modifies the machine instruction lexer so that it now accepts the
'$' characters in identifier tokens.

This change makes the syntax for unquoted global value tokens consistent with
the syntax for the global idenfitier tokens in the LLVM's assembly language.

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

9 years agoAsmParser: Add a function to parse a standalone constant value.
Alex Lorenz [Fri, 17 Jul 2015 22:07:03 +0000 (22:07 +0000)]
AsmParser: Add a function to parse a standalone constant value.

This commit extends the interface provided by the AsmParser library by adding a
function that allows the user to parse a standalone contant value.

This change is useful for MIR serialization, as it will allow the MIR Parser to
parse the constant values in a machine constant pool.

Reviewers: Duncan P. N. Exon Smith

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

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

9 years ago[asan] Add a comment explaining why non-instrumented allocas are moved.
Kuba Brecka [Fri, 17 Jul 2015 19:20:21 +0000 (19:20 +0000)]
[asan] Add a comment explaining why non-instrumented allocas are moved.

Addition to r242510.

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

9 years agoMergeFuncs: Transfer the function parameter attributes to the call site
Arnold Schwaighofer [Fri, 17 Jul 2015 18:59:08 +0000 (18:59 +0000)]
MergeFuncs: Transfer the function parameter attributes to the call site

rdar://21516488

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

9 years agoStart adding documentation for llvm-lib.
Rafael Espindola [Fri, 17 Jul 2015 18:49:26 +0000 (18:49 +0000)]
Start adding documentation for llvm-lib.

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

9 years agoRevert "ARM: Enable MachineScheduler and disable PostRAScheduler for swift."
Adam Nemet [Fri, 17 Jul 2015 18:14:19 +0000 (18:14 +0000)]
Revert "ARM: Enable MachineScheduler and disable PostRAScheduler for swift."

This reverts commit r242500.

It broke some internal tests and Matthias asked me to revert it while he
is investigating.

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

9 years agoUse llvm_unreachable() instead of report_fatal_error() if the machine model is incomplete
Matthias Braun [Fri, 17 Jul 2015 17:50:11 +0000 (17:50 +0000)]
Use llvm_unreachable() instead of report_fatal_error() if the machine model is incomplete

This error is for developers only so it makes sense to abort and get a
backtrace.

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

9 years ago[OCaml] Do not use -warn-error in tests.
Peter Zotov [Fri, 17 Jul 2015 17:33:23 +0000 (17:33 +0000)]
[OCaml] Do not use -warn-error in tests.

This -warn-error flag invariably gets into release tarballs
and breaks builds on distributions that run tests as a part
of release process. The OCaml binding tests are especially
critical, since they often expose lingering toolchain bugs,
and so it is replaced with -w +A (equivalent to -Wall).

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

9 years ago[ARM] Use [SU]ABSDIFF nodes instead of intrinsics for VABD/VABA
James Molloy [Fri, 17 Jul 2015 17:10:55 +0000 (17:10 +0000)]
[ARM] Use [SU]ABSDIFF nodes instead of intrinsics for VABD/VABA

No functional change, but it preps codegen for the future when SABSDIFF
will start getting generated in anger.

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

9 years ago[AArch64] Use [SU]ABSDIFF nodes instead of intrinsics for ABD/ABA
James Molloy [Fri, 17 Jul 2015 17:10:45 +0000 (17:10 +0000)]
[AArch64] Use [SU]ABSDIFF nodes instead of intrinsics for ABD/ABA

No functional change, but it preps codegen for the future when SABSDIFF
will start getting generated in anger.

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

9 years agoAdd libunwind to the release scripts
Hans Wennborg [Fri, 17 Jul 2015 16:49:59 +0000 (16:49 +0000)]
Add libunwind to the release scripts

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

9 years agoUse inbounds GEPs for memcpy and memset lowering
Eli Bendersky [Fri, 17 Jul 2015 16:42:33 +0000 (16:42 +0000)]
Use inbounds GEPs for memcpy and memset lowering

Follow-up on discussion in http://reviews.llvm.org/D11220

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

9 years agoAdd support for producing thin archives in llvm-lib.
Rafael Espindola [Fri, 17 Jul 2015 16:01:11 +0000 (16:01 +0000)]
Add support for producing thin archives in llvm-lib.

I will send an entry in docs/CommandGuide for review today.

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

9 years agoEdited the CPUNames table of TargetParser
Alexandros Lamprineas [Fri, 17 Jul 2015 15:49:32 +0000 (15:49 +0000)]
Edited the CPUNames table of TargetParser
- Changed the default FPU of cortex-m4.
- Removed "cortex-m4f" entry. Currently not supported.

Change-Id: I73121e358aa9e7ba68eb001c2143df390ff2352a
Phabricator: http://reviews.llvm.org/D11100

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

9 years agoMake global aliases have symbol size equal to their type
John Brawn [Fri, 17 Jul 2015 12:12:03 +0000 (12:12 +0000)]
Make global aliases have symbol size equal to their type

This is mainly for the benefit of GlobalMerge, so that an alias into a
MergedGlobals variable has the same size as the original non-merged
variable.

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

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

9 years agotest-release.sh: Add ability to do a test build using the trunk or branches.
Daniel Sanders [Fri, 17 Jul 2015 10:40:40 +0000 (10:40 +0000)]
test-release.sh: Add ability to do a test build using the trunk or branches.

Summary:
Adds '--svn-path BRANCH' that causes the script to export the specified path
from each project. Otherwise the tag specified by -release, -rc, etc. will be
used. The version portion of the package name will be 'test-$path' (any forward
slashes in the branch name are replaced with underscores), for example:
  -svn-path trunk => clang+llvm-test-trunk-mips-linux-gnu.tar.xz
  -svn-path branches/release_35 => clang+llvm-test-branches_release_35-mips-linux-gnu.tar.xz

This is primarily useful for bringing new release packages up to standard
without needing to create and maintain a tag for the purpose.

Reviewers: tstellarAMD, hans

Subscribers: llvm-commits

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

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

9 years ago[PM/AA] Disable the core unsafe aspect of GlobalsModRef in the face of
Chandler Carruth [Fri, 17 Jul 2015 06:58:24 +0000 (06:58 +0000)]
[PM/AA] Disable the core unsafe aspect of GlobalsModRef in the face of
basic changes to the IR such as folding pointers through PHIs, Selects,
integer casts, store/load pairs, or outlining.

This leaves the feature available behind a flag. This flag's default
could be flipped if necessary, but the real-world performance impact of
this particular feature of GMR may not be sufficiently significant for
many folks to want to run the risk.

Currently, the risk here is somewhat mitigated by half-hearted attempts
to update GlobalsModRef when the rest of the optimizer changes
something. However, I am currently trying to remove that update
mechanism as it makes migrating the AA infrastructure to a form that can
be readily shared between new and old pass managers very challenging.
Without this update mechanism, it is possible that this still unlikely
failure mode will start to trip people, and so I wanted to try to
proactively avoid that.

There is a lengthy discussion on the mailing list about why the core
approach here is flawed, and likely would need to look totally different
to be both reasonably effective and resilient to basic IR changes
occuring. This patch is essentially the first of two which will enact
the result of that discussion. The next patch will remove the current
update mechanism.

Thanks to lots of folks that helped look at this from different angles.
Especial thanks to Michael Zolotukhin for doing some very prelimanary
benchmarking of LTO without GlobalsModRef to get a rough idea of the
impact we could be facing here. So far, it looks very small, but there
are some concerns lingering from other benchmarking. The default here
may get flipped if performance results end up pointing at this as a more
significant issue.

Also thanks to Pete and Gerolf for reviewing!

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

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

9 years ago[OCaml] Use a nicer style for documentation than OCaml default.
Peter Zotov [Fri, 17 Jul 2015 06:37:59 +0000 (06:37 +0000)]
[OCaml] Use a nicer style for documentation than OCaml default.

In particular, it's much easier to read, as it doesn't expand all
the way on wide-screen displays.

CSS committed under LLVM license with explicit permission from
Daniel Bünzli <daniel.buenzli@erratique.ch>.

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

9 years ago[asan] Fix invalid debug info for promotable allocas
Kuba Brecka [Fri, 17 Jul 2015 06:29:57 +0000 (06:29 +0000)]
[asan] Fix invalid debug info for promotable allocas

Since r230724 ("Skip promotable allocas to improve performance at -O0"), there is a regression in the generated debug info for those non-instrumented variables. When inspecting such a variable's value in LLDB, you often get garbage instead of the actual value. ASan instrumentation is inserted before the creation of the non-instrumented alloca. The only allocas that are considered standard stack variables are the ones declared in the first basic-block, but the initial instrumentation setup in the function breaks that invariant.

This patch makes sure uninstrumented allocas stay in the first BB.

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

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

9 years ago[llvm-cxxdump] Don't rely on global state
Davide Italiano [Fri, 17 Jul 2015 06:18:36 +0000 (06:18 +0000)]
[llvm-cxxdump] Don't rely on global state

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

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

9 years agoAArch64: add comment missed out from earlier patch.
Tim Northover [Fri, 17 Jul 2015 03:31:50 +0000 (03:31 +0000)]
AArch64: add comment missed out from earlier patch.

Helps explain some of the background behind this bit of code.

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

9 years agoARM: Enable MachineScheduler and disable PostRAScheduler for swift.
Matthias Braun [Fri, 17 Jul 2015 01:44:31 +0000 (01:44 +0000)]
ARM: Enable MachineScheduler and disable PostRAScheduler for swift.

This is mostly done to disable the PostRAScheduler which optimizes for
instruction latencies which isn't a good fit for out-of-order
architectures. This also allows to leave out the itinerary table in
swift in favor of the SchedModel ones.

This change leads to performance improvements/regressions by as much as
10% in some benchmarks, in fact we loose 0.4% performance over the
llvm-testsuite for reasons that appear to be unknown or out of the
compilers control. rdar://20803802 documents the investigation of
these effects.

While it is probably a good idea to perform the same switch for the
other ARM out-of-order CPUs, I limited this change to swift as I cannot
perform the benchmark verification on the other CPUs.

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

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

9 years agoOnly do fmul (fadd x, x), c combine if the fadd only has one use
Matt Arsenault [Fri, 17 Jul 2015 01:14:35 +0000 (01:14 +0000)]
Only do fmul (fadd x, x), c combine if the fadd only has one use

This was increasing the instruction count if the fadd has multiple uses.

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

9 years agoUse small encodings for constants when possible.
Rafael Espindola [Fri, 17 Jul 2015 00:57:52 +0000 (00:57 +0000)]
Use small encodings for constants when possible.

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

9 years agoMIR Serialization: Serialize the frame setup machine instruction flag.
Alex Lorenz [Fri, 17 Jul 2015 00:24:15 +0000 (00:24 +0000)]
MIR Serialization: Serialize the frame setup machine instruction flag.

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

9 years agoMIR Serialization: Serialize the frame index machine operands.
Alex Lorenz [Thu, 16 Jul 2015 23:37:45 +0000 (23:37 +0000)]
MIR Serialization: Serialize the frame index machine operands.

Reviewers: Duncan P. N. Exon Smith

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

9 years agoAdd new constructors for LoopInfo/DominatorTree/BFI/BPI
Cong Hou [Thu, 16 Jul 2015 23:23:35 +0000 (23:23 +0000)]
Add new constructors for LoopInfo/DominatorTree/BFI/BPI

Those new constructors make it more natural to construct an object for a function. For example, previously to build a LoopInfo for a function, we need four statements:

DominatorTree DT;
LoopInfo LI;
DT.recalculate(F);
LI.analyze(DT);

Now we only need one statement:

LoopInfo LI(DominatorTree(F));

http://reviews.llvm.org/D11274

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

9 years agoArm: Don't define a label twice with two setjmps in a function.
Matthias Braun [Thu, 16 Jul 2015 22:34:20 +0000 (22:34 +0000)]
Arm: Don't define a label twice with two setjmps in a function.

Constructing a name based on the function name didn't give us a unique
symbol if we had more than one setjmp in a function. Using
MCContext::createTempSymbol() always gives us a unique name.

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

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

9 years agoFix __builtin_setjmp in combination with sjlj exception handling.
Matthias Braun [Thu, 16 Jul 2015 22:34:16 +0000 (22:34 +0000)]
Fix __builtin_setjmp in combination with sjlj exception handling.

llvm.eh.sjlj.setjmp was used as part of the SjLj exception handling
style but is also used in clang to implement __builtin_setjmp.  The ARM
backend needs to output additional dispatch tables for the SjLj
exception handling style, these tables however can't be emitted if
llvm.eh.sjlj.setjmp is simply used for __builtin_setjmp and no actual
landing pad blocks exist.

To solve this issue a new llvm.eh.sjlj.setup_dispatch intrinsic is
introduced which is used instead of llvm.eh.sjlj.setjmp in the SjLj
exception handling lowering, so we can differentiate between the case
where we actually need to setup a dispatch table and the case where we
just need the __builtin_setjmp semantic.

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

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

9 years agoFix ffiInvoke() use of DataLayout, broken in 242414
Mehdi Amini [Thu, 16 Jul 2015 22:23:09 +0000 (22:23 +0000)]
Fix ffiInvoke() use of DataLayout, broken in 242414

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

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

9 years ago[SCEV][NFC] Use triple-slash (///) for comment.
Sanjoy Das [Thu, 16 Jul 2015 22:08:37 +0000 (22:08 +0000)]
[SCEV][NFC] Use triple-slash (///) for comment.

Makes the comments for proveNoWrapByVaryingStart consistent with the
rest of ScalarEvolution.h

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

9 years agoFix spelling. NFCI.
Simon Pilgrim [Thu, 16 Jul 2015 21:44:53 +0000 (21:44 +0000)]
Fix spelling. NFCI.

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

9 years agoAArch64: make inexact signalling on round Darwin-specific
Tim Northover [Thu, 16 Jul 2015 21:30:21 +0000 (21:30 +0000)]
AArch64: make inexact signalling on round Darwin-specific

C11 leaves the choice on whether round-to-integer operations set the inexact
flag implementation-defined. Darwin does expect it to be set, but this seems to
be against the intent of the IEEE document and slower to implement anyway. So
it should be opt-in.

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

9 years ago[X86][SSE] Added nounwind attribute to vector shift tests.
Simon Pilgrim [Thu, 16 Jul 2015 21:14:26 +0000 (21:14 +0000)]
[X86][SSE] Added nounwind attribute to vector shift tests.

Stop i686 codegen from generating cfi directives.

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

9 years ago[PowerPC] v4i32 is a VSRCRegClass
Bill Schmidt [Thu, 16 Jul 2015 21:14:07 +0000 (21:14 +0000)]
[PowerPC] v4i32 is a VSRCRegClass

I was looking at some vector code generation and kept seeing
unnecessary vector copies into the Altivec half of the VSX registers.
I discovered that we overlooked v4i32 when adding the register classes
for VSX; we only added v4f32 and v2f64.  This means that anything that
canonicalizes into v4i32 (which is a LOT of stuff) ends up being
forced into VRRC on its way to VSRC.

The fix is one line.  The rest of the patch is fixing up some test
cases whose code generation has changed as a result.

This seems like it would be a good candidate for backport to 3.7.

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

9 years agoList supported architectures for StackMap section and related intrinsics
Philip Reames [Thu, 16 Jul 2015 21:10:46 +0000 (21:10 +0000)]
List supported architectures for StackMap section and related intrinsics

Not having this documented led to some confusion in a recent review thread.

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

9 years ago[X86][SSE] Updated vector conversion test names.
Simon Pilgrim [Thu, 16 Jul 2015 21:00:57 +0000 (21:00 +0000)]
[X86][SSE] Updated vector conversion test names.

I'll be adding further tests shortly so need a more thorough naming convention.

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

9 years agoStreamline the coding style in NVPTXLowerAggrCopies
Eli Bendersky [Thu, 16 Jul 2015 20:42:38 +0000 (20:42 +0000)]
Streamline the coding style in NVPTXLowerAggrCopies

Make the style consistent with LLVM style throughout and clang-format.

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

9 years agoMachineInstr: Explain the subtle semantics of uses()/defs()
Matthias Braun [Thu, 16 Jul 2015 20:27:01 +0000 (20:27 +0000)]
MachineInstr: Explain the subtle semantics of uses()/defs()

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

9 years ago[NVPTX] enable SpeculativeExecution in NVPTX
Jingyue Wu [Thu, 16 Jul 2015 20:13:48 +0000 (20:13 +0000)]
[NVPTX] enable SpeculativeExecution in NVPTX

Summary:
SpeculativeExecution enables a series straight line optimizations (such
as SLSR and NaryReassociate) on conditional code. For example,

  if (...)
    ... b * s ...
  if (...)
    ... (b + 1) * s ...

speculative execution can hoist b * s and (b + 1) * s from then-blocks,
so that we have

  ... b * s ...
  if (...)
    ...
  ... (b + 1) * s ...
  if (...)
    ...

Then, SLSR can rewrite (b + 1) * s to (b * s + s) because after
speculative execution b * s dominates (b + 1) * s.

The performance impact of this change is significant. It speeds up the
benchmarks running EigenFloatContractionKernelInternal16x16
(https://bitbucket.org/eigen/eigen/src/ba68f42fa69e4f43417fe1e52669d4dd5d2b3bee/unsupported/Eigen/CXX11/src/Tensor/TensorContractionCuda.h?at=default#cl-526)
by roughly 2%. Some internal benchmarks that have the above code pattern
are improved by up to 40%. No significant slowdowns are observed on
Eigen CUDA microbenchmarks.

Reviewers: jholewinski, broune, eliben

Subscribers: llvm-commits, jholewinski

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

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

9 years agoAArch64: Implement conditional compare sequence matching.
Matthias Braun [Thu, 16 Jul 2015 20:02:37 +0000 (20:02 +0000)]
AArch64: Implement conditional compare sequence matching.

This is a new iteration of the reverted r238793 /
http://reviews.llvm.org/D8232 which wrongly assumed that any and/or
trees can be represented by conditional compare sequences, however there
are some restrictions to that. This version fixes this and adds comments
that explain exactly what types of and/or trees can actually be
implemented as conditional compare sequences.

Related to http://llvm.org/PR20927, rdar://18326194

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

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

9 years agoAMDPGU/SI: Negative offsets aren't allowed in MUBUF's vaddr operand
Tom Stellard [Thu, 16 Jul 2015 19:40:09 +0000 (19:40 +0000)]
AMDPGU/SI: Negative offsets aren't allowed in MUBUF's vaddr operand

Reviewers: arsenm

Subscribers: llvm-commits

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

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

9 years agoAMDPGU/SI: Use AssertZext node to mask high bit for scratch offsets
Tom Stellard [Thu, 16 Jul 2015 19:40:07 +0000 (19:40 +0000)]
AMDPGU/SI: Use AssertZext node to mask high bit for scratch offsets

Summary:
We can safely assume that the high bit of scratch offsets will never
be set, because this would require at least 128 GB of GPU memory.

Reviewers: arsenm

Subscribers: llvm-commits

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

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

9 years agoLiveInterval: Document and enforce rules about empty subranges.
Matthias Braun [Thu, 16 Jul 2015 18:55:35 +0000 (18:55 +0000)]
LiveInterval: Document and enforce rules about empty subranges.

Empty subranges are not allowed in a LiveInterval and must be removed
instead: Check this in the verifiers, put a reminder for this in the
comment of the shrinkToUses variant for a single lane and make it
automatic for the shrinkToUses variant for a LiveInterval.

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

9 years agoDo not duplicate method name in comment, remove duplicate comment
Matthias Braun [Thu, 16 Jul 2015 18:55:32 +0000 (18:55 +0000)]
Do not duplicate method name in comment, remove duplicate comment

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

9 years agoDelete an unused function.
Rafael Espindola [Thu, 16 Jul 2015 18:41:41 +0000 (18:41 +0000)]
Delete an unused function.

Patch by Xan López!

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

9 years agoRevert "Add missing load/store flags to thumb2 instructions."
Pete Cooper [Thu, 16 Jul 2015 18:38:13 +0000 (18:38 +0000)]
Revert "Add missing load/store flags to thumb2 instructions."

This reverts commit r242300.

This is causing buildbot failures which we are investigating.
I'll reapply once we know whats going on, but for now want to
get the bots green.

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

9 years agoRename LoopInfo::Analyze() to LoopInfo::analyze() and turn its parameter type to...
Cong Hou [Thu, 16 Jul 2015 18:23:57 +0000 (18:23 +0000)]
Rename LoopInfo::Analyze() to LoopInfo::analyze() and turn its parameter type to const&.

The benefit of turning the parameter of LoopInfo::analyze() to const& is that it now can accept a rvalue.

http://reviews.llvm.org/D11250

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

9 years agoInternalize: internalize comdat members as a group, and drop comdat on such members.
Peter Collingbourne [Thu, 16 Jul 2015 17:42:21 +0000 (17:42 +0000)]
Internalize: internalize comdat members as a group, and drop comdat on such members.

Internalizing an individual comdat group member without also internalizing
the other members of the comdat can break comdat semantics. For example,
if a module contains a reference to an internalized comdat member, and the
linker chooses a comdat group from a different object file, this will break
the reference to the internalized member.

This change causes the internalizer to only internalize comdat members if all
other members of the comdat are not externally visible. Once a comdat group
has been fully internalized, there is no need to apply comdat rules to its
members; later optimization passes (e.g. globaldce) can legally drop individual
members of the comdat. So we drop the comdat attribute from all comdat members.

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

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

9 years ago[NVPTX] Don't leak dead instructions after unlinking them from the BasicBlock
Benjamin Kramer [Thu, 16 Jul 2015 16:51:48 +0000 (16:51 +0000)]
[NVPTX] Don't leak dead instructions after unlinking them from the BasicBlock

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

9 years agoFix Kaleidoscope tuto: ExecutionEngine->getDataLayout() returns a ref
Mehdi Amini [Thu, 16 Jul 2015 16:47:18 +0000 (16:47 +0000)]
Fix Kaleidoscope tuto: ExecutionEngine->getDataLayout() returns a ref

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

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

9 years agoMake ExecutionEngine owning a DataLayout
Mehdi Amini [Thu, 16 Jul 2015 16:34:23 +0000 (16:34 +0000)]
Make ExecutionEngine owning a DataLayout

Summary:
This change is part of a series of commits dedicated to have a single
DataLayout during compilation by using always the one owned by the
module.

The ExecutionEngine will act as an exception and will be unsafe to
be reused across context. We don't enforce this rule but undefined
behavior can occurs if the user tries to do it.

Reviewers: lhames

Subscribers: echristo, llvm-commits, rafael, yaron.keren

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

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

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

9 years agoCorrect lowering of memmove in NVPTX
Eli Bendersky [Thu, 16 Jul 2015 16:27:19 +0000 (16:27 +0000)]
Correct lowering of memmove in NVPTX

This fixes https://llvm.org/bugs/show_bug.cgi?id=24056

Also a bit of refactoring along the way.

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

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

9 years agoAMDGPU/R600: Remove unused variable
Tom Stellard [Thu, 16 Jul 2015 16:13:34 +0000 (16:13 +0000)]
AMDGPU/R600: Remove unused variable

This fixes a warning introduced by r242410.

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

9 years agoAMDPGU/R600: Replace llvm_unreachable() call with LLVMContext::emitError()
Tom Stellard [Thu, 16 Jul 2015 15:38:29 +0000 (15:38 +0000)]
AMDPGU/R600: Replace llvm_unreachable() call with LLVMContext::emitError()

Summary:
This fixes an issue on MIPS where the infinite-loop-evergreen.ll test
was failing to terminate.

Fixes PR24147.

Reviewers: arsenm, dsanders

Subscribers: llvm-commits

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

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

9 years ago[Codegen] Add intrinsics 'absdiff' and corresponding SDNodes for absolute difference...
James Molloy [Thu, 16 Jul 2015 15:22:46 +0000 (15:22 +0000)]
[Codegen] Add intrinsics 'absdiff' and corresponding SDNodes for absolute difference operation

This adds new intrinsics "*absdiff" for absolute difference ops to facilitate efficient code generation for "sum of absolute differences" operation.
The patch also contains the introduction of corresponding SDNodes and basic legalization support.Sanity of the generated code is tested on X86.

This is 1st of the three patches.

Patch by Shahid Asghar-ahmad!

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

9 years ago- TargetParser does not handle armv7l in parseArchProfile().
Alexandros Lamprineas [Thu, 16 Jul 2015 14:54:41 +0000 (14:54 +0000)]
- TargetParser does not handle armv7l in parseArchProfile().
- ARM V7L matches the 'A' profile of ARM architecture.

Change-Id: I80c8b973f5c93fb040c177a227644d56b1b83ea8
Phabricator: http://reviews.llvm.org/D11261

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

9 years agoFix memcheck interval ends for pointers with negative strides
Silviu Baranga [Thu, 16 Jul 2015 14:02:58 +0000 (14:02 +0000)]
Fix memcheck interval ends for pointers with negative strides

Summary:
The checking pointer grouping algorithm assumes that the
starts/ends of the pointers are well formed (start <= end).

The runtime memory checking algorithm also assumes this by doing:

 start0 < end1 && start1 < end0

to detect conflicts. This check only works if start0 <= end0 and
start1 <= end1.

This change correctly orders the interval ends by either checking
the stride (if it is constant) or by using min/max SCEV expressions.

Reviewers: anemet, rengolin

Subscribers: rengolin, llvm-commits

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

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

9 years ago[X86] Test for r242395 (Fix emitPrologue() to make less assumptions about pushes)
Michael Kuperstein [Thu, 16 Jul 2015 13:55:39 +0000 (13:55 +0000)]
[X86] Test for r242395 (Fix emitPrologue() to make less assumptions about pushes)

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

9 years ago[X86] Reapply r240257 : "Allow more call sequences to use push instructions for argum...
Michael Kuperstein [Thu, 16 Jul 2015 13:54:14 +0000 (13:54 +0000)]
[X86] Reapply r240257 : "Allow more call sequences to use push instructions for argument passing"

This allows more call sequences to use pushes instead of movs when optimizing for size.
In particular, calling conventions that pass some parameters in registers (e.g. thiscall) are now supported.

This should no longer cause miscompiles, now that a bug in emitPrologue was fixed in r242395.

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

9 years ago[X86] Fix emitPrologue() to make less assumptions about pushes
Michael Kuperstein [Thu, 16 Jul 2015 12:27:59 +0000 (12:27 +0000)]
[X86] Fix emitPrologue() to make less assumptions about pushes

When X86FrameLowering::emitPrologue() looks for where to insert the %esp subtraction
to allocate stack space for local allocations, it assumes that any sequence of push
instructions that starts at function entry consists purely of spills of callee-save
registers.
This may be false, since from some point forward, the pushes may pushing arguments
to a subsequent function call.

This caused a miscompile that was exposed by r240257, and is not easily testable
since r240257 was reverted. A test will be committed separately after r240257 is
reapplied.

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

9 years agoRevert "Make ExecutionEngine owning a DataLayout"
Michael Kuperstein [Thu, 16 Jul 2015 12:20:31 +0000 (12:20 +0000)]
Revert "Make ExecutionEngine owning a DataLayout"

Reverting to fix buildbot breakage.

This reverts commit r242387.

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

9 years ago[Mips] Make helper function static, NFC.
Benjamin Kramer [Thu, 16 Jul 2015 11:12:05 +0000 (11:12 +0000)]
[Mips] Make helper function static, NFC.

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

9 years agoAdd PM extension point EP_VectorizerStart
Tobias Grosser [Thu, 16 Jul 2015 08:20:37 +0000 (08:20 +0000)]
Add PM extension point EP_VectorizerStart

This extension point allows passes to be executed right before the vectorizer
and other highly target specific optimizations are run.

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

9 years agoAdd missing break in switch case in R600ISelLowering
Mehdi Amini [Thu, 16 Jul 2015 06:23:12 +0000 (06:23 +0000)]
Add missing break in switch case in R600ISelLowering

Summary: Catched by coverity.

Reviewers: arsenm

Subscribers: llvm-commits

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

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

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

9 years agoMake ExecutionEngine owning a DataLayout
Mehdi Amini [Thu, 16 Jul 2015 06:17:14 +0000 (06:17 +0000)]
Make ExecutionEngine owning a DataLayout

Summary:
This change is part of a series of commits dedicated to have a single
DataLayout during compilation by using always the one owned by the
module.

The ExecutionEngine will act as an exception and will be unsafe to
be reused across context. We don't enforce this rule but undefined
behavior can occurs if the user tries to do it.

Reviewers: lhames

Subscribers: echristo, llvm-commits, rafael, yaron.keren

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

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

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

9 years agoMove most user of TargetMachine::getDataLayout to the Module one
Mehdi Amini [Thu, 16 Jul 2015 06:11:10 +0000 (06:11 +0000)]
Move most user of TargetMachine::getDataLayout to the Module one

Summary:
This change is part of a series of commits dedicated to have a single
DataLayout during compilation by using always the one owned by the
module.

This patch is quite boring overall, except for some uglyness in
ASMPrinter which has a getDataLayout function but has some clients
that use it without a Module (llmv-dsymutil, llvm-dwarfdump), so
some methods are taking a DataLayout as parameter.

Reviewers: echristo

Subscribers: yaron.keren, rafael, llvm-commits, jholewinski

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

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

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

9 years agoRemove DataLayout from TargetLoweringObjectFile, redirect to Module
Mehdi Amini [Thu, 16 Jul 2015 06:04:17 +0000 (06:04 +0000)]
Remove DataLayout from TargetLoweringObjectFile, redirect to Module

Summary:
This change is part of a series of commits dedicated to have a single
DataLayout during compilation by using always the one owned by the
module.

Reviewers: echristo

Subscribers: yaron.keren, rafael, llvm-commits, jholewinski

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

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

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

9 years agoRedirect pointerSize query to the TargetMachine in ASMPrinter
Mehdi Amini [Thu, 16 Jul 2015 05:59:25 +0000 (05:59 +0000)]
Redirect pointerSize query to the TargetMachine in ASMPrinter

Summary:
Because llvm-dsymutil is using ASMPrinter without any MachineFunction
of Module available.

This change is part of a series of commits dedicated to have a single
DataLayout during compilation by using always the one owned by the
module.

Reviewers: echristo

Subscribers: yaron.keren, rafael, llvm-commits

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

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

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

9 years ago[LAA] Split out a helper to check the pointer partitions, NFC
Adam Nemet [Thu, 16 Jul 2015 02:48:05 +0000 (02:48 +0000)]
[LAA] Split out a helper to check the pointer partitions, NFC

This is made a static public member function to allow the transition of
this logic from LAA to LoopDistribution.  (Technically, it could be an
implementation-local static function but then it would not be accessible
from LoopDistribution.)

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

9 years agoRevert "[X86] Allow more call sequences to use push instructions for argument passing"
Reid Kleckner [Thu, 16 Jul 2015 01:30:00 +0000 (01:30 +0000)]
Revert "[X86] Allow more call sequences to use push instructions for argument passing"

It miscompiles some code and a reduced test case has been sent to the
author.

This reverts commit r240257.

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

9 years agoRevert "Update LLVM bindings after r239940. ..."
Reid Kleckner [Thu, 16 Jul 2015 01:16:39 +0000 (01:16 +0000)]
Revert "Update LLVM bindings after r239940. ..."

Revert the changes to the C API LLVMBuildLandingPad that were part of
the personality function move. We now set the personality on the parent
function when the C API attempts to construct a landingpad with a
personality.

This reverts commit r240010.

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

9 years agoFix broken testcase from r242358.
Alex Lorenz [Thu, 16 Jul 2015 00:58:33 +0000 (00:58 +0000)]
Fix broken testcase from r242358.

The testcase failed on non X86 targets, because I forgot to pass the
'-march=x86-64' option into llc for one of the X86 specific tests.

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

9 years ago[ARM] Define a subtarget feature that is used to avoid using movt/movw
Akira Hatanaka [Thu, 16 Jul 2015 00:58:23 +0000 (00:58 +0000)]
[ARM] Define a subtarget feature that is used to avoid using movt/movw
pairs for 32-bit immediates.

This change is needed to avoid emitting movt/movw pairs when doing LTO
and do so on a per-function basis.

Out-of-tree projects currently using cl::opt option -arm-use-movt=0 or
false to avoid emitting movt/movw pairs should make changes to add
subtarget feature "+no-movt" (see the changes made to clang in r242368).

rdar://problem/21529937

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

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

9 years agoTrying to fix the windows bots.
Rafael Espindola [Thu, 16 Jul 2015 00:38:34 +0000 (00:38 +0000)]
Trying to fix the windows bots.

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

9 years agoFix handling of relative paths in thin archives.
Rafael Espindola [Thu, 16 Jul 2015 00:14:49 +0000 (00:14 +0000)]
Fix handling of relative paths in thin archives.

The member has to end up with a path relative to the archive.

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

9 years agoClear kill flags in ARMLoadStoreOptimizer.
Pete Cooper [Thu, 16 Jul 2015 00:09:18 +0000 (00:09 +0000)]
Clear kill flags in ARMLoadStoreOptimizer.

The pass here was clearing kill flags on instructions which had
their sources killed in the instruction being combined.  But
given that the new instruction is inserted after the existing ones,
any existing instructions with kill flags will lead to the verifier
complaining that we are reading an undefined physreg.

For example, what we had prior to this optimization is
t2STRi12 %R1, %SP, 12
t2STRi12 %R1<kill>, %SP, 16
t2STRi12 %R0<kill>, %SP, 8

and prior to this fix that would generate
t2STRi12 %R1<kill>, %SP, 16
t2STRDi8 %R0<kill>, %R1, %SP, 8

This is clearly incorrect as it didn't clear the kill flag on R1
used with offset 16 because there was no kill flag on the instruction
with offset 12.

After this change we clear the kill flag on the offset 16 instruction
because we know it will be used afterwards in the new instruction.

I haven't provided a test case.  I have a small test, but even it is
very sensitive to register allocation order which isn't ideal.

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

9 years agoMIR Serialization: Serialize the jump table index operands.
Alex Lorenz [Wed, 15 Jul 2015 23:38:35 +0000 (23:38 +0000)]
MIR Serialization: Serialize the jump table index operands.

Reviewers: Duncan P. N. Exon Smith

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

9 years agoMIR Serialization: Serialize the jump table info.
Alex Lorenz [Wed, 15 Jul 2015 23:31:07 +0000 (23:31 +0000)]
MIR Serialization: Serialize the jump table info.

The jump table info is serialized using a YAML mapping that contains its kind
and a YAML sequence of jump table entries. A jump table entry is a YAML mapping
that has an ID and an inline YAML sequence of machine basic block references.

The testcase 'CodeGen/MIR/X86/jump-table-info.mir' doesn't have any instructions
because one of them contains a jump table index operand. The jump table index
operands will be serialized in a follow up patch, and the appropriate
instructions will be added to this testcase.

Reviewers: Duncan P. N. Exon Smith

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

9 years agoAdd a test for r242281 from an old patch of mine.
Sean Silva [Wed, 15 Jul 2015 23:23:02 +0000 (23:23 +0000)]
Add a test for r242281 from an old patch of mine.

This isn't thorough, but should serve as a sanity check.

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

9 years agoRemove a private member of BranchProbabilityInfo which is not used at all.
Cong Hou [Wed, 15 Jul 2015 23:20:34 +0000 (23:20 +0000)]
Remove a private member of BranchProbabilityInfo which is not used at all.

The member to be removed is LoopInfo *LI.

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

9 years agollvm-ar: Don't write the directory in the string table.
Rafael Espindola [Wed, 15 Jul 2015 23:15:33 +0000 (23:15 +0000)]
llvm-ar: Don't write the directory in the string table.

We were already doing the right thing for short file names, but not long
ones.

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

9 years agoCreate a wrapper pass for BranchProbabilityInfo.
Cong Hou [Wed, 15 Jul 2015 22:48:29 +0000 (22:48 +0000)]
Create a wrapper pass for BranchProbabilityInfo.

This new wrapper pass is useful when we want to do branch probability analysis conditionally (e.g. only in PGO mode) but don't want to add one more pass dependence.

http://reviews.llvm.org/D11241

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

9 years agoSilence GCC -Wparenthesis warning
David Majnemer [Wed, 15 Jul 2015 22:48:26 +0000 (22:48 +0000)]
Silence GCC -Wparenthesis warning

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

9 years agoFor new archive member we only need to store the full path.
Rafael Espindola [Wed, 15 Jul 2015 22:46:53 +0000 (22:46 +0000)]
For new archive member we only need to store the full path.

We were storing both the path and the file name, which was redundant
and easy to get confused up with.

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

9 years ago[LoopUnswitch] Add an else clause to IsTrivialUnswitchCondition() when checking Heade...
Chen Li [Wed, 15 Jul 2015 22:41:13 +0000 (22:41 +0000)]
[LoopUnswitch] Add an else clause to IsTrivialUnswitchCondition() when checking HeaderTerm instruction type

Summary:
This is a trivial code change with no functionality effect.

When LoopUnswitch determines trivial unswitch condition, it checks whether the loop header's terminator instruction is a branch instruction or switch instruction since trivial unswitch condition can only apply to these two instruction types. The current code does not fail the check directly on other instruction types, but check the nullness of LoopExitBB variable instead. The added else clause makes the check fail immediately on other instruction types and makes the code more obvious.

Reviewers: reames

Subscribers: llvm-commits

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

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

9 years agotest-release.sh: Run both .o files through sed before comparing them
Hans Wennborg [Wed, 15 Jul 2015 22:18:25 +0000 (22:18 +0000)]
test-release.sh: Run both .o files through sed before comparing them

On some systems (e.g. Mac OS X), sed will add a newline to the end of
the output if there wasn't one already. This would cause false
cmp errors since the .o file from Phase 2 was passed through sed and
the one from Phase 3 wasn't. Work around this by passing both through
sed.

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

9 years agoTargetRegisterInfo: Provide a way to check assigned registers in getRegAllocationHints()
Matthias Braun [Wed, 15 Jul 2015 22:16:00 +0000 (22:16 +0000)]
TargetRegisterInfo: Provide a way to check assigned registers in getRegAllocationHints()

Pass a const reference to LiveRegMatrix to getRegAllocationHints()
because some targets can prodive better hints if they can test whether a
physreg has been used for register allocation yet.

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

9 years agoMIR Serialization: Serialize references from the stack objects to named allocas.
Alex Lorenz [Wed, 15 Jul 2015 22:14:49 +0000 (22:14 +0000)]
MIR Serialization: Serialize references from the stack objects to named allocas.

This commit serializes the references to the named LLVM alloca instructions from
the stack objects in the machine frame info. This commit adds a field 'Name' to
the struct 'yaml::MachineStackObject'. This new field is used to store the name
of the alloca instruction when the alloca is present and when it has a name.

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

9 years agoAdd a "debugger tuning" concept that allows us to fine-tune how we
Paul Robinson [Wed, 15 Jul 2015 22:04:54 +0000 (22:04 +0000)]
Add a "debugger tuning" concept that allows us to fine-tune how we
emit debug info, according to the preferences of the different
debuggers used on various targets.
Darwin and FreeBSD default to tuning for LLDB; PS4 defaults to tuning for
the SCE (Sony Computer Entertainment) debugger.  All others default to GDB.

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

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

9 years agoFix mergefunc infinite loop
JF Bastien [Wed, 15 Jul 2015 21:51:33 +0000 (21:51 +0000)]
Fix mergefunc infinite loop

Self-referential constants containing references to a merged function
no longer cause the MergeFunctions pass to infinite loop. Also adds a
reproduction IR which would otherwise fail, which was isolated from a similar
issue in Chromium.

Author: jrkoenig
Reviewers: nlewycky, jfb
Subscribers: llvm-commits, nlewycky, jfb

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

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