Commit Graph

15281 Commits

Author SHA1 Message Date
Chandler Carruth
12c74dc2c2 Revert commit r186217 -- this is breaking bots:
http://lab.llvm.org:8013/builders/clang-x86_64-darwin11-nobootstrap-RAincremental/builds/4328

Original commit log:
  Use the function attributes to pass along the stack protector buffer
  size.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186234 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-13 01:00:17 +00:00
Bill Wendling
8a50013cc2 Use the function attributes to pass along the stack protector buffer size.
Now that we have robust function attributes, don't use a command line option to
specify the stack protecto buffer size.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186217 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-12 22:25:20 +00:00
Arnold Schwaighofer
c0a11edba6 TargetTransformInfo: address calculation parameter for gather/scather
Address calculation for gather/scather in vectorized code can incur a
significant cost making vectorization unbeneficial. Add infrastructure to add
cost.
Tests and cost model for targets will be in follow-up commits.

radar://14351991

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186187 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-12 19:16:02 +00:00
Manman Ren
da07e9df84 PEI: refactor replaceFrameIndices(MF) to call replaceFrameIndices(BB).
replaceFrameIndices(MF) will iterate over the BBs and call
replaceFrameIndices(BB). No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186141 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-12 00:37:01 +00:00
Craig Topper
9e639e8fd9 Use SmallVectorImpl& instead of SmallVector to avoid repeating small vector size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186098 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-11 16:22:38 +00:00
Hal Finkel
6cf88c9850 Initialize AsmPrinter::MF in the constructor
MF is normally initialized in AsmPrinter::SetupMachineFunction, but if the file
contains only globals (no functions), then we need this to be initialized
because, when encountering an error, lowerConstant() references it.

This should fix the non-deterministic failures of
test/CodeGen/X86/nonconst-static-iv.ll, etc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186068 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-11 06:41:14 +00:00
Hal Finkel
838a7fb1a3 RegScavenger should not exclude undef uses
When computing currently-live registers, the register scavenger excludes undef
uses. As a result, undef uses are ignored when computing the restore points of
registers spilled into the emergency slots. While the register scavenger
normally excludes from consideration, when scavenging, registers used by the
current instruction, we need to not exclude undef uses. Otherwise, we might end
up requiring more emergency spill slots than we have (in the case where the
undef use *is* the currently-spilled register).

Another bug found by llvm-stress.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186067 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-11 05:55:57 +00:00
Stephen Lin
75d13065fd Remove trailing whitespac
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186032 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-10 20:47:39 +00:00
Adrian Prantl
43ae5e85f8 Use the appropriate unsigned int type for the offset.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186015 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-10 16:56:52 +00:00
Adrian Prantl
4759f26c31 Safeguard DBG_VALUE handling. Unbreaks the ASAN buildbot.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186014 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-10 16:56:47 +00:00
Adrian Prantl
45ff709caf Un-break the buildbot by tweaking the indirection flag.
Pulled in a testcase from the debuginfo-test suite.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185993 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-10 01:53:37 +00:00
Adrian Prantl
893ae83f42 Document a known limitation of the status quo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185992 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-10 01:53:30 +00:00
Eric Christopher
61c91d5d7c Fix comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185984 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-09 23:48:45 +00:00
Adrian Prantl
b2754919ca Typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185971 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-09 21:44:06 +00:00
Adrian Prantl
3517640443 Reapply an improved version of r180816/180817.
Change the informal convention of DBG_VALUE machine instructions so that
we can express a register-indirect address with an offset of 0.
The old convention was that a DBG_VALUE is a register-indirect value if
the offset (operand 1) is nonzero. The new convention is that a DBG_VALUE
is register-indirect if the first operand is a register and the second
operand is an immediate. For plain register values the combination reg,
reg is used. MachineInstrBuilder::BuildMI knows how to build the new
DBG_VALUES.

rdar://problem/13658587

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185966 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-09 20:28:37 +00:00
Hal Finkel
b9c8c40acb WidenVecRes_BUILD_VECTOR must use the first operand's type
Because integer BUILD_VECTOR operands may have a larger type than the result's
vector element type, and all operands must have the same type, when widening a
BUILD_VECTOR node by adding UNDEFs, we cannot use the vector element type, but
rather must use the type of the existing operands.

Another bug found by llvm-stress.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185960 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-09 18:55:10 +00:00
Stephen Lin
e54885af9b AArch64/PowerPC/SystemZ/X86: This patch fixes the interface, usage, and all
in-tree implementations of TargetLoweringBase::isFMAFasterThanMulAndAdd in
order to resolve the following issues with fmuladd (i.e. optional FMA)
intrinsics:

1. On X86(-64) targets, ISD::FMA nodes are formed when lowering fmuladd
intrinsics even if the subtarget does not support FMA instructions, leading
to laughably bad code generation in some situations.

2. On AArch64 targets, ISD::FMA nodes are formed for operations on fp128,
resulting in a call to a software fp128 FMA implementation.

3. On PowerPC targets, FMAs are not generated from fmuladd intrinsics on types
like v2f32, v8f32, v4f64, etc., even though they promote, split, scalarize,
etc. to types that support hardware FMAs.

The function has also been slightly renamed for consistency and to force a
merge/build conflict for any out-of-tree target implementing it. To resolve,
see comments and fixed in-tree examples.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185956 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-09 18:16:56 +00:00
Hal Finkel
bd6f1f6896 DAGCombine tryFoldToZero cannot create illegal types after type legalization
When folding sub x, x (and other similar constructs), where x is a vector, the
result is a vector of zeros. After type legalization, make sure that the input
zero elements have a legal type. This type may be larger than the result's
vector element type.

This was another bug found by llvm-stress.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185949 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-09 17:02:45 +00:00
Alexander Potapenko
9467b3e0ac Revert r185872 - "Stop emitting weak symbols into the "coal" sections"
This patch broke `make check-asan` on Mac, causing ld warnings like the following one:

ld: warning: direct access in __GLOBAL__I_a to global weak symbol
___asan_mapping_scale means the weak symbol cannot be overridden at
runtime. This was likely caused by different translation units being
compiled with different visibility settings.

The resulting test binaries crashed with incorrect ASan warnings.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185923 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-09 10:00:16 +00:00
Stephen Lin
b494015330 Style fixes: remove unnecessary braces for one-statement if blocks, no else after return, etc. No funcionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185893 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-09 00:44:49 +00:00
Bill Wendling
8722e25715 Stop emitting weak symbols into the "coal" sections.
The Mach-O linker has been able to support the weak-def bit on any symbol for
quite a while now. The compiler however continued to place these symbols into a
"coal" section, which required the linker to map them back to the base section
name.

Replace the sections like this:

  __TEXT/__textcoal_nt   instead use  __TEXT/__text
  __TEXT/__const_coal    instead use  __TEXT/__const
  __DATA/__datacoal_nt   instead use  __DATA/__data

<rdar://problem/14265330>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185872 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-08 21:34:52 +00:00
Eric Christopher
cced212851 Update comment to avoid mentioning DbgValues which is an instance
variable later in the class.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185866 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-08 21:16:18 +00:00
Manman Ren
d03d2b243a Debug Info: clean up usage of Verify.
No functionality change. It should suffice to check the type of a debug info
metadata, instead of calling Verify.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185847 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-08 18:33:29 +00:00
David Blaikie
66f464ee26 DebugInfo: Correct comment & re-format a nearby loop
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185844 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-08 17:51:28 +00:00
David Blaikie
5ce4091a68 DebugInfo: Simplify Address Pool index handling.
Since the pool indexes are necessarily sequential and contiguous, just
insert things in the right place rather than having to sort the sequence
after the fact.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185842 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-08 17:33:10 +00:00
Hal Finkel
6c75160b87 Improve the comment from r185794 (re: PromoteIntRes_BUILD_VECTOR)
In response to Duncan's review, I believe that the original comment was not as
clear as it could be. Hopefully, this is better.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185824 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-08 14:40:04 +00:00
Hal Finkel
63e7a38c89 Fix PromoteIntRes_BUILD_VECTOR crash with i1 vectors
This fixes a bug (found by llvm-stress) in
DAGTypeLegalizer::PromoteIntRes_BUILD_VECTOR where it assumed that the result
type would always be larger than the original operands. This is not always
true, however, with boolean vectors. For example, promoting a node of type v8i1
(where the operands will be of type i32, the type to which i1 is promoted) will
yield a node with a result vector element type of i16 (and operands of type
i32). As a result, we cannot blindly assume that we can ANY_EXTEND the operands
to the result type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185794 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-08 06:16:58 +00:00
Kai Nacke
113d32cea8 Revert: Emit personality function and Dwarf EH data for Win64 SEH.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185788 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-08 04:43:23 +00:00
Hal Finkel
04b84c2f92 Add the nearbyint -> FNEARBYINT mapping to BasicTargetTransformInfo
This fixes an oversight that Intrinsic::nearbyint was not being mapped to
ISD::FNEARBYINT (thus fixing the over-optimistic cost we were assigning to
nearbyint calls for some targets).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185783 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-08 03:24:07 +00:00
Stephen Lin
155615d7dc Remove trailing whitespace from SelectionDAG/*.cpp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185780 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-08 00:37:03 +00:00
Stephen Lin
09f8ca3986 SelectionDAGBuilder: style fixes (add space between end parentheses and open brace)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185768 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-06 21:44:25 +00:00
Kai Nacke
28bb04453d Emit personality function and Dwarf EH data for Win64 SEH.
Obviously the personality function should be emitted as language handler
instead of the hard coded _GCC_specific_handler. The language specific
data must be placed after the unwind information therefore it must not
be emitted into a separate section.

Reviewed by Charles Davis and Nico Rieck.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185761 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-06 17:17:31 +00:00
Benjamin Kramer
f4eeab452a DAGCombiner: Don't drop extension behavior when shrinking a load when unsafe.
ReduceLoadWidth unconditionally drops extensions from loads. Limit it to the
case when all of the bits the extension would otherwise produce are dropped by
the shrink. It would be possible to shrink the load in more cases by merging
the extensions, but this isn't trivial and a very rare case. I left a TODO for
that case.

Fixes PR16551.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185755 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-06 14:05:09 +00:00
Tim Northover
e5a81a130f Stop putting operations after a tail call.
This prevents the emission of DAG-generated vreg definitions after a
tail call be dropping them entirely (on the grounds that nothing could
use them anyway, and they interfere with O0 CodeGen).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185754 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-06 12:58:45 +00:00
Nico Rieck
8064628379 MC: Implement COFF .linkonce directive
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185753 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-06 12:13:10 +00:00
Jakob Stoklund Olesen
202eb7b18e Use modern API to avoid exposing LiveInterval internals.
No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185733 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-05 23:48:07 +00:00
Jakob Stoklund Olesen
1f2415efc3 Remove dead function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185731 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-05 23:04:55 +00:00
Richard Sandiford
71804149a3 [SystemZ] Remove no-op MVCs
The stack coloring pass has code to delete stores and loads that become
trivially dead after coloring.  Extend it to cope with single instructions
that copy from one frame index to another.

The testcase happens to show an example of this kicking in at the moment.
It did occur in Real Code too though.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185705 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-05 14:38:48 +00:00
Richard Sandiford
5f1c7e5eac Fix double renaming bug in stack coloring pass
The stack coloring pass renumbered frame indexes with a loop of the form:

  for each frame index FI
    for each instruction I that uses FI
      for each use of FI in I
        rename FI to FI'

This caused problems if an instruction used two frame indexes F0 and F1
and if F0 was renamed to F1 and F1 to F2.  The first time we visited the
instruction we changed F0 to F1, then we changed both F1s to F2.

In other words, the problem was that SSRefs recorded which instructions
used an FI, but not which MachineOperands and MachineMemOperands within
that instruction used it.

This is easily fixed for MachineOperands by walking the instructions
once and processing each operand in turn.  There's already a loop to
do that for dead store elimination, so it seemed more efficient to
fuse the two at the block level.

MachineMemOperands are more tricky because they can be shared between
instructions.  The patch handles them by making SSRefs an array of
MachineMemOperands rather than an array of MachineInstrs.  We might end
up processing the same MachineMemOperand twice, but that's OK because
we always know from the SSRefs index what the original frame index was.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185703 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-05 14:24:47 +00:00
Richard Sandiford
7271ac2c03 [SystemZ] Clean up register scavenging code
SystemZ wants normal register scavenging slots, as close to the stack or
frame pointer as possible.  The only reason it was using custom code was
because PrologEpilogInserter assumed an x86-like layout, where the frame
pointer is at the opposite end of the frame from the stack pointer.
This meant that when frame pointer elimination was disabled,
the slots ended up being as close as possible to the incoming
stack pointer, which is the opposite of what we want on SystemZ.

This patch adds a new knob to say which layout is used and converts
SystemZ to use target-independent scavenging slots.  It's one of the pieces
needed to support frame-to-frame MVCs, where two slots might be required.

The ABI requires us to allocate 160 bytes for calls, so one approach
would be to use that area as temporary spill space instead.  It would need
some surgery to make sure that the slot isn't live across a call though.

I stuck to the "isFPCloseToIncomingSP - ..." style comment on the
"do what the surrounding code does" principle.  The FP case is already
covered by several Systemz/frame-* tests, which fail without the
PrologueEpilogueInserter change, so no new ones are needed.

No behavioural change intended.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185696 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-05 12:55:00 +00:00
Benjamin Kramer
b6566aee30 Simplify code. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185689 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-05 10:20:57 +00:00
Nico Rieck
25746ddd66 Initialize object file info before output streamer
r179494 switched to using the object file info to retrieve the default text
section for some MC streamers. It is possible that initializing an MC
streamer can request sections before the object file info is initialized
when the AutoInitSections flag is set on the streamer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185670 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-04 21:37:26 +00:00
Jakob Stoklund Olesen
f349a6e9e6 Remove the EXCEPTIONADDR, EHSELECTION, and LSDAADDR ISD opcodes.
These exception-related opcodes are not used any longer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185625 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-04 13:54:20 +00:00
Jakob Stoklund Olesen
1ab111ed01 Typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185618 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-04 04:53:49 +00:00
Jakob Stoklund Olesen
918b7c82f8 Simplify landing pad lowering.
Stop using the ISD::EXCEPTIONADDR and ISD::EHSELECTION when lowering
landing pad arguments. These nodes were previously legalized into
CopyFromReg nodes, but that never worked properly because the
CopyFromReg node weren't guaranteed to be  scheduled at the top of the
basic block.

This meant the exception pointer and selector registers could be
clobbered before being copied to a virtual register.

This patch copies the two physical registers to virtual registers at
the beginning of the basic block, and lowers the landingpad instruction
directly to two CopyFromReg nodes reading the *virtual* registers. This
is safe because virtual registers don't get clobbered.

A future patch will remove the ISD::EXCEPTIONADDR and ISD::EHSELECTION
nodes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185617 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-04 04:53:45 +00:00
Jakob Stoklund Olesen
ef22e0e0b5 FastISel can only apend to basic blocks.
Compute the insertion point from the end of the basic block instead of
skipping labels from the front.

This caused failures in landing pads when live-in copies where inserted
before instruction selection.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185616 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-04 04:32:39 +00:00
Jakob Stoklund Olesen
c982e14458 Live-in copies go *after* EH_LABELs.
This will soon be tested by exception handling working at all.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185615 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-04 04:32:35 +00:00
Jakob Stoklund Olesen
c93822901a Revert r185595-185596 which broke buildbots.
Revert "Simplify landing pad lowering."
Revert "Remove the EXCEPTIONADDR, EHSELECTION, and LSDAADDR ISD opcodes."

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185600 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-04 00:26:30 +00:00
Jakob Stoklund Olesen
62204220e1 Remove the EXCEPTIONADDR, EHSELECTION, and LSDAADDR ISD opcodes.
These exception-related opcodes are not used any longer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185596 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-03 23:56:31 +00:00
Jakob Stoklund Olesen
9c0e921732 Simplify landing pad lowering.
Stop using the ISD::EXCEPTIONADDR and ISD::EHSELECTION when lowering
landing pad arguments. These nodes were previously legalized into
CopyFromReg nodes, but that never worked properly because the
CopyFromReg node weren't guaranteed to be  scheduled at the top of the
basic block.

This meant the exception pointer and selector registers could be
clobbered before being copied to a virtual register.

This patch copies the two physical registers to virtual registers at
the beginning of the basic block, and lowers the landingpad instruction
directly to two CopyFromReg nodes reading the *virtual* registers. This
is safe because virtual registers don't get clobbered.

A future patch will remove the ISD::EXCEPTIONADDR and ISD::EHSELECTION
nodes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185595 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-03 23:56:24 +00:00
Jakob Stoklund Olesen
f647652445 Add MachineBasicBlock::addLiveIn().
This function adds a live-in physical register to an MBB and ensures
that it is copied to a virtual register immediately.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185594 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-03 23:56:20 +00:00
Eric Christopher
7c2f3e8944 Hoist all of the Entry.getLoc() calls int a single variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185589 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-03 22:40:21 +00:00
Eric Christopher
0d0782ae93 Make DotDebugLocEntry a class, reorder the members along with comments
for them and update all uses.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185588 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-03 22:40:18 +00:00
Eric Christopher
4e976457eb Elaborate on comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185586 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-03 21:37:03 +00:00
Eric Christopher
3a1812d1fe Add names to the header file since they help in documenting the API
(and for consistency).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185585 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-03 21:23:59 +00:00
Eric Christopher
08ebdc73de Move typedefs inside the class that they belong to.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185573 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-03 20:36:36 +00:00
Eric Christopher
52f5a65f84 Remove unused field.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185523 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-03 08:26:07 +00:00
Eric Christopher
6af85aec4a Constify a few functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185520 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-03 08:13:55 +00:00
Craig Topper
32bdf82b9f Use SmallVectorImpl::const_iterator instead of SmallVector to avoid specifying the vector size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185514 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-03 05:18:47 +00:00
Craig Topper
78477ffdfd Use SmallVectorImpl instead of SmallVector as method argument to avoid specifying vector size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185513 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-03 05:16:59 +00:00
Craig Topper
f22fd3f7b5 Use SmallVectorImpl instead of SmallVector for iterators and references to avoid specifying the vector size unnecessarily.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185512 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-03 05:11:49 +00:00
Craig Topper
40c744ee33 Use SmallVectorImpl::iterator/const_iterator instead of SmallVector to avoid specifying the vector size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185509 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-03 04:42:33 +00:00
Craig Topper
01eb99af2f Introduce some typedefs for DenseMaps containing SmallVectors so the vector size doesn't have to repeated when creating iterators for the DenseMap.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185508 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-03 04:40:27 +00:00
Craig Topper
9f4c37915f Return SmallVectorImpl& instead of SmallVector& in a couple places to avoid having to specify the vector size in multiple places.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185507 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-03 04:30:58 +00:00
Craig Topper
9f43ac6cd3 Use SmallVectorImpl& instead of SmallVector& to avoid needlessly respecifying the small vector size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185505 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-03 04:24:43 +00:00
Craig Topper
2d785dbace Use SmallVectorImpl::iterator/const_iterator instead of SmallVector to avoid specifying the vector size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185504 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-03 04:17:25 +00:00
Eric Christopher
e717713547 Avoid doing a lot of computation when we have multiple ranges and
avoid adding information for the debug_inlined section when it isn't
going to be emitted anyhow.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185500 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-03 02:23:53 +00:00
Eric Christopher
f53d643bd9 Move iterator to where it's used and update comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185498 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-03 01:57:28 +00:00
Eric Christopher
c9c17a8e4f Move instance variable before experimental section.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185497 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-03 01:57:26 +00:00
Eric Christopher
aa30a0cf9b Fix typo to make grep for DW_AT_comp_dir work without case-insensitive
grep.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185496 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-03 01:57:23 +00:00
Eric Christopher
015343eb7c Remove unnecessary forward declare.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185495 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-03 01:57:20 +00:00
Eric Christopher
da965defb8 Add a helpful comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185492 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-03 01:22:29 +00:00
Eric Christopher
e4721495b6 addConstantValue, addConstantFPValue never returned anything but
true, so remove the return value and propagate accordingly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185490 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-03 01:08:30 +00:00
Manman Ren
0e6783feed Debug Info: use module flag to set up Dwarf version.
Correctly handles ref_addr depending on the Dwarf version. Emit Dwarf with
version from module flag.

TODO: turn on/off features depending on the Dwarf version.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185484 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-02 23:40:10 +00:00
Eric Christopher
d3b98530c5 Fix comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185480 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-02 21:36:07 +00:00
Ulrich Weigand
716a94f0c9 [DebugInfo] Allow getDebugThreadLocalSymbol to return MCExpr
This allows getDebugThreadLocalSymbol to return a generic MCExpr
instead of just a MCSymbolRefExpr.

This is in preparation for supporting debug info for TLS variables
on PowerPC, where we need to describe the variable location using
a more complex expression than just MCSymbolRefExpr.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185460 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-02 18:47:09 +00:00
Ulrich Weigand
18dbe5029f [DebugInfo] Hold generic MCExpr in AddrPool
This changes the AddrPool infrastructure to enable it to hold
generic MCExpr expressions, not just MCSymbolRefExpr.

This is in preparation for supporting debug info for TLS variables
on PowerPC, where we need to describe the variable location using
a more complex expression than just MCSymbolRefExpr.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185459 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-02 18:46:46 +00:00
Ulrich Weigand
1f8aacd6af [DebugInfo] Introduce DIEExpr variant of DIEValue to hold MCExpr values
This partially reverts r185202 and restores DIELabel to hold plain
MCSymbol references.  Instead, we add a new subclass DIEExpr of
DIEValue that can hold generic MCExpr references.

This is in preparation for supporting debug info for TLS variables
on PowerPC, where we need to describe the variable location using
a more complex expression than just MCSymbolRefExpr.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185458 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-02 18:46:26 +00:00
Jakob Stoklund Olesen
92879a8cb1 Revert (most of) r185393 and r185395.
"Remove floating point computations form SpillPlacement.cpp."

These commits caused test failures in lencod on clang-native-arm-lnt.

I suspect these changes are only exposing an existing issue, but
reverting anyway to keep the bots passing while we investigate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185447 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-02 17:31:58 +00:00
Rafael Espindola
a3863ea2da Remove address spaces from MC.
This is dead code since PIC16 was removed in 2010. The result was an odd mix,
where some parts would carefully pass it along and others would assert it was
zero (most of the object streamer for example).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185436 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-02 15:49:13 +00:00
Tim Northover
5bce67a95f DAGCombiner: fix use-counting issue when forming zextload
DAGCombiner was counting all uses of a load node  when considering whether it's
worth combining into a zextload. Really, it wants to ignore the chain and just
count real uses.

rdar://problem/13896307

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185419 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-02 09:58:53 +00:00
David Blaikie
8fed05ec1b PR14728: DebugInfo: TLS variables with -gsplit-dwarf
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185398 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-01 23:55:52 +00:00
Jakob Stoklund Olesen
7babb052a6 Tweak some comments that referred to the old bias computations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185395 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-01 23:36:37 +00:00
Jakob Stoklund Olesen
74d2a3e1a0 Remove floating point computations form SpillPlacement.cpp.
Patch by Benjamin Kramer!

Use the BlockFrequency class instead of floats in the Hopfield network
computations. This rescales the node Bias field from a [-2;2] float
range to two block frequencies BiasN and BiasP pulling in opposite
directions. This construct has a more predictable behavior when block
frequencies saturate.

The per-node scaling factors are no longer necessary, assuming the block
frequencies around a bundle are consistent.

This patch can cause the register allocator to make different spilling
decisions. The differences should be small.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185393 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-01 23:19:39 +00:00
David Blaikie
a35ae96291 PR16493: DebugInfo with TLS on PPC crashing due to invalid relocation
Restrict the current TLS support to X86 ELF for now. Test that we don't
produce it on PPC & we can flesh that test case out with the right thing
once someone implements it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185389 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-01 21:45:25 +00:00
Lang Hames
781f5b3953 Make PBQP require/preserve MachineLoopInfo - the spiller requires it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185378 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-01 20:47:47 +00:00
Cameron Zwarich
f807a6ee3a Fix the build after r185363. Use llvm::next instead of raw next.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185367 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-01 19:49:48 +00:00
Cameron Zwarich
03fae50cfa Fix PR16508.
When phis get lowered, destination copies are inserted using an iterator that is
determined once for all phis in the block, which BuildMI interprets as a request
to insert an instruction directly before the iterator. In the case of a cyclic
phi, source copies may also be inserted directly before this iterator, which can
cause source copies to be inserted before destination copies. The fix is to keep
an iterator to the last phi and then advance it while lowering each phi in order
to insert destination copies directly after the phis.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185363 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-01 19:42:46 +00:00
Michael Gottesman
48b4d4f647 Added c++ mode selector to head of SelectionDAGBuilder.h so editors open it in c++ mode instead of c mode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185348 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-01 16:53:41 +00:00
Benjamin Kramer
04d5613162 misched: Compress pairs returned by getUnderlyingObjectsForInstr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185266 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-29 18:41:17 +00:00
David Blaikie
59eaa38746 DebugInfo: PR14728: TLS support
Based on GCC's output for TLS variables (OP_constNu, x@dtpoff,
OP_lo_user), this implements debug info support for TLS in ELF. Verified
that this output is correct/sufficient on Linux (using gold - if you're
using binutils-ld, you'll need something with the fix for
http://sourceware.org/bugzilla/show_bug.cgi?id=15685 in it).

Support on non-ELF is sort of "arbitrary" at the moment - if Apple folks
want to discuss (or just go ahead & implement) how this should work in
MachO, etc, I'm open.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185203 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-28 20:05:11 +00:00
David Blaikie
95e72c90e4 DebugInfo: Pass MCSymbolRefExprs for labels instead of MCSymbols
This is a precursor to adding debug info support for TLS which requires
non-default relocations applied to TLS symbols.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185202 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-28 20:05:04 +00:00
David Blaikie
1ca79907ef DebugInfo: Revise r185189 to avoid subtle 'unsigned += bool'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185190 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-28 18:55:13 +00:00
David Blaikie
1c736322a2 DebugInfo: Simplify the AddressPool representation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185189 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-28 18:47:19 +00:00
David Blaikie
321d83ba9e DebugInfo: constify the AddressPool MCSymbol pointers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185188 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-28 18:47:14 +00:00
Lang Hames
dfccd9ee98 Add missing case to switch statement - DAGTypeLegalizer::ExpandIntegerResult
should expand ATOMIC_CMP_SWAP nodes the same way that it does for ATOMIC_SWAP.

Since ATOMIC_LOADs on some targets (e.g. older ARM variants) get legalized to
ATOMIC_CMP_SWAPs, the missing case had been causing i64 atomic loads to crash
during isel.

<rdar://problem/14074644>



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185186 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-28 18:36:42 +00:00
Manman Ren
cbafae6d33 Debug Info: clean up usage of Verify.
No functionality change.
It should suffice to check the type of a debug info metadata, instead of
calling Verify. For cases where we know the type of a DI metadata, use
assert.

Also update testing cases to make them conform to the format of DI classes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185135 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-28 05:43:10 +00:00
Benjamin Kramer
88d93a7cc4 Remove unused variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185072 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-27 11:26:41 +00:00
Elena Demikhovsky
d8026708ef Fixed a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184933 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-26 12:15:53 +00:00
Elena Demikhovsky
87070fe107 Optimized integer vector multiplication operation by replacing it with shift/xor/sub when it is possible. Fixed a bug in SDIV, where the const operand is not a splat constant vector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184931 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-26 10:55:03 +00:00