OSDN Git Service

android-x86/external-llvm.git
8 years agoconstify InstCombine::foldAllocaCmp. NFC.
Pete Cooper [Fri, 12 Aug 2016 17:13:28 +0000 (17:13 +0000)]
constify InstCombine::foldAllocaCmp.  NFC.

This is part of an effort to constify ValueTracking.cpp.  This change is
to methods which need const Value* instead of Value* to go with the upcoming
changes to ValueTracking.

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

8 years agoFine tuning of sample profile propagation algorithm.
Dehao Chen [Fri, 12 Aug 2016 16:22:12 +0000 (16:22 +0000)]
Fine tuning of sample profile propagation algorithm.

Summary: The refined propagation algorithm is more accurate and robust.

Reviewers: davidxl, dnovillo

Subscribers: llvm-commits

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

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

8 years ago[x86] X86ISelLowering zext(add_nuw(x, C)) --> add(zext(x), C_zext)
Artur Pilipenko [Fri, 12 Aug 2016 16:08:30 +0000 (16:08 +0000)]
[x86] X86ISelLowering zext(add_nuw(x, C)) --> add(zext(x), C_zext)

Currently X86ISelLowering has a similar transformation for sexts:
sext(add_nsw(x, C)) --> add(sext(x), C_sext)

In this change I extend this code to handle zexts as well.

Reviewed By: spatel

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

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

8 years ago[BasicAA] Avoid calling GetUnderlyingObject, when the result of a previous call can...
Ehsan Amiri [Fri, 12 Aug 2016 16:05:03 +0000 (16:05 +0000)]
[BasicAA] Avoid calling GetUnderlyingObject, when the result of a previous call can be reused.

Recursive calls to aliasCheck from alias[GEP|Select|PHI] may result in a second call to GetUnderlyingObject for a Value, whose underlying object is already computed. This patch ensures that in this situations, the underlying object is not computed again, and the result of the previous call is resued.

https://reviews.llvm.org/D22305

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

8 years ago[LVI] Take guards into account
Artur Pilipenko [Fri, 12 Aug 2016 15:52:23 +0000 (15:52 +0000)]
[LVI] Take guards into account

Teach LVI to gather control dependant constraints from guards.

Reviewed By: sanjoy

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

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

8 years agoAdd move ops to satisfy MSVC.
Teresa Johnson [Fri, 12 Aug 2016 15:39:26 +0000 (15:39 +0000)]
Add move ops to satisfy MSVC.

Try to appease Windows bots after r278508:
http://lab.llvm.org:8011/builders/sanitizer-windows/builds/27250
http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/14776

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

8 years ago[AArch64] Re-factor code shared by AArch64LoadStoreOpt and AArch64InstrInfo.
Geoff Berry [Fri, 12 Aug 2016 15:26:00 +0000 (15:26 +0000)]
[AArch64] Re-factor code shared by AArch64LoadStoreOpt and AArch64InstrInfo.

This re-factoring could cause the following slight changes in generated
code, though none were observed during testing:

- MachineScheduler could decide not to cluster some loads/stores if
  there are other load/stores with non-pairable opcodes that have the
  same base register and offset as a pairable set of load/stores.  One
  case of different MachineScheduler pairing did show up in my testing,
  but it wasn't due to this issue, but due
  BaseMemOpClusterMutation::clusterNeighboringMemOps() being unstable
  w.r.t. the order it considers memory operations.  See PR28942.

- The ImplicitNullChecks optimization could be done for more load/store
  opcodes.  This optimization isn't done for C/C++ code, so it didn't
  show up in my testing.

Reviewers: mcrosier, t.p.northover

Subscribers: aemerson, rengolin, mcrosier, llvm-commits

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

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

8 years ago[LVI] Fix potential memory corruption in getValueFromCondition
Artur Pilipenko [Fri, 12 Aug 2016 15:08:15 +0000 (15:08 +0000)]
[LVI] Fix potential memory corruption in getValueFromCondition

Rewrite Visited[Cond] = getValueFromConditionImpl(..., Visited) statement which can lead to a memory corruption since getValueFromConditionImpl changes Visited map and invalidates the iterators.

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

8 years agoADT: Share code for embedded sentinel traits, NFC
Duncan P. N. Exon Smith [Fri, 12 Aug 2016 15:00:55 +0000 (15:00 +0000)]
ADT: Share code for embedded sentinel traits, NFC

Share code for the (mostly problematic) embedded sentinel traits.
- Move the LLVM_NO_SANITIZE("object-size") attribute to
  ilist_half_embedded_sentinel_traits and ilist_embedded_sentinel_traits
  (previously it spread throughout the code duplication).
- Add an ilist_full_embedded_sentinel_traits which has no UB (but has
  the downside of storing the complete node).
- Replace all the custom sentinel traits in LLVM with a declaration of
  ilist_sentinel_traits that inherits from one of the embedded sentinel
  traits classes.

There are still custom sentinel traits in other LLVM subprojects.  I'll
remove those in a follow-up.

Nothing at all should be changing here, this is just rearranging code.
Note that the final goal here is to remove the sentinel traits
altogether, settling on the memory layout of
ilist_half_embedded_sentinel_traits without the UB.  This intermediate
step moves the logic into ilist.h.

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

8 years agoFix type to avoid problems on 32-bit builds
Teresa Johnson [Fri, 12 Aug 2016 14:55:43 +0000 (14:55 +0000)]
Fix type to avoid problems on 32-bit builds

lto::InputFile::Symbol::getCommonSize should return uint64_t instead of
size_t since it is returning the result of DataLayout::getTypeAllocSize
which returns uint64_t, and the result of getCommonSize is assigned to a
uint64_t variable. On 32-bit builds size_t is unsigned int and there are
type errors. This was introduced in r278338.

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

8 years agoRevert "[Sparc] Leon errata fix passes."
James Y Knight [Fri, 12 Aug 2016 14:48:09 +0000 (14:48 +0000)]
Revert "[Sparc] Leon errata fix passes."
...and the two followup commits:
Revert "[Sparc][Leon] Missed resetting option flags from check-in 278489."
Revert "[Sparc][Leon] Errata fixes for various errata in different
versions of the Leon variants of the Sparc 32 bit processor."

This reverts commit r274856, r278489, and r278492.

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

8 years ago[PM] Port NameAnonFunction pass to new pass manager
Teresa Johnson [Fri, 12 Aug 2016 14:03:36 +0000 (14:03 +0000)]
[PM] Port NameAnonFunction pass to new pass manager

Summary:
Port the NameAnonFunction pass and add a test.

Depends on D23439.

Reviewers: mehdi_amini

Subscribers: llvm-commits, mehdi_amini

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

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

8 years ago[PM] Port ModuleSummaryIndex analysis to new pass manager
Teresa Johnson [Fri, 12 Aug 2016 13:53:02 +0000 (13:53 +0000)]
[PM] Port ModuleSummaryIndex analysis to new pass manager

Summary:
Port the ModuleSummaryAnalysisWrapperPass to the new pass manager.
Use it in the ported BitcodeWriterPass (similar to how we use the
legacy ModuleSummaryAnalysisWrapperPass in the legacy WriteBitcodePass).

Also, pass the -module-summary opt flag through to the new pass
manager pipeline and through to the bitcode writer pass, and add
a test that uses it.

Reviewers: mehdi_amini

Subscribers: llvm-commits, mehdi_amini

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

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

8 years ago[X86][SSE] Add support for combining target shuffles to PSLLDQ/PSRLDQ byte shifts
Simon Pilgrim [Fri, 12 Aug 2016 11:24:34 +0000 (11:24 +0000)]
[X86][SSE] Add support for combining target shuffles to PSLLDQ/PSRLDQ byte shifts

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

8 years ago[Hexagon] Standardize pseudo-instructions for calls and returns
Krzysztof Parzyszek [Fri, 12 Aug 2016 11:12:02 +0000 (11:12 +0000)]
[Hexagon] Standardize pseudo-instructions for calls and returns

- CALLv3nr        PS_call_nr
- CALLRv3nr       PS_callr_nr
- CALLstk         PS_call_stk

- TCRETURNi       PS_tailcall_i
- TCRETURNr       PS_tailcall_r

- JMPret          PS_jmpret
- JMPrett         PS_jmprett
- JMPretf         PS_jmpretf
- JMPrettnew      PS_jmprettnew
- JMPretfnew      PS_jmpretfnew
- JMPrettnewpt    PS_jmprettnewpt
- JMPretfnewpt    PS_jmpretfnewpt

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

8 years ago[Hexagon] Treat non-returning indirect calls as scheduling boundaries
Krzysztof Parzyszek [Fri, 12 Aug 2016 11:01:10 +0000 (11:01 +0000)]
[Hexagon] Treat non-returning indirect calls as scheduling boundaries

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

8 years ago[LVI] Take range metadata into account while calculating icmp condition constraints
Artur Pilipenko [Fri, 12 Aug 2016 10:14:11 +0000 (10:14 +0000)]
[LVI] Take range metadata into account while calculating icmp condition constraints

Take range metadata into account for conditions like this:

%length = load i32, i32* %length_ptr, !range !{i32 0, i32 2147483647}
%cmp = icmp ult i32 %a, %length

This is a common pattern for range checks where the length of the array is dynamically loaded.

Reviewed By: sanjoy

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

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

8 years ago[Webassembly] disable unstable test.
Benjamin Kramer [Fri, 12 Aug 2016 10:13:45 +0000 (10:13 +0000)]
[Webassembly] disable unstable test.

It reads uninitialized memory and crashes randomly.

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

8 years ago[X86][SSE] Fixed PALIGNR target shuffle decode
Simon Pilgrim [Fri, 12 Aug 2016 10:10:51 +0000 (10:10 +0000)]
[X86][SSE] Fixed PALIGNR target shuffle decode

The PALIGNR target shuffle decode was not taking into account that DecodePALIGNRMask (rather oddly) expects the operands to be in reverse order, nor was it detecting unary patterns, causing combines to combine with the incorrect input.

The cgbuiltin, auto upgrade and instruction comments code correctly swap the operands so are not affected.

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

8 years ago[LVI] Handle any predicate in comparisons like icmp <pred> (add Val, Offset), ...
Artur Pilipenko [Fri, 12 Aug 2016 10:05:11 +0000 (10:05 +0000)]
[LVI] Handle any predicate in comparisons like icmp <pred> (add Val, Offset), ...

Currently LVI can only gather value constraints from comparisons like:

* icmp <pred> Val, ...
* icmp ult (add Val, Offset), ...

In fact we can handle any predicate in latter comparisons.

Reviewed By: sanjoy

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

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

8 years ago[Sparc][Leon] Missed resetting option flags from check-in 278489.
Chris Dewhurst [Fri, 12 Aug 2016 09:54:39 +0000 (09:54 +0000)]
[Sparc][Leon] Missed resetting option flags from check-in 278489.

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

8 years ago[Sparc][Leon] Errata fixes for various errata in different versions of the Leon varia...
Chris Dewhurst [Fri, 12 Aug 2016 09:34:26 +0000 (09:34 +0000)]
[Sparc][Leon] Errata fixes for various errata in different versions of the Leon variants of the Sparc 32 bit processor.

The nature of the errata are listed in the comments preceding the errata fix passes. Relevant unit tests are implemented for each of these.

These changes update older versions of these errata fixes with improvements to code and unit tests.

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

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

8 years ago[Coroutines] Move class into anonymous namespace.
Benjamin Kramer [Fri, 12 Aug 2016 08:47:13 +0000 (08:47 +0000)]
[Coroutines] Move class into anonymous namespace.

Hopefully fixes visibility warnings from GCC. No functionality change.

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

8 years agoRevert "[BranchFolding] Restrict tail merging loop blocks after MBP"
Haicheng Wu [Fri, 12 Aug 2016 08:40:24 +0000 (08:40 +0000)]
Revert "[BranchFolding] Restrict tail merging loop blocks after MBP"

This reverts commit r278463 because it hits the bot.

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

8 years ago[Coroutines]: Part6b: Add coro.id intrinsic.
Gor Nishanov [Fri, 12 Aug 2016 05:45:49 +0000 (05:45 +0000)]
[Coroutines]: Part6b: Add coro.id intrinsic.

Summary:
1. Make coroutine representation more robust against optimization that may duplicate instruction by introducing coro.id intrinsics that returns a token that will get fed into coro.alloc and coro.begin. Due to coro.id returning a token, it won't get duplicated and can be used as reliable indicator of coroutine identify when a particular coroutine call gets inlined.
2. Move last three arguments of coro.begin into coro.id as they will be shared if coro.begin will get duplicated.
3. doc + test + code updated to support the new intrinsic.

Reviewers: mehdi_amini, majnemer

Subscribers: mehdi_amini, llvm-commits

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

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

8 years agoADT: Remove all ilist_iterator => pointer casts, NFC
Duncan P. N. Exon Smith [Fri, 12 Aug 2016 05:05:36 +0000 (05:05 +0000)]
ADT: Remove all ilist_iterator => pointer casts, NFC

Remove all ilist_iterator to pointer casts.  There were two reasons for
casts:

  - Checking for an uninitialized (i.e., null) iterator.  I added
    MachineInstrBundleIterator::isValid() to check for that case.

  - Comparing an iterator against the underlying pointer value while
    avoiding converting the pointer value to an iterator.  This is
    occasionally necessary in MachineInstrBundleIterator, since there is
    an assertion in the constructors that the underlying MachineInstr is
    not bundled (but we don't care about that if we're just checking for
    pointer equality).

To support the latter case, I rewrote the == and != operators for
ilist_iterator and MachineInstrBundleIterator.

  - The implicit constructors now use enable_if to exclude
    const-iterator => non-const-iterator conversions from overload
    resolution (previously it was a compiler error on instantiation, now
    it's SFINAE).

  - The == and != operators are now global (friends), and are not
    templated.

  - MachineInstrBundleIterator has overloads to compare against both
    const_pointer and const_reference.  This avoids the implicit
    conversions to MachineInstrBundleIterator that assert, instead just
    checking the address (and I added unit tests to confirm this).

Notably, the only remaining uses of ilist_iterator::getNodePtrUnchecked
are in ilist.h, and no code outside of ilist*.h directly relies on this
UB end-iterator-to-pointer conversion anymore.  It's still needed for
ilist_*sentinel_traits, but I'll clean that up soon.

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

8 years agoUse the range variant of transform instead of unpacking begin/end
David Majnemer [Fri, 12 Aug 2016 04:32:45 +0000 (04:32 +0000)]
Use the range variant of transform instead of unpacking begin/end

No functionality change is intended.

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

8 years agoUse the range variant of transform instead of unpacking begin/end
David Majnemer [Fri, 12 Aug 2016 04:32:42 +0000 (04:32 +0000)]
Use the range variant of transform instead of unpacking begin/end

No functionality change is intended.

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

8 years agoUse the range variant of remove_if instead of unpacking begin/end
David Majnemer [Fri, 12 Aug 2016 04:32:37 +0000 (04:32 +0000)]
Use the range variant of remove_if instead of unpacking begin/end

No functionality change is intended.

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

8 years agoUse the range variant of count_if instead of unpacking begin/end
David Majnemer [Fri, 12 Aug 2016 04:32:29 +0000 (04:32 +0000)]
Use the range variant of count_if instead of unpacking begin/end

No functionality change is intended.

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

8 years agoUse the range variant of find/find_if instead of unpacking begin/end
David Majnemer [Fri, 12 Aug 2016 03:55:06 +0000 (03:55 +0000)]
Use the range variant of find/find_if instead of unpacking begin/end

If the result of the find is only used to compare against end(), just
use is_contained instead.

No functionality change is intended.

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

8 years agoADT: Add ilist_iterator conversions to/from ilist_node
Duncan P. N. Exon Smith [Fri, 12 Aug 2016 03:35:33 +0000 (03:35 +0000)]
ADT: Add ilist_iterator conversions to/from ilist_node

Allow an ilist_iterator to be constructed from an ilist_node, and give
access to the underlying ilist_node as well.

This will be used immediately in lld to support a type-erasure use case.
Longer term, they'll stick around once the iterator is using
ilist_node<NodeTy>* instead of NodeTy*.

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

8 years agoRecommit 'Remove the restriction that MachineSinking is now stopped by
Wei Mi [Fri, 12 Aug 2016 03:33:22 +0000 (03:33 +0000)]
Recommit 'Remove the restriction that MachineSinking is now stopped by
"insert_subreg, subreg_to_reg, and reg_sequence" instructions' after
adjusting some unittest checks.

This is to solve PR28852. The restriction was added at 2010 to make better register
coalescing. We assumed that it was not necessary any more. Testing results on x86
supported the assumption.

We will look closely to any performance impact it will bring and will be prepared
to help analyzing performance problem found on other architectures.

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

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

8 years ago[BranchFolding] Restrict tail merging loop blocks after MBP
Haicheng Wu [Fri, 12 Aug 2016 03:30:23 +0000 (03:30 +0000)]
[BranchFolding] Restrict tail merging loop blocks after MBP

To fix PR28014, this patch restricts tail merging to blocks that belong to the
same loop after MBP.

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

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

8 years agoWholeProgramDevirt: initialize WasDevirt in all constructors.
Ivan Krasin [Fri, 12 Aug 2016 01:40:10 +0000 (01:40 +0000)]
WholeProgramDevirt: initialize WasDevirt in all constructors.

Summary: This is a follow up to r278389 and r278442.

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

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

8 years ago[DSE] Don't remove stores made live by a call which unwinds.
Eli Friedman [Fri, 12 Aug 2016 01:09:53 +0000 (01:09 +0000)]
[DSE] Don't remove stores made live by a call which unwinds.

Issue exposed by noalias or more aggressive alias analysis.

Fixes http://llvm.org/PR25422.

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

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

8 years agoRefactor isValidAssumeForContext to reduce duplication and indentation. NFC.
Pete Cooper [Fri, 12 Aug 2016 01:00:15 +0000 (01:00 +0000)]
Refactor isValidAssumeForContext to reduce duplication and indentation.  NFC.

This method had some duplicate code when we did or did not have a dom tree.  Refactor
it to remove the duplication, but also clean up the control flow to have less duplication.

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

8 years agoUse the range variant of find_if instead of unpacking begin/end
David Majnemer [Fri, 12 Aug 2016 00:18:03 +0000 (00:18 +0000)]
Use the range variant of find_if instead of unpacking begin/end

No functionality change is intended.

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

8 years agoWholeProgramDevirt: fix access to a non-initialized field.
Ivan Krasin [Fri, 12 Aug 2016 00:07:14 +0000 (00:07 +0000)]
WholeProgramDevirt: fix access to a non-initialized field.

Summary: This is a follow up to r278389, where I have introduced the bug

Reviewers: mehdi_amini

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

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

8 years agoAdd comment /NFC
Xinliang David Li [Thu, 11 Aug 2016 23:09:56 +0000 (23:09 +0000)]
Add comment /NFC

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

8 years ago[ADT] Migrate DepthFirstIterator to use NodeRef
Tim Shen [Thu, 11 Aug 2016 22:36:16 +0000 (22:36 +0000)]
[ADT] Migrate DepthFirstIterator to use NodeRef

Summary:
Notice that the data layout is changed: instead of using
std::pair<PointerIntPair<NodeType*, 1>, ChildItTy>, now use
std::pair<NodeRef, Optional<ChildItTy>>.

A NFC but worth noticing change is operator==(), since we only compare
an iterator against end(), it's better to put an assert there and make
people noticed when it fails.

Reviewers: dblaikie, chandlerc

Subscribers: mzolotukhin, llvm-commits

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

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

8 years agoFix typos /NFC
Xinliang David Li [Thu, 11 Aug 2016 22:34:00 +0000 (22:34 +0000)]
Fix typos /NFC

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

8 years agoRemove unnecessary extra version of isValidAssumeForContext. NFC.
Pete Cooper [Thu, 11 Aug 2016 22:23:07 +0000 (22:23 +0000)]
Remove unnecessary extra version of isValidAssumeForContext.  NFC.

There were 2 versions of this method.  A public one which takes a
const Instruction* and a private implementation which takes a mutable
Value* and casts to an Instruction*.

There was no need for the 2 versions as all callers pass a const Instruction*
and there was no need for a mutable pointer as we only do analysis here.

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

8 years agoUse the range variant of find instead of unpacking begin/end
David Majnemer [Thu, 11 Aug 2016 22:21:41 +0000 (22:21 +0000)]
Use the range variant of find instead of unpacking begin/end

If the result of the find is only used to compare against end(), just
use is_contained instead.

No functionality change is intended.

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

8 years agoDon't import variadic functions
Piotr Padlewski [Thu, 11 Aug 2016 22:13:57 +0000 (22:13 +0000)]
Don't import variadic functions

Summary:
This patch adds IsVariadicFunction bit to summary in order
to not import variadic functions. Inliner doesn't inline
variadic functions because it is hard to reason about it.

This one small fix improves Importer by about 16%
(going from 86% to 100% of imported functions that are
inlined anywhere)
on some spec benchmarks like 'int' and others.

Reviewers: eraman, mehdi_amini, tejohnson

Subscribers: mehdi_amini, llvm-commits

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

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

8 years agoX86-FMA3: Implemented commute transformation for EVEX/AVX512 FMA3 opcodes.
Vyacheslav Klochkov [Thu, 11 Aug 2016 22:07:33 +0000 (22:07 +0000)]
X86-FMA3: Implemented commute transformation for EVEX/AVX512 FMA3 opcodes.
This helped to improved memory-folding and register coalescing optimizations.

Also, this patch fixed the tracker #17229.

Reviewer: Craig Topper.
Differential Revision: https://reviews.llvm.org/D23108

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

8 years agoRe-commit r278066: Do not ignore SizeOfOptionalHeader in COFF header even if PE heade...
Rui Ueyama [Thu, 11 Aug 2016 22:02:44 +0000 (22:02 +0000)]
Re-commit r278066: Do not ignore SizeOfOptionalHeader in COFF header even if PE header is not present.

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

8 years agoGlobalISel: support 'null' constant in translation.
Tim Northover [Thu, 11 Aug 2016 21:40:55 +0000 (21:40 +0000)]
GlobalISel: support 'null' constant in translation.

It's sharing the integer G_CONSTANT for now since I don't *think* it creates
any ambiguity (even on weird archs). If that turns out wrong we can create a
G_PTRCONSTANT or something.

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

8 years agoExtend trip count instead of truncating IV in LFTR, when legal
Ehsan Amiri [Thu, 11 Aug 2016 21:31:40 +0000 (21:31 +0000)]
Extend trip count instead of truncating IV in LFTR, when legal

When legal, extending trip count in the loop control logic generates better code compared to truncating IV. This is because

(1) extending trip count is a loop invariant operation (see genLoopLimit where we prove trip count is loop invariant).
(2) Scalar Evolution seems to have problems understanding trunc when computing loop trip count. So removing them allows better analysis performed in Scalar Evolution. (In particular this fixes PR 28363 which is the motivation for this change).

I am not going to perform any performance test. Any degradation caused by this should be an indication of a bug elsewhere.

To prove legality, we rely on SCEV to prove zext(trunc(IV)) == IV (or similarly for sext). If this holds, we can prove equivalence of trunc(IV)==ExitCnt (1) and IV == zext(ExitCnt). Simply take zext of boths sides of (1) and apply the proven equivalence.

This commit contains changes in a newly added testcase which was not included in the previous commit (which was reverted later on).

https://reviews.llvm.org/D23075

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

8 years ago[MSSA] Use is_contained
Daniel Berlin [Thu, 11 Aug 2016 21:26:50 +0000 (21:26 +0000)]
[MSSA] Use is_contained

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

8 years agoUse range algorithms instead of unpacking begin/end
David Majnemer [Thu, 11 Aug 2016 21:15:00 +0000 (21:15 +0000)]
Use range algorithms instead of unpacking begin/end

No functionality change is intended.

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

8 years ago[Hexagon] Allow non-returning calls in hardware loops
Krzysztof Parzyszek [Thu, 11 Aug 2016 21:14:25 +0000 (21:14 +0000)]
[Hexagon] Allow non-returning calls in hardware loops

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

8 years ago[vim] Add more attributes to llvm.vim
David Majnemer [Thu, 11 Aug 2016 21:14:05 +0000 (21:14 +0000)]
[vim] Add more attributes to llvm.vim

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

8 years agoAMDGPU: Remove unused tablegen utilities
Matt Arsenault [Thu, 11 Aug 2016 21:08:43 +0000 (21:08 +0000)]
AMDGPU: Remove unused tablegen utilities

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

8 years ago[SCEV] Update interface to handle SCEVExpander insert point motion.
Geoff Berry [Thu, 11 Aug 2016 21:05:17 +0000 (21:05 +0000)]
[SCEV] Update interface to handle SCEVExpander insert point motion.

Summary:
This is an extension of the fix in r271424.  That fix dealt with builder
insert points being moved by SCEV expansion, but only for the lifetime
of the expand call.  This change modifies the interface so that LSR can
safely call expand multiple times at the same insert point and do the
right thing if one of the expansions decides to move the original insert
point.

This is a fix for PR28719.

Reviewers: sanjoy

Subscribers: llvm-commits, mcrosier, mzolotukhin

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

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

8 years agoRemove empty file left by partial reversion.
Tim Northover [Thu, 11 Aug 2016 21:01:15 +0000 (21:01 +0000)]
Remove empty file left by partial reversion.

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

8 years agoGlobalISel: add translation support for shift operations.
Tim Northover [Thu, 11 Aug 2016 21:01:13 +0000 (21:01 +0000)]
GlobalISel: add translation support for shift operations.

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

8 years agoGlobalISel: support zext & sext during translation phase.
Tim Northover [Thu, 11 Aug 2016 21:01:10 +0000 (21:01 +0000)]
GlobalISel: support zext & sext during translation phase.

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

8 years agoFix type truncation warnings
Teresa Johnson [Thu, 11 Aug 2016 20:38:39 +0000 (20:38 +0000)]
Fix type truncation warnings

Avoid type truncation warnings from a 32-bit bot due to size_t not
being unsigned long long, by converting the variables and constants to
unsigned. This was introduced by r278338 and caused warnings here:
http://bb.pgr.jp/builders/i686-mingw32-RA-on-linux/builds/15527/steps/build_llvmclang/logs/warnings%20%287%29

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

8 years agoMove GVNHoist tests into their own directory since it is a separate pass
Daniel Berlin [Thu, 11 Aug 2016 20:35:07 +0000 (20:35 +0000)]
Move GVNHoist tests into their own directory since it is a separate pass

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

8 years agoAMDGPU : Add intrinsic for instruction v_cvt_pk_u8_f32
Wei Ding [Thu, 11 Aug 2016 20:34:48 +0000 (20:34 +0000)]
AMDGPU : Add intrinsic for instruction v_cvt_pk_u8_f32

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

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

8 years agoRevert rL278384 which caused several buildbot failures (like check failures in CodeGe...
Wei Mi [Thu, 11 Aug 2016 20:33:37 +0000 (20:33 +0000)]
Revert rL278384 which caused several buildbot failures (like check failures in CodeGen/X86/clz.ll).

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

8 years agoFix PR 28933
Daniel Berlin [Thu, 11 Aug 2016 20:32:43 +0000 (20:32 +0000)]
Fix PR 28933

Summary:
This fixes PR 28933 by making sure GVNHoist does not try to recreate memory
accesses when it has not actually moved them.

Reviewers: sebpop

Subscribers: llvm-commits, george.burgess.iv

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

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

8 years ago[ADT] Add relation operators for Optional
Tim Shen [Thu, 11 Aug 2016 20:10:15 +0000 (20:10 +0000)]
[ADT] Add relation operators for Optional

Summary: Make Optional's behavior the same as the coming std::optional.

Reviewers: dblaikie

Subscribers: llvm-commits

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

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

8 years agoCodeGen: Avoid dereferencing end() in MachineScheduler
Duncan P. N. Exon Smith [Thu, 11 Aug 2016 20:03:09 +0000 (20:03 +0000)]
CodeGen: Avoid dereferencing end() in MachineScheduler

Check MachineInstr::isDebugValue for the same instruction as we're
calling isSchedBoundary, avoiding the possibility of dereferencing
end().

This is a functionality change even when I!=end().  Matthias had a look
and agrees this is the right resolution (as opposed to checking for
end()).

This is triggered by a huge number of tests, but they happen to
magically pass right now.  I found this because WIP patches for PR26753
convert them into crashes.

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

8 years agoAMDGPU: Prune includes
Matt Arsenault [Thu, 11 Aug 2016 19:18:50 +0000 (19:18 +0000)]
AMDGPU: Prune includes

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

8 years ago[Hexagon] Standardize "select" pseudo-instructions
Krzysztof Parzyszek [Thu, 11 Aug 2016 19:12:18 +0000 (19:12 +0000)]
[Hexagon] Standardize "select" pseudo-instructions

- PS_pselect: general register pairs
- PS_vselect: vector registers (+ 128B version)
- PS_wselect: vector register pairs (+ 128B version)

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

8 years agoWholeProgramDevirt: generate more detailed and accurate remarks.
Ivan Krasin [Thu, 11 Aug 2016 19:09:02 +0000 (19:09 +0000)]
WholeProgramDevirt: generate more detailed and accurate remarks.

Summary:
Keep track of all methods for which we have devirtualized at least
one call and then print them sorted alphabetically. That allows to
avoid duplicates and also makes the order deterministic.

Add optimization names into the remarks, so that it's easier to
understand how has each method been devirtualized.

Fix a bug when wrong methods could have been reported for
tryVirtualConstProp.

Reviewers: kcc, mehdi_amini

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

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

8 years agoRemove the restriction that MachineSinking is now stopped by "insert_subreg,
Wei Mi [Thu, 11 Aug 2016 18:42:56 +0000 (18:42 +0000)]
Remove the restriction that MachineSinking is now stopped by "insert_subreg,
subreg_to_reg, and reg_sequence" instructions.

This is to solve PR28852. The restriction was added at 2010 to make better register
coalescing. We assumed that it was not necessary any more. Testing results on x86
supported the assumption.

We will look closely to any performance impact it will bring and will be prepared
to help analyzing performance problem found on other architectures.

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

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

8 years agoIf-conversion incorrectly calculates liveness of redefined registers
Krzysztof Parzyszek [Thu, 11 Aug 2016 18:42:06 +0000 (18:42 +0000)]
If-conversion incorrectly calculates liveness of redefined registers

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

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

8 years agoTest commit
Barnabas Bittner [Thu, 11 Aug 2016 18:34:29 +0000 (18:34 +0000)]
Test commit

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

8 years agoTarget independent codesize heuristics for Loop Idiom Recognition
Andrew Kaylor [Thu, 11 Aug 2016 18:28:33 +0000 (18:28 +0000)]
Target independent codesize heuristics for Loop Idiom Recognition

Patch by Sunita Marathe

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

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

8 years agoAdd a new method to create SimpleInliner instance and make pre-inliner use this.
Easwaran Raman [Thu, 11 Aug 2016 18:24:08 +0000 (18:24 +0000)]
Add a new method to create SimpleInliner instance and make pre-inliner use this.

This adds a createFunctionInliningPass pass that takes an InlineParams object and use this to create the pre-inliner pass. This prevents the regular inliner's threshold flag from influencing the preinliner.

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

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

8 years ago[Hexagon] Skip byval arguments when checking parameter attributes
Krzysztof Parzyszek [Thu, 11 Aug 2016 18:15:16 +0000 (18:15 +0000)]
[Hexagon] Skip byval arguments when checking parameter attributes

From the point of view of register assignment, byval parameters are
ignored: a byval parameter is not going to be assigned to a register,
and it will not affect the assignments of subsequent parameters.
When matching registers with parameters in the bit tracker, make sure
to skip byval parameters before advancing the registers.

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

8 years agoImprove virtual register handling when computing debug information
Dominic Chen [Thu, 11 Aug 2016 17:52:40 +0000 (17:52 +0000)]
Improve virtual register handling when computing debug information

Summary: Some backends, like WebAssembly, use virtual registers instead of physical registers. This crashes the DbgValueHistoryCalculator pass, which assumes that all registers are physical. Instead, skip virtual registers when iterating aliases, and assume that they are clobbered.

Reviewers: dexonsmith, dschuff, aprantl

Subscribers: yurydelendik, llvm-commits, jfb, sunfish

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

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

8 years agoMake TwoAddressInstructionPass::rescheduleMIBelowKill subreg-aware
Michael Kuperstein [Thu, 11 Aug 2016 17:38:33 +0000 (17:38 +0000)]
Make TwoAddressInstructionPass::rescheduleMIBelowKill subreg-aware

This fixes PR28824.

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

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

8 years agoAMDGPU: Fix crashes on memory functions
Matt Arsenault [Thu, 11 Aug 2016 17:31:42 +0000 (17:31 +0000)]
AMDGPU: Fix crashes on memory functions

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

8 years agoAArch64: Assert on analyzeBranch failing
Matt Arsenault [Thu, 11 Aug 2016 17:22:59 +0000 (17:22 +0000)]
AArch64: Assert on analyzeBranch failing

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

8 years ago[AliasSetTracker] Delete dead code
Michael Kuperstein [Thu, 11 Aug 2016 17:20:20 +0000 (17:20 +0000)]
[AliasSetTracker] Delete dead code

Deletes unused remove() and containsPointer() interfaces. NFC.

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

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

8 years agoFix some Clang-tidy modernize and Include What You Use warnings.
Eugene Zelenko [Thu, 11 Aug 2016 17:20:18 +0000 (17:20 +0000)]
Fix some Clang-tidy modernize and Include What You Use warnings.

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

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

8 years agoAdd move ops to satisfy MSVC.
Teresa Johnson [Thu, 11 Aug 2016 17:19:53 +0000 (17:19 +0000)]
Add move ops to satisfy MSVC.

Try to appease MSVC bot:
http://lab.llvm.org:8011/builders/sanitizer-windows/builds/27164/steps/run%20tests/logs/stdio

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

8 years agoAMDGPU: Remove custom getSubReg
Matt Arsenault [Thu, 11 Aug 2016 17:15:32 +0000 (17:15 +0000)]
AMDGPU: Remove custom getSubReg

This was kind of confusing, the subregister
class shouldn't really be necessary.

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

8 years agoAMDGPU: Remove unused tracking of flat instructions
Matt Arsenault [Thu, 11 Aug 2016 17:15:28 +0000 (17:15 +0000)]
AMDGPU: Remove unused tracking of flat instructions

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

8 years agoAMDGPU : Fix SAD related instruction LIT tests function atttibute issues.
Wei Ding [Thu, 11 Aug 2016 17:14:17 +0000 (17:14 +0000)]
AMDGPU : Fix SAD related instruction LIT tests function atttibute issues.

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

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

8 years agoHexagon: Avoid dereferencing end() in HexagonCopyToCombine::findPairable
Duncan P. N. Exon Smith [Thu, 11 Aug 2016 16:40:03 +0000 (16:40 +0000)]
Hexagon: Avoid dereferencing end() in HexagonCopyToCombine::findPairable

Check for end() before skipping through debug values.  This avoids
dereferencing end() when the instruction is the final one in the basic
block.  (It still assumes that a debug value will not be the final
instruction in the basic block.  No tests seemed to violate that.)

Many Hexagon tests trigger this, but they happen to magically pass right
now.  I found this because WIP patches for PR26753 convert them into
crashes.

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

8 years agoAMDGPU : Add LLVM intrinsics for SAD related instructions.
Wei Ding [Thu, 11 Aug 2016 16:33:53 +0000 (16:33 +0000)]
AMDGPU : Add LLVM intrinsics for SAD related instructions.

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

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

8 years agoAdd (hopefully last) remaining missing dependences to llvm-lto2
Teresa Johnson [Thu, 11 Aug 2016 16:29:47 +0000 (16:29 +0000)]
Add (hopefully last) remaining missing dependences to llvm-lto2

There are still a few missing symbols reported by:
http://bb.pgr.jp/builders/i686-mingw32-RA-on-linux/builds/15535/steps/build_llvmclang/logs/stdio
http://bb.pgr.jp/builders/i686-mingw32-RA-on-linux/builds/15535/steps/build_llvmclang/logs/stdio

This should hopefully take care of them.

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

8 years agoGlobalISel: clear vreg mapping after translating each function
Tim Northover [Thu, 11 Aug 2016 16:21:29 +0000 (16:21 +0000)]
GlobalISel: clear vreg mapping after translating each function

Otherwise we only materialize (shared) constants in the first function they
appear in. This doesn't go well.

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

8 years agoRemove FIXME about asserting on the end iterator
Reid Kleckner [Thu, 11 Aug 2016 16:00:43 +0000 (16:00 +0000)]
Remove FIXME about asserting on the end iterator

After machine block placement, MBBs may not have terminators, and it is
appropriate to check for the end iterator here. We can fold the check
into the next if, as well. This look is really just looking for BBs that
end in CATCHRET.

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

8 years agoMore missing llvm-lto2 dependencies
Teresa Johnson [Thu, 11 Aug 2016 15:58:49 +0000 (15:58 +0000)]
More missing llvm-lto2 dependencies

Follow-on to r278341: Update CMakeLists.txt to match LLVMBuild.txt

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

8 years ago[MCJIT] Improve documentation and error handling for MCJIT::runFunction.
Lang Hames [Thu, 11 Aug 2016 15:56:23 +0000 (15:56 +0000)]
[MCJIT] Improve documentation and error handling for MCJIT::runFunction.

ExecutionEngine::runFunction is supposed to allow execution of arbitrary
function types, but MCJIT can only reasonably support a limited subset of
main-linke function types. This patch documents this limitation, and fixes
MCJIT::runFunction to abort with a meaningful error at runtime if called with
an unsupported function type.

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

8 years agoX86: Use operator lookup for operator==, NFC
Duncan P. N. Exon Smith [Thu, 11 Aug 2016 15:51:29 +0000 (15:51 +0000)]
X86: Use operator lookup for operator==, NFC

Avoid relying on the MachineInstrBundleIterator operator== being
implemented as a member function.

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

8 years agoIR: Don't cast the end iterator to Instruction*
Duncan P. N. Exon Smith [Thu, 11 Aug 2016 15:45:04 +0000 (15:45 +0000)]
IR: Don't cast the end iterator to Instruction*

End iterators are usually sentinels, not actually Instruction* at all.
Stop casting to it just to get an iterator back.

There is likely no observable functionality change here right now
(although this is relying on UB, I doubt it was triggering anything),
but I'll be removing the cast soon.

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

8 years agoCodeGen: Check for a terminator in llvm::getFuncletMembership
Duncan P. N. Exon Smith [Thu, 11 Aug 2016 15:29:02 +0000 (15:29 +0000)]
CodeGen: Check for a terminator in llvm::getFuncletMembership

Check for an end iterator from MachineBasicBlock::getFirstTerminator in
llvm::getFuncletMembership.  If this is turned into an assertion, it
fires in 48 X86 testcases (for example,
CodeGen/X86/regalloc-spill-at-ehpad.ll).

Since this is likely a latent bug (shouldn't all basic blocks end with a
terminator?) I've filed PR28938.

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

8 years ago[SLP] Make RecursionMaxDepth a command line option (NFC)
Matthew Simpson [Thu, 11 Aug 2016 15:28:45 +0000 (15:28 +0000)]
[SLP] Make RecursionMaxDepth a command line option (NFC)

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

8 years agofix comment; NFC
Sanjay Patel [Thu, 11 Aug 2016 15:23:56 +0000 (15:23 +0000)]
fix comment; NFC

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

8 years agoFix bot failure from r278338 due to missing dependences
Teresa Johnson [Thu, 11 Aug 2016 15:23:05 +0000 (15:23 +0000)]
Fix bot failure from r278338 due to missing dependences

Add some missing dependences to the llvm-lto2 tool to attempt to appease
missing symbols in link from bot:
http://bb.pgr.jp/builders/i686-mingw32-RA-on-linux/builds/15527

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

8 years agouse auto* with dyn_cast ; NFC
Sanjay Patel [Thu, 11 Aug 2016 15:21:21 +0000 (15:21 +0000)]
use auto* with dyn_cast ; NFC

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

8 years agogetParent()->getParent() == getFunction() ; NFC
Sanjay Patel [Thu, 11 Aug 2016 15:16:06 +0000 (15:16 +0000)]
getParent()->getParent() == getFunction() ; NFC

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

8 years agoRestore "Resolution-based LTO API."
Teresa Johnson [Thu, 11 Aug 2016 14:58:12 +0000 (14:58 +0000)]
Restore "Resolution-based LTO API."

This restores commit r278330, with fixes for a few bot failures:
- Fix a late change I had made to the save temps output file that I
  missed due to existing files sitting on my disk
- Fix a bunch of Windows bot failures with "ambiguous call to overloaded
  function" due to confusion between llvm::make_unique vs
  std::make_unique (preface the new make_unique calls with "llvm::")
- Attempt to fix a modules bot failure by adding a missing include
  to LTO/Config.h.

Original change:

Resolution-based LTO API.

Summary:
This introduces a resolution-based LTO API. The main advantage of this API over
existing APIs is that it allows the linker to supply a resolution for each
symbol in each object, rather than the combined object as a whole. This will
become increasingly important for use cases such as ThinLTO which require us
to process symbol resolutions in a more complicated way than just adjusting
linkage.

Patch by Peter Collingbourne.

Reviewers: rafael, tejohnson, mehdi_amini

Subscribers: lhames, tejohnson, mehdi_amini, llvm-commits

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

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