Commit Graph

202784 Commits

Author SHA1 Message Date
Jingyue Wu f6ca8cfdcc [NFC] added a missing space
llvm-svn: 239495
2015-06-10 22:54:02 +00:00
Richard Smith ae7c04f065 Work around MSVC miscompilation.
llvm-svn: 239494
2015-06-10 22:49:14 +00:00
Pete Cooper 3fc3040860 Stop returning a Use* from allocHungOffUses.
This always just set the User::OperandList which is now set
in that method instead of being returned.

Reviewed by Duncan Exon Smith.

llvm-svn: 239493
2015-06-10 22:38:46 +00:00
Pete Cooper 93f9ff5781 Add User::growHungoffUses and use it to grow the hung off uses. NFC.
PhiNode, SwitchInst, LandingPad and IndirectBr all had virtually identical
logic for growing the hung off uses.
Move it to User so that they can all call a single shared implementation.

Their destructors were all empty after this change and were deleted.  They all
have virtual clone_impl methods which can be used as vtable anchors.

Reviewed by Duncan Exon Smith.

llvm-svn: 239492
2015-06-10 22:38:41 +00:00
Pete Cooper 178dcc2938 Delete User::dropHungOffUses and move it in to ~User which is the only caller. NFC.
Now that the subclasses which care about hung off uses let ~User clean it up,
there's no need for a separate method.  Just inline it to ~User and delete it.

Reviewed by Duncan Exon Smith.

llvm-svn: 239491
2015-06-10 22:38:38 +00:00
Pete Cooper c6c0439d2a Make User track whether a class has 'hung off uses' and delete them in its destructor.
Currently all of the logic for deleting hung off uses, which PHI/switch/etc use,
is in their classes.

This adds a bit to Value which tracks whether that user had hung off uses,
then User can be responsible for clearing them instead of the sub classes.

Note, the bit used here was taken from NumOperands which was 30-bits.
Given the reduction to 29 bits, and the average User being just over 100 bytes,
a single User with 29-bits of num operands would need 50GB of RAM for itself
so its reasonable to assume that 29-bits is enough for now.

This is a step towards hiding all the hung off uses logic in the User.

Reviewed by Duncan Exon Smith.

llvm-svn: 239490
2015-06-10 22:38:34 +00:00
Pete Cooper 87b925b064 Move the special Phi logic for hung off uses in to User::allocHungOffUses. NFC.
PhiNode's need to allocate space for an array of Use[N] and then BasicBlock*[N].

They had their own allocHungOffUses to handle all of this.  This moves the logic
in to User::allocHungOffUses and PhiNode passes in a bool to say to allocate
the BB* space too.

Reviewed by Duncan Exon Smith.

llvm-svn: 239489
2015-06-10 22:38:30 +00:00
Peter Collingbourne 115fe37621 ArgumentPromotion: Drop sret attribute on functions that are only called directly.
If the first argument to a function is a 'this' argument and the second
has the sret attribute, the ArgumentPromotion pass may promote the 'this'
argument to more than one argument, violating the IR constraint that 'sret'
may only be applied to the first or second argument.

Although this IR constraint is arguably unnecessary, it highlighted the fact
that ArgPromotion does not need to preserve this attribute. Dropping the
attribute reduces register pressure in the backend by avoiding the register
copy required by sret. Because sret implies noalias, we also replace the
former with the latter.

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

llvm-svn: 239488
2015-06-10 21:14:34 +00:00
Richard Smith 95d83959d8 [modules] Don't allow use of non-visible (inherited) default template arguments.
llvm-svn: 239487
2015-06-10 20:36:34 +00:00
Sanjay Patel 08829bac81 [x86] Add a reassociation optimization to increase ILP via the MachineCombiner pass
This is a reimplementation of D9780 at the machine instruction level rather than the DAG.

Use the MachineCombiner pass to reassociate scalar single-precision AVX additions (just a
starting point; see the TODO comments) to increase ILP when it's safe to do so.

The code is closely based on the existing MachineCombiner optimization that is implemented
for AArch64.

This patch should not cause the kind of spilling tragedy that led to the reversion of r236031.

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

llvm-svn: 239486
2015-06-10 20:32:21 +00:00
Richard Smith e7bd6defd7 [modules] Track all default template arguments for a given parameter across
modules, and allow use of a default template argument if any of the parameters
providing it is visible.

llvm-svn: 239485
2015-06-10 20:30:23 +00:00
Sanjay Patel ccb8d5cc57 punctuation policing; NFC
llvm-svn: 239484
2015-06-10 19:52:58 +00:00
Serge Pavlov 47ebb75cf9 Do not parse members of incomplete class.
If definition of a class is unknown and out-of-line definition of its
member is encountered, do not parse the member declaration.
This change fixes PR18542.

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

llvm-svn: 239483
2015-06-10 19:06:59 +00:00
Reid Kleckner c87a6faba1 [WinEH] _except_handlerN uses 0 instead of 1 to indicate catch-all
Our usage of 1 was a holdover from __C_specific_handler.

llvm-svn: 239482
2015-06-10 18:14:07 +00:00
Teresa Johnson 88c3c67997 Pass down the -flto option to the -cc1 job, and from there into the
CodeGenOptions and onto the PassManagerBuilder. This enables gating
the new EliminateAvailableExternally module pass on whether we are
preparing for LTO.

If we are preparing for LTO (e.g. a -flto -c compile), the new pass is not
included as we want to preserve available externally functions for possible
link time inlining.

llvm-svn: 239481
2015-06-10 17:49:45 +00:00
Teresa Johnson 232fa9af3b Add new EliminateAvailableExternally module pass, which is performed in
O2 compiles just before GlobalDCE, unless we are preparing for LTO.

This pass eliminates available externally globals (turning them into
declarations), regardless of whether they are dead/unreferenced, since
we are guaranteed to have a copy available elsewhere at link time.
This enables additional opportunities for GlobalDCE.

If we are preparing for LTO (e.g. a -flto -c compile), the pass is not
included as we want to preserve available externally functions for possible
link time inlining. The FE indicates whether we are doing an -flto compile
via the new PrepareForLTO flag on the PassManagerBuilder.

llvm-svn: 239480
2015-06-10 17:49:28 +00:00
Alexey Samsonov 89645dfa4d [GVN] Set proper debug locations for some instructions created by GVN.
Determining proper debug locations for instructions created in
PHITransAddr is tricky. We use a simple approach here and simply copy
debug locations from instructions computing load address to
"corresponding" instructions re-creating the address computation
in predecessor basic blocks.

This may not always be correct, given all the rearrangement and
simplification going on, and debug locations may jump around a lot,
as the basic blocks we copy locations between may be very far from
each other.

Still, this would work good in most simple cases (e.g. when chain
of address computing instruction is short, or our mapping turns out
to be 1-to-1), and we desire to have *some* reasonable debug locations
associated with newly inserted instructions.

See http://reviews.llvm.org/D10351 review thread for more details.

Test Plan: regression test suite

Reviewers: spatel, dblaikie

Subscribers: llvm-commits

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

llvm-svn: 239479
2015-06-10 17:37:38 +00:00
Sanjay Patel a32fadd14a fix typo in comment; NFC
llvm-svn: 239478
2015-06-10 17:08:12 +00:00
Colin LeMahieu 1e9d1d768c [Hexagon] Adding decoders for signed operands and ensuring all signed operand types disassemble correctly.
llvm-svn: 239477
2015-06-10 16:52:32 +00:00
Scott Douglass cc01359cfe some StmtExprs do not have side-effects
Differential Revision: http://reviews.llvm.org/D10211

llvm-svn: 239476
2015-06-10 15:18:23 +00:00
Benjamin Kramer feacdd39d5 [Hexagon] Make global arrays 'static const'. NFC.
llvm-svn: 239475
2015-06-10 14:43:59 +00:00
Scott Douglass 503fc39d1f add ConstEvaluatedExprVisitor
Differential Revision: http://reviews.llvm.org/D10210

llvm-svn: 239474
2015-06-10 13:53:15 +00:00
Igor Laevsky 965bf6a3ce [Statepoints] Add test case to check that statepoint is marked with Throwable attribute.
Differential Revision: http://reviews.llvm.org/D10215

llvm-svn: 239473
2015-06-10 13:24:00 +00:00
Igor Laevsky 346ff628f7 [StatepointLowering] Reuse stack slots across basic blocks
During statepoint lowering we can sometimes avoid spilling of the value if we know that it was already spilled for previous statepoint.
We were doing this by checking if incoming statepoint value was lowered into load from stack slot. This was working only in boundaries of one basic block.

But instead of looking at the lowered node we can look directly at the llvm-ir value and if it was gc.relocate (or some simple modification of it) look up stack slot for it's derived pointer and reuse stack slot from it. This allows us to look across basic block boundaries.

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

llvm-svn: 239472
2015-06-10 12:31:53 +00:00
Daniel Sanders a73f1fdb19 Replace string GNU Triples with llvm::Triple in MCSubtargetInfo and create*MCSubtargetInfo(). NFC.
Summary:
This continues the patch series to eliminate StringRef forms of GNU triples
from the internals of LLVM that began in r239036.

Reviewers: rafael

Reviewed By: rafael

Subscribers: rafael, ted, jfb, llvm-commits, rengolin, jholewinski

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

llvm-svn: 239467
2015-06-10 12:11:26 +00:00
Alexander Musman 70e9f5fcb3 PR5172: Fix for a bug in pragma redefine_extname implementation:
it doesn't work correctly when a structure is declared before pragma
and then a function with the same name declared after pragma.

Patch by Andrey Bokhanko

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

llvm-svn: 239466
2015-06-10 11:20:26 +00:00
Daniel Sanders 9aa7e38bf8 Replace string GNU Triples with llvm::Triple in create*MCRelocationInfo(). NFC.
Summary:
This continues the patch series to eliminate StringRef forms of GNU triples
from the internals of LLVM that began in r239036.

Reviewers: rafael

Reviewed By: rafael

Subscribers: rafael, llvm-commits, rengolin

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

llvm-svn: 239465
2015-06-10 10:54:40 +00:00
Daniel Sanders 418caf5002 Replace string GNU Triples with llvm::Triple in MCAsmBackend subclasses and create*AsmBackend(). NFC.
Summary:
This continues the patch series to eliminate StringRef forms of GNU triples
from the internals of LLVM that began in r239036.

Reviewers: echristo, rafael

Reviewed By: rafael

Subscribers: rafael, llvm-commits, rengolin

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

llvm-svn: 239464
2015-06-10 10:35:34 +00:00
Mohit K. Bhakkad 056c45a4a1 [LLDB][MIPS] Getting correct signals for MIPS Host
Patch by Nitesh Jain

Reviewers: clayborg, ovyalov.
Subscribers: jaydeep, bhushan, dsanders, mohit.bhakkad, sagar, labath, lldb-commits.
Differential Revision: http://reviews.llvm.org/D10180

llvm-svn: 239463
2015-06-10 10:02:21 +00:00
Daniel Jasper 11ca263994 clang-format: [JS] Only special case top level object literal
assignments as enums.

Top level object literals are treated as enums, and their k/v pairs are put on
separate lines:

  X.Y = {
    A: 1,
    B: 2
  };

However assignments within blocks should not be affected:

  function x() {
    y = {a:1, b:2};
  }

This change fixes the second case. Patch by Martin Probst.

llvm-svn: 239462
2015-06-10 09:21:09 +00:00
Yury Gribov ef40f0bbff [ASan] Quick-fix tests for new string interceptors.
Patch by Maria Guseva.

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

llvm-svn: 239461
2015-06-10 07:16:02 +00:00
Elena Demikhovsky 00c9ad5ec2 AVX-512: Fixed a bug in comparison of i1 vectors.
cmp eq should give kxnor instruction
cmp neq should give kxor 

https://llvm.org/bugs/show_bug.cgi?id=23631

llvm-svn: 239460
2015-06-10 06:49:28 +00:00
Yaron Keren e38c035af2 Replace magic number 19 with the constant GlobalValueSubClassDataBits.
llvm-svn: 239459
2015-06-10 06:00:59 +00:00
Rui Ueyama 8b33f59bfd COFF: De-virtualize and inline garbage collector functions.
isRoot, isLive and markLive functions are called very frequently.
Previously, they were virtual functions. This patch make them
non-virtual.

Also this patch checks chunk liveness before calling its mark().
Previously, we did that at beginning of markLive(), so the virtual
function would return immediately if it's live. That was inefficient.

llvm-svn: 239458
2015-06-10 04:21:47 +00:00
Yunzhong Gao d290eb4565 Fix the test case to handle different IR variable names.
llvm-svn: 239457
2015-06-10 03:19:08 +00:00
Alexei Starovoitov a38e198222 fix crash
fix segfault by checking for UnknownArch, since
getArchTypePrefix() will return nullptr for UnknownArch.

This fixes regression caused by r238424.

llvm-svn: 239456
2015-06-10 03:06:06 +00:00
Craig Topper 8e29d71623 Remove unnecessary conversion from StringRef to std::string and back to StringRef. NFC.
llvm-svn: 239455
2015-06-10 02:07:37 +00:00
Richard Smith 8346e52f89 [modules] Reconstruct template default argument inheritance on reload rather
than wasting storage and triggering eager deserializations by serializing it.

llvm-svn: 239454
2015-06-10 01:47:58 +00:00
Sean Silva 4881e8b239 [cleanup] Remove unused default argument and tidy up.
The RequestingModule argument was unused and always its default value of
nullptr.

Also move a declaration closer to its use, and range-for'ify.

llvm-svn: 239453
2015-06-10 01:37:59 +00:00
Richard Smith 8dbe7e236c Revert accidentally-committed test change from r239447.
llvm-svn: 239452
2015-06-10 01:36:14 +00:00
Reid Kleckner 673de15af9 [WinEH] Call llvm.stackrestore in __except blocks
We have to do this manually, the runtime only sets up ebp. Fixes a crash
when returning after catching an exception.

llvm-svn: 239451
2015-06-10 01:34:54 +00:00
Oleksiy Vyalov 18f4c9f5a0 Mark TestMultithreaded as XTIMEOUT on Linux.
llvm-svn: 239450
2015-06-10 01:34:25 +00:00
Reid Kleckner ca6ef66e4c Remove safeseh debug print and remove extra braces
llvm-svn: 239449
2015-06-10 01:13:44 +00:00
Reid Kleckner 2bc93ca846 [WinEH] Emit .safeseh directives for all 32-bit exception handlers
Use a "safeseh" string attribute to do this. You would think we chould
just accumulate the set of personalities like we do on dwarf, but this
fails to account for the LSDA-loading thunks we use for
__CxxFrameHandler3. Each of those needs to make it into .sxdata as well.
The string attribute seemed like the most straightforward approach.

llvm-svn: 239448
2015-06-10 01:02:30 +00:00
Richard Smith 1469b9196c Refactor storage of default template arguments.
This is just a preparatory step towards fixing visibility for default template
arguments in modules builds.

llvm-svn: 239447
2015-06-10 00:29:03 +00:00
Yunzhong Gao cb77930d6b Implementing C99 partial re-initialization behavior (DR-253)
Based on previous discussion on the mailing list, clang currently lacks support
for C99 partial re-initialization behavior:
Reference: http://lists.cs.uiuc.edu/pipermail/cfe-dev/2013-April/029188.html
Reference: http://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_253.htm

This patch attempts to fix this problem.

Given the following code snippet,

struct P1 { char x[6]; };
struct LP1 { struct P1 p1; };

struct LP1 l = { .p1 = { "foo" }, .p1.x[2] = 'x' };
// this example is adapted from the example for "struct fred x[]" in DR-253;
// currently clang produces in l: { "\0\0x" },
//   whereas gcc 4.8 produces { "fox" };
// with this fix, clang will also produce: { "fox" };


Differential Review: http://reviews.llvm.org/D5789

llvm-svn: 239446
2015-06-10 00:27:52 +00:00
Reid Kleckner 7912d9b899 Fix -Wsign-compare warning in WinException.cpp
llvm-svn: 239445
2015-06-10 00:04:53 +00:00
Pete Cooper 17d6359488 Fix warning of comparing different enums. NFC
llvm-svn: 239443
2015-06-09 23:33:35 +00:00
NAKAMURA Takumi e6c1b56780 Add explicit -mtriple=arm-unknown to llvm/test/CodeGen/ARM/disable-tail-calls.ll, to satisfy *-win32.
llvm-svn: 239442
2015-06-09 23:33:25 +00:00
Pete Cooper 4750efad9a Revert "Move MCSymbol Value in to the union of Offset and CommonSize."
This reverts commit 2e449ec5bcdf67b52b315b16c2128aaf25d5b73c.

This was svn r239440.  Its currently failing an ARM test so reverting while I work out
what to do next.

llvm-svn: 239441
2015-06-09 22:35:55 +00:00