136620 Commits

Author SHA1 Message Date
Davide Italiano
1ea5b393e5 [SimplifyLibCalls] Restore the old behaviour, emit a libcall.
Hal pointed out that the semantic of our intrinsic and the libc
call are slightly different. Add a comment while I'm here to
explain why we can't emit an intrinsic. Thanks Hal!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278200 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-10 06:33:32 +00:00
Easwaran Raman
74dacfe33e Do not directly use inline threshold cl options in cost analysis.
This adds an InlineParams struct which is populated from the command line options by getInlineParams and passed to getInlineCost for the call analyzer to use.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278189 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-10 00:48:04 +00:00
Adam Nemet
c70a5f4bf1 [OptDiag] Add class Doxygen comment
This was requested in D22694.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278186 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-10 00:44:56 +00:00
Adam Nemet
37a4ac8678 [Inliner,OptDiag] Add hotness attribute to opt diagnostics
Summary:
The inliner not being a function pass requires the work-around of
generating the OptimizationRemarkEmitter and in turn BFI on demand.
This will go away after the new PM is ready.

BFI is only computed inside ORE if the user has requested hotness
information for optimization diagnostitics (-pass-remark-with-hotness at
the 'opt' level).  Thus there is no additional overhead without the
flag.

Reviewers: hfinkel, davidxl, eraman

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278185 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-10 00:44:44 +00:00
Kostya Serebryany
1e3f45d363 [scudo] Documentation update for Scudo, from https://reviews.llvm.org/D23332
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278180 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 23:57:04 +00:00
Vedant Kumar
5987faf07f [IR] Remove some unused #includes (NFC)
I needed a reader-writer lock for a downstream project and noticed that
llvm has one. Function.cpp is the only file in-tree that refers to it.
To anyone reading this: are you using RWMutex in out-of-tree code? Maybe
it's not worth keeping around any more...

Since we're not actually using RWMutex *here*, remove the #include (and
a few other stale headers while we're at it).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278178 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 23:14:37 +00:00
Zachary Turner
dc89d2a880 Make LLVM_PRETTY_FUNCTION support __func__.
In case there are compilers that support neither __FUNCSIG__ or
__PRETTY_FUNCTION__, we fall back to __func__ as a last resort,
which should be guaranteed by C++11 and C99.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278176 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 23:03:55 +00:00
Tim Northover
84aa82e380 GlobalISel: support 'undef' constant.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278174 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 23:01:30 +00:00
Michael Zolotukhin
4b4709686d [LoopSimplify] Rebuild LCSSA for the inner loop after separating nested loops.
Summary:
This hopefully fixes PR28825. The problem now was that a value from the
original loop was used in a subloop, which became a sibling after separation.
While a subloop doesn't need an lcssa phi node, a sibling does, and that's
where we broke LCSSA. The most natural way to fix this now is to simply call
formLCSSA on the original loop: it'll do what we've been doing before plus
it'll cover situations described above.

I think we don't need to run formLCSSARecursively here, and we have an assert
to verify this (I've tried testing it on LLVM testsuite + SPECs). I'd be happy
to be corrected here though.

I also changed a run line in the test from '-lcssa -loop-unroll' to
'-lcssa -loop-simplify -indvars', because it exercises LCSSA
preservation to the same extent, but also makes less unrelated
transformation on the CFG, which makes it easier to verify.

Reviewers: chandlerc, sanjoy, silvas

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278173 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 22:44:56 +00:00
Andrew Kaylor
6c6978f931 [ValueTracking] Improve ValueTracking on left shift with nsw flag
Patch by Li Huang

Differential Revison: https://reviews.llvm.org/D23296



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278172 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 22:41:35 +00:00
Derek Schuff
4dd8705c8c [WebAssembly] Add -emscripten-cxx-exceptions-whitelist option
This patch adds -emscripten-cxx-exceptions-whitelist option to
WebAssemblyLowerEmscriptenExceptions pass. This options is the list of
function names in which Emscripten-style exception handling is enabled.
This is to support emscripten's EXCEPTION_CATCHING_WHITELIST which
exists because of the performance impact of emscripten's non-zero-cost
EH method.

Patch by Heejin Ahn

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278171 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 22:37:00 +00:00
Zachary Turner
a533deff7a Add a platform independent version of __PRETTY_FUNCTION__.
MSVC doesn't have this, it only has __FUNCSIG__.  So this adds
a new macro called LLVM_PRETTY_FUNCTION which evaluates to the
right thing on any platform.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278170 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 22:03:45 +00:00
Tim Northover
c1cf490954 GlobalISel: first translation support for Constants.
For now put them all in the entry block. This should be correct but may give
poor runtime performance. Hopefully MachineSinking combined with
isReMaterializable can solve those issues, but if not the interface is sound
enough to support alternatives.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278168 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 21:28:04 +00:00
Sanjay Patel
c14478f169 add test cases for missed vselect optimizations (PR28895)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278165 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 21:07:17 +00:00
Lang Hames
d5ab2f8e97 [ExecutionEngine] Disable weak symbol tests for COFF.
COFF doesn't support weak linkage on functions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278162 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 20:48:22 +00:00
Wei Mi
fc25cfb37a Fix the runtime error caused by "Use ValueOffsetPair to enhance value reuse during SCEV expansion".
The patch is to fix the bug in PR28705. It was caused by setting wrong return
value for SCEVExpander::findExistingExpansion. The return values of findExistingExpansion
have different meanings when the function is used in different ways so it is easy to make
mistake. The fix creates two new interfaces to replace SCEVExpander::findExistingExpansion,
and specifies where each interface is expected to be used.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278161 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 20:40:03 +00:00
Wei Mi
8b93225c07 Recommit "Use ValueOffsetPair to enhance value reuse during SCEV expansion".
The fix for PR28705 will be committed consecutively.

In D12090, the ExprValueMap was added to reuse existing value during SCEV expansion.
However, const folding and sext/zext distribution can make the reuse still difficult.

A simplified case is: suppose we know S1 expands to V1 in ExprValueMap, and
  S1 = S2 + C_a
  S3 = S2 + C_b
where C_a and C_b are different SCEVConstants. Then we'd like to expand S3 as
V1 - C_a + C_b instead of expanding S2 literally. It is helpful when S2 is a
complex SCEV expr and S2 has no entry in ExprValueMap, which is usually caused
by the fact that S3 is generated from S1 after const folding.

In order to do that, we represent ExprValueMap as a mapping from SCEV to
ValueOffsetPair. We will save both S1->{V1, 0} and S2->{V1, C_a} into the
ExprValueMap when we create SCEV for V1. When S3 is expanded, it will first
expand S2 to V1 - C_a because of S2->{V1, C_a} in the map, then expand S3 to
V1 - C_a + C_b.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278160 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 20:37:50 +00:00
Chris Dewhurst
6aabb5f33e Without explicitly including <string>, I'm getting an error on the new code in this file. Won't present an issue for anyone that isn't having the same trouble as me.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278159 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 20:32:59 +00:00
Tim Shen
2962e3e6b2 [ADT] Change iterator_adaptor_base's default template arguments to forward more underlying typedefs
Reviewers: chandlerc

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278157 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 20:23:13 +00:00
Sanjay Patel
b2b51a4ba6 regenerate checks and remove 'opt' run dependency
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278154 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 20:09:16 +00:00
Anna Thomas
f69ccb711f [EarlyCSE] Teach about CSE'ing over invariant.start intrinsics
Summary:
Teach EarlyCSE about invariant.start intrinsic. Specifically, we can perform
store-load, load-load forwarding over this call.

Reviewers: majnemer, reames, dberlin, sanjoy

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278153 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 20:00:47 +00:00
Ying Yi
17a2f3f28e [llvm-cov] Swapped the line and count columns.
In the coverage report, the line and count columns have been swapped to make it more readable.
A follow-up commit in compiler-rt is needed

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278152 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 19:53:35 +00:00
Sanjay Patel
bf1a5ce9bf update to use FileCheck and auto-generate checks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278150 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 19:42:52 +00:00
Lang Hames
04d404bad2 Re-apply r278065 (Weak symbol support in RuntimeDyld) with a fix for ELF.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278149 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 19:27:17 +00:00
David Majnemer
c93602e15a [vim] Update the llvm.vim syntax file
We never updated this file to contain the WinEH instructions.
Also, add the dereferenceable attribute.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278146 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 18:34:19 +00:00
David Majnemer
543ae79447 [X86] Don't model UD2/UD2B as a terminator
A UD2 might make its way into the program via a call to @llvm.trap.
Obviously, calls are not terminators.  However, we modeled the X86
instruction, UD2, as a terminator.  Later on, this confuses the epilogue
insertion machinery which results in the epilogue getting inserted
before the UD2.  For some platforms, like x64, the result is a
violation of the ABI.

Instead, model UD2/UD2B as a side effecting instruction which may
observe memory.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278144 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 17:55:12 +00:00
Simon Pilgrim
4cdc9853bc [DAGCombiner] Better support for shifting large value type by constants
As detailed on D22726, much of the shift combining code assume constant values will fit into a uint64_t value and calls ConstantSDNode::getZExtValue where it probably shouldn't (leading to asserts). Using APInt directly avoids this problem but we encounter other assertions if we attempt to compare/operate on 2 APInt of different bitwidths.

This patch adds a helper function to ensure that 2 APInt values are zero extended as required so that they can be safely used together. I've only added an initial example use for this to the '(SHIFT (SHIFT x, c1), c2) --> (SHIFT x, (ADD c1, c2))' combines. Further cases can easily be added as required.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278141 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 17:39:11 +00:00
Anna Thomas
9cd4907159 [AliasAnalysis] Treat invariant.start as read-memory
Summary:
We teach alias analysis that invariant.start is readonly.
This helps with GVN and memcopy optimizations that currently treat.
invariant.start as a clobber.
We need to treat this as readonly, so that DSE does not incorrectly
remove stores prior to the invariant.start

Reviewers: sanjoy, reames, majnemer, dberlin

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278138 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 17:18:05 +00:00
Sanjay Patel
cfc3af0b7e auto-generate checks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278137 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 17:03:51 +00:00
Sanjay Patel
1019cf0a26 auto-generate checks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278136 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 17:02:17 +00:00
Sanjay Patel
9abb9495da auto-generate checks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278135 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 16:59:54 +00:00
Hans Wennborg
a8ca6b663b test-release.sh: Drop autoconf support
The autoconf build was deleted some time ago.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278133 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 16:46:02 +00:00
Sanjay Patel
7734cde26b add tests for missing vector icmp folds
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278132 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 16:39:05 +00:00
Sanjay Patel
7f4d34245e update to use FileCheck and auto-generate checks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278131 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 16:19:57 +00:00
Sanjay Patel
7e67a7072b regenerate checks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278130 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 16:17:46 +00:00
Sanjay Patel
9c5bb05f3d add tests for missing vector icmp folds
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278129 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 16:05:57 +00:00
Xinliang David Li
f78dbb951b [Profile] turn off verbose warnings by default
no prof data for func warning is turned off by default
due to its high verbosity and minimal usefulness.

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




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278127 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 15:35:28 +00:00
Artur Pilipenko
861388b1f5 [LVI] Make LVI smarter about comparisons with non-constants
Make LVI smarter about comparisons with a non-constant. For example, a s< b constraints a to be in [INT_MIN, INT_MAX) range. This is a part of https://llvm.org/bugs/show_bug.cgi?id=28620 fix.

Reviewed By: sanjoy

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278122 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 14:50:08 +00:00
Simon Pilgrim
04876e5fe5 [X86][XOP] Add support for combining target shuffles to VPERMIL2PD/VPERMIL2PS
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278120 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 12:56:15 +00:00
Kuba Brecka
5a9fa77faf Add #ifdef __cplusplus around extern "C" in Compiler.h. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278119 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 12:12:15 +00:00
Elena Demikhovsky
1b988acdfb AVX-512: A new test for FMA intrinsic
A new test that explores sub-optimal sequence of FMA intrinsic and FNEG operation.
An upcoming patch will fix it.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278117 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 11:54:14 +00:00
Simon Pilgrim
39287026f3 [X86][XOP] Add support for combining target shuffles to VPPERM
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278114 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 10:56:29 +00:00
Dean Michael Berris
8b56a91677 [XRay] Test for xray_instr_map in object file. (NFC)
This makes a trivial change in the emission of the per-function XRay
tables, and makes sure that the xray_instr_map section does show up in
the object file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278113 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 10:42:11 +00:00
Artur Pilipenko
a552eea7f1 Revert 278107 which causes buildbot failures and in addition has wrong commit message
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278109 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 10:00:22 +00:00
Vassil Vassilev
76ebea17d5 [modules]Add missing include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278108 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 09:46:11 +00:00
Artur Pilipenko
7a7dcf69e7 Teach CorrelatedValuePropagation to mark adds as no wrap
Use LVI to prove that adds do not wrap. The change is motivated by https://llvm.org/bugs/show_bug.cgi?id=28620 bug and it's the first step to fix that problem.

Reviewed By: sanjoy

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278107 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 09:41:34 +00:00
Simon Pilgrim
ba7797343e [X86][SSE] Fix memory folding of (v)roundsd / (v)roundss
We only had partial memory folding support for the intrinsic definitions, and (as noted on PR27481) was causing FR32/FR64/VR128 mismatch errors with the machine verifier.

This patch adds missing memory folding support for both intrinsics and the ffloor/fnearbyint/fceil/frint/ftrunc patterns and in doing so fixes the failing machine verifier stack folding tests from PR27481.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278106 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 09:32:34 +00:00
Artur Pilipenko
3d7517b003 [LVI] NFC. Fix a typo Bofore -> Before
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278105 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 09:14:29 +00:00
Craig Topper
380a420a69 [X86] Reduce duplicated code in the execution domain lookup functions by passing tables as an argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278098 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 05:26:09 +00:00
Craig Topper
fa0ea29ddd [AVX-512] Add support for execution domain switching masked logical ops between floating point and integer domain.
This switches PS<->D and PD<->Q.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278097 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 05:26:07 +00:00