Commit Graph

137684 Commits

Author SHA1 Message Date
Aditya Kumar
79dbe29bca [SelectionDAGBuilder] Add const to relevant places
Reviewers: hans, evandro, sebpop

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280430 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-01 23:35:26 +00:00
Dehao Chen
7bb9af1901 Refactor LICM to expose canSinkOrHoistInst to LoopSink pass.
Summary: LoopSink pass shares the same canSinkOrHoistInst functionality with LICM pass. This patch exposes this function in preparation of https://reviews.llvm.org/D22778

Reviewers: chandlerc, davidxl, danielcdh

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280429 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-01 23:31:25 +00:00
Dehao Chen
d21744e2b8 Refactor replaceDominatedUsesWith to have a flag to control whether to replace uses in BB itself.
Summary: This is in preparation for LoopSink pass which calls replaceDominatedUsesWith to update after sinking.

Reviewers: chandlerc, davidxl, danielcdh

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280427 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-01 23:26:48 +00:00
Dehao Chen
910602a540 Refactor LICM pass in preparation for LoopSink pass.
Summary: LoopSink pass uses some common function in LICM. This patch refactor the LICM code to make it usable by LoopSink pass (https://reviews.llvm.org/D22778).

Reviewers: chandlerc, davidxl, danielcdh

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280425 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-01 23:15:50 +00:00
Michael Kuperstein
f71b301fc9 [Legalizer] Don't throw away false low half when expanding GT/LT SETCC
When expanding a SETCC for which the low half is known to evaluate to false,
we can only throw it away for LT/GT comparisons, not LE/GE.

This fixes PR29170.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280424 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-01 23:02:32 +00:00
Chandler Carruth
2c8b23f86f Make the coding standards a bit more clear that we prefer the fancy new
auto-brief format for doxygen comments. Most notable is switching to
that in the example doxygen comment. I've also tweaked the wording but
am happy to tweak it further if others have suggestions here.

Mostly doing this to capture something I and others have been writing
consistently and repeatedly in code reviews.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280419 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-01 22:18:25 +00:00
Michael Kuperstein
5cf52dab7b [SelectionDAG] Generate vector_shuffle nodes for undersized result vector sizes
Prior to this, we could generate a vector_shuffle from an IR shuffle when the
size of the result was exactly the sum of the sizes of the input vectors.
If the output vector was narrower - e.g. a <12 x i8> being formed by a shuffle
with two <8 x i8> inputs - we would lower the shuffle to a sequence of extracts
and inserts.

Instead, we can form a larger vector_shuffle, and then extract a subvector
of the right size - e.g. shuffle the two <8 x i8> inputs into a <16 x i8>
and then extract a <12 x i8>.

This also includes a target-specific X86 combine that in the presence of
AVX2 combines:
(vector_shuffle <mask> (concat_vectors t1, undef)
                       (concat_vectors t2, undef))
into:
(vector_shuffle <mask> (concat_vectors t1, t2), undef)
in cases where this allows us to form VPERMD/VPERMQ.

(This is not a separate commit, as that pattern does not appear without
the DAGBuilder change.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280418 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-01 21:32:09 +00:00
Heejin Ahn
d5f9cd91f5 [WebAssembly] Add asm.js-style setjmp/longjmp handling for wasm (reland r280302)
Summary: This patch adds asm.js-style setjmp/longjmp handling support for WebAssembly. It also uses JavaScript's try and catch mechanism.

Reviewers: jpp, dschuff

Subscribers: jfb, dschuff

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280415 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-01 21:05:15 +00:00
Justin Bogner
1879d5cc54 bugpoint: clang-format and modernize comments in ListReducer. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280414 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-01 21:04:36 +00:00
Tim Northover
3b190749fe GlobalISel: add a G_PHI instruction to give phis a type.
They're another source of generic vregs, which are going to need a type on the
definition when we remove the register width from MachineRegisterInfo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280412 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-01 20:45:41 +00:00
Reid Kleckner
2ae7de27f7 Fix the ASan fuse-lld.cc test after LLD r280012
With that change, images built with 'lld-link /debug' always have a
debug directory. If no PDB filename was passed on the command line, then
the filename in the executable is empty.

PDB information would never work anyway if the PDB file name is empty,
so go ahead and try DWARF in that case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280410 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-01 20:28:59 +00:00
Matthew Simpson
af1a999e07 [LV] Use ScalarParts for ad-hoc pointer IV scalarization (NFCI)
We can now maintain scalar values in VectorLoopValueMap. Thus, we no longer
have to create temporary vectors with insertelement instructions when handling
pointer induction variables. This case was mistakenly missed from r279649 when
refactoring the other scalarization code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280405 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-01 19:40:19 +00:00
Sanjay Patel
78e359ca5b [InstCombine] add tests to show potential shuffle+insert folds
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280403 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-01 19:14:19 +00:00
Andrey Turetskiy
fa2569c73b [X86] Loosen memory folding requirements for cvtdq2pd and cvtps2pd instructions.
According to spec cvtdq2pd and cvtps2pd instructions don't require memory operand to be aligned
to 16 bytes. This patch removes this requirement from the memory folding table.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280402 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-01 18:50:02 +00:00
Yaxun Liu
7f885e7bc0 AMDGPU: Add runtime metadata for pointee alignment of argument.
Add runtime metdata for pointee alignment of pointer type kernel argument. The key is KeyArgPointeeAlign and the value is a 32 bit unsigned integer.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280399 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-01 18:46:49 +00:00
Davide Italiano
a964a2836f [lib/LTO] Simplify a bit. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280396 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-01 18:34:47 +00:00
Chris Bieneman
816c475854 [CMake] Connecting check-all and test-depends targets correctly
My previous attempt at this connected the sub-project check targets to the test-depends target instead of to the check-all target. That resulted in the tests running multiple times on bots that built "test-depends" and "check-all" in separate build invocations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280392 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-01 18:26:01 +00:00
Michael Kuperstein
add0a5d6fe Rename some variables to have meaningful names. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280391 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-01 18:24:42 +00:00
Matthew Simpson
8dabfb7c14 [LV] Move VectorParts allocation and mapping into PHI widening (NFC)
This patch moves the allocation of VectorParts for PHI nodes into the actual
PHI widening code. Previously, we allocated these VectorParts in
vectorizeBlockInLoop, and passed them by reference to widenPHIInstruction. Upon
returning, we would then map the VectorParts in VectorLoopValueMap. This
behavior is problematic for the cases where we only want to generate a scalar
version of a PHI node. For example, if in the future we only generate a scalar
version of an induction variable, we would end up inserting an empty vector
entry into the map once we return to vectorizeBlockInLoop. We now no longer
need to pass VectorParts to the various PHI widening functions, and we can keep
VectorParts allocation as close as possible to the point at which they are
actually mapped in VectorLoopValueMap.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280390 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-01 18:14:27 +00:00
Zachary Turner
6ece050eff [codeview] Properly propagate the TypeLeafKind through the pipeline.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280388 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-01 18:08:19 +00:00
Michael Kuperstein
1b35037238 [DAGCombine] Don't fold a trunc if it feeds an anyext
Legalization tends to create anyext(trunc) patterns. This should always be
combined - into either a single trunc, a single ext, or nothing if the
types match exactly. But if we happen to combine the trunc first, we may pull
the trunc away from the anyext or make it implicit (e.g. the truncate(extract)
-> extract(bitcast) fold).

To prevent this, we can avoid doing the fold, similarly to how we already handle
fpround(fpextend).

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280386 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-01 17:59:24 +00:00
Changpeng Fang
97a9f60dce AMDGPU/SI: MIMG TD Refactoring.
Summary:
 Created a new td file MIMGInstructions.td which contains all definitions
of MIMG related instructions.

Reviewed by:
  kzhuravl, vpykhtin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280385 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-01 17:54:54 +00:00
Reid Kleckner
23bc604438 [lit] Use multiprocessing by default on Windows
Apparently nobody evaluated multiprocessing on Windows since Daniel
enabled multiprocessing on Unix in r193279. It works so far as I can
tell.

Today this is worth about an 8x speedup (631.29s to 73.25s) on my 24
core Windows machine. Hopefully this will improve Windows buildbot cycle
time, where currently it takes more time to run check-all than it does
to self-host with assertions enabled:
http://lab.llvm.org:8011/builders/clang-x86-windows-msvc2015/builds/20
  build stage 2 ninja all ( 28 mins, 22 secs )
  ninja check 2 stage 2   ( 37 mins, 38 secs )

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280382 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-01 17:19:44 +00:00
Chris Bieneman
51d3515b04 [CMake] Revive LLVM_*_DIRS variables
This is a partial revert of r280013. Brad King pointed out these variable names are matching CMake conventions, so we should preserve them.

I've also added a direct mapping of the LLVM_*_DIR variables which we need to make projects support building in and out of tree.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280380 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-01 16:43:39 +00:00
Geoff Berry
6f45ebf800 [EarlyCSE] Change C API pass interface for EarlyCSE w/ MemorySSA
Previous change broke the C API for creating an EarlyCSE pass w/
MemorySSA by adding a bool parameter to control whether MemorySSA was
used or not.  This broke the OCaml bindings.  Instead, change the old C
API entry point back and add a new one to request an EarlyCSE pass with
MemorySSA.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280379 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-01 15:07:46 +00:00
Simon Dardis
f27163fda4 [mips] Include missed file from previous commit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280377 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-01 15:03:13 +00:00
Simon Pilgrim
49aa0296df [X86][SSE] Dropped (V)CVTPD2PS intrinsic patterns now that its bound to X86vfpround
It now uses X86vfpround patterns directly instead.

Followup to D23797



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280376 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-01 14:59:20 +00:00
Simon Dardis
dbc69646c5 [mips] interAptiv based generic schedule model
This scheduler describes a processor which covers all MIPS ISAs based
around the interAptiv and P5600 timings.

Reviewers: vkalintiris, dsanders

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280374 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-01 14:53:53 +00:00
Andrey Bokhanko
0f970f8cb2 [CMake] Fix LLVM_ENABLE_EH and LLVM_ENABLE_RTTI on MSVC
Patch by Johannes Sebastian Mueller-Roemer.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280371 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-01 14:39:54 +00:00
Sanjay Patel
36ff41aa37 [InstCombine] remove fold of an icmp pattern that should never happen
While removing a scalar shackle from an icmp fold, I noticed that I couldn't find any tests to trigger
this code path.

The 'and' shrinking transform should be handled by InstCombiner::foldCastedBitwiseLogic()
or eliminated with InstSimplify. The icmp narrowing is part of InstCombiner::foldICmpWithCastAndCast().

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280370 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-01 14:20:43 +00:00
Krzysztof Parzyszek
fc0391434b [Hexagon] Deal with undefs when extending live intervals
Reapply r280275, since MSVC accepts r280358.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280369 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-01 13:59:35 +00:00
Elena Demikhovsky
cea4c9fe43 Optimized FMA intrinsic + FNEG , like
-(a*b+c)

and FNEG + FMA, like
a*b-c or (-a)*b+c.

The bug description is here :  https://llvm.org/bugs/show_bug.cgi?id=28892

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280368 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-01 13:58:53 +00:00
James Molloy
f37c8a6b19 [SimplifyCFG] Handle tail-sinking of more than 2 incoming branches
This was a real restriction in the original version of SinkIfThenCodeToEnd. Now it's been rewritten, the restriction can be lifted.

As part of this, we handle a very common and useful case where one of the incoming branches is actually conditional. Consider:

   if (a)
     x(1);
   else if (b)
     x(2);

This produces the following CFG:

         [if]
        /    \
      [x(1)] [if]
        |     | \
        |     |  \
        |  [x(2)] |
         \    |  /
          [ end ]

[end] has two unconditional predecessor arcs and one conditional. The conditional refers to the implicit empty 'else' arc. This same pattern can also be caused by an empty default block in a switch.

We can't sink the call to x() down to end because no call to x() happens on the third incoming arc (assume that x() has sideeffects for the sake of argument; if something is safe to speculate we could indeed sink nevertheless but this cannot happen in the general case and causes many extra selects).

We are now able to detect this case and split off the unconditional arcs to a common successor:

         [if]
        /    \
      [x(1)] [if]
        |     | \
        |     |  \
        |  [x(2)] |
         \   /    |
     [sink.split] |
           \     /
           [ end ]

Now we can sink the call to x() into %sink.split. This can cause significant code simplification in many testcases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280364 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-01 12:58:13 +00:00
Krzysztof Parzyszek
e0daa1e6fe Add an optional parameter with a list of undefs to extendToIndices
Reapply r280268, hopefully in a version that MSVC likes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280358 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-01 12:10:36 +00:00
Honggyu Kim
89ea36c5e1 [IR] Properly handle escape characters in Attribute::getAsString()
If an attribute name has special characters such as '\01', it is not
properly printed in LLVM assembly language format.  Since the format
expects the special characters are printed as it is, it has to contain
escape characters to make it printable.

Before:
  attributes #0 = { ... "counting-function"="^A__gnu_mcount_nc" ...

After:
  attributes #0 = { ... "counting-function"="\01__gnu_mcount_nc" ...

Reviewers: hfinkel, rengolin, rjmccall, compnerd

Subscribers: nemanjai, mcrosier, hans, shenhan, majnemer, llvm-commits

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280357 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-01 11:44:06 +00:00
James Molloy
f991e38d15 [SimplifyCFG] Change the algorithm in SinkThenElseCodeToEnd
r279460 rewrote this function to be able to handle more than two incoming edges and took pains to ensure this didn't regress anything.

This time we change the logic for determining if an instruction should be sunk. Previously we used a single pass greedy algorithm - sink instructions until one requires more than one PHI node or we run out of instructions to sink.

This had the problem that sinking instructions that had non-identical but trivially the same operands needed extra logic so we sunk them aggressively. For example:

    %a = load i32* %b          %d = load i32* %b
    %c = gep i32* %a, i32 0    %e = gep i32* %d, i32 1

Sinking %c and %e would naively require two PHI merges as %a != %d. But the loads are obviously equivalent (and maybe can't be hoisted because there is no common predecessor).

This is why we implemented the fairly complex function areValuesTriviallySame(), to look through trivial differences like this. However it's just not clever enough.

Instead, throw areValuesTriviallySame away, use pointer equality to check equivalence of operands and switch to a two-stage algorithm.

In the "scan" stage, we look at every sinkable instruction in isolation from end of block to front. If it's sinkable, we keep track of all operands that required PHI merging.

In the "sink" stage, we iteratively sink the last non-terminator in the source blocks. But when calculating how many PHIs are actually required to be inserted (to work out if we should stop or not) we remove any values that have already been sunk from the set of PHI-merges required, which allows us to be more aggressive.

This turns an algorithm with potentially recursive lookahead (looking through GEPs, casts, loads and any other instruction potentially not CSE'd) to two linear scans.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280351 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-01 10:44:35 +00:00
Hal Finkel
77579f5cd8 Add ISD::EH_DWARF_CFA, simplify @llvm.eh.dwarf.cfa on Mips, fix on PowerPC
LLVM has an @llvm.eh.dwarf.cfa intrinsic, used to lower the GCC-compatible
__builtin_dwarf_cfa() builtin. As pointed out in PR26761, this is currently
broken on PowerPC (and likely on ARM as well). Currently, @llvm.eh.dwarf.cfa is
lowered using:

  ADD(FRAMEADDR, FRAME_TO_ARGS_OFFSET)

where FRAME_TO_ARGS_OFFSET defaults to the constant zero. On x86,
FRAME_TO_ARGS_OFFSET is lowered to 2*SlotSize. This setup, however, does not
work for PowerPC. Because of the way that the stack layout works, the canonical
frame address is not exactly (FRAMEADDR + FRAME_TO_ARGS_OFFSET) on PowerPC
(there is a lower save-area offset as well), so it is not just a matter of
implementing FRAME_TO_ARGS_OFFSET for PowerPC (unless we redefine its
semantics -- We can do that, since it is currently used only for
@llvm.eh.dwarf.cfa lowering, but the better to directly lower the CFA construct
itself (since it can be easily represented as a fixed-offset FrameIndex)). Mips
currently does this, but by using a custom lowering for ADD that specifically
recognizes the (FRAMEADDR, FRAME_TO_ARGS_OFFSET) pattern.

This change introduces a ISD::EH_DWARF_CFA node, which by default expands using
the existing logic, but can be directly lowered by the target. Mips is updated
to use this method (which simplifies its implementation, and I suspect makes it
more robust), and updates PowerPC to do the same.

Fixes PR26761.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280350 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-01 10:28:47 +00:00
Valery Pykhtin
81276830ee [AMDGPU] Scalar Memory instructions TD refactoring
Differential revision: https://reviews.llvm.org/D23996

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280349 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-01 09:56:47 +00:00
Hal Finkel
f73c9c11e7 Add a counter-function insertion pass
As discussed in https://reviews.llvm.org/D22666, our current mechanism to
support -pg profiling, where we insert calls to mcount(), or some similar
function, is fundamentally broken. We insert these calls in the frontend, which
means they get duplicated when inlining, and so the accumulated execution
counts for the inlined-into functions are wrong.

Because we don't want the presence of these functions to affect optimizaton,
they should be inserted in the backend. Here's a pass which would do just that.
The knowledge of the name of the counting function lives in the frontend, so
we're passing it here as a function attribute. Clang will be updated to use
this mechanism.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280347 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-01 09:42:39 +00:00
Chandler Carruth
e1ceee0a1d [Support] Fix a warning introduced in r280339 due to the member
initializers not being in the same order as the members.

Specifically, 'preg' is the first member followed by 'error', so they
will be initialized in that order and should be written in the member
initializer list in that order.

For the constructor in question, there is no change in behavior.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280345 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-01 09:31:02 +00:00
James Molloy
16a76ce5f3 [SimplifyCFG] Fix nondeterministic iteration order
We iterate over the result from SafeToMergeTerminators, so make it a SmallSetVector instead of a SmallPtrSet.

Should fix stage3 convergence builds.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280342 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-01 09:01:34 +00:00
George Rimar
5c88a870c9 Commit of forgotten header for r280339 "[LLVM/Support] - Create no-arguments constructor for llvm::Regex"
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280340 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-01 08:02:20 +00:00
George Rimar
ee728f8830 [LLVM/Support] - Create no-arguments constructor for llvm::Regex
This is useful when need to defer the construction,
e.g. using Regex as a member of class.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280339 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-01 08:00:28 +00:00
James Molloy
f4e1029357 [SimplifyCFG] Improve FoldValueComparisonIntoPredecessors to handle more cases
A very important case is not handled here: multiple arcs to a single block with a PHI. Consider:

    a:
      %1 = icmp %b, 1
      br %1, label %c, label %e
    c:
      %2 = icmp %b, 2
      br %2, label %d, label %e
    d:
      br %e
    e:
      phi [0, %a], [1, %c], [2, %d]

FoldValueComparisonIntoPredecessors will refuse to fold this, as it doesn't know how to deal with two arcs to a common destination with different PHI values. The answer is obvious - just split all conflicting arcs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280338 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-01 07:45:25 +00:00
Dean Michael Berris
1d154049a4 [NFC] Remove unnecessary comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280336 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-01 01:58:24 +00:00
Dean Michael Berris
d17ccfb980 [XRay] Detect and emit sleds for sibling/tail calls
Summary:
This change promotes the 'isTailCall(...)' member function to
TargetInstrInfo as a query interface for determining on a per-target
basis whether a given MachineInstr is a tail call instruction. We build
upon this in the XRay instrumentation pass to emit special sleds for
tail call optimisations, where we emit the correct kind of sled.

The tail call sleds look like a mix between the function entry and
function exit sleds. Form-wise, the sled comes before the "jmp"
instruction that implements the tail call similar to how we do it for
the function entry sled. Functionally, because we know this is a tail
call, it behaves much like an exit sled -- i.e. at runtime we may use
the exit trampolines instead of a different kind of trampoline.

A follow-up change to recognise these sleds will be done in compiler-rt,
so that we can start intercepting these initially as exits, but also
have the option to have different log entries to more accurately reflect
that this is actually a tail call.

Reviewers: echristo, rSerge, majnemer

Subscribers: mehdi_amini, dberris, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280334 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-01 01:29:13 +00:00
Kostya Serebryany
501485f6e4 [libFuzzer] add -minimize_crash flag (to minimize crashers). also add two tests that I failed to commit last time
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280332 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-01 01:22:27 +00:00
Dean Michael Berris
31a52c200b [XRay][NFC] Promote isTailCall() as virtual in TargetInstrInfo.
This change is broken out from D23986, where XRay detects tail call
exits.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280331 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-01 01:03:22 +00:00
Heejin Ahn
2a3f18e638 Revert "Add asm.js-style setjmp/longjmp handling for wasm"
This reverts commit r280302, it broke the integration tests.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280329 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-01 00:44:37 +00:00
Justin Bogner
ba2b23190e Support: Avoid errors with LLVM_FALLTHROUGH in clang 3.6 and below in C mode
Older versions of clang defined __has_cpp_attribute in C mode, but
would choke on scoped attributes, as per llvm.org/PR23435. Since we
support building with clang all the way back to 3.1, we have to work
around this issue.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280326 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-31 23:43:14 +00:00