Commit Graph

25089 Commits

Author SHA1 Message Date
Lang Hames
be06dbe647 [Orc] Enable user supplied partitioning functors in the CompileOnDemand layer.
Previously the CompileOnDemand layer always created single-function partitions.
In theory this new API allows for more interesting partitions, though this has
not been well tested yet.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249623 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-07 21:53:41 +00:00
Reid Kleckner
03d0b1421e [WinEH] Undo the effect of r249578 for 32-bit
The __CxxFrameHandler3 tables for 32-bit are supposed to hold stack
offsets relative to EBP, not ESP. I blindly updated the win-catchpad.ll
test case, and immediately noticed that 32-bit catching stopped working.

While I'm at it, move the frame index to frame offset WinEH table logic
out of PEI.  PEI shouldn't have to know about WinEHFuncInfo. I realized
we can calculate frame index offsets just fine from the table printer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249618 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-07 21:13:15 +00:00
Duncan P. N. Exon Smith
10b15bcfb2 Support: Stop using iplist in Recycler
Recycler just needs a singly-linked list, and it takes less (and
simpler) code to hand-roll one of those than to build up the equivalent
`iplist_traits`.  In theory, this should speed things up a bit too, but
this is really just a drive-by cleanup so I haven't measured.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249615 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-07 20:49:09 +00:00
Rafael Espindola
5aa05ff94c git-clang-format r249548.
Sorry for missing this the first time.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249610 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-07 20:32:24 +00:00
Duncan P. N. Exon Smith
2a8bcfaff1 IR: Create SymbolTableList wrapper around iplist, NFC
Create `SymbolTableList`, a wrapper around `iplist` for lists that
automatically manage a symbol table.  This commit reduces a ton of code
duplication between the six traits classes that were used previously.

As a drive by, reduce the number of template parameters from 2 to 1 by
using a SymbolTableListParentType metafunction (I originally had this as
a separate commit, but it touched most of the same lines so I squashed
them).

I'm in the process of trying to remove the UB in `createSentinel()` (see
the FIXMEs I added for `ilist_embedded_sentinel_traits` and
`ilist_half_embedded_sentinel_traits`).  My eventual goal is to separate
the list logic into a base class layer that knows nothing about (and
isn't templated on) the downcasted nodes -- removing the need to invoke
UB -- but for now I'm just trying to get a handle on all the current use
cases (and cleaning things up as I see them).

Besides these six SymbolTable lists, there are two others that use the
addNode/removeNode/transferNodes() hooks: the `MachineInstruction` and
`MachineBasicBlock` lists.  Ideally there'll be a way to factor these
hooks out of the low-level API entirely, but I'm not quite there yet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249602 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-07 20:05:10 +00:00
Sanjoy Das
e344577388 [IRBuilder] Add gc.statepoint related methods to IRBuilder
Summary:
This adds some more routines to `IRBuilder` around creating calls and
invokes to `gc.statepoint`.  These will be used later.

Reviewers: reames, swaroop.sridhar

Subscribers: sanjoy, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249596 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-07 19:52:12 +00:00
Rafael Espindola
d546ca6a18 Use SpecificBumpPtrAllocator to simplify the MCSeciton destruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249589 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-07 19:08:19 +00:00
Reid Kleckner
5e3eac7a27 [WinEH] Fix two minor issues in __CxxFrameHandler3 tables
There was an off-by-one bug in ip2state tables which manifested when one
call immediately preceded the try-range of the next. The return address
of the previous call would appear to be within the try range of the next
scope, resulting in extra destructors or catches running.

We also computed the wrong offset for catch parameter stack objects. The
offset should be from RSP, not from RBP.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249578 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-07 17:49:32 +00:00
Chad Rosier
cc78fcae6a [ARM] Promote helper function to SelectionDAG.
I'll be using the function in a similar combine for AArch64.  The helper was
also improved to handle undef values.

Part of http://reviews.llvm.org/D13442

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249572 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-07 17:28:58 +00:00
Rafael Espindola
c6f2e2a584 Use non virtual destructors for sections.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249548 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-07 13:46:06 +00:00
Rafael Espindola
93ef2f5a97 Don't repeat names in comments and don't indent in namespaces. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249546 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-07 13:38:49 +00:00
Michael Kuperstein
6d30abd62e [X86] Emit .cfi_escape GNU_ARGS_SIZE when adjusting the stack before calls
When outgoing function arguments are passed using push instructions, and EH
is enabled, we may need to indicate to the stack unwinder that the stack
pointer was adjusted before the call.

This should fix the exception handling issues in PR24792.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249522 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-07 07:01:31 +00:00
Sanjoy Das
76cac27719 [OperandBundles] Add an accessor to get an operand bundle by tag
Not used at the moment, but will be used in a later change to
RewriteStatepointsForGC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249510 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-07 02:39:24 +00:00
Sanjoy Das
9f70f927c5 [OperandBundles] Remove a useless accessor from OperandBundleUser
Since the `const` version of `getOperandBundle` returns a value of the
same type as the non-`const` version, the non-`const` version is
redundant.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249509 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-07 02:39:21 +00:00
Reid Kleckner
ee97a1a33b [SEH] Add llvm.eh.exceptioncode intrinsic
This will support the Clang __exception_code intrinsic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249492 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-07 00:27:33 +00:00
Lang Hames
3ce6a23469 [Orc] Teach the CompileOnDemand layer to clone aliases.
This allows modules containing aliases to be lazily jit'd. Previously these
failed with missing symbol errors because the aliases weren't cloned from the
original module.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249481 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-06 22:55:05 +00:00
Duncan P. N. Exon Smith
3c050416f0 IR: Remove unnecessary TraitsClass typedef, NFC
No classes are specializing the symbol table traits, so no need to look
through a typedef for class API.  Make a few more functions private
since only SymbolTableListTraits should be using them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249476 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-06 22:14:06 +00:00
Duncan P. N. Exon Smith
ac3b52bb0d CodeGen: s/protected:/private:/ in MachineBasicBlock, NFC
Nothing inherits from `MachineBasicBlock`, so this should have no real
functionality change.  Just makes the code easier to understand.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249473 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-06 21:48:31 +00:00
Sanjoy Das
d15cdb7b13 [IndVars] Don't break dominance in eliminateIdentitySCEV
Summary:
After r249211, `getSCEV(X) == getSCEV(Y)` does not guarantee that X and
Y are related in the dominator tree, even if X is an operand to Y (I've
included a toy example in comments, and a real example as a test case).

This commit changes `SimplifyIndVar` to require a `DominatorTree`.  I
don't think this is a problem because `ScalarEvolution` requires it
anyway.

Fixes PR25051.

Depends on D13459.

Reviewers: atrick, hfinkel

Subscribers: joker.eph, llvm-commits, sanjoy

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249471 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-06 21:44:49 +00:00
Duncan P. N. Exon Smith
67f918ec8f IR: Remove unnecessary specialization of getSymTab(), NFC
The only specializations of `getSymTab()` were identical to the default
defined in `SymbolTableListTraits::getSymTab()`.  Remove the
specializations, and stop treating it like a configuration point.  Just
to be sure no one else accesses this, make it private.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249469 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-06 21:31:07 +00:00
Joseph Tremoulet
7d21fd604e [WinEH] Implement state numbering for CoreCLR
Summary:
Assign one state number per handler/funclet, tracking parent state,
handler type, and catch type token.
State numbers are arranged such that ancestors have lower state numbers
than their descendants.

Reviewers: majnemer, andrew.w.kaylor, rnk

Subscribers: pgavlin, AndyAyers, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249457 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-06 20:30:33 +00:00
Joseph Tremoulet
8136c73a75 [WinEH] Recognize CoreCLR personality function
Summary:
 - Add CoreCLR to if/else ladders and switches as appropriate.
 - Rename isMSVCEHPersonality to isFuncletEHPersonality to better
   reflect what it captures.

Reviewers: majnemer, andrew.w.kaylor, rnk

Subscribers: pgavlin, AndyAyers, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249455 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-06 20:28:16 +00:00
Duncan P. N. Exon Smith
dd076fe91a IR: Use typedefs for getSublistAccess(), NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249439 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-06 18:33:43 +00:00
Diego Novillo
d6ac66492e Remove AutoFDO profile handling for GCC's LIPO. NFC.
Given the work we are doing on ThinLTO, we will never need to support
module groups and working sets in GCC's implementation of LIPO. These
are currently dead code, and will continue to be so.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249351 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-05 21:08:05 +00:00
Benjamin Kramer
9fdd48c184 [Support] Add a version of fs::make_absolute with a custom CWD.
This will be used soon from clang.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249309 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-05 13:02:43 +00:00
Rafael Espindola
0eba49c22e Fix pr24486.
This extends the work done in r233995 so that now getFragment (in addition to
getSection) also works for variable symbols.

With that the existing logic to decide if a-b can be computed works even if
a or b are variables. Given that, the expression evaluation can avoid expanding
variables as aggressively and that in turn lets the relocation code see the
original variable.

In order for this to work with the asm streamer, there is now a dummy fragment
per section. It is used to assign a section to a symbol when no other fragment
exists.

This patch is a joint work by Maxim Ostapenko andy myself.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249303 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-05 12:07:05 +00:00
NAKAMURA Takumi
deb80b5397 Reformat partially.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249288 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-05 04:46:30 +00:00
NAKAMURA Takumi
9ad5c5f1f8 Reformat 3 files in llvm/include/llvm/CodeGen/.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249287 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-05 04:44:18 +00:00
NAKAMURA Takumi
cc43180d94 Trailing whitespaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249286 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-05 04:44:08 +00:00
NAKAMURA Takumi
b2700222ec Prune trailing whitespaces in comment lines.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249285 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-05 04:43:57 +00:00
NAKAMURA Takumi
dc0de228e2 Reformat blank lines.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249284 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-05 04:43:48 +00:00
Teresa Johnson
b97baa5fe5 Support for function summary index bitcode sections and files.
Summary:
The bitcode format is described in this document:
  https://drive.google.com/file/d/0B036uwnWM6RWdnBLakxmeDdOeXc/view
For more info on ThinLTO see:
  https://sites.google.com/site/llvmthinlto

The first customer is ThinLTO, however the data structures are designed
and named more generally based on prior feedback. There are a few
comments regarding how certain interfaces are used by ThinLTO, and the
options added here to gold currently have ThinLTO-specific names as the
behavior they provoke is currently ThinLTO-specific.

This patch includes support for generating per-module function indexes,
the combined index file via the gold plugin, and several tests
(more are included with the associated clang patch D11908).

Reviewers: dexonsmith, davidxl, joker.eph

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249270 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-04 14:33:43 +00:00
Igor Breger
295b19789d AVX512: Implemented encoding and intrinsics for VPERMILPS/PD instructions.
Added tests for intrinsics and encoding.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249261 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-04 07:20:41 +00:00
David Majnemer
492f1cfa37 [WinEH] Permit branch folding in the face of funclets
Track which basic blocks belong to which funclets.  Permit branch
folding to fire but only if it can prove that doing so will not cause
code in one funclet to be reused in another.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249257 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-04 02:22:52 +00:00
Rafael Espindola
26585cfcaa Remove unnecessary includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249242 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-03 18:38:50 +00:00
Rafael Espindola
8e4f570760 Move registerSection out of line and reduce #includes. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249241 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-03 18:28:40 +00:00
Sanjoy Das
cf7b076df0 Fix comment ASCII art to unbreak the gcc 4.9.1 build
The trailing backslashes in some ASCII art added in r248527 cause a
"error: multi-line comment [-Werror=comment]" when building with gcc
4.9.1 -Wall.  Swallow (ASCII-)artistic integrity and use pipes instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249212 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-02 23:24:52 +00:00
Sanjoy Das
23b6f4b200 [SCEV] Recognize simple br-phi patterns
Summary:
Teach SCEV to match patterns like

```
  br %cond, label %left, label %right
 left:
  br label %merge
 right:
  br label %merge
 merge:
  V = phi [ %x, %left ], [ %y, %right ]
```

as "select %cond, %x, %y".  Before this SCEV would match PHI nodes
exclusively to add recurrences.

This addresses PR25005.

Reviewers: joker.eph, joker-eph, atrick

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249211 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-02 23:09:44 +00:00
Piotr Padlewski
264b0361be inariant.group handling in GVN
The most important part required to make clang
devirtualization works ( ͡°͜ʖ ͡°).
The code is able to find non local dependencies, but unfortunatelly
because the caller can only handle local dependencies, I had to add
some restrictions to look for dependencies only in the same BB.

http://reviews.llvm.org/D12992

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249196 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-02 22:12:22 +00:00
Dan Gohman
216303e8fd [WebAssembly] Add a resize_memory intrinsic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249178 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-02 20:10:26 +00:00
Sanjoy Das
3d58b720c3 [SCEV] Refactor out a createNodeForSelect
Summary:
We will shortly re-use this for select-like br-phi pairs.

Reviewers: atrick, joker-eph, joker.eph

Subscribers: sanjoy, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249177 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-02 19:39:59 +00:00
Dan Gohman
7eb00c4bc2 [WebAssembly] Add a memory_size intrinsic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249171 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-02 19:21:15 +00:00
Matt Arsenault
63a9180f3c Add way to test for generic TargetOpcodes
The alternative would be to add a bit to the target's
InstrFlags but that seems like a waste of a bit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249169 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-02 18:58:33 +00:00
Sanjoy Das
8c0c4322dd [SCEV] Try to prove predicates by splitting them
Summary:
This change teaches SCEV that to prove `A u< B` it is sufficient to
prove each of these facts individually:

 - B >= 0
 - A s< B
 - A >= 0

In practice, SCEV sometimes finds it easier to prove these facts
individually than to prove `A u< B` as one atomic step.

Reviewers: reames, atrick, nlewycky, hfinkel

Subscribers: sanjoy, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249168 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-02 18:50:30 +00:00
Richard Smith
d25872f0cd DenseMap: we're trying to call the reserved global placement allocation
function here; use "::new" to avoid accidentally picking up a class-specific
operator new.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249112 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-02 00:46:33 +00:00
Reid Kleckner
646073b30f [WinEH] Emit __C_specific_handler tables for the new IR
We emit denormalized tables, where every range of invokes in the same
state gets a complete list of EH action entries. This is significantly
simpler than trying to infer the correct nested scoping structure from
the MI. Fortunately, for SEH, the nesting structure is really just a
size optimization.

With this, some basic __try / __except examples work.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249078 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-01 21:38:24 +00:00
David Majnemer
68754da26d [WinEH] Make FuncletLayout more robust against catchret
Catchret transfers control from a catch funclet to an earlier funclet.
However, it is not completely clear which funclet the catchret target is
part of.  Make this clear by stapling the catchret target's funclet
membership onto the CATCHRET SDAG node.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249052 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-01 18:44:59 +00:00
Tom Stellard
7fe09ce82f AMDGPU: Add MEM_RAT STORE_TYPED.
v2: Add test (Matt).
    Fix capitalization of isEOP (Matt).
    Move pattern to class parameter (Matt).
    Make the instruction available to Cayman (Matt).
    Change name from MEM_RAT WRITE_TYPED to MEM_RAT STORE_TYPED.

Patch by: Zoltan Gilian

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249042 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-01 17:51:34 +00:00
NAKAMURA Takumi
c3f6054a2c Revert r248959, "[WinEH] Emit int3 after noreturn calls on Win64"
It broke; LLVM :: CodeGen__Generic__2009-11-16-BadKillsCrash.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249032 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-01 17:00:56 +00:00
Rafael Espindola
0af0b8d223 Use more strict types. NFC.
On 32 bit ELF these are 32 bit values.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249022 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-01 15:22:42 +00:00