Commit Graph

126553 Commits

Author SHA1 Message Date
Xinliang David Li
728b07f28e Fix a bug in test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258276 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-20 02:49:53 +00:00
Joseph Tremoulet
14e824a6a8 [Inliner/WinEH] Honor implicit nounwinds
Summary:
Funclet EH tables require that a given funclet have only one unwind
destination for exceptional exits.  The verifier will therefore reject
e.g. two cleanuprets with different unwind dests for the same cleanup, or
two invokes exiting the same funclet but to different unwind dests.
Because catchswitch has no 'nounwind' variant, and because IR producers
are not *required* to annotate calls which will not unwind as 'nounwind',
it is legal to nest a call or an "unwind to caller" catchswitch within a
funclet pad that has an unwind destination other than caller; it is
undefined behavior for such a call or catchswitch to unwind.

Normally when inlining an invoke, calls in the inlined sequence are
rewritten to invokes that unwind to the callsite invoke's unwind
destination, and "unwind to caller" catchswitches in the inlined sequence
are rewritten to unwind to the callsite invoke's unwind destination.
However, if such a call or "unwind to caller" catchswitch is located in a
callee funclet that has another exceptional exit with an unwind
destination within the callee, applying the normal transformation would
give that callee funclet multiple unwind destinations for its exceptional
exits.  There would be no way for EH table generation to determine which
is the "true" exit, and the verifier would reject the function
accordingly.

Add logic to the inliner to detect these cases and leave such calls and
"unwind to caller" catchswitches as calls and "unwind to caller"
catchswitches in the inlined sequence.

This fixes PR26147.


Reviewers: rnk, andrew.w.kaylor, majnemer

Subscribers: alexcrichton, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258273 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-20 02:15:15 +00:00
Xinliang David Li
6d3068a6fb [PGO] Add a new interface to be used by Indirect Call Promotion
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258271 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-20 01:26:34 +00:00
Eduard Burtescu
50ea6775b6 [NFC] Replace several manual GEP loops with gep_type_iterator.
Reviewers: dblaikie

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258262 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-20 00:26:52 +00:00
Xinliang David Li
fbdf207659 Function name change /NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258260 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-20 00:24:36 +00:00
Matthias Braun
d267d377b8 MachineScheduler: Allow independent scheduling of sub register defs
Note that this is disabled by default and still requires a patch to
handleMove() which is not upstreamed yet.

If the TrackLaneMasks policy/strategy is enabled the MachineScheduler
will build a schedule graph where definitions of independent
subregisters are no longer serialised.

Implementation comments:
- Without lane mask tracking a sub register def also counts as a use
  (except for the first one with the read-undef flag set), with lane
  mask tracking enabled this is no longer the case.
- Pressure Diffs where previously maintained per definition of a
  vreg with the help of the SSA information contained in the
  LiveIntervals.  With lanemask tracking enabled we cannot do this
  anymore and instead change the pressure diffs for all uses of the vreg
  as it becomes live/dead.  For this changed style to work correctly we
  ignore uses of instructions that define the same register again: They
  won't affect register pressure.
- With lanemask tracking we remove all read-undef flags from
  sub register defs when building the graph and re-add them later when
  all vreg lanes have become dead.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258259 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-20 00:23:32 +00:00
Matthias Braun
051b30e8e2 RegisterPressure: Make liveness tracking subregister aware
Differential Revision: http://reviews.llvm.org/D14968

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258258 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-20 00:23:26 +00:00
Matthias Braun
1c6737efbc LiveInterval: Add utility class to rename independent subregister usage
This renaming is necessary to avoid a subregister aware scheduler
accidentally creating liveness "holes" which are rejected by the
MachineVerifier.

Explanation as found in this patch:

Helper class that can divide MachineOperands of a virtual register into
equivalence classes of connected components.
MachineOperands belong to the same equivalence class when they are part of
the same SubRange segment or adjacent segments (adjacent in control
flow); Different subranges affected by the same MachineOperand belong to
the same equivalence class.

Example:
  vreg0:sub0 = ...
  vreg0:sub1 = ...
  vreg0:sub2 = ...
  ...
  xxx        = op vreg0:sub1
  vreg0:sub1 = ...
  store vreg0:sub0_sub1

The example contains 3 different equivalence classes:
  - One for the (dead) vreg0:sub2 definition
  - One containing the first vreg0:sub1 definition and its use,
    but not the second definition!
  - The remaining class contains all other operands involving vreg0.

We provide a utility function here to rename disjunct classes to different
virtual registers.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258257 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-20 00:23:21 +00:00
Tom Stellard
76c5275226 AMDGPU/SI: Prevent the DAGCombiner from creating setcc with i1 inputs
Reviewers: arsenm

Subscribers: arsenm, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258256 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-20 00:13:22 +00:00
Sanjoy Das
e0f8e1a9a9 [MachineSink] Don't break ImplicitNulls
Summary:
This teaches MachineSink to not sink instructions that might break the
implicit null check optimization that runs later.  This should not
affect frontends that do not use implicit null checks.

Reviewers: aadg, reames, hfinkel, atrick

Subscribers: majnemer, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258254 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-20 00:06:14 +00:00
Davide Italiano
0e29198282 Reinstate the second part of a comment. NFC.
Reported by:  Filipe Cabecinhas
Pointy-hat to: me


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258223 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19 23:39:28 +00:00
Quentin Colombet
5a15c7dc2c [X86] Do not run shrink-wrapping on function with split-stack attribute or HiPE
calling convention.
The implementation of the related callbacks in the x86 backend for such
functions are not ready to deal with a prologue block that is not the entry
block of the function.

This fixes PR26107, but the longer term solution would be to fix those callbacks.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258221 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19 23:29:03 +00:00
Sanjay Patel
3ae6879978 add tests to show missing memset/malloc optimizations (PR25892)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258218 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19 23:07:10 +00:00
David Majnemer
42a735c8ed [MC, COFF] Add .reloc support for WinCOFF
This adds rudimentary support for a few relocations that we will use for
the CodeView debug format.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258216 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19 23:05:27 +00:00
Simon Pilgrim
df369b21b9 [X86][SSE] Add VZEXT_MOVL target shuffle decoding.
Add support for decoding VZEXT_MOVL target shuffle masks, allowing it to be used as a source in target shuffle combines.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258215 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19 23:04:56 +00:00
Nico Weber
b73878a88c Reenable -Wexpansion-to-defined.
I think I fixed all instances of this in the codebase
(r258202, 258200, 258190).  Also, the suppression didn't
have an effect on bots using make anyways, and it looks
like many bots still use configure/make bots.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258210 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19 22:46:33 +00:00
Lang Hames
b8b874987e [Orc] Oops - lambda capture changed in r258206 was correct.
Fully qualify reference to Finalized in the body of the lambda instead to work
around GCC ICE.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258208 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19 22:32:58 +00:00
Quentin Colombet
871b3df6d9 [MachineFunction] Constify getter. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258207 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19 22:31:12 +00:00
Lang Hames
b9be9b997a [Orc] Add missing capture to lambda.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258206 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19 22:31:01 +00:00
Simon Pilgrim
250273a9ce [X86][SSE] Add INSERTPS target shuffle combines.
As vector shuffles can only reference two inputs many (V)INSERTPS patterns end up being split over two targets shuffles.

This patch adds combines to attempt to combine (V)INSERTPS nodes with input/output nodes that are just zeroing out these additional vector elements.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258205 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19 22:24:12 +00:00
Lang Hames
f32ef420e6 [Orc] Qualify call to make_unique to avoid ambiguity with std::make_unique.
This should fix some of the bot failures associated with r258185.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258204 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19 22:22:43 +00:00
Lang Hames
4ce7a6cb25 [Orc] #undef a MACRO after I'm done with it.
Suggested by Philip Reames in review of r257951.

Thanks Philip!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258203 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19 22:20:21 +00:00
Chad Rosier
e15795f83d [AArch64] Remove a bunch of useless FIXME comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258193 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19 21:47:24 +00:00
Dan Gohman
92c68ce7c8 [WebAssembly] Remove an unused data member. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258192 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19 21:31:41 +00:00
Chad Rosier
8ead0df472 [AArch64] Remove more dead code after r258093.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258191 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19 21:27:05 +00:00
Nico Weber
3c247736dd Fix undefined behavior in llvm's local changes to googletest.
r100895 landed an llvm-only change to add minix support to googletest.
It did that by putting "defined()" in a macro, which has undefined
behavior.  Slightly reshuffle things to remove that undefined behavior.
Also mention in README.LLVM that minix support is a local change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258190 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19 21:22:36 +00:00
Xinliang David Li
306bcccc42 Fix a coverage reading bug
function record pointer is not advanced when
duplicate entry is found.

Test case to be added.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258188 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19 21:18:12 +00:00
Lang Hames
08e6e6af38 [Orc] Fix a stale comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258187 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19 21:13:54 +00:00
Lang Hames
1665b573d9 [Orc] Refactor ObjectLinkingLayer::addObjectSet to defer loading objects until
they're needed.

Prior to this patch objects were loaded (via RuntimeDyld::loadObject) when they
were added to the ObjectLinkingLayer, but were not relocated and finalized until
a symbol address was requested. In the interim, another object could be loaded
and finalized with the same memory manager, causing relocation/finalization of
the first object to fail (as the first finalization call may have marked the
allocated memory for the first object read-only).

By deferring the loadObject call (and subsequent memory allocations) until an
object file is needed we can avoid prematurely finalizing memory.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258185 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19 21:06:38 +00:00
Sanjoy Das
96068f9791 [SCEV] Fix PR26207
In some cases, the max backedge taken count can be more conservative
than the exact backedge taken count (for instance, because
ScalarEvolution::getRange is not control-flow sensitive whereas
computeExitLimitFromICmp can be).  In these cases,
computeExitLimitFromCond (specifically the bit that deals with `and` and
`or` instructions) can create an ExitLimit instance with a
`SCEVCouldNotCompute` max backedge count expression, but a computable
exact backedge count expression.  This violates an implicit SCEV
assumption: a computable exact BE count should imply a computable max BE
count.

This change

 - Makes the above implicit invariant explicit by adding an assert to
   ExitLimit's constructor

 - Changes `computeExitLimitFromCond` to be more robust around
   conservative max backedge counts

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258184 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19 20:53:51 +00:00
Sanjoy Das
95b171a2ef [SCEV] Use range-for; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258183 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19 20:53:46 +00:00
JF Bastien
e5109343c1 WebAssembly: mark known failure caused by r258125
The following test program triggers the assertion:
https://github.com/gcc-mirror/gcc/blob/master/gcc/testsuite/gcc.c-torture/execute/20030916-1.c

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258182 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19 20:53:12 +00:00
Nico Weber
d45a9597c8 Fix bootstrap -Werror builds after clang r258128
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258181 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19 20:52:17 +00:00
Kostya Serebryany
429a7edf9b [libFuzzer] use std::mt19937 for generating random numbers by default. Fix MyStoll to handle negative values. Use std::any_of instead of std::find_if
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258178 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19 20:33:57 +00:00
Sanjay Patel
4d02b51dd0 getParent()->getParent() == getModule() ; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258176 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19 19:58:49 +00:00
Sanjay Patel
130d7af1cf function names start with a lowercase letter; NFC
Note: There are no uses of these functions outside of
SimplifyLibCalls, so they could be static functions in
that file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258172 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19 19:46:10 +00:00
Hans Wennborg
f049f0721c test-release.sh: Use CMake also for Darwin
This didn't work for 3.7, but hopefully it should work now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258168 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19 19:21:58 +00:00
Sanjay Patel
f04cfb4e1c fix formatting; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258167 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19 19:17:47 +00:00
Sanjay Patel
f62a7b5f62 don't repeat documentation comments in implementation file; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258166 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19 19:16:10 +00:00
Sanjay Patel
70a272d71e don't repeat function names in documentation comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258164 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19 19:10:10 +00:00
Manuel Jacob
5884e2f9ac Move part of an if condition into an assertion. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258163 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19 19:04:49 +00:00
Michael Zuckerman
dee7d6fcc6 [AVX512] Adding VPERMT2B and VPERMI2B instruction .
Differential Revision: http://reviews.llvm.org/D16297


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258161 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19 18:47:02 +00:00
Philip Reames
477926b924 Revert 258157
According the build bots, clang is using the Registry class somewhere as well. Will reapply with appropriate clang changes at a later point.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258159 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19 18:41:10 +00:00
Sanjay Patel
507edcba42 [LibCallSimplifier] use instruction-level fast-math-flags to shrink calls
This is a continuation of adding FMF to call instructions:
http://reviews.llvm.org/rL255555



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258158 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19 18:38:52 +00:00
Philip Reames
c66b44070b [GC] Registry initialization and linkage interactions
The Registry class constructs a linked list of nodes whose storage is inside static variables and nodes are added via static initializers. The trick is that those static initializers are in both the LLVM code base, and some random plugin that might get loaded in at runtime. The existing code tries to use C++ templates and their ODR rules to get a single definition of the registry for each type, but, experimentally, this doesn't quite work as designed. (Well, the entire structure doesn't. It might not actually be an ODR problem.)

Previously, when I tried moving the GCStrategy class (along with it's registry) from CodeGen to IR, I ran into a problem where asking the GCStrategyRegistry a question would return inconsistent results depending on whether you asked from CodeGen (where the static initializers still were) or Transforms. My best guess is that this is a result of either a) an order of initialization error, or b) we ended up with two copies of the registry being created. I remember at the time having convinced myself it was probably (b), but I don't have any of my notes around from that investigation any more.

See http://reviews.llvm.org/rL226311 for the original patch in question.

This patch tries to remove the possibility of (b) above. (a) was already fixed in change 258109.

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




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258157 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19 18:34:27 +00:00
Rong Xu
eeedfde497 [PGO] Create the profile data variable before the lowering
This patch creates the profile data variable before lowering the profile intrinsics.

Reviewers: davidxl, silvas

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258156 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19 18:29:54 +00:00
Philip Reames
c7630ca045 Add clarifying comments defining what a Loop is
Our loop construct is not a way to identify cycles in the CFG.  This wasn't immediately obvious from the header, so clarify that fact.

The motivation for this was that I just fixed a out of tree bug due to a mistaken assumption (on my part) on what a Loop actually was.  While it was fresh in my mind, I wanted to document the key point.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258154 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19 18:26:01 +00:00
Sanjay Patel
a9c8e55a04 [LibCallSimplifier] use instruction-level fast-math-flags to transform pow(x, [small integer]) calls
This is a continuation of adding FMF to call instructions:
http://reviews.llvm.org/rL255555

As with D15937, the intent of the patch is to preserve the current behavior of the transform
except that we use the pow call's 'fast' attribute as a trigger rather than a function-level
attribute.

The TODO comment notes a potential follow-on patch that would propagate FMF to the new
instructions.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258153 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19 18:15:12 +00:00
Chris Ray
6ef997afec NFC Test Commit whitespace change in a comment
Changed whitespace so comments line up.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258151 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19 18:01:20 +00:00
Rafael Espindola
be7a41bf5d Use larger write sizes for MCFillFragment.
This brings the pr26208 testcase down to 3.2 seconds. Not checking it in
since it does create a 4GB .o file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258149 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19 17:47:48 +00:00