oota-llvm.git
9 years ago[inliner] Don't inline a function if it doesn't have exactly the same
Akira Hatanaka [Mon, 13 Apr 2015 18:43:38 +0000 (18:43 +0000)]
[inliner] Don't inline a function if it doesn't have exactly the same
target-cpu and target-features attribute strings as the caller.

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

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

9 years agoMake the ARM testcase from r234764 also pass on Thumb
Krzysztof Parzyszek [Mon, 13 Apr 2015 18:39:52 +0000 (18:39 +0000)]
Make the ARM testcase from r234764 also pass on Thumb

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

9 years ago[RewriteStatepointsForGC] Fix a latent bug in normalization for invoke statepoint...
Philip Reames [Mon, 13 Apr 2015 18:07:21 +0000 (18:07 +0000)]
[RewriteStatepointsForGC] Fix a latent bug in normalization for invoke statepoint [NFC]

Since we're restructuring the CFG, we also need to make sure to update the analsis passes. While I'm touching the code, I dedicided to restructure it a bit.  The code involved here was very confusing.  This change moves the normalization to essentially being a pre-pass before the main insertion work and updates a few comments to actually say what is happening and *why*.

The restructuring should be covered by existing tests.  I couldn't easily see how to create a test for the invalidation bug.  Suggestions welcome.

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

9 years agoRevert revisions r234755, r234759, r234760
Jan Vesely [Mon, 13 Apr 2015 17:47:15 +0000 (17:47 +0000)]
Revert revisions r234755, r234759, r234760

Revert "Remove default in fully-covered switch (to fix Clang -Werror -Wcovered-switch-default)"
Revert "R600: Add carry and borrow instructions. Use them to implement UADDO/USUBO"
Revert "LegalizeDAG: Try to use Overflow operations when expanding ADD/SUB"

Using overflow operations fails CodeGen/Generic/2011-07-07-ScheduleDAGCrash.ll
on hexagon, nvptx, and r600. Revert while I investigate.

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

9 years ago[RewriteStatepointsForGC] Strengthen assertions around liveness
Philip Reames [Mon, 13 Apr 2015 17:35:55 +0000 (17:35 +0000)]
[RewriteStatepointsForGC] Strengthen assertions around liveness

This is related to the issues addressed in 234651.  These assertions check the properties ensured by that change at the place of use.  Note that a similiar property is checked in checkBasicSSA, but without the reachability constraint.  Technically, the liveness would be correct to include unreachable values, but this would be problematic for actual relocation.

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

9 years agoAllow memory intrinsics to be tail calls
Krzysztof Parzyszek [Mon, 13 Apr 2015 17:16:45 +0000 (17:16 +0000)]
Allow memory intrinsics to be tail calls

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

9 years agoDAGCombiner: Fix crash in select(select) opt.
Matthias Braun [Mon, 13 Apr 2015 17:16:33 +0000 (17:16 +0000)]
DAGCombiner: Fix crash in select(select) opt.

In case of different types used for the condition of the selects the
select(select) -> select(and) normalisation cannot be performed.

See also: http://reviews.llvm.org/D7622

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

9 years ago[RewriteStatepointsForGC] Move an expensive debugging check to XDEBUG
Philip Reames [Mon, 13 Apr 2015 16:41:32 +0000 (16:41 +0000)]
[RewriteStatepointsForGC] Move an expensive debugging check to XDEBUG

The check in question is attempting to help find cases where we haven't relocated a pointer at a safepoint we should have.  It does this by coercing the value to null at any safepoint which doesn't relocate it.

Unfortunately, this turns out to be rather expensive in terms of memory usage and time.  The number of stores inserted can grow with O(number of values x number of statepoints).  On at least one example I looked at, over half of peak memory usage was coming from this check.

With this change, the check is no longer enabled by default in Asserts builds.  It is enabled for expensive asserts builds and has a command line option to enable it in both Asserts and non-Asserts builds.

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

9 years agoRemove default in fully-covered switch (to fix Clang -Werror -Wcovered-switch-default)
David Blaikie [Mon, 13 Apr 2015 16:37:50 +0000 (16:37 +0000)]
Remove default in fully-covered switch (to fix Clang -Werror -Wcovered-switch-default)

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

9 years agoR600: Add carry and borrow instructions. Use them to implement UADDO/USUBO
Jan Vesely [Mon, 13 Apr 2015 16:26:00 +0000 (16:26 +0000)]
R600: Add carry and borrow instructions. Use them to implement UADDO/USUBO

v2: tighten the sub64 tests
v3: rename to CARRY/BORROW
v4: fixup test cmdline
    add known bits computation
    use sign extend instead of sub 0,x
    better add test
v5: remove redundant break
    move lowering to separate functions
    fix comments

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewers: arsenm

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

9 years agollvm-readobj: teach it to handle MachO Universal Archive correctly
David Blaikie [Mon, 13 Apr 2015 16:05:49 +0000 (16:05 +0000)]
llvm-readobj: teach it to handle MachO Universal Archive correctly

Patch by Chilledheart (rwindz0@gmail.com).

Reviewed By: rafael

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

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

9 years ago[docs] Update outdated ExtendingLLVM.rst
David Blaikie [Mon, 13 Apr 2015 16:04:17 +0000 (16:04 +0000)]
[docs] Update outdated ExtendingLLVM.rst

Summary:
The document is still incomplete in some degrees, but updated to reflect the
latest changes. Anyway we can detail it if any one think it is not enough. For
the sake of it, some useful examples are listed below:

Refer to r113618 "Add X86 MMX type to bitcode and Type" for how to add a new
type.

> One notable change from then is only one thing that ``lib/VMCore`` is renamed
to ``lib/IR``.

Refer to r194760 "Add addrspacecast instruction" for how to add a new
instruction.

Patch by Chilledheart (rwindz0@gmail.com).

Reviewed By: echristo

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

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

9 years agoLegalizeDAG: Try to use Overflow operations when expanding ADD/SUB
Jan Vesely [Mon, 13 Apr 2015 15:32:01 +0000 (15:32 +0000)]
LegalizeDAG: Try to use Overflow operations when expanding ADD/SUB

v2: consider BooleanContents when processing overflow

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewers: resistor, jholewinsky (nvidia parts)
Differential Revision: http://reviews.llvm.org/D6340

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

9 years agoFix SupportsSeeking detection on windows.
Rafael Espindola [Mon, 13 Apr 2015 11:09:48 +0000 (11:09 +0000)]
Fix SupportsSeeking detection on windows.

Will be tested by existing tests once used (soon).

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

9 years ago[ARM] Align global variables passed to memory intrinsics
John Brawn [Mon, 13 Apr 2015 10:47:39 +0000 (10:47 +0000)]
[ARM] Align global variables passed to memory intrinsics

Fill in the TODO in CodeGenPrepare::OptimizeCallInst so that global
variables that are passed to memory intrinsics are aligned in the same
way that allocas are.

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

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

9 years agoAdd r234615 back, but make sure outs() is binary.
Rafael Espindola [Mon, 13 Apr 2015 10:28:56 +0000 (10:28 +0000)]
Add r234615 back, but make sure outs() is binary.

Original message.

Have one raw_fd_ostream constructor forward to the other.

This fixes some odd behaviour differences between the two. In particular,
the version that takes a FD no longer unconditionally sets stdout to binary.

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

9 years agoRevert r234615, "Have one raw_fd_ostream constructor forward to the other."
NAKAMURA Takumi [Mon, 13 Apr 2015 04:54:19 +0000 (04:54 +0000)]
Revert r234615, "Have one raw_fd_ostream constructor forward to the other."

It broke MSVCRT hosts:

  LLVM :: Object/check_binary_output.ll
  LLVM :: Object/extract.ll

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

9 years ago[CMake] Uniquify LLVM_ABI_BREAKING_CHECKS. It reverts r233784, "[CMake] Cache in...
NAKAMURA Takumi [Mon, 13 Apr 2015 04:54:12 +0000 (04:54 +0000)]
[CMake] Uniquify LLVM_ABI_BREAKING_CHECKS. It reverts r233784, "[CMake] Cache in LLVMConfig.cmake."

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

9 years agollvm/test/CodeGen/R600/fminnum.ll: Relax an expression for NaN on MSVCRT like r204118.
NAKAMURA Takumi [Mon, 13 Apr 2015 04:54:06 +0000 (04:54 +0000)]
llvm/test/CodeGen/R600/fminnum.ll: Relax an expression for NaN on MSVCRT like r204118.

  <stdin>:202:2: note: possible intended match here
   2143289344(1.#QNAN0e+00), 2(2.802597e-45)

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

9 years agoRevert "Verifier: Check for incompatible bit piece expressions"
Duncan P. N. Exon Smith [Mon, 13 Apr 2015 00:06:28 +0000 (00:06 +0000)]
Revert "Verifier: Check for incompatible bit piece expressions"

This reverts commit r234698.

This caused a use-after-free: `QueuedBitPieceExpressions` holds onto
references to `DbgInfoIntrinsic`s and references them past where they're
deleted (this is because the verifier is run as a function pass, and
then `verifyTypeRefs()` is called during `doFinalization()`).

I'll include a reduced crasher for `llc` when I recommit the check.

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

9 years agoR600: Make FMIN/MAXNUM legal on all asics
Jan Vesely [Sun, 12 Apr 2015 23:45:05 +0000 (23:45 +0000)]
R600: Make FMIN/MAXNUM legal on all asics

v2: Add tests

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
reviewer: arsenm

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

9 years agoR600: remove manual BFE optimization
Jan Vesely [Sun, 12 Apr 2015 23:45:01 +0000 (23:45 +0000)]
R600: remove manual BFE optimization

Fixed since r233079

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
reviewer: arsenm

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

9 years ago[MC] Write padding into fragments when -mc-relax-all flag is used
Petr Hosek [Sun, 12 Apr 2015 23:42:25 +0000 (23:42 +0000)]
[MC] Write padding into fragments when -mc-relax-all flag is used

Summary:
When instruction bundling is enabled and the -mc-relax-all flag is
set, we can write bundle padding directly into fragments and avoid
creating large number of fragments significantly reducing LLVM MC
memory usage.

Test Plan: Regression test attached

Reviewers: eliben

Subscribers: jfb, mseaborn

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

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

9 years ago[Orc] Remove duplicate "then" in comment.
Lang Hames [Sun, 12 Apr 2015 22:23:57 +0000 (22:23 +0000)]
[Orc] Remove duplicate "then" in comment.

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

9 years ago[Orc] Fix out-of-date comment for the IRCompileLayer.
Lang Hames [Sun, 12 Apr 2015 22:21:48 +0000 (22:21 +0000)]
[Orc] Fix out-of-date comment for the IRCompileLayer.

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

9 years ago[Orc] During module partitioning, rename anonymous and asm-private globals.
Lang Hames [Sun, 12 Apr 2015 20:05:51 +0000 (20:05 +0000)]
[Orc] During module partitioning, rename anonymous and asm-private globals.

If they're not (re)named, these globals will fail to resolve when the
partitioned modules are linked.

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

9 years agoFix typo.
Mark Lacey [Sun, 12 Apr 2015 18:18:51 +0000 (18:18 +0000)]
Fix typo.

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

9 years ago[PowerPC] Really iterate over all loops in PPCLoopDataPrefetch/PPCLoopPreIncPrep
Hal Finkel [Sun, 12 Apr 2015 17:18:56 +0000 (17:18 +0000)]
[PowerPC] Really iterate over all loops in PPCLoopDataPrefetch/PPCLoopPreIncPrep

When I fixed these a couple of days ago to iterate over all loops, not just
depth == 1 loops, I inadvertently made it such that we'd only look at the first
top-level loop. Make sure that we really look at all of them.

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

9 years ago[LoopUnrollRuntime] Clean up a predicate.
Sanjoy Das [Sun, 12 Apr 2015 01:24:01 +0000 (01:24 +0000)]
[LoopUnrollRuntime] Clean up a predicate.

Clean up a predicate I added in r229731, fix the relevant comment and
add a test case.  The earlier version is confusing to read and was also
buggy (probably not a coincidence) till Alexey fixed it in r233881.

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

9 years agoDebugInfo: Make MDSubprogram::getFunction() return Constant
Duncan P. N. Exon Smith [Sat, 11 Apr 2015 20:27:40 +0000 (20:27 +0000)]
DebugInfo: Make MDSubprogram::getFunction() return Constant

Change `MDSubprogram::getFunction()` and
`MDGlobalVariable::getConstant()` to return a `Constant`.  Previously,
both returned `ConstantAsMetadata`.

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

9 years agoVerifier: Check for incompatible bit piece expressions
Duncan P. N. Exon Smith [Sat, 11 Apr 2015 19:58:35 +0000 (19:58 +0000)]
Verifier: Check for incompatible bit piece expressions

Convert an assertion into a `Verifier` check.  Bit piece expressions
must fit inside the variable, and mustn't be the entire variable.
Catching this in the verifier will help us find bugs sooner, and makes
`DIVariable::getSizeInBits()` dead code.

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

9 years agoDebugInfo: Remove dead DIDescriptor::replaceAllUsesWith()
Duncan P. N. Exon Smith [Sat, 11 Apr 2015 19:29:09 +0000 (19:29 +0000)]
DebugInfo: Remove dead DIDescriptor::replaceAllUsesWith()

r234696 replaced the only use of `DIDescriptor::replaceAllUsesWith()`
with `DIBuilder::replaceTemporary()` (added in r234695).  Delete the
dead code.

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

9 years agoDebugInfo: Introduce DIBuilder::replaceTemporary()
Duncan P. N. Exon Smith [Sat, 11 Apr 2015 19:04:09 +0000 (19:04 +0000)]
DebugInfo: Introduce DIBuilder::replaceTemporary()

Add `DIBuilder::replaceTemporary()` as a replacement for
`DIDescriptor::replaceAllUsesWith()`.  I'll update clang to use the new
method, and then come back to delete the original.

This method dispatches to `replaceAllUsesWith()` or
`replaceWithUniqued()`, depending on whether the replacement is actually
a different node from the original.

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

9 years agoMark empty default constructors as =default if it makes the type POD
Benjamin Kramer [Sat, 11 Apr 2015 18:57:14 +0000 (18:57 +0000)]
Mark empty default constructors as =default if it makes the type POD

NFC

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

9 years agoDebugInfo: Assume a valid pointer for DISubprogram::getFunction()
Duncan P. N. Exon Smith [Sat, 11 Apr 2015 18:15:48 +0000 (18:15 +0000)]
DebugInfo: Assume a valid pointer for DISubprogram::getFunction()

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

9 years agoMake OnDiskChainedHashTableGenerator's Bucket type a POD type and reorder fields...
Benjamin Kramer [Sat, 11 Apr 2015 18:00:28 +0000 (18:00 +0000)]
Make OnDiskChainedHashTableGenerator's Bucket type a POD type and reorder fields to optimize padding

For the common case of offset_type=unsigned this brings Bucket from 24 to 16
bytes.

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

9 years agoDebugInfo: Move DIScope::getName() and getContext() to MDScope
Duncan P. N. Exon Smith [Sat, 11 Apr 2015 17:37:23 +0000 (17:37 +0000)]
DebugInfo: Move DIScope::getName() and getContext() to MDScope

Continue gutting the `DIDescriptor` hierarchy.  In this case, move the
guts of `DIScope::getName()` and `DIScope::getContext()` to
`MDScope::getName()` and `MDScope::getScope()`.

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

9 years agoRemove empty non-virtual destructors or mark them =default when non-public
Benjamin Kramer [Sat, 11 Apr 2015 15:32:26 +0000 (15:32 +0000)]
Remove empty non-virtual destructors or mark them =default when non-public

These add no value but can make a class non-trivially copyable. NFC.

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

9 years ago[PowerPC] Disable part-word atomics on the P7
Hal Finkel [Sat, 11 Apr 2015 13:40:36 +0000 (13:40 +0000)]
[PowerPC] Disable part-word atomics on the P7

As it turns out, even though these are part of ISA 2.06, the P7 does not
support them (or, at least, not any P7s we're tested so far).

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

9 years agoAdd direct moves to/from VSR and exploit them for FP/INT conversions
Nemanja Ivanovic [Sat, 11 Apr 2015 10:40:42 +0000 (10:40 +0000)]
Add direct moves to/from VSR and exploit them for FP/INT conversions

This patch corresponds to review:
http://reviews.llvm.org/D8928

It adds direct move instructions to/from VSX registers to GPR's. These are
exploited for FP <-> INT conversions.

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

9 years agoUse 'override/final' instead of 'virtual' for overridden methods
Alexander Kornienko [Sat, 11 Apr 2015 02:11:45 +0000 (02:11 +0000)]
Use 'override/final' instead of 'virtual' for overridden methods

The patch is generated using clang-tidy misc-use-override check.

This command was used:

  tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py \
    -checks='-*,misc-use-override' -header-filter='llvm|clang' \
    -j=32 -fix -format

http://reviews.llvm.org/D8925

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

9 years agoDebugInfo: Rewrite atSameLineAs() as MDLocation::canDiscriminate()
Duncan P. N. Exon Smith [Sat, 11 Apr 2015 01:00:47 +0000 (01:00 +0000)]
DebugInfo: Rewrite atSameLineAs() as MDLocation::canDiscriminate()

Rewrite `DILocation::atSameLineAs()` as `MDLocation::canDiscriminate()`
with a doxygen comment explaining its purpose.  I've added a few FIXMEs
where I think this check is too weak; fixing that is tracked by PR23199.

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

9 years ago[Orc] Update kaleidoscope tutorial for API change in r234669.
Lang Hames [Sat, 11 Apr 2015 00:56:21 +0000 (00:56 +0000)]
[Orc] Update kaleidoscope tutorial for API change in r234669.

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

9 years agoDebugInfo: Remove dead DIRef friends
Duncan P. N. Exon Smith [Sat, 11 Apr 2015 00:45:24 +0000 (00:45 +0000)]
DebugInfo: Remove dead DIRef friends

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

9 years agoDebugInfo: Add forwarding getFilename() accessor to new hierarchy
Duncan P. N. Exon Smith [Sat, 11 Apr 2015 00:39:43 +0000 (00:39 +0000)]
DebugInfo: Add forwarding getFilename() accessor to new hierarchy

Add forwarding `getFilename()` and `getDirectory()` accessors to nodes
in the new hierarchy that define a `getFile()`.  Use that to
re-implement existing functionality in the `DIDescriptor` hierarchy.

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

9 years ago[PowerPC] Fix PPCLoopPreIncPrep for depth > 1 loops
Hal Finkel [Sat, 11 Apr 2015 00:33:08 +0000 (00:33 +0000)]
[PowerPC] Fix PPCLoopPreIncPrep for depth > 1 loops

This pass had the same problem as the data-prefetching pass: it was only
checking for depth == 1 loops in practice. Fix that, add some debugging
statements, and make sure that, when we grab an AddRec, it is for the loop we
expect.

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

9 years ago[Orc] Tidy up IndirectionUtils API a little, add some comments. NFC.
Lang Hames [Sat, 11 Apr 2015 00:23:49 +0000 (00:23 +0000)]
[Orc] Tidy up IndirectionUtils API a little, add some comments. NFC.

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

9 years ago[Statepoints] Fix a release only build failure
Philip Reames [Sat, 11 Apr 2015 00:06:47 +0000 (00:06 +0000)]
[Statepoints] Fix a release only build failure

A function which is used only in Asserts builds needs to be defined only in Asserts builds.

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

9 years ago[CodeGen] Split -enable-global-merge into ARM and AArch64 options.
Ahmed Bougacha [Sat, 11 Apr 2015 00:06:36 +0000 (00:06 +0000)]
[CodeGen] Split -enable-global-merge into ARM and AArch64 options.

Currently, there's a single flag, checked by the pass itself.
It can't force-enable the pass (and is on by default), because it
might not even have been created, as that's the targets decision.
Instead, have separate explicit flags, so that the decision is
consistently made in the target.

Keep the flag as a last-resort "force-disable GlobalMerge" for now,
for backwards compatibility.

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

9 years agoDebugInfo: Remove dead DIDescriptor::getDescriptorField()
Duncan P. N. Exon Smith [Fri, 10 Apr 2015 23:53:44 +0000 (23:53 +0000)]
DebugInfo: Remove dead DIDescriptor::getDescriptorField()

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

9 years ago[AArch64] Strengthen the code for the prologue insertion.
Quentin Colombet [Fri, 10 Apr 2015 23:14:34 +0000 (23:14 +0000)]
[AArch64] Strengthen the code for the prologue insertion.
The spilled registers are pristine and thus, correctly handled by
the register scavenger and so on, but the liveness information is
strictly speaking wrong at this point.
Fix that.

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

9 years ago[WinEH] Recognize SEH finally block inserted by the frontend
Reid Kleckner [Fri, 10 Apr 2015 23:12:29 +0000 (23:12 +0000)]
[WinEH] Recognize SEH finally block inserted by the frontend

This allows winehprepare to build sensible llvm.eh.actions calls for SEH
finally blocks.  The pattern matching in this change is brittle and
should be replaced with something more robust soon.  In the meantime,
this will let us write the code that produces __C_specific_handler xdata
tables, which we need regardless of how we decide to get finally blocks
through EH preparation.

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

9 years ago[RewriteStatepointsForGC] Use a SetVector for a worklist [NFC]
Philip Reames [Fri, 10 Apr 2015 23:11:26 +0000 (23:11 +0000)]
[RewriteStatepointsForGC] Use a SetVector for a worklist [NFC]

Using a SetVector to replace equivelent but more verbose functionality.

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

9 years agoGeneric: Make isMask_N and isShiftedMask_N consistent over 0
Tim Northover [Fri, 10 Apr 2015 22:58:48 +0000 (22:58 +0000)]
Generic: Make isMask_N and isShiftedMask_N consistent over 0

Previously, isMask_N returned false for 0 but isShiftedMask_N returned true.
Almost all uses are for pattern matching bitfield operations in the backends,
and expect false (this was discovered because of AArch64's copy of this logic).

Unfortunately, I couldn't put together a small non-fragile test for this. The
nature of the bitfield operations means that this edge case is only really
triggered for nodes like "(and N, 0)", which the DAG combiner is usually very
good at folding away before they get to this stage.

rdar://20501377

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

9 years ago[RewriteStatepointsForGC] test case missing from 234657
Philip Reames [Fri, 10 Apr 2015 22:58:39 +0000 (22:58 +0000)]
[RewriteStatepointsForGC] test case missing from 234657

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

9 years ago[RewriteStatepointsForGC] Use an actual liveness algorithm
Philip Reames [Fri, 10 Apr 2015 22:53:14 +0000 (22:53 +0000)]
[RewriteStatepointsForGC] Use an actual liveness algorithm

When rewriting statepoints to make relocations explicit, we need to have a conservative but consistent notion of where a particular pointer is live at a particular site. The old code just used dominance, which is correct, but decidedly more conservative then it needed to be. This patch implements a simple dataflow algorithm that's run one per function (well, twice counting fixup after base pointer insertion). There's still lots of room to make this faster, but it's fast enough for all practical purposes today.

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

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

9 years ago[RewriteStatepointsForGC] clang-format file
Philip Reames [Fri, 10 Apr 2015 22:34:56 +0000 (22:34 +0000)]
[RewriteStatepointsForGC] clang-format file

Format the entire file to reduce diff of change to follow.

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

9 years ago[CodeGenPrepare] Report all changes made during instruction sinking
Benjamin Kramer [Fri, 10 Apr 2015 22:25:36 +0000 (22:25 +0000)]
[CodeGenPrepare] Report all changes made during instruction sinking

r234638 chained another transform below which was tripping over the
deleted instruction. Use after free found by asan in many regression
tests.

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

9 years ago[RewriteStatepointsForGC] Missed review comment from 234651 & build fix
Philip Reames [Fri, 10 Apr 2015 22:16:58 +0000 (22:16 +0000)]
[RewriteStatepointsForGC] Missed review comment from 234651 & build fix

After submitting 234651, I noticed I hadn't responded to a review comment by mjacob.  This patch addresses that comment and fixes a Release only build problem due to an unused variable.

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

9 years ago[RewriteStatepointsForGC] Preprocess the IR to remove unreachable blocks and single...
Philip Reames [Fri, 10 Apr 2015 22:07:04 +0000 (22:07 +0000)]
[RewriteStatepointsForGC] Preprocess the IR to remove unreachable blocks and single entry phis

Two related small changes:

    Various dominance based queries about liveness can get confused if we're talking about unreachable blocks. To avoid reasoning about such cases, just remove them before rewriting statepoints.
    Remove single entry phis (likely left behind by LCSSA) to reduce the number of live values.

Both of these are motivated by http://reviews.llvm.org/D8674 which will be submitted shortly.

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

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

9 years ago[RewriteStatepointsForGC] Limited support for vectors of pointers
Philip Reames [Fri, 10 Apr 2015 21:48:25 +0000 (21:48 +0000)]
[RewriteStatepointsForGC] Limited support for vectors of pointers

This patch adds limited support for inserting explicit relocations when there's a vector of pointers live over the statepoint. This doesn't handle the case where the vector contains a mix of base and non-base pointers; that's future work.

The current implementation just scalarizes the vector over the gc.statepoint before doing the explicit rewrite. An alternate approach would be to plumb the vector all the way though the backend lowering, but doing that appears challenging. In particular, the size of the indirect spill slot is currently assumed to be sizeof(pointer) throughout the backend.

In practice, this is enough to allow running the SLP and Loop vectorizers before RewriteStatepointsForGC.

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

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

9 years ago[InstCombine][CodeGenPrep] Create llvm.uadd.with.overflow in CGP.
Sanjoy Das [Fri, 10 Apr 2015 21:07:09 +0000 (21:07 +0000)]
[InstCombine][CodeGenPrep] Create llvm.uadd.with.overflow in CGP.

Summary:
This change moves creating calls to `llvm.uadd.with.overflow` from
InstCombine to CodeGenPrep.  Combining overflow check patterns into
calls to the said intrinsic in InstCombine inhibits optimization because
it introduces an intrinsic call that not all other transforms and
analyses understand.

Depends on D8888.

Reviewers: majnemer, atrick

Subscribers: llvm-commits

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

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

9 years agoAvoid spewing binary to stdout in some filetype=obj tests
Reid Kleckner [Fri, 10 Apr 2015 19:36:55 +0000 (19:36 +0000)]
Avoid spewing binary to stdout in some filetype=obj tests

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

9 years agouse update_llc_test_checks.py to tighten checking
Sanjay Patel [Fri, 10 Apr 2015 18:31:42 +0000 (18:31 +0000)]
use update_llc_test_checks.py to tighten checking

test features, not CPUs

remove unnecessary cruft

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

9 years agoRemember if lseek works in this FD.
Rafael Espindola [Fri, 10 Apr 2015 18:15:51 +0000 (18:15 +0000)]
Remember if lseek works in this FD.

It will be used in clang in a sec.

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

9 years agoDebugInfo: Stop leaking temporaries in DIBuilder::createCompileUnit()
Duncan P. N. Exon Smith [Fri, 10 Apr 2015 18:01:58 +0000 (18:01 +0000)]
DebugInfo: Stop leaking temporaries in DIBuilder::createCompileUnit()

Stop leaking temporary nodes from `DIBuilder::createCompileUnit()`.
`replaceAllUsesWith()` doesn't delete the nodes, so we need to delete
them "manually" (well, `TempMDTuple` does that for us).

Similarly, stop leaking the temporary nodes used for variables of
subprograms.

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

9 years agoHave one raw_fd_ostream constructor forward to the other.
Rafael Espindola [Fri, 10 Apr 2015 17:52:22 +0000 (17:52 +0000)]
Have one raw_fd_ostream constructor forward to the other.

This fixes some odd behavior differences between the two. In particular,
the version that takes a FD no longer unconditionally sets stdout to binary.

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

9 years ago[FS] Report errors from llvm::sys::fs::rename on Windows
Reid Kleckner [Fri, 10 Apr 2015 17:20:45 +0000 (17:20 +0000)]
[FS] Report errors from llvm::sys::fs::rename on Windows

Previously we would always report success, which is pretty bogus.

I'm too lazy to write a test where rename will portably fail on all
platforms. I'm just trying to fix breakage introduced by r234597, which
happened to tickle this.

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

9 years ago[WinEH] Try to make outlining invokes work a little better
Reid Kleckner [Fri, 10 Apr 2015 16:26:42 +0000 (16:26 +0000)]
[WinEH] Try to make outlining invokes work a little better

WinEH currently turns invokes into calls. Long term, we will reconsider
this, but for now, make sure we remap the operands and clone the
successors of the new terminator.

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

9 years ago[CallSite] Use the injected base class name. NFC.
Benjamin Kramer [Fri, 10 Apr 2015 16:02:34 +0000 (16:02 +0000)]
[CallSite] Use the injected base class name. NFC.

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

9 years ago[PowerPC] Prefetching should also consider depth > 1 loops
Hal Finkel [Fri, 10 Apr 2015 15:05:02 +0000 (15:05 +0000)]
[PowerPC] Prefetching should also consider depth > 1 loops

Iterating over loops from the LoopInfo instance only provides top-level loops.
We need to search the whole tree of loops to find the inner ones.

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

9 years ago[CallSite] Make construction from Value* (or Instruction*) explicit.
Benjamin Kramer [Fri, 10 Apr 2015 14:50:08 +0000 (14:50 +0000)]
[CallSite] Make construction from Value* (or Instruction*) explicit.

CallSite roughly behaves as a common base CallInst and InvokeInst. Bring
the behavior closer to that model by making upcasts explicit. Downcasts
remain implicit and work as before.

Following dyn_cast as a mental model checking whether a Value *V isa
CallSite now looks like this:
  if (auto CS = CallSite(V)) // think dyn_cast
instead of:
  if (CallSite CS = V)

This is an extra token but I think it is slightly clearer. Making the
ctor explicit has the advantage of not accidentally creating nullptr
CallSites, e.g. when you pass a Value * to a function taking a CallSite
argument.

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

9 years ago[mips] [IAS] Improve comments in MipsAsmParser::expandLoadImm. NFC.
Toma Tabacu [Fri, 10 Apr 2015 13:28:16 +0000 (13:28 +0000)]
[mips] [IAS] Improve comments in MipsAsmParser::expandLoadImm. NFC.

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

9 years ago[AArch64] Changes some SchedAlias to WriteRes for Cortex-A57.
Chad Rosier [Fri, 10 Apr 2015 13:19:27 +0000 (13:19 +0000)]
[AArch64] Changes some SchedAlias to WriteRes for Cortex-A57.

Using SchedAliases is convenient and works well for latency and resource
lookup for instructions.  However, this creates an entry in
AArch64WriteLatencyTable with a WriteResourceID of 0, breaking any
SchedReadAdvance since the lookup will fail.

http://reviews.llvm.org/D8043
Patch by Dave Estes <cestes@codeaurora.org>!

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

9 years ago[AArch64] Adjusts Cortex-A57 machine model to handle zero shift.
Chad Rosier [Fri, 10 Apr 2015 13:19:21 +0000 (13:19 +0000)]
[AArch64] Adjusts Cortex-A57 machine model to handle zero shift.

http://reviews.llvm.org/D8043
Patch by Dave Estes <cestes@codeaurora.org>!

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

9 years agoMicrooptimize DenseMap::clear.
Benjamin Kramer [Fri, 10 Apr 2015 12:46:44 +0000 (12:46 +0000)]
Microoptimize DenseMap::clear.

Cache NumEntries locally, it's only used in an assert and using the member
variable prevents the compiler from eliminating the tombstone check for types
with trivial destructors. No functionality change intended.

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

9 years agoReduce dyn_cast<> to isa<> or cast<> where possible.
Benjamin Kramer [Fri, 10 Apr 2015 11:24:51 +0000 (11:24 +0000)]
Reduce dyn_cast<> to isa<> or cast<> where possible.

No functional change intended.

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

9 years ago[mips] [IAS] Make the mips-expansions-bad.s test more readable. NFC.
Toma Tabacu [Fri, 10 Apr 2015 10:46:59 +0000 (10:46 +0000)]
[mips] [IAS] Make the mips-expansions-bad.s test more readable. NFC.

Move the check lines below the code lines and change the indentation from 8
spaces to 2 spaces.

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

9 years ago[lib/Fuzzer] Section: How good is my fuzzer?
Kostya Serebryany [Fri, 10 Apr 2015 06:32:29 +0000 (06:32 +0000)]
[lib/Fuzzer] Section: How good is my fuzzer?

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

9 years ago[lib/Fuzzer] explain compatibility with AFL
Kostya Serebryany [Fri, 10 Apr 2015 05:44:43 +0000 (05:44 +0000)]
[lib/Fuzzer] explain compatibility with AFL

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

9 years agoDivergence analysis for GPU programs
Jingyue Wu [Fri, 10 Apr 2015 05:03:50 +0000 (05:03 +0000)]
Divergence analysis for GPU programs

Summary:
Some optimizations such as jump threading and loop unswitching can negatively
affect performance when applied to divergent branches. The divergence analysis
added in this patch conservatively estimates which branches in a GPU program
can diverge. This information can then help LLVM to run certain optimizations
selectively.

Test Plan: test/Analysis/DivergenceAnalysis/NVPTX/diverge.ll

Reviewers: resistor, hfinkel, eliben, meheff, jholewinski

Subscribers: broune, bjarke.roune, madhur13490, tstellarAMD, dberlin, echristo, jholewinski, llvm-commits

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

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

9 years ago[WinEHPrepare] Don't rely on the order of IR
David Majnemer [Fri, 10 Apr 2015 04:56:17 +0000 (04:56 +0000)]
[WinEHPrepare] Don't rely on the order of IR

The IPToState table must be emitted after we have generated labels for
all functions in the table.  Don't rely on the order of the list of
globals.  Instead, utilize WinEHFuncInfo to tell us how many catch
handlers we expect to outline.  Once we know we've visited all the catch
handlers, emit the cppxdata.

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

9 years ago[PowerPC] Don't crash on PPC32 i64 fp_to_uint on modern cores
Hal Finkel [Fri, 10 Apr 2015 03:39:00 +0000 (03:39 +0000)]
[PowerPC] Don't crash on PPC32 i64 fp_to_uint on modern cores

When we have an instruction for this (and, thus, don't generate a runtime
call), we need to custom type legalize this (in a trivial way, just as we do
for fp_to_sint).

Fixes PR23173.

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

9 years ago[AArch64] Promote f16 operations to f32.
Ahmed Bougacha [Fri, 10 Apr 2015 00:08:48 +0000 (00:08 +0000)]
[AArch64] Promote f16 operations to f32.

For the most common ones (such as fadd), we already did the promotion.
Do the same thing for all the others.

Currently, we'll just crash/assert on all these operations, as
there's no hardware or libcall support whatsoever.

f16 (half) is specified as an interchange - not arithmetic - format,
and is expected to be promoted to single-precision for arithmetic
operations.

While there, teach the legalizer about promoting some of the (mostly
floating-point) operations that we never needed before.

Differential Revision: http://reviews.llvm.org/D8648
See related discussion on the thread for: http://reviews.llvm.org/D8755

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

9 years agoAdd LLVM support for remaining integer divide and permute instructions from ISA 2.06
Nemanja Ivanovic [Thu, 9 Apr 2015 23:54:37 +0000 (23:54 +0000)]
Add LLVM support for remaining integer divide and permute instructions from ISA 2.06

This is the patch corresponding to review:
http://reviews.llvm.org/D8406

It adds some missing instructions from ISA 2.06 to the PPC back end.

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

9 years agoSimplify use of formatted_raw_ostream.
Rafael Espindola [Thu, 9 Apr 2015 21:06:08 +0000 (21:06 +0000)]
Simplify use of formatted_raw_ostream.

formatted_raw_ostream is a wrapper over another stream to add column and line
number tracking.

It is used only for asm printing.

This patch moves the its creation down to where we know we are printing
assembly. This has the following advantages:

* Simpler lifetime management: std::unique_ptr
* We don't compute column and line number of object files :-)

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

9 years ago[CodeGen] Combine concat_vector of trunc'd scalar to scalar_to_vector.
Ahmed Bougacha [Thu, 9 Apr 2015 20:04:47 +0000 (20:04 +0000)]
[CodeGen] Combine concat_vector of trunc'd scalar to scalar_to_vector.

We already do:
  concat_vectors(scalar, undef) -> scalar_to_vector(scalar)
When the scalar is legal.
When it's not, but is a truncated legal scalar, we can also do:
  concat_vectors(trunc(scalar), undef) -> scalar_to_vector(scalar)
Which is equivalent, since the upper lanes are undef anyway.
While there, teach the combine to look at more than 2 operands.

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

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

9 years ago[AArch64][FastISel] Fix integer extend optimization.
Juergen Ributzka [Thu, 9 Apr 2015 20:00:46 +0000 (20:00 +0000)]
[AArch64][FastISel] Fix integer extend optimization.

The integer extend optimization tries to fold the extend into the load
instruction. This requires us to identify if the extend has already been
emitted or not and act accordingly on it.

The check that was originally performed for this was not sufficient. Besides
checking the ValueMap for a mapped register we also need to check if the
virtual register has already an associated machine instruction that defines it.

This fixes rdar://problem/20470788.

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

9 years agoRemove duplicated code and consolidate initializers.
Eric Christopher [Thu, 9 Apr 2015 19:20:37 +0000 (19:20 +0000)]
Remove duplicated code and consolidate initializers.

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

9 years agoclang-format bits of code to make a followup patch easy to read.
Rafael Espindola [Thu, 9 Apr 2015 18:32:58 +0000 (18:32 +0000)]
clang-format bits of code to make a followup patch easy to read.

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

9 years agoRevert "Refactoring and enhancement to FMA combine."
Rafael Espindola [Thu, 9 Apr 2015 18:29:32 +0000 (18:29 +0000)]
Revert "Refactoring and enhancement to FMA combine."

This reverts commit r234513. It was failing on the bots.

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

9 years agoDefine a function with "... llvm::func...".
Rafael Espindola [Thu, 9 Apr 2015 18:08:15 +0000 (18:08 +0000)]
Define a function with "... llvm::func...".

Using this instead of
namespace llvm {
  func...
}

Has the advantage that the build fails with a compiler error if it gets out
of sync with the .h file.

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

9 years agoRefactoring and enhancement to FMA combine.
Olivier Sallenave [Thu, 9 Apr 2015 17:55:26 +0000 (17:55 +0000)]
Refactoring and enhancement to FMA combine.

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

9 years agoIR: Preserve use-list order by default in bitcode
Duncan P. N. Exon Smith [Thu, 9 Apr 2015 17:41:20 +0000 (17:41 +0000)]
IR: Preserve use-list order by default in bitcode

Pull the `-preserve-*-use-list-order` flags out of "experimental" mode,
and preserve use-list order by default when serializing to bitcode.

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

9 years agoUse a raw_svector_ostream instead of a raw_string_ostream.
Rafael Espindola [Thu, 9 Apr 2015 17:16:25 +0000 (17:16 +0000)]
Use a raw_svector_ostream instead of a raw_string_ostream.

It saves a bit of copying.

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

9 years agoDon't repeat name in comment. NFC.
Rafael Espindola [Thu, 9 Apr 2015 17:10:57 +0000 (17:10 +0000)]
Don't repeat name in comment. NFC.

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

9 years ago[NFC] add more comments for SLSR
Jingyue Wu [Thu, 9 Apr 2015 17:04:28 +0000 (17:04 +0000)]
[NFC] add more comments for SLSR

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

9 years agoMisc cleanup. NFC.
Rafael Espindola [Thu, 9 Apr 2015 16:59:07 +0000 (16:59 +0000)]
Misc cleanup. NFC.

These were lost when I reverted the raw_ostream changes.

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

9 years agoclang-format. NFC.
Rafael Espindola [Thu, 9 Apr 2015 16:43:22 +0000 (16:43 +0000)]
clang-format. NFC.

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

9 years agoclang-format this constructor.
Rafael Espindola [Thu, 9 Apr 2015 16:37:11 +0000 (16:37 +0000)]
clang-format this constructor.

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