136506 Commits

Author SHA1 Message Date
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
Craig Topper
c59de2e139 [X86] Remove the Fv packed logical operation alias instructions. Replace them with patterns to the regular instructions.
This enables execution domain fixing which is why the tests changed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278090 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 03:06:33 +00:00
Craig Topper
abbe1e899e [X86] Cleanup patterns for AVX/SSE for PS operations. Always try to look for bitcasts from floating point types. If only AVX1 is supported we also need to handle integer types with floating point ops without looking for bitcasts.
Previously SSE1 had a pattern that looked for integer types without bitcasts, but the type wasn't legal with only SSE1 and SSE2 add an identical pattern for the integer instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278089 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 03:06:28 +00:00
Craig Topper
4f5ecb323c [X86] Remove unnecessary bitcast from the front of AVX1Only 256-bit logical operation patterns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278088 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 03:06:26 +00:00
Matthias Braun
9a82d30088 X86InstrInfo: Update liveness in classifyLea()
We need to update liveness information when we create COPYs in
classifyLea().

This fixes http://llvm.org/28301

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278086 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 01:47:26 +00:00
Derek Schuff
e7c619024b [WebAssembly] Fix bugs in WebAssemblyLowerEmscriptenExceptions pass
* Delete extra '_' prefixes from JS library function names. fixImports()
  function in JS glue code deals with this for wasm.
* Change command-line option names in order to be consistent with
  asm.js.
* Add missing lowering code for llvm.eh.typeid.for intrinsics
* Delete commas in mangled function names
* Fix a function argument attributes bug. Because we add the pointer to
  the original callee as the first argument of invoke wrapper, all
  argument attribute indices have to be incremented by one.

Patch by Heejin Ahn

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278081 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 00:29:55 +00:00
Sean Silva
2058f10aaa Consistently use CGSCCAnalysisManager
Besides a general consistently benefit, the extra layer of indirection
allows the mechanical part of https://reviews.llvm.org/D23256 that
requires touching every transformation and analysis to be factored out
cleanly.

Thanks to David for the suggestion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278080 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 00:28:56 +00:00
Sean Silva
a4f9d70f9b Consistently use LoopAnalysisManager
One exception here is LoopInfo which must forward-declare it (because
the typedef is in LoopPassManager.h which depends on LoopInfo).

Also, some includes for LoopPassManager.h were needed since that file
provides the typedef.

Besides a general consistently benefit, the extra layer of indirection
allows the mechanical part of https://reviews.llvm.org/D23256 that
requires touching every transformation and analysis to be factored out
cleanly.

Thanks to David for the suggestion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278079 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 00:28:52 +00:00
Sean Silva
2fb9a98752 Consistently use ModuleAnalysisManager
Besides a general consistently benefit, the extra layer of indirection
allows the mechanical part of https://reviews.llvm.org/D23256 that
requires touching every transformation and analysis to be factored out
cleanly.

Thanks to David for the suggestion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278078 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 00:28:38 +00:00
Sean Silva
20b343c051 Consistently use FunctionAnalysisManager
Besides a general consistently benefit, the extra layer of indirection
allows the mechanical part of https://reviews.llvm.org/D23256 that
requires touching every transformation and analysis to be factored out
cleanly.

Thanks to David for the suggestion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278077 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 00:28:15 +00:00
Saleem Abdulrasool
b79146f48d CodeView: extract the OMF Directory Header
The DebugDirectory contains a pointer to the CodeView info structure which is a
derivative of the OMF debug directory.  The structure has evolved a bit over
time, and PDB 2.0 used a slightly different definition from PDB 7.0.  Both of
these are specific to CodeView and not COFF.  Reflect this by moving the
structure definitions into the DebugInfo/CodeView headers.  Define a generic
DebugInfo union type that can be used to pass around a reference to the
DebugInfo irrespective of the versioning.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278075 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 00:25:12 +00:00
Sanjay Patel
f7c3c99642 [x86] split combineVSelectWithAllOnesOrZeros into a helper function; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278074 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 00:01:11 +00:00
Derek Schuff
d55ce11c46 [WebAssembly] Fix CFI index to account for padding nullptr function
The WebAssembly linker now creates a dummy function at index 0 to
prevent miscomparisons with the NULL pointer, see
https://github.com/WebAssembly/binaryen/pull/658. Thanks to pcc for
pointing out this problem!

Patch by Dominic Chen

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278073 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-08 23:56:01 +00:00
Rui Ueyama
922b42a995 Revert "Do not ignore SizeOfOptionalHeader in COFF header even if PE header is not present."
This reverts commit r278066 to unbreak buildbots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278070 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-08 23:07:03 +00:00
Lang Hames
06c9df2f1c Revert r278065 while I investigate some build-bot breakage.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278069 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-08 22:57:30 +00:00