Commit Graph

19709 Commits

Author SHA1 Message Date
David Majnemer
8cec2f2816 [IR] Reformulate LLVM's EH funclet IR
While we have successfully implemented a funclet-oriented EH scheme on
top of LLVM IR, our scheme has some notable deficiencies:
- catchendpad and cleanupendpad are necessary in the current design
  but they are difficult to explain to others, even to seasoned LLVM
  experts.
- catchendpad and cleanupendpad are optimization barriers.  They cannot
  be split and force all potentially throwing call-sites to be invokes.
  This has a noticable effect on the quality of our code generation.
- catchpad, while similar in some aspects to invoke, is fairly awkward.
  It is unsplittable, starts a funclet, and has control flow to other
  funclets.
- The nesting relationship between funclets is currently a property of
  control flow edges.  Because of this, we are forced to carefully
  analyze the flow graph to see if there might potentially exist illegal
  nesting among funclets.  While we have logic to clone funclets when
  they are illegally nested, it would be nicer if we had a
  representation which forbade them upfront.

Let's clean this up a bit by doing the following:
- Instead, make catchpad more like cleanuppad and landingpad: no control
  flow, just a bunch of simple operands;  catchpad would be splittable.
- Introduce catchswitch, a control flow instruction designed to model
  the constraints of funclet oriented EH.
- Make funclet scoping explicit by having funclet instructions consume
  the token produced by the funclet which contains them.
- Remove catchendpad and cleanupendpad.  Their presence can be inferred
  implicitly using coloring information.

N.B.  The state numbering code for the CLR has been updated but the
veracity of it's output cannot be spoken for.  An expert should take a
look to make sure the results are reasonable.

Reviewers: rnk, JosephTremoulet, andrew.w.kaylor

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255422 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-12 05:38:55 +00:00
Matt Arsenault
be6eaee35a SelectionDAG: Match min/max if the scalar operation is legal
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255388 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-11 23:16:47 +00:00
Hal Finkel
15c5be1ee5 Revert r248483, r242546, r242545, and r242409 - absdiff intrinsics
After much discussion, ending here:

  http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20151123/315620.html

it has been decided that, instead of having the vectorizer directly generate
special absdiff and horizontal-add intrinsics, we'll recognize the relevant
reduction patterns during CodeGen. Accordingly, these intrinsics are not needed
(the operations they represent can be pattern matched, as is already done in
some backends). Thus, we're backing these out in favor of the current
development work.

r248483 - Codegen: Fix llvm.*absdiff semantic.
r242546 - [ARM] Use [SU]ABSDIFF nodes instead of intrinsics for VABD/VABA
r242545 - [AArch64] Use [SU]ABSDIFF nodes instead of intrinsics for ABD/ABA
r242409 - [Codegen] Add intrinsics 'absdiff' and corresponding SDNodes for absolute difference operation

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255387 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-11 23:11:52 +00:00
Matthias Braun
f43272c76e CodeGen: Redo analyzePhysRegs() and computeRegisterLiveness()
computeRegisterLiveness() was broken in that it reported dead for a
register even if a subregister was alive. I assume this was because the
results of analayzePhysRegs() are hard to understand with respect to
subregisters.

This commit: Changes the results of analyzePhysRegs (=struct
PhysRegInfo) to be clearly understandable, also renames the fields to
avoid silent breakage of third-party code (and improve the grammar).

Fix all (two) users of computeRegisterLiveness() in llvm: By reenabling
it and removing workarounds for the bug.

This fixes http://llvm.org/PR24535 and http://llvm.org/PR25033

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255362 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-11 19:42:09 +00:00
Manman Ren
6aac92b939 CXX_FAST_TLS calling convention: target independent portion.
The access function has a short entry and a short exit, the initialization
block is only run the first time. To improve the performance, we want to
have a short frame at the entry and exit.

We explicitly handle most of the CSRs via copies. Only the CSRs that are not
handled via copies will be in CSR_SaveList.

Frame lowering and prologue/epilogue insertion will generate a short frame
in the entry and exit according to CSR_SaveList. The majority of the CSRs will
be handled by register allcoator. Register allocator will try to spill and
reload them in the initialization block.

We add CSRsViaCopy, it will be explicitly handled during lowering.

1> we first set FunctionLoweringInfo->SplitCSR if conditions are met (the target
   supports it for the given calling convention and the function has only return
   exits). We also call TLI->initializeSplitCSR to perform initialization.
2> we call TLI->insertCopiesSplitCSR to insert copies from CSRsViaCopy to
   virtual registers at beginning of the entry block and copies from virtual
   registers to CSRsViaCopy at beginning of the exit blocks.
3> we also need to make sure the explicit copies will not be eliminated.

rdar://problem/23557469

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255353 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-11 18:24:30 +00:00
Eric Christopher
54f1a90d45 Fix (bitcast (fabs x)), (bitcast (fneg x)) and (bitcast (fcopysign cst,
x)) combines for ppc_fp128, since signbit computation is more
complicated.

Discussion thread:
http://lists.llvm.org/pipermail/llvm-dev/2015-November/092863.html

Patch by Tim Shen!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255305 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-10 22:09:06 +00:00
Cong Hou
dd635a682c Delete a duplicate branch in IfConversion.cpp. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255291 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-10 19:57:22 +00:00
Simon Pilgrim
45d4194e91 [DAGCombiner] Fix PR25763 - vector comparison constant folding + sign-extension
PR25763 demonstrated an issue with D14683 - vector comparison constant folding only works for i1 results, so we need to split off the sign-extension of the result to the required type. Luckily this can be done with the existing type legalization code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255289 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-10 19:47:06 +00:00
Sanjay Patel
f3ba0560c0 remove duplicated comments and don't repeat function names in comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255257 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-10 16:34:21 +00:00
Jonas Paulsson
92969682ea [PostRA scheduling] Allow a target to do scheduling when it wants post RA.
SystemZ needs to do its scheduling after branch relaxation, which can
only happen after block placement, and therefore the standard
PostRAScheduler point in the pass sequence is too early.

TargetMachine::targetSchedulesPostRAScheduling() is a new method that
signals on returning true that target will insert the final scheduling
pass on its own.

Reviewed by Hal Finkel

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255234 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-10 09:10:07 +00:00
Matthias Braun
a84e7b8f4d RegisterPressure: Factor out liveness dead-def detection logic; NFCI
Detecting additional dead-defs without a dead flag that are only visible
through liveness information should be part of the register operand
collection not intertwined with the register pressure update logic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255192 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-10 01:04:15 +00:00
Dan Gohman
029e84caf4 PeepholeOptimizer: Ignore dead implicit defs
Target-specific instructions may have uninteresting physreg clobbers,
for target-specific reasons. The peephole pass doesn't need to concern
itself with such defs, as long as they're implicit and marked as dead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255182 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-10 00:37:51 +00:00
Sanjay Patel
28e18e1782 use range-based for loops; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255171 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-09 22:45:45 +00:00
Robert Lougher
c8a1727001 Fix cycle in selection DAG introduced by extractelement legalization
During selection DAG legalization, extractelement is replaced with a load
instruction.  To do this, a temporary store to the stack is used unless an
existing store is found that can be re-used.
    
If re-using a store, the chain going out of the store must be replaced by
the one going out of the new load (this ensures that any stores that must
take place after the store happens after the load, else the value might
be overwritten before it is loaded).
    
The problem is, if the extractelement index is dependent on the store
replacing the chain will introduce a cycle in the selection DAG (the load
uses the index, and by replacing the chain we will make the index dependent
on the load).
    
To fix this, if the index is dependent on the store, the store is skipped.
This is conservative as we may end up creating an unnecessary extra store
to the stack.  However, the situation is not expected to occur very often.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255114 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-09 14:34:10 +00:00
Mehdi Amini
b310704b13 Revert "Implement a new pass - LiveDebugValues - to compute the set of live DEBUG_VALUEs at each basic block and insert them. Reviewed and accepted at: http://reviews.llvm.org/D11933"
This reverts commit r255096.

Break the bots: http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_check/16378/

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255101 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-09 08:17:42 +00:00
Vikram TV
2f351a5ca7 Implement a new pass - LiveDebugValues - to compute the set of live DEBUG_VALUEs at each basic block and insert them. Reviewed and accepted at: http://reviews.llvm.org/D11933
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255096 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-09 05:49:14 +00:00
Reid Kleckner
f4e0a47be3 [CGP] Reimplement r255055 a different way
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255070 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-08 23:00:03 +00:00
Reid Kleckner
903c0998cc Revert "[CGP] Check that we have an insert point before moving llvm.dbg.value around"
This reverts commit r255055.

Breakage has been reported.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255063 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-08 22:33:23 +00:00
Reid Kleckner
898fa74bf2 [CGP] Check that we have an insert point before moving llvm.dbg.value around
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255055 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-08 21:50:52 +00:00
Justin Bogner
cbf2c65b9e AsmPrinter: Use emitGlobalConstantFP to emit elements of constant data
It's strange to duplicate the logic for emitting FP values into
emitGlobalConstantDataSequential, and it's even stranger that we end
up printing the verbose assembly comments differently between the two
paths. Just call into emitGlobalConstantFP rather than crudely
duplicating its logic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254988 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-08 02:37:48 +00:00
Sanjay Patel
afd3f07154 fix return values to match bool return type; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254968 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-07 23:34:30 +00:00
Elena Demikhovsky
b06ff9b1e1 AVX-512: Fixed masked load / store instruction selection for KNL.
Patterns were missing for KNL target for <8 x i32>, <8 x float> masked load/store.

This intrinsic comes with all legal types:
<8 x float> @llvm.masked.load.v8f32(<8 x float>* %addr, i32 align, <8 x i1> %mask, <8 x float> %passThru),
but still requires lowering, because VMASKMOVPS, VMASKMOVDQU32 work with 512-bit vectors only.

All data operands should be widened to 512-bit vector.
The mask operand should be widened to v16i1 with zeroes.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254909 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-07 13:39:24 +00:00
Craig Topper
79402ee6f9 Replace uint16_t with the MCPhysReg typedef in many places. A lot of physical register arrays already use this typedef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254843 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-05 07:13:35 +00:00
Cong Hou
c7d0ead45b Normalize successors' probabilities when building MBBs for jump table.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254837 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-05 05:00:55 +00:00
Matthias Braun
c57a70c327 ScheduleDAGInstrs: Move LiveIntervals field to ScheduleDAGMI
Now that ScheduleDAGInstrs doesn't need it anymore we can move the field
down the class hierarcy to ScheduleDAGMI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254759 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-04 19:54:24 +00:00
Rafael Espindola
9ce890e1fe Revert "[BranchFolding] Merge MMOs during tail merge"
This reverts commit r254694.

It broke bootstrap.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254700 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-04 04:15:05 +00:00
Junmo Park
64649a7dc7 [BranchFolding] Merge MMOs during tail merge
Summary:
If we remove the MMOs from Load/Store instructions,
they are treated as volatile. This makes other optimization passes unhappy.
eg. Load/Store Optimization

So, it looks better to merge, not remove.

Reviewers: gberry, mcrosier

Subscribers: gberry, llvm-commits

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254694 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-04 02:29:25 +00:00
Junmo Park
d8ba62ab99 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254686 91177308-0d34-0410-b5e6-96231b3b80d8 2015-12-04 02:06:59 +00:00
Matthias Braun
7adbf112c7 ScheduleDAGInstrs: Rework schedule graph builder.
Re-comitting with a change that avoids undefined uses getting put into
the VRegUses list.

The new algorithm remembers the uses encountered while walking backwards
until a matching def is found. Contrary to the previous version this:
- Works without LiveIntervals being available
- Allows to increase the precision to subregisters/lanemasks
  (not used for now)

The changes in the AMDGPU tests are necessary because the R600 scheduler
is not stable with respect to the order of nodes in the ready queues.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254683 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-04 01:51:19 +00:00
Matthias Braun
ae4aa8b8d2 raw_ostream: << operator for callables with raw_ostream argument
This is a revised version of r254655 which uses a Printable wrapper
class to avoid ambiguous overload problems.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254681 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-04 01:31:59 +00:00
Evgeniy Stepanov
cb1cb45c60 Emit function alias to data as a function symbol.
CFI emits jump slots for indirect functions as a byte array
constant, and declares function-typed aliases to these constants.

This change fixes AsmPrinter to emit these aliases as function
symbols and not data symbols.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254674 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-04 00:45:43 +00:00
JF Bastien
922e9787e6 CodeGen peephole: fold redundant phys reg copies
Code generation often exposes redundant physical register copies through
virtual registers such as:

  %vreg = COPY %PHYSREG
  ...
  %PHYSREG = COPY %vreg

There are cases where no intervening clobber of %PHYSREG occurs, and the
later copy could therefore be removed. In some cases this further allows
us to remove the initial copy.

This patch contains a motivating example which comes from the x86 build
of Chrome, specifically cc::ResourceProvider::UnlockForRead uses
libstdc++'s implementation of hash_map. That example has two tests live
at the same time, and after machine sinking LLVM has confused itself
enough and things spilling EFLAGS is a great idea even though it's
never restored and the comparison results are both live.

Before this patch we have:
  DEC32m %RIP, 1, %noreg, <ga:@L>, %noreg, %EFLAGS<imp-def>
  %vreg1<def> = COPY %EFLAGS; GR64:%vreg1
  %EFLAGS<def> = COPY %vreg1; GR64:%vreg1
  JNE_1 <BB#1>, %EFLAGS<imp-use>

Both copies are useless. This patch tries to eliminate the later copy in
a generic manner.

dec is especially confusing to LLVM when compared with sub.

I wrote this patch to treat all physical registers generically, but only
remove redundant copies of non-allocatable physical registers because
the allocatable ones caused issues (e.g. when calling conventions weren't
properly modeled) and should be handled later by the register allocator
anyways.

The following tests used to failed when the patch also replaced allocatable
registers:
  CodeGen/X86/StackColoring.ll
  CodeGen/X86/avx512-calling-conv.ll
  CodeGen/X86/copy-propagation.ll
  CodeGen/X86/inline-asm-fpstack.ll
  CodeGen/X86/musttail-varargs.ll
  CodeGen/X86/pop-stack-cleanup.ll
  CodeGen/X86/preserve_mostcc64.ll
  CodeGen/X86/tailcallstack64.ll
  CodeGen/X86/this-return-64.ll
This happens because COPY has other special meaning for e.g. dependency
breakage and x87 FP stack.

Note that all other backends' tests pass.

Reviewers: qcolombet
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D15157

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254665 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-03 23:43:56 +00:00
Justin Bogner
c5aa4e71ff AsmPrinter: Simplify emitting FP elements in sequential data. NFC
Use APFloat APIs here Rather than manually type-punning through
unions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254664 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-03 23:28:35 +00:00
Matthias Braun
add5c9809b Revert "raw_ostream: << operator for callables with raw_stream argument"
This commit provoked "error C2593: 'operator <<' is ambiguous" on MSVC.

This reverts commit r254655.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254661 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-03 23:00:28 +00:00
Matthias Braun
bb300c5120 raw_ostream: << operator for callables with raw_stream argument
This allows easier construction of print helpers. Example:

Printable PrintLaneMask(unsigned LaneMask) {
  return Printable([LaneMask](raw_ostream &OS) {
    OS << format("%08X", LaneMask);
  });
}

// Usage:
OS << PrintLaneMask(Mask);

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254655 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-03 22:17:26 +00:00
Chih-Hung Hsieh
9f51f8f7e7 [X86] Part 1 to fix x86-64 fp128 calling convention.
Almost all these changes are conditioned and only apply to the new
x86-64 f128 type configuration, which will be enabled in a follow up
patch. They are required together to make new f128 work. If there is
any error, we should fix or revert them as a whole.
These changes should have no impact to current configurations.

* Relax type legalization checks to accept new f128 type configuration,
  whose TypeAction is TypeSoftenFloat, not TypeLegal, but also has
  TLI.isTypeLegal true.
* Relax GetSoftenedFloat to return in some cases f128 type SDValue,
  which is TLI.isTypeLegal but not "softened" to i128 node.
* Allow customized FABS, FNEG, FCOPYSIGN on new f128 type configuration,
  to generate optimized bitwise operators for libm functions.
* Enhance related Lower* functions to handle f128 type.
* Enhance DAGTypeLegalizer::run, SoftenFloatResult, and related functions
  to keep new f128 type in register, and convert f128 operators to library calls.
* Fix Combiner, Emitter, Legalizer routines that did not handle f128 type.
* Add ExpandConstant to handle i128 constants, ExpandNode
  to handle ISD::Constant node.
* Add one more parameter to getCommonSubClass and firstCommonClass,
  to guarantee that returned common sub class will contain the specified
  simple value type.
  This extra parameter is used by EmitCopyFromReg in InstrEmitter.cpp.
* Fix infinite loop in getTypeLegalizationCost when f128 is the value type.
* Fix printOperand to handle null operand.
* Enhance ISD::BITCAST node to handle f128 constant.
* Expand new f128 type for BR_CC, SELECT_CC, SELECT, SETCC nodes.
* Enhance X86AsmPrinter to emit f128 values in comments.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254653 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-03 22:02:40 +00:00
Andrew Kaylor
c4b843ccb7 [WinEH] Avoid infinite loop in BranchFolding for multiple single block funclets
Differential Revision: http://reviews.llvm.org/D14996



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254629 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-03 18:55:28 +00:00
Matthias Braun
033f871101 Revert "ScheduleDAGInstrs: Rework schedule graph builder."
This works mostly fine but breaks some stage 1 builders when compiling
compiler-rt on i386. Revert for further investigation as I can't see an
obvious cause/fix.

This reverts commit r254577.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254586 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-03 03:01:10 +00:00
Matthias Braun
c0a189c379 ScheduleDAGInstrs: Rework schedule graph builder.
The new algorithm remembers the uses encountered while walking backwards
until a matching def is found. Contrary to the previous version this:
- Works without LiveIntervals being available
- Allows to increase the precision to subregisters/lanemasks
  (not used for now)

The changes in the AMDGPU tests are necessary because the R600 scheduler
is not stable with respect to the order of nodes in the ready queues.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254577 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-03 02:05:27 +00:00
Matthias Braun
26ddca1969 RegisterPressure: Use range based for, fix else style; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254575 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-03 01:44:45 +00:00
David Majnemer
1114aa2fc6 Move EH-specific helper functions to a more appropriate place
No functionality change is intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254562 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-02 23:06:39 +00:00
Reid Kleckner
de603060b9 Use std::string instead of strdup() and free() in WinCodeViewLineTables
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254557 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-02 22:34:30 +00:00
Kyle Butt
325a79d6e9 [CodeGen]: Fix bad interaction with AntiDep breaking and inline asm.
AggressiveAntiDepBreaker was renaming registers specified by the user
for inline assembly. While this will work for compiler-specified
registers, it won't work for user-specified registers, and at the time
this runs, I don't currently see a way to distinguish them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254532 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-02 18:58:51 +00:00
Fiona Glaser
8afe0eb7ca Fix accidental off by one change
Didn't break any tests, but did unnecessary extra work.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254529 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-02 18:46:23 +00:00
Fiona Glaser
2b2fb7fbf2 Scheduler / Regalloc: use unique_ptr[] instead of std::vector
vector.resize() is significantly slower than memset in many STLs
and the cost of initializing these vectors is significant on targets
with many registers. Since we don't need the overhead of a vector,
use a simple unique_ptr instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254526 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-02 18:32:59 +00:00
Tim Northover
57b1a9599b AArch64: use ldxp/stxp pair to implement 128-bit atomic loads.
The ARM ARM is clear that 128-bit loads are only guaranteed to have been atomic
if there has been a corresponding successful stxp. It's less clear for AArch32, so
I'm leaving that alone for now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254524 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-02 18:12:57 +00:00
Cong Hou
d715c5a2cf Fix a bug in IfConversion.cpp.
The bug is introduced in r254377 which failed some tests on ARM, where a new
probability is assigned to a successor but the provided BB may not be a
successor.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254463 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-01 21:50:20 +00:00
Sanjay Patel
116b08e395 use range-based for loops; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254453 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-01 19:57:43 +00:00
Sanjay Patel
936f2daba2 don't repeat function/variable names in comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254445 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-01 19:32:35 +00:00
Sanjay Patel
bedc55e063 fix typo; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254442 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-01 19:19:18 +00:00