OSDN Git Service

android-x86/external-llvm.git
7 years agoRevert "Use _Unwind_Backtrace on Apple platforms."
Bob Wilson [Fri, 6 Jan 2017 02:26:33 +0000 (02:26 +0000)]
Revert "Use _Unwind_Backtrace on Apple platforms."

This reverts commit 63165f6ae3bac1623be36d4b3ce63afa1d51a30a.

After making this change, I discovered that _Unwind_Backtrace is
unable to unwind past a signal handler after an assertion failure.
I filed a bug report about that issue in rdar://29866587 but even if
we get a fix soon, it will be awhile before it get released.

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

7 years agoDisable sigaltstack on Apple platforms
Bob Wilson [Fri, 6 Jan 2017 02:26:30 +0000 (02:26 +0000)]
Disable sigaltstack on Apple platforms

Using sigaltstack on Apple platforms is a bad idea. Darwin's backtrace()
function does not work with sigaltstack, and my change in r286851 was
supposed to solve that by using _Unwind_Backtrace instead. I tested that
_Unwind_Backtrace works for crashes but then discovered that it does not
work for assertion failures when using sigaltstack, at least on macOS.
The stack trace shows only the frames on the alternate stack.
I also saw some reports of this happening for crashes, but it fails
consistently for assertion failures. I tried various things to get it to
work but the problem seems to be in _Unwind_Backtrace itself. Disabling
sigaltstack is unfortunate since it would be nice to get backtraces for
stack overflows, but at least this gets us backtraces for the more common
cases. rdar://problem/29662459

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

7 years agoLowerTypeTests: Split the pass in two: a resolution phase and a lowering phase.
Peter Collingbourne [Fri, 6 Jan 2017 02:22:47 +0000 (02:22 +0000)]
LowerTypeTests: Split the pass in two: a resolution phase and a lowering phase.

This change separates how type identifiers are resolved from how intrinsic
calls are lowered. All information required to lower an intrinsic call
is stored in a new TypeIdLowering data structure. The idea is that this
data structure can either be initialized using the module itself during
regular LTO, or using the module summary in ThinLTO backends.

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

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

7 years agoRemove unused private fields to fix the clang -Werror build.
David Blaikie [Fri, 6 Jan 2017 00:48:24 +0000 (00:48 +0000)]
Remove unused private fields to fix the clang -Werror build.

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

7 years ago[AArch64, Lanai] Fix some Clang-tidy modernize and Include What You Use warnings...
Eugene Zelenko [Fri, 6 Jan 2017 00:30:53 +0000 (00:30 +0000)]
[AArch64, Lanai] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

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

7 years ago[SelectionDAG] Correctly transform range metadata to AssertZExt
David Majnemer [Fri, 6 Jan 2017 00:11:46 +0000 (00:11 +0000)]
[SelectionDAG] Correctly transform range metadata to AssertZExt

We used the logBase2 of the high instead of the ceilLogBase2 resulting
in the wrong result for certain values.  For example, it resulted in an
i1 AssertZExt when the exclusive portion of the range was 3.

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

7 years ago[libFuzzer] remove dead code, NFC
Kostya Serebryany [Fri, 6 Jan 2017 00:09:40 +0000 (00:09 +0000)]
[libFuzzer] remove dead code, NFC

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

7 years agoAdd iterator support to DWARFDie to allow child DIE iteration.
Greg Clayton [Thu, 5 Jan 2017 23:47:37 +0000 (23:47 +0000)]
Add iterator support to DWARFDie to allow child DIE iteration.

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

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

7 years agoCode cleanup: Remove tab indents.
Logan Chien [Thu, 5 Jan 2017 23:41:33 +0000 (23:41 +0000)]
Code cleanup: Remove tab indents.

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

7 years ago[APFloatTest] Add tests for various operations
Tim Shen [Thu, 5 Jan 2017 22:57:54 +0000 (22:57 +0000)]
[APFloatTest] Add tests for various operations

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

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

7 years ago[CostModel][X86] Tidyup arithmetic costs code. NFCI.
Simon Pilgrim [Thu, 5 Jan 2017 22:48:02 +0000 (22:48 +0000)]
[CostModel][X86] Tidyup arithmetic costs code. NFCI.

Remove unnecessary braces, remove one use variables and keep LUTs to similar naming convention.

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

7 years ago[libFuzzer] improve error handling during the merge (handle various IO failures)
Kostya Serebryany [Thu, 5 Jan 2017 22:05:47 +0000 (22:05 +0000)]
[libFuzzer] improve error handling during the merge (handle various IO failures)

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

7 years ago[AArch64] Fold some filled/spilled subreg COPYs
Geoff Berry [Thu, 5 Jan 2017 21:51:42 +0000 (21:51 +0000)]
[AArch64] Fold some filled/spilled subreg COPYs

Summary:
Extend AArch64 foldMemoryOperandImpl() to handle folding spills of
subreg COPYs with read-undef defs like:

  %vreg0:sub_32<def,read-undef> = COPY %WZR; GPR64:%vreg0

by widening the spilled physical source reg and generating:

  STRXui %XZR <fi#0>

as well as folding fills of similar COPYs like:

  %vreg0:sub_32<def,read-undef> = COPY %vreg1; GPR64:%vreg0, GPR32:%vreg1

by generating:

  %vreg0:sub_32<def,read-undef> = LDRWui <fi#0>

Reviewers: MatzeB, qcolombet

Subscribers: aemerson, rengolin, mcrosier, llvm-commits

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

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

7 years agoFix typo. NFC
Xin Tong [Thu, 5 Jan 2017 21:40:08 +0000 (21:40 +0000)]
Fix typo. NFC

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

7 years agoThinLTO: add early "dead-stripping" on the Index
Teresa Johnson [Thu, 5 Jan 2017 21:34:18 +0000 (21:34 +0000)]
ThinLTO: add early "dead-stripping" on the Index

Summary:
Using the linker-supplied list of "preserved" symbols, we can compute
the list of "dead" symbols, i.e. the one that are not reachable from
a "preserved" symbol transitively on the reference graph.
Right now we are using this information to mark these functions as
non-eligible for import.

The impact is two folds:
- Reduction of compile time: we don't import these functions anywhere
  or import the function these symbols are calling.
- The limited number of import/export leads to better internalization.

Patch originally by Mehdi Amini.

Reviewers: mehdi_amini, pcc

Subscribers: llvm-commits

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

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

7 years agoPR 31534: When emitting both DWARF unwind tables and debug information,
Joerg Sonnenberger [Thu, 5 Jan 2017 20:55:28 +0000 (20:55 +0000)]
PR 31534: When emitting both DWARF unwind tables and debug information,
do not use .cfi_sections. This requires checking if any non-declaration
function in the module needs an unwind table.

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

7 years ago[LICM] Allow promotion of some stores that are not guaranteed to execute.
Michael Kuperstein [Thu, 5 Jan 2017 20:42:06 +0000 (20:42 +0000)]
[LICM] Allow promotion of some stores that are not guaranteed to execute.

Promotion is always legal when a store within the loop is guaranteed to execute.

However, this is not a necessary condition - for promotion to be memory model
semantics-preserving, it is enough to have a store that dominates every exit
block. This is because if the store dominates every exit block, the fact the
exit block was executed implies the original store was executed as well.

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

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

7 years agoCodeGen: Assert that liveness is up to date when reading block live-ins.
Matthias Braun [Thu, 5 Jan 2017 20:01:19 +0000 (20:01 +0000)]
CodeGen: Assert that liveness is up to date when reading block live-ins.

Add an assert that checks whether liveins are up to date before they are
used.

- Do not print liveins into .mir files anymore in situations where they
  are out of date anyway.
- The assert in the RegisterScavenger is superseded by the new one in
  livein_begin().
- Skip parts of the liveness updating logic in IfConversion.cpp when
  liveness isn't tracked anymore (just enough to avoid hitting the new
  assert()).

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

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

7 years agoRevert "Reapply r291025 ("AMDGPU: Remove unneccessary intermediate vector")"
Evgeniy Stepanov [Thu, 5 Jan 2017 19:51:13 +0000 (19:51 +0000)]
Revert "Reapply r291025 ("AMDGPU: Remove unneccessary intermediate vector")"

Summary: This reverts commit r291144. It breaks build bots.

http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-autoconf/builds/3270, http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fuzzer/builds/2058

lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp:1638:12: error: could not convert ‘(const unsigned int*)(& Variants)’ from ‘const unsigned int*’ to ‘llvm::ArrayRef<unsigned int>’
     return Variants;

Reviewers: eugenis, tstellarAMD

Patch by Alex Shlyapnikov.

Subscribers: arsenm, kzhuravl, wdng, nhaehnle, yaxunl, tony-tye, llvm-commits

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

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

7 years ago[CostModel][X86] Move vXi32 MUL costs into existing tables. NFCI.
Simon Pilgrim [Thu, 5 Jan 2017 19:42:43 +0000 (19:42 +0000)]
[CostModel][X86] Move vXi32 MUL costs into existing tables. NFCI.

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

7 years agoRemove trailing whitespace. NFCI.
Simon Pilgrim [Thu, 5 Jan 2017 19:24:25 +0000 (19:24 +0000)]
Remove trailing whitespace. NFCI.

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

7 years ago[CostModel][X86] Reordered SSE42 arithmetic cost LUT into descending order. NFCI.
Simon Pilgrim [Thu, 5 Jan 2017 19:19:39 +0000 (19:19 +0000)]
[CostModel][X86] Reordered SSE42 arithmetic cost LUT into descending order. NFCI.

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

7 years ago[CostModel][X86] Move vXi64 MUL costs into existing tables. NFCI.
Simon Pilgrim [Thu, 5 Jan 2017 19:01:50 +0000 (19:01 +0000)]
[CostModel][X86] Move vXi64 MUL costs into existing tables. NFCI.

Removes need for yet another LUT.

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

7 years ago[LICM] Small update to note changes made in hoistRegion
Andrew Kaylor [Thu, 5 Jan 2017 18:53:24 +0000 (18:53 +0000)]
[LICM] Small update to note changes made in hoistRegion

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

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

7 years ago[CostModel][X86] Strip unused 256-bit vector shift costs. NFCI.
Simon Pilgrim [Thu, 5 Jan 2017 18:36:48 +0000 (18:36 +0000)]
[CostModel][X86] Strip unused 256-bit vector shift costs. NFCI.

Remove SSE2 256-bit entries - AVX targets will have used the SSE42 costs instead.

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

7 years ago[x86] add test to show bug in select lowering; NFC
Sanjay Patel [Thu, 5 Jan 2017 18:35:44 +0000 (18:35 +0000)]
[x86] add test to show bug in select lowering; NFC

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

7 years ago[CostModel][X86] Include the cost of 256-bit upper subvector extract/insertion in...
Simon Pilgrim [Thu, 5 Jan 2017 18:20:25 +0000 (18:20 +0000)]
[CostModel][X86] Include the cost of 256-bit upper subvector extract/insertion in AVX1 v4i64 MUL

Matches other MUL/ADD/SUB 256-bit case on AVX1

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

7 years agoTypo
Joerg Sonnenberger [Thu, 5 Jan 2017 17:59:22 +0000 (17:59 +0000)]
Typo

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

7 years ago[CostModel][X86] Merged SK_PermuteSingleSrc/SK_PermuteTwoSrc into common shuffle...
Simon Pilgrim [Thu, 5 Jan 2017 17:56:19 +0000 (17:56 +0000)]
[CostModel][X86] Merged SK_PermuteSingleSrc/SK_PermuteTwoSrc into common shuffle cost LUTs. NFCI.

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

7 years agoReapply r291025 ("AMDGPU: Remove unneccessary intermediate vector")
Matt Arsenault [Thu, 5 Jan 2017 17:36:11 +0000 (17:36 +0000)]
Reapply r291025 ("AMDGPU: Remove unneccessary intermediate vector")

Arrays are supposed to be static const

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

7 years ago[AArch64][CostModel] Add coverage for bswap intrinsics.
Chad Rosier [Thu, 5 Jan 2017 16:55:32 +0000 (16:55 +0000)]
[AArch64][CostModel] Add coverage for bswap intrinsics.

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

7 years ago[Docs] Update docs to indicate that CUDA compilation is supported on Windows.
Justin Lebar [Thu, 5 Jan 2017 16:54:28 +0000 (16:54 +0000)]
[Docs] Update docs to indicate that CUDA compilation is supported on Windows.

Subscribers: cfe-commits, llvm-commits

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

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

7 years agoRemove a unnecessary hasLoopInvariantOperands check in loop sink.
Xin Tong [Thu, 5 Jan 2017 16:52:37 +0000 (16:52 +0000)]
Remove a unnecessary hasLoopInvariantOperands check in loop sink.

Summary:
Preheader instruction's operands will always be invariant w.r.t. the loop which its the preheader
for.

Memory aliases are handled in canSinkOrHoistInst.

Reviewers: danielcdh, davidxl

Subscribers: mzolotukhin, llvm-commits

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

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

7 years ago[X86] Add test cases that cover pr31551. NFC.
Zvi Rackover [Thu, 5 Jan 2017 16:48:28 +0000 (16:48 +0000)]
[X86] Add test cases that cover pr31551. NFC.

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

7 years agoless braces; NFC
Sanjay Patel [Thu, 5 Jan 2017 16:47:32 +0000 (16:47 +0000)]
less braces; NFC

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

7 years ago[CostModel][X86] Add support for broadcast shuffle costs
Simon Pilgrim [Thu, 5 Jan 2017 15:56:08 +0000 (15:56 +0000)]
[CostModel][X86] Add support for broadcast shuffle costs

Currently only for broadcasts with input and output of the same width.

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

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

7 years ago[X86] Optimize vector shifts with variable but uniform shift amounts
Zvi Rackover [Thu, 5 Jan 2017 15:11:43 +0000 (15:11 +0000)]
[X86] Optimize vector shifts with variable but uniform shift amounts

Summary:
For instructions such as PSLLW/PSLLD/PSLLQ a variable shift amount may be passed in an XMM register.
The lower 64-bits of the register are evaluated to determine the shift amount.
This patch improves the construction of the vector containing the shift amount.

Reviewers: craig.topper, delena, RKSimon

Subscribers: llvm-commits

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

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

7 years ago[ThinLTO] Add parenthesis as per build warning
Teresa Johnson [Thu, 5 Jan 2017 15:10:10 +0000 (15:10 +0000)]
[ThinLTO] Add parenthesis as per build warning

Fixes a warning about "||" and "&&" due to r291108.

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

7 years ago[AArch64] Remove mcpu option as this test is not target specific. NFC.
Chad Rosier [Thu, 5 Jan 2017 15:05:03 +0000 (15:05 +0000)]
[AArch64] Remove mcpu option as this test is not target specific. NFC.

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

7 years ago[PowerPC] Implement missing ISA 2.06 instructions.
Tony Jiang [Thu, 5 Jan 2017 15:00:45 +0000 (15:00 +0000)]
[PowerPC] Implement missing ISA 2.06 instructions.

Instructions: fctidu[.], fctiwu[.], ftdiv, ftsqrt are not implemented. Implement
them and add corresponding test cases in this patch.

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

7 years ago[ThinLTO] Use DenseSet instead of SmallPtrSet for holding GUIDs
Teresa Johnson [Thu, 5 Jan 2017 14:59:56 +0000 (14:59 +0000)]
[ThinLTO] Use DenseSet instead of SmallPtrSet for holding GUIDs

Should fix some more bot failures from r291108.
This should have been a DenseSet, since GUID is not a pointer type.
It caused some bots to fail, but for some reason I wasnt't getting a
build failure.

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

7 years agoWdocumentation fix
Simon Pilgrim [Thu, 5 Jan 2017 14:58:54 +0000 (14:58 +0000)]
Wdocumentation fix

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

7 years ago[AArch64] Remove unused arguments from tests. NFC.
Chad Rosier [Thu, 5 Jan 2017 14:48:53 +0000 (14:48 +0000)]
[AArch64] Remove unused arguments from tests. NFC.

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

7 years ago[ThinLTO] Update new ModuleSummaryIndexYAML.h for r291108
Teresa Johnson [Thu, 5 Jan 2017 14:40:15 +0000 (14:40 +0000)]
[ThinLTO] Update new ModuleSummaryIndexYAML.h for r291108

Should fix bot failures due to r291108 which happened due to a
change required in ModuleSummaryIndexYAML.h which was just added in
r291069.

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

7 years ago[CostModel][X86] Pulled out common type legalization code
Simon Pilgrim [Thu, 5 Jan 2017 14:33:32 +0000 (14:33 +0000)]
[CostModel][X86] Pulled out common type legalization code

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

7 years ago[ThinLTO] Subsume all importing checks into a single flag
Teresa Johnson [Thu, 5 Jan 2017 14:32:16 +0000 (14:32 +0000)]
[ThinLTO] Subsume all importing checks into a single flag

Summary:
This adds a new summary flag NotEligibleToImport that subsumes
several existing flags (NoRename, HasInlineAsmMaybeReferencingInternal
and IsNotViableToInline). It also subsumes the checking of references
on the summary that was being done during the thin link by
eligibleForImport() for each candidate. It is much more efficient to
do that checking once during the per-module summary build and record
it in the summary.

Reviewers: mehdi_amini

Subscribers: llvm-commits

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

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

7 years agoCurrently isLikelyComplexAddressComputation tries to figure out if the given stride...
Mohammed Agabaria [Thu, 5 Jan 2017 14:03:41 +0000 (14:03 +0000)]
Currently isLikelyComplexAddressComputation tries to figure out if the given stride seems to be 'complex' and need some extra cost for address computation handling.

This code seems to be target dependent which may not be the same for all targets.
Passed the decision whether the given stride is complex or not to the target by sending stride information via SCEV to getAddressComputationCost instead of 'IsComplex'.

Specifically at X86 targets we dont see any significant address computation cost in case of the strided access in general.

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

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

7 years ago[GlobalISel] Add support for address-taken basic blocks
Kristof Beyls [Thu, 5 Jan 2017 13:27:52 +0000 (13:27 +0000)]
[GlobalISel] Add support for address-taken basic blocks

To make this work, pointers from the MachineBasicBlock to the LLVM-IR-level
basic blocks need to be initialized, as the AsmPrinter uses this link to be
able to print out labels for the basic blocks that are address-taken.

Most of the changes in this commit are about adapting existing tests to include
the basic block name that is now printed out in the MIR format, now that the
name becomes available as the link to the LLVM-IR basic block is initialized.
The relevant test change for the functionality added in this patch are the
added "(address-taken)" strings in
test/CodeGen/AArch64/GlobalISel/arm64-irtranslator.ll.

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

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

7 years ago[doc] Fix minor grammatical error in Phabricator.rst
Anmol P. Paralkar [Thu, 5 Jan 2017 13:08:14 +0000 (13:08 +0000)]
[doc] Fix minor grammatical error in Phabricator.rst

Summary: Test commit, fix minor grammatical error in Phabricator.rst

Reviewers: delcypher

Subscribers: llvm-commits

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

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

7 years ago[GlobalISel] Add support for switch statements
Kristof Beyls [Thu, 5 Jan 2017 11:28:51 +0000 (11:28 +0000)]
[GlobalISel] Add support for switch statements

This commit does this using a trivial chain of conditional branches.  In the
future, we probably want to reuse the optimized switch lowering used in
SelectionDAG.

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

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

7 years ago[GlobalISel] Fix AArch64 ICMP instruction selection
Kristof Beyls [Thu, 5 Jan 2017 10:16:08 +0000 (10:16 +0000)]
[GlobalISel] Fix AArch64 ICMP instruction selection

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

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

7 years ago[Test Commit] fixing some format issue in X86TTI to match clang-format output.
Mohammed Agabaria [Thu, 5 Jan 2017 09:51:02 +0000 (09:51 +0000)]
[Test Commit] fixing some format issue in X86TTI to match clang-format output.

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

7 years agoAVX-512: Optimized pattern for truncate with unsigned saturation.
Elena Demikhovsky [Thu, 5 Jan 2017 08:21:09 +0000 (08:21 +0000)]
AVX-512: Optimized pattern for truncate with unsigned saturation.

DAG patterns optimization: truncate + unsigned saturation supported by VPMOVUS* instructions in AVX-512.
Differential revision: https://reviews.llvm.org/D28216

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

7 years agotest: remove unnecessary triple argument
Saleem Abdulrasool [Thu, 5 Jan 2017 06:30:12 +0000 (06:30 +0000)]
test: remove unnecessary triple argument

This test is entirely target agnostic.  Avoid the triple to repair the
build bots.

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

7 years ago[X86] Add Intel Kaby Lake model numbers to getHostCPUName aliased to "skylake" since...
Craig Topper [Thu, 5 Jan 2017 05:57:27 +0000 (05:57 +0000)]
[X86] Add Intel Kaby Lake model numbers to getHostCPUName aliased to "skylake" since there are no feature differences.

Model numbers found here http://www.sandpile.org/x86/cpuid.htm

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

7 years agoMC: support passing search paths to the IAS
Saleem Abdulrasool [Thu, 5 Jan 2017 05:56:39 +0000 (05:56 +0000)]
MC: support passing search paths to the IAS

This is needed to support inclusion in inline assembly via the
`.include` directive.

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

7 years ago[X86] Change getHostCPUName to report Intel model 0x4e as "skylake" instead of "skyla...
Craig Topper [Thu, 5 Jan 2017 05:47:29 +0000 (05:47 +0000)]
[X86] Change getHostCPUName to report Intel model 0x4e as "skylake" instead of "skylake-avx512". Add the proper 0x55 model for "skylake-avx512".

Summary:
Intel's i5-6300U CPU is reporting to have a model id of 78 (4e).
The Host detection assumes that to be Skylake Xeon (with AVX512 support),
instead of a normal Skylake machine.

Patch by: Valentin Churavy

Reviewers: nalimilan, craig.topper

Subscribers: hfinkel, tkelman, craig.topper, nalimilan, llvm-commits

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

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

7 years agoTentative fix for modules build.
Peter Collingbourne [Thu, 5 Jan 2017 04:40:09 +0000 (04:40 +0000)]
Tentative fix for modules build.

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

7 years ago[libFuzzer] use /tmp (or $TMPDIR, if present) to store temp files during merge
Kostya Serebryany [Thu, 5 Jan 2017 04:32:19 +0000 (04:32 +0000)]
[libFuzzer] use /tmp (or $TMPDIR, if present) to store temp files during merge

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

7 years agoFix build bots.
Peter Collingbourne [Thu, 5 Jan 2017 04:00:09 +0000 (04:00 +0000)]
Fix build bots.

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

7 years agoIR: Module summary representation for type identifiers; summary test scaffolding...
Peter Collingbourne [Thu, 5 Jan 2017 03:39:00 +0000 (03:39 +0000)]
IR: Module summary representation for type identifiers; summary test scaffolding for lowertypetests.

Set up basic YAML I/O support for module summaries, plumb the summary into
the pass and add a few command line flags to test YAML I/O support. Bitcode
support to come separately, as will the code in LowerTypeTests that actually
uses the summary. Also add a couple of tests that pass by virtue of the pass
doing nothing with the summary (which happens to be the correct thing to do
for those tests).

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

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

7 years agoRevert r291025 ("AMDGPU: Remove unneccessary intermediate vector")
Richard Smith [Thu, 5 Jan 2017 03:13:10 +0000 (03:13 +0000)]
Revert r291025 ("AMDGPU: Remove unneccessary intermediate vector")

This caused buildbot failures due to returning ArrayRefs referencing local
(temporary) objects.

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

7 years ago[PM] Fix a typo in a comment that Davide spotted in another code review.
Chandler Carruth [Thu, 5 Jan 2017 03:10:26 +0000 (03:10 +0000)]
[PM] Fix a typo in a comment that Davide spotted in another code review.

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

7 years ago[gtest] Work around broken installs of libc++ where we don't have
Chandler Carruth [Thu, 5 Jan 2017 01:41:49 +0000 (01:41 +0000)]
[gtest] Work around broken installs of libc++ where we don't have
a cxxabi.h in the include search paths.

This comes up when libc++ is installed with some other abi library. At
some points in time in history we have had CMake hackery to try and get
a cxxabi.h installed that would work, but there are lots of examples
lacking this. Also, the just-built tree with libc++ seems to not quite
get this right.

To let folks make progress, we can easily work around this by detecting
that the header is missing and disabling the relevant parts of gtest.
This should fix the last remainging build bot failures. While these
failures are typically indicative of a questionable install, I don't
think gtest should be the thing that surfaces those issues and I don't
want folks blocked on this.

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

7 years ago[AVX-512] Update vextract64x4 intrinsic upgrade test cases to use a legal immediate...
Craig Topper [Thu, 5 Jan 2017 01:34:55 +0000 (01:34 +0000)]
[AVX-512] Update vextract64x4 intrinsic upgrade test cases to use a legal immediate so they test the instruction selection correctly.

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

7 years agoMark test that is testing statistics output as requiring Assertions
Mehdi Amini [Thu, 5 Jan 2017 01:08:01 +0000 (01:08 +0000)]
Mark test that is testing statistics output as requiring Assertions

We only enable statistic in an assert build by default.

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

7 years ago[InstSimplify] add tests to show missing select simplifications; NFC
Sanjay Patel [Thu, 5 Jan 2017 00:40:52 +0000 (00:40 +0000)]
[InstSimplify] add tests to show missing select simplifications; NFC

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

7 years ago[PM] Edit comments in PassManager.h.
Justin Lebar [Thu, 5 Jan 2017 00:12:51 +0000 (00:12 +0000)]
[PM] Edit comments in PassManager.h.

Summary:
This covers most of PassManager.h, up to the introduction of inner/outer
analysis proxies.

If there's a theme to these changes, it's simplifying the language.  For
example:

  * PreservedAnalyses is a "set of analyses", not an "abstract set".
    "Abstract" doesn't have any particular meaning here.

  * "Build types for the concept types" becomes "define the concept types".

  * Instead of "data structures optimized for pointer-like types using
    the alignment-provided low bits", say "data structures that use the
    low bits of pointers."

  * "Clear the map pointing into the results list" becomes
    "Delete the map entries that point into the results list."

This patch also fixes a few places where we referred to "function" and
"module" pass/analysis managers, instead of the more abstract "IRUnitT"
PM/AMs we have now.

Subscribers: mehdi_amini

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

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

7 years agoPatch gtest to move GTEST_IS_THREADSAFE out of unrelated GTEST_HAS_SEH ifdef
Reid Kleckner [Thu, 5 Jan 2017 00:00:05 +0000 (00:00 +0000)]
Patch gtest to move GTEST_IS_THREADSAFE out of unrelated GTEST_HAS_SEH ifdef

Fixes the sanitizer Windows build, which happens to set
-DGTEST_HAS_SEH=0.

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

7 years ago[DWARF] Null out the debug locs of load instructions that have been moved by GVN
Wolfgang Pieb [Wed, 4 Jan 2017 23:58:26 +0000 (23:58 +0000)]
[DWARF] Null out the debug locs of load instructions that have been moved by GVN
performing partial redundancy elimination (PRE). Not doing so can cause jumpy line
tables and confusing (though correct) source attributions.

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

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

7 years ago[gtest] Fix the way we disable a warning for unittests.
Chandler Carruth [Wed, 4 Jan 2017 23:40:06 +0000 (23:40 +0000)]
[gtest] Fix the way we disable a warning for unittests.

I somehow wrote this fix and then lost it prior to commit. Really sorry
about the noise. This should fix some issues with hacking add_definition
to do things with warning flags.

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

7 years ago[gtest] Upgrade googletest to version 1.8.0, minimizing local changes.
Chandler Carruth [Wed, 4 Jan 2017 23:06:03 +0000 (23:06 +0000)]
[gtest] Upgrade googletest to version 1.8.0, minimizing local changes.

This required re-working the streaming support and lit's support for
'--gtest_list_tests' but otherwise seems to be a clean upgrade.

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

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

7 years agoUse lazy-loading of Metadata in MetadataLoader when importing is enabled (NFC)
Mehdi Amini [Wed, 4 Jan 2017 22:54:33 +0000 (22:54 +0000)]
Use lazy-loading of Metadata in MetadataLoader when importing is enabled (NFC)

Summary:
This is a relatively simple scheme: we use the index emitted in the
bitcode to avoid loading all the global metadata. Instead we load
the index with their position in the bitcode so that we can load each
of them individually. Materializing the global metadata block in this
condition only triggers loading the named metadata, and the ones
referenced from there (transitively). When materializing a function,
metadata from the global block are loaded lazily as they are
referenced.

Two main current limitations are:

1) Global values other than functions are not materialized on demand,
so we need to eagerly load METADATA_GLOBAL_DECL_ATTACHMENT records
(and their transitive dependencies).
2) When we load a single metadata, we don't recurse on the operands,
instead we use a placeholder or a temporary metadata. Unfortunately
tepmorary nodes are very expensive. This is why we don't have it
always enabled and only for importing.

These two limitations can be lifted in a subsequent improvement if
needed.

With this change, the total link time of opt with ThinLTO and Debug
Info enabled is going down from 282s to 224s (~20%).

Reviewers: pcc, tejohnson, dexonsmith

Subscribers: llvm-commits

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

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

7 years agoChange BitstreamCursor::skipRecord to return the record code (NFC)
Mehdi Amini [Wed, 4 Jan 2017 22:54:14 +0000 (22:54 +0000)]
Change BitstreamCursor::skipRecord to return the record code (NFC)

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

7 years agoAMDGPU: Remove unneccessary intermediate vector
Matt Arsenault [Wed, 4 Jan 2017 22:54:10 +0000 (22:54 +0000)]
AMDGPU: Remove unneccessary intermediate vector

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

7 years agoFixup some header includes from recent IntrusiveRefCntPtr cleanup.
David Blaikie [Wed, 4 Jan 2017 22:52:00 +0000 (22:52 +0000)]
Fixup some header includes from recent IntrusiveRefCntPtr cleanup.

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

7 years ago[ADT] Attempt to fix GCC warning in IntrusiveRefCntPtrTest.
Justin Lebar [Wed, 4 Jan 2017 22:49:55 +0000 (22:49 +0000)]
[ADT] Attempt to fix GCC warning in IntrusiveRefCntPtrTest.

Our copy constructor doesn't explicitly invoke the base class's
constructor, and GCC is (rightly) concerned.

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

7 years agoInstCombine: Fold cos(-x) -> cos(x)
Matt Arsenault [Wed, 4 Jan 2017 22:49:03 +0000 (22:49 +0000)]
InstCombine: Fold cos(-x) -> cos(x)

Also cos(fabs(x)) -> cos(x)

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

7 years agoReapply "Make BitCodeAbbrev ownership explicit using shared_ptr rather than Intrusive...
David Blaikie [Wed, 4 Jan 2017 22:36:33 +0000 (22:36 +0000)]
Reapply "Make BitCodeAbbrev ownership explicit using shared_ptr rather than IntrusiveRefCntPtr""

If this is a problem for anyone (shared_ptr is two pointers in size,
whereas IntrusiveRefCntPtr is 1 - and the ref count control block that
make_shared adds is probably larger than the one int in RefCountedBase)
I'd prefer to address this by adding a lower-overhead version of
shared_ptr (possibly refactoring IntrusiveRefCntPtr into such a thing)
to avoid the intrusiveness - this allows memory ownership to remain
orthogonal to types and at least to me, seems to make code easier to
understand (since no implicit ownership acquisition can happen).

This recommits 291006, reverted in r291007.

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

7 years ago[Legalizer] Fix fp-to-uint to fp-tosint promotion assertion.
Tim Shen [Wed, 4 Jan 2017 22:11:42 +0000 (22:11 +0000)]
[Legalizer] Fix fp-to-uint to fp-tosint promotion assertion.

Summary:
When promoting fp-to-uint16 to fp-to-sint32, the result is actually zero
extended. For example, given double 65534.0, without legalization:

  fp-to-uint16: 65534.0 -> 0xfffe

With the legalization:

  fp-to-sint32: 65534.0 -> 0x0000fffe

Without this patch, legalization wrongly emits a signed extend assertion,
which is consumed by later icmp instruction, and cause miscompile.

Note that the floating point value must be in [0, 65535), otherwise the
behavior is undefined.

This patch reverts r279223 behavior and adds more tests and
documentations.

In PR29041's context, James Molloy mentioned that:

  We don't need to mask because conversion from float->uint8_t is
  undefined if the integer part of the float value is not representable in
  uint8_t. Therefore we can assume this doesn't happen!

which is totally true and good, because fptoui is documented clearly to
have undefined behavior when overflow/underflow happens. We should take
the advantage of this behavior so that we can save unnecessary mask
instructions.

Reviewers: jmolloy, nadav, echristo, kbarton

Subscribers: mehdi_amini, nemanjai, llvm-commits

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

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

7 years agoFix some buildbot issues with const objects with default ctors
David Blaikie [Wed, 4 Jan 2017 21:59:22 +0000 (21:59 +0000)]
Fix some buildbot issues with const objects with default ctors

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

7 years agoThe patch fixes (base, index, offset) match.
Evgeny Stupachenko [Wed, 4 Jan 2017 21:43:39 +0000 (21:43 +0000)]
The patch fixes (base, index, offset) match.

Summary:
Instead of matching:
  (a + i) + 1 -> (a + i, undef, 1)
Now it matches:
  (a + i) + 1 -> (a, i, 1)

Reviewers: rengolin

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

From: Evgeny Stupachenko <evstupac@gmail.com>

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

7 years ago[AArch64] Update the feature set for Qualcomm's Falkor CPU.
Chad Rosier [Wed, 4 Jan 2017 21:26:23 +0000 (21:26 +0000)]
[AArch64] Update the feature set for Qualcomm's Falkor CPU.

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

7 years agoAdd positive test for sqrt "partial inlining". NFC.
Michael Kuperstein [Wed, 4 Jan 2017 21:24:56 +0000 (21:24 +0000)]
Add positive test for sqrt "partial inlining". NFC.

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

7 years ago[AArch64] Fix over-eager early-exit in load-store combiner
Nirav Dave [Wed, 4 Jan 2017 21:21:46 +0000 (21:21 +0000)]
[AArch64] Fix over-eager early-exit in load-store combiner

Fix early-exit analysis for memory operation pairing when operations are
not emitted in ascending order.

Reviewers: mcrosier, t.p.northover

Subscribers: aemerson, rengolin, llvm-commits

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

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

7 years agoRevert "Make BitCodeAbbrev ownership explicit using shared_ptr rather than IntrusiveR...
David Blaikie [Wed, 4 Jan 2017 21:19:28 +0000 (21:19 +0000)]
Revert "Make BitCodeAbbrev ownership explicit using shared_ptr rather than IntrusiveRefCntPtr"

Breaks Clang's use of bitcode. Reverting until I have a fix to go with
it there.

This reverts commit r291006.

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

7 years agoMake BitCodeAbbrev ownership explicit using shared_ptr rather than IntrusiveRefCntPtr
David Blaikie [Wed, 4 Jan 2017 21:13:35 +0000 (21:13 +0000)]
Make BitCodeAbbrev ownership explicit using shared_ptr rather than IntrusiveRefCntPtr

If this is a problem for anyone (shared_ptr is two pointers in size,
whereas IntrusiveRefCntPtr is 1 - and the ref count control block that
make_shared adds is probably larger than the one int in RefCountedBase)
I'd prefer to address this by adding a lower-overhead version of
shared_ptr (possibly refactoring IntrusiveRefCntPtr into such a thing)
to avoid the intrusiveness - this allows memory ownership to remain
orthogonal to types and at least to me, seems to make code easier to
understand (since no implicit ownership acquisition can happen).

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

7 years agoRemove unnecessary intrusive ref counting in favor of std::shared_ptr/make_shared
David Blaikie [Wed, 4 Jan 2017 21:13:28 +0000 (21:13 +0000)]
Remove unnecessary intrusive ref counting in favor of std::shared_ptr/make_shared

The intrusive nature of the reference counting is not required/used
here, so simplify the ownership model to make the code easier to
understand.

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

7 years agoRemove accidentally target-dependent test and pacify bots.
Michael Kuperstein [Wed, 4 Jan 2017 21:08:53 +0000 (21:08 +0000)]
Remove accidentally target-dependent test and pacify bots.

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

7 years ago[PowerPC] Fix logic dealing with nop after calls (and tail-call eligibility)
Hal Finkel [Wed, 4 Jan 2017 21:05:13 +0000 (21:05 +0000)]
[PowerPC] Fix logic dealing with nop after calls (and tail-call eligibility)

This change aims to unify and correct our logic for when we need to allow for
the possibility of the linker adding a TOC restoration instruction after a
call. This comes up in two contexts:

 1. When determining tail-call eligibility. If we make a tail call (i.e.
    directly branch to a function) then there is no place for the linker to add
    a TOC restoration.
 2. When determining when we need to add a nop instruction after a call.
    Likewise, if there is a possibility that the linker might need to add a
    TOC restoration after a call, then we need to put a nop after the call
    (the bl instruction).

First problem: We were using similar, but different, logic to decide (1) and
(2). This is just wrong. Both the resideInSameModule function (used when
determining tail-call eligibility) and the isLocalCall function (used when
deciding if the post-call nop is needed) were supposed to be determining the
same underlying fact (i.e. might a TOC restoration be needed after the call).
The same logic should be used in both places.

Second problem: The logic in both places was wrong. We only know that two
functions will share the same TOC when both functions come from the same
section of the same object. Otherwise the linker might cause the functions to
use different TOC base addresses (unless the multi-TOC linker option is
disabled, in which case only shared-library boundaries are relevant). There are
a number of factors that can cause functions to be placed in different sections
or come from different objects (-ffunction-sections, explicitly-specified
section names, COMDAT, weak linkage, etc.). All of these need to be checked.
The existing logic only checked properties of the callee, but the properties of
the caller must also be checked (for example, calling from a function in a
COMDAT section means calling between sections).

There was a conceptual error in the resideInSameModule function in that it
allowed tail calls to functions with weak linkage and protected/hidden
visibility. While protected/hidden visibility does prevent the function
implementation from being replaced at runtime (via interposition), it does not
prevent the linker from using an alternate implementation at link time (i.e.
using some strong definition to replace the provided weak one during linking).
If this happens, then we're still potentially looking at a required TOC
restoration upon return.

Otherwise, in general, the post-call nop is needed wherever ELF interposition
needs to be supported. We don't currently support ELF interposition at the IR
level (see http://lists.llvm.org/pipermail/llvm-dev/2016-November/107625.html
for more information), and I don't think we should try to make it appear to
work in the backend in spite of that fact. Unfortunately, because of the way
that the ABI works, we need to generate code as if we supported interposition
whenever the linker might insert stubs for the purpose of supporting it.

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

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

7 years agoNewGVN: Track the maximum number of iterations GVN takes on any function, so we can...
Daniel Berlin [Wed, 4 Jan 2017 21:01:02 +0000 (21:01 +0000)]
NewGVN: Track the maximum number of iterations GVN takes on any function, so we can pinpoint performance issues.

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

7 years agoAdd positive test for sqrt "partial inlining". NFC.
Michael Kuperstein [Wed, 4 Jan 2017 20:48:30 +0000 (20:48 +0000)]
Add positive test for sqrt "partial inlining". NFC.

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

7 years ago[lib/LTO] Simplify logic removing set but unused variable. NFCI.
Davide Italiano [Wed, 4 Jan 2017 20:37:57 +0000 (20:37 +0000)]
[lib/LTO] Simplify logic removing set but unused variable. NFCI.

Reported by David Binderman and ack'ed by Teresa on IRC.
PR: 31527

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

7 years agoYAML: Remove Input::MapHNode::isValidKey(), use llvm::is_contained() instead. NFC.
Peter Collingbourne [Wed, 4 Jan 2017 20:10:43 +0000 (20:10 +0000)]
YAML: Remove Input::MapHNode::isValidKey(), use llvm::is_contained() instead. NFC.

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

7 years agoRemove dead and unused variable NumSentinelElements.
Eric Christopher [Wed, 4 Jan 2017 20:05:18 +0000 (20:05 +0000)]
Remove dead and unused variable NumSentinelElements.

Fixes PR31529.

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

7 years agoRemove dead variable Len.
Eric Christopher [Wed, 4 Jan 2017 19:47:10 +0000 (19:47 +0000)]
Remove dead variable Len.

Fixes PR31528

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

7 years agoAdd missing CHECK: line to test case added in 29097
Tobias Grosser [Wed, 4 Jan 2017 19:35:38 +0000 (19:35 +0000)]
Add missing CHECK: line to test case added in 29097

Without this CHECK line, we may not detect incorrectly detected additional
regions at the end of the region tree.

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

7 years agoADT: IntrusiveRefCntPtr: Broaden the definition of correct usage of RefCountedBase
David Blaikie [Wed, 4 Jan 2017 18:57:31 +0000 (18:57 +0000)]
ADT: IntrusiveRefCntPtr: Broaden the definition of correct usage of RefCountedBase

This roughly matches the semantics of std::enable_shared_from_this - that it
does not dictate the ownership model of all users, but constrains those users
taking advantage of the intrusive nature to do so only when there's a guarantee
that that's the ownership model being used for the object being passed.

Reviewers: jlebar

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

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

7 years agofix comment formatting; NFC
Sanjay Patel [Wed, 4 Jan 2017 18:16:43 +0000 (18:16 +0000)]
fix comment formatting; NFC

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

7 years agoAMDGPU/SI: Implement sendmsghalt intrinsic
Jan Vesely [Wed, 4 Jan 2017 18:06:55 +0000 (18:06 +0000)]
AMDGPU/SI: Implement sendmsghalt intrinsic

v2: expose using amdgcn prefix

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

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