Commit Graph

17486 Commits

Author SHA1 Message Date
Lang Hames
4e2cbd5158 [RegAlloc] Kill off the trivial spiller - nobody is using it any more.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221474 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-06 19:12:38 +00:00
Rafael Espindola
eed959015b Compute the correct jump table entries on 32 bit windows.
On 32 bit windows we use label differences and .set does not suppress
rolocations, a combination that was not used before r220256.

This fixes PR21497.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221456 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-06 14:39:49 +00:00
Rafael Espindola
58de7099c7 Add three other sections when L symbols are allowed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221436 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-06 05:01:21 +00:00
Rafael Espindola
e1f22e397d Allow L symbols in no_dead_strip sections.
If a section cannot be dead stripped, it is safe to use L symbols, since
the linker will keep all of it in the end.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221431 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-06 02:42:03 +00:00
Duncan P. N. Exon Smith
bad06b13ba IR: MDNode => Value: NamedMDNode::getOperator()
Change `NamedMDNode::getOperator()` from returning `MDNode *` to
returning `Value *`.  To reduce boilerplate at some call sites, add a
`getOperatorAsMDNode()` for named metadata that's expected to only
return `MDNode` -- for now, that's everything, but debug node named
metadata (such as llvm.dbg.cu and llvm.dbg.sp) will soon change.  This
is part of PR21433.

Note that there's a follow-up patch to clang for the API change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221375 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-05 18:16:03 +00:00
Andrea Di Biagio
042bee88f3 [X86] Teach method 'isVectorClearMaskLegal' how to check for legal blend masks.
This patch improves the folding of vector AND nodes into blend operations for
targets that feature SSE4.1. A vector AND node where one of the operands is
a constant build_vector with elements that are either zero or all-ones can be
converted into a blend.

This allows for example to simplify the following code:

define <4 x i32> @test(<4 x i32> %A, <4 x i32> %B) {
  %1 = and <4 x i32> %A, <i32 0, i32 0, i32 0, i32 -1>
  %2 = and <4 x i32> %B, <i32 -1, i32 -1, i32 -1, i32 0>
  %3 = or <4 x i32> %1, %2
  ret <4 x i32> %3
}

Before this patch llc (-mcpu=corei7) generated:
        andps  LCPI1_0(%rip), %xmm0, %xmm0
        andps  LCPI1_1(%rip), %xmm1, %xmm1
        orps   %xmm1, %xmm0, %xmm0
        retq

With this patch we generate a single 'vpblendw'.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221343 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-05 13:04:14 +00:00
Craig Topper
04a45948a0 Improve logic that decides if its profitable to commute when some of the virtual registers involved have uses/defs chains connecting them to physical register. Fix up the tests that this change improves.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221336 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-05 06:43:02 +00:00
David Blaikie
f49ead7098 Provide gmlt-like inline scope information in the skeleton CU to facilitate symbolication without needing the .dwo files
Clang -gsplit-dwarf self-host -O0, binary increases by 0.0005%, -O2,
binary increases by 25%.

A large binary inside Google, split-dwarf, -O0, and other internal flags
(GDB index, etc) increases by 1.8%, optimized build is 35%.

The size impact may be somewhat greater in .o files (I haven't measured
that much - since the linked executable -O0 numbers seemed low enough)
due to relocations. These relocations could be removed if we taught the
llvm-symbolizer to handle indexed addressing in the .o file (GDB can't
cope with this just yet, but GDB won't be reading this info anyway).
Also debug_ranges could be shared between .o and .dwo, though ideally
debug_ranges would get a schema that could used index(+offset)
addressing, and move to the .dwo file, then we'd be back to sharing
addresses in the address pool again.

But for now, these sizes seem small enough to go ahead with this.

Verified that no other DW_TAGs are produced into the .o file other than
subprograms and inlined_subroutines.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221306 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-04 22:12:25 +00:00
David Blaikie
41ebc263a9 Move cross-unit DIE caching to the DwarfFile level, so it doesn't interfere with fission-gmlt data and produce skeleton<>full unit cross referencing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221305 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-04 22:12:18 +00:00
Arnaud A. de Grandmaison
e1bec75134 [PBQP] Callee saved regs should have a higher cost than scratch regs
Registers are not all equal. Some are not allocatable (infinite cost),
some have to be preserved but can be used, and some others are just free
to use.

Ensure there is a cost hierarchy reflecting this fact, so that the
allocator will favor scratch registers over callee-saved registers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221293 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-04 20:51:29 +00:00
Arnaud A. de Grandmaison
8025a39d11 [PBQP] Tweak spill costs and coalescing benefits
This patch improves how the different costs (register, interference, spill
and coalescing) relates together. The assumption is now that:
 - coalescing (or any other "side effect" of reg alloc) is negative, and
   instead of being derived from a spill cost, they use the block
   frequency info.
 - spill costs are in the [MinSpillCost:+inf( range
 - register or interference costs are in [0.0:MinSpillCost( or +inf

The current MinSpillCost is set to 10.0, which is a random value high
enough that the current constraint builders do not need to worry about
when settings costs. It would however be worth adding a normalization
step for register and interference costs as the last step in the
constraint builder chain to ensure they are not greater than SpillMinCost
(unless this has some sense for some architectures). This would work well
with the current builder pipeline, where all costs are tweaked relatively
to each others, but could grow above MinSpillCost if the pipeline is
deep enough.

The current heuristic is tuned to depend rather on the number of uses of
a live interval rather than a density of uses, as used by the greedy
allocator. This heuristic provides a few percent improvement on a number
of benchmarks (eembc, spec, ...) and will definitely need to change once
spill placement is implemented: the current spill placement is really
ineficient, so making the cost proportionnal to the number of use is a
clear win.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221292 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-04 20:51:24 +00:00
David Majnemer
ab15115ee0 CodeGen: Enable DWARF emission for MS ABI targets
This is experimental, just barely enough to get things to not
immediately combust.

A note for those who are curious:
Only lld can successfully link the object files, other linkers truncate
the section names making the debug sections illegible to debuggers.

Even with this in mind, we believe we are having trouble with SECREL
relocations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221245 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-04 08:03:31 +00:00
Sanjoy Das
67bcf74b14 The patchpoint lowering logic would crash with live constants equal to
the tombstone or empty keys of a DenseMap<int64_t, T>.  This patch
fixes the issue (and adds a tests case).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221214 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-04 00:59:21 +00:00
Sanjoy Das
60c2a98db4 Change logic in StackMaps::recordStackMapOpers to use the isInt<32>
predicate instead of bitwise operations.

This is not a functional change.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221209 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-04 00:06:57 +00:00
David Blaikie
42090c633f Use common range handling for the CU's ranges
This generalizes the range handling for ranges in both the skeleton and
full unit, laying the foundation for the addition of more ranges (rather
than just the CU's special case) in the skeleton CU with fission+gmlt.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221202 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-03 23:10:59 +00:00
David Blaikie
fcd4288009 Push the CURangeList down into the skeleton CU (where available) rather than the full CU
So that it may be shared between skeleton/full compile unit, for CU
ranges and other ranges to be added for fission+gmlt.

(at some point we might want some kind of object shared between the
skeleton and full compile units for all those things we only want one of
in that scope, rather than having the full unit always look through to
the skeleton... - alternatively, we might be able to have the skeleton
pointer (or another, separate pointer) point to the skeleton or to the
unit itself in non-fission, so we don't have to special case its
absence)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221186 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-03 21:52:56 +00:00
David Blaikie
dc1d16ae54 Add DwarfCompileUnit::BaseAddress to track the base address used by relative addressing in debug_ranges and debug_loc
This is one of a few steps to generalize range handling to include the
CU range (thus the CU's range list will be moved into the range list
list, losing track of the base address in the process), which means
generalizing ranges from both the skeleton and full unit under fission.

And... then I can used that generalized support for ranges in
fission+gmlt where there'll be a bunch more ranges in the skeleton.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221182 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-03 21:15:30 +00:00
Paul Robinson
c3e82bf9f5 Normally an 'optnone' function goes through fast-isel, which does not
call DAGCombiner. But we ran into a case (on Windows) where the
calling convention causes argument lowering to bail out of fast-isel,
and we end up in CodeGenAndEmitDAG() which does run DAGCombiner.
So, we need to make DAGCombiner check for 'optnone' after all.

Commit includes the test that found this, plus another one that got
missed in the original optnone work.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221168 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-03 18:19:26 +00:00
David Blaikie
c34113433a Cleanup some unused or trivial functions in DwarfCompileUnit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221164 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-03 17:10:38 +00:00
David Blaikie
60b9b0d581 Sink DwarfUnit::CURanges into DwarfCompileUnit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221161 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-03 16:40:43 +00:00
Oliver Stannard
25f4c35b22 Revert r221150, as it broke sanitizer tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221151 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-03 12:19:03 +00:00
Oliver Stannard
b63d71ef81 Emit .eh_frame with relocations to functions, rather than sections
When LLVM emits DWARF call frame information, it currently creates a local,
section-relative symbol in the code section, which is pointed to by a
relocation on the .eh_frame section. However, for C++ we emit some functions in
section groups, and the SysV ABI has some rules to make it easier to remove
these sections
(http://www.sco.com/developers/gabi/latest/ch4.sheader.html#section_group_rules):

  A symbol table entry with STB_LOCAL binding that is defined relative to one
  of a group's sections, and that is contained in a symbol table section that is
  not part of the group, must be discarded if the group members are discarded.
  References to this symbol table entry from outside the group are not allowed.

This means that we need to use the function symbol for the relocation, not a
temporary symbol.

There was a comment in the code claiming that the local symbol was used to
avoid creating a relocation, but a relocation must be created anyway as the
code and CFI are in different sections.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221150 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-03 12:02:51 +00:00
David Blaikie
c70aecad29 Sink range list handling down from DwarfUnit into its only use, in DwarfCompileUnit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221123 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-03 02:41:49 +00:00
David Blaikie
e8e0fcf1f3 Formatting
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221095 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-02 08:52:37 +00:00
David Blaikie
67177d320d Add DwarfUnit::isDwoUnit and use it to generalize string creation
Currently we only need to emit skeleton strings into the CU header and
we do this by explicitly calling "addLocalString". With gmlt-in-fission,
we'll be emitting a bunch of other strings from other codepaths where
it's not statically known that these strings will be local or not.

Introduce a virtual function to indicate whether this unit is a DWO unit
or not (I'm not sure if we have a good term for this, the
opposite/alternative to 'skeleton' unit) and use that to generalize the
string emission logic so that strings can be correctly emitted in both
the skeleton and dwo unit when in split dwarf mode.

And to demonstrate that this works, switch the existing special callers
of addLocalString in the skeleton builder to addString - and they still
work. Yay.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221094 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-02 08:51:37 +00:00
David Blaikie
1fcc568ebb Remove the last mention of LineTablesOnly from DwarfUnit, sinking it into DwarfCompileUnit
This is a useful distinction/invariant/delination to make because
LineTablesOnly mode is never relevant to type units, so it's clear that
we're not doing weird line-tables-only-with-types by making this API
choice.

It also lays the foundations nicely for adding gmlt-like data to fission
skeleton CUs while limiting the effects to CUs and not TUs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221093 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-02 08:18:06 +00:00
David Blaikie
c28e37e4dd Sink DwarfUnit::applySubprogramAttributesToDefinition into DwarfCompileUnit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221092 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-02 08:09:09 +00:00
David Blaikie
c821f8794d Sink DwarfUnit::addExpr into DwarfCompileUnit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221090 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-02 07:11:55 +00:00
David Blaikie
3c2838f6ad Fix the build from the last commit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221089 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-02 07:08:12 +00:00
David Blaikie
9aa32f9e1f Sink DwarfUnit::applyVariableAttributes into DwarfCompileUnit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221088 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-02 07:06:51 +00:00
David Blaikie
51af3541a8 Sink DwarfUnit::addLocationList down into DwarfCompileUnit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221087 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-02 07:03:19 +00:00
David Blaikie
1ce60ab99d Sink DwarfUnit::addComplexAddress down into DwarfCompileUnit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221086 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-02 06:58:44 +00:00
David Blaikie
9e4cbe62b1 Push DwarfUnit::addAddress down into DwarfCompileUnit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221085 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-02 06:46:40 +00:00
David Blaikie
f5dd438f80 Sink DwarfUnit::addVariableAddress into DwarfCompileUnit since type units don't have variables
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221084 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-02 06:37:23 +00:00
David Blaikie
21cd65acf4 DebugInfo: Sink accelerator table lists down (GlobalNames/Types) into DwarfCompileUnit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221083 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-02 06:16:39 +00:00
David Blaikie
5ede09079b Add DwarfUnit::addGlobalType to match DwarfUnit::addGlobalName
(these will shortly become virtual, with a null implementation in
DwarfUnit (since type units don't have accelerator tables in the current
schema) and the current implementation down in DwarfCompileUnit, moving
the actual maps there too)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221082 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-02 06:06:14 +00:00
David Blaikie
7f0ed39af9 DebugInfo: Refactor index type DIE initialization by rolling it into the accessor
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221080 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-02 03:09:13 +00:00
David Blaikie
91ff6ebef0 Be sure to initialize DwarfCompileUnit::LabelBegin now that it may be skipped in initSection
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221079 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-02 02:40:26 +00:00
David Blaikie
3ee898c624 Don't bother creating LabelBegin for .dwo units
This would help catch cases where we might otherwise try to reference a
dwo CU label, which would be weird - because without relocations in the
dwo file it's not generally meaningful to talk about the CU offsets
there (or, if it is, we can do so in absolute terms without using a
relocation to compute it).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221078 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-02 02:26:24 +00:00
David Blaikie
d998d1cc56 Drop DwarfCompileUnit::getLocalLabel* in favor of just mapping through the skeleton explicitly.
Confusing to do this two different ways - I'm not too wedded to either
one, but here goes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221076 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-02 01:21:43 +00:00
David Blaikie
da53f1e088 Sink DwarfUnit::LabelBegin down into DwarfCompileUnit since that's the only place it's needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221075 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-02 01:21:40 +00:00
David Blaikie
5e8ee21fb6 Sink dwarf unit length emission down into DwarfUnit::emitHeader
This allows the CU label to be emitted only for compile units, as
they're the only ones that need it (so they can be referenced from
pubnames)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221072 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-01 23:59:23 +00:00
David Blaikie
8ff48760a3 Remove DwarfUnit::LabelEnd in favor of computing the length of the section directly
This was a compile-unit specific label (unused in type units) and seems
unnecessary anyway when we can more easily directly compute the size of
the compile unit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221067 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-01 23:07:14 +00:00
David Blaikie
33e07581b2 Sink DwarfUnit::SectionSym into DwarfCompileUnit as it's only needed/used there.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221062 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-01 20:06:28 +00:00
David Blaikie
b2dae39d05 Make DwarfCompileUnit::Skeleton more narrowly typed (DwarfCompileUnit* instead of DwarfUnit*) now that it's specific to DwarfCompileUnit anyway.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221060 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-01 19:26:05 +00:00
David Blaikie
4e35ac1b48 Sink DwarfUnit::Skeleton down into DwarfCompileUnit
Type units no longer have skeletons and it's misleading to be able to
query for a type unit's skeleton (it might incorrectly lead one to
conclude that if a unit doesn't have a skeleton it's not in a .dwo
file... ).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221055 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-01 18:18:07 +00:00
David Blaikie
153cd65fd4 Sink DwarfDebug::AbstractSPDies down into DwarfFile
This is the first big step to allowing gmlt-like inline scope
information in the skeleton CU. While this commit doesn't change the
functionality, it's only a small step to call
"constructAbstractSubprogramDIE" on both the InfoHolder and the
SkeletonHolder (when in use) and that will at least create the abstract
SP dies in that case, though still not creating the other subprograms.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221051 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-01 17:21:26 +00:00
David Blaikie
db5d201b2a Remove unused function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221037 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-01 01:15:26 +00:00
David Blaikie
b1494f18ec And... fix the build some more.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221036 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-01 01:15:24 +00:00
David Blaikie
a49cbece54 Just iterate the DwarfCompileUnits rather than trying to filter them out of the list of all units.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221034 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-01 01:11:19 +00:00