Commit Graph

23713 Commits

Author SHA1 Message Date
Rafael Espindola
504473e6ae Stop using MCSectionData in MCExpr.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238163 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 00:52:18 +00:00
Rafael Espindola
f363960679 Return a MCSection from MCFragment::getParent().
Another step in merging MCSectionData and MCSection.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238162 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 00:36:57 +00:00
Rafael Espindola
68e7d22de4 Store a MCSection in MCFragment.
Part of the work to merge MCSectionData into MCSection.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238160 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-25 23:48:22 +00:00
Rafael Espindola
e86bc46939 Turn MCSectionData into a field of MCSection.
This also changes MCAssembler to store a vector of MCSections instead of an
iplist of MCSectionData.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238159 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-25 23:14:17 +00:00
Rafael Espindola
5e435847b0 Move MCSectionData to MCSection.h.
Another step in merging MCSectionData and MCSection.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238158 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-25 22:57:48 +00:00
Rafael Espindola
50c2fe1d5c Remove dead code. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238157 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-25 22:07:33 +00:00
Rafael Espindola
0d46e8a420 Insert MCSectionData into the section list directly in getOrCreateSectionData.
Removing the logic from the constructor will make it easier to merge
MCSectionData and MCSection.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238155 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-25 20:39:23 +00:00
Rafael Espindola
712c27f870 Move HasInstructions to MCSection.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238150 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-25 18:34:26 +00:00
Kit Barton
948ecae20e This patch adds support for the vector quadword add/sub instructions introduced
in POWER8:

vadduqm
vaddeuqm
vaddcuq
vaddecuq
vsubuqm
vsubeuqm
vsubcuq
vsubecuq
In addition to adding the instructions themselves, it also adds support for the
v1i128 type for intrinsics (Intrinsics.td, Function.cpp, and
IntrinsicEmitter.cpp).

http://reviews.llvm.org/D9081


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238144 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-25 15:49:26 +00:00
Rafael Espindola
68c5b83e12 Move bundle info from MCSectionData to MCSection.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238143 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-25 15:04:26 +00:00
Rafael Espindola
63b75630b4 Add a isBundleLocked helper to MCELFStreamer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238142 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-25 14:57:35 +00:00
Rafael Espindola
b3eb86c875 Move LayoutOrder to MCSection.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238141 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-25 14:25:28 +00:00
Rafael Espindola
6cd7f1bca6 Use a simple initial value for the ordinal.
The odd value was only used by the ELF writer to check if the section was one
that it had created.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238140 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-25 14:18:24 +00:00
Rafael Espindola
8823110a85 Stop forwarding getOrdinal and setOrdinal.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238139 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-25 14:12:48 +00:00
Rafael Espindola
98e5e8e3f6 Use default member initializes. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238138 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-25 14:04:31 +00:00
Rafael Espindola
84ff6c4ce7 Move Ordinal from MCSectionData to MCSection. NFC.
Part of the work to merge MCSectionData and MCSection.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238137 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-25 14:00:56 +00:00
NAKAMURA Takumi
f61fb0c9a7 Prune CRLFs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238125 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-25 01:43:23 +00:00
Duncan P. N. Exon Smith
8ef4be78cd AsmPrinter: Make DIEValue::Ty private, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238123 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-24 17:03:15 +00:00
Duncan P. N. Exon Smith
518dcb905e AsmPrinter: Avoid creating symbols in DwarfStringPool
Stop creating symbols we don't need in `DwarfStringPool`.  The consumers
only call `DwarfStringPoolEntryRef::getSymbol()` when DWARF is
relocatable, so this just stops creating the unused symbols when it's
not.  This drops memory usage from 851 MB to 845 MB, around 0.7%.

(I'm looking at `llc` memory usage on `verify-uselistorder.lto.opt.bc`;
see r236629 for details.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238122 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-24 16:58:59 +00:00
Duncan P. N. Exon Smith
9ec6380779 AsmPrinter: Avoid EmitLabelDifference() in DwarfAccelTable
Mint a new function, `AsmPrinter::emitDwarfStringOffset()`, which takes
a `DwarfStringPoolEntryRef`.  When DWARF is relocatable across sections,
this defers to `emitSectionOffset()` and emits the `MCSymbol`;
otherwise, just emit the offset directly, without using any intermediate
symbols.

`EmitLabelDifference()` is already optimized to emit absolute label
differences cheaply when possible, so there aren't any major memory
savings here (853 MB down to 851 MB, or 0.2%).  However, it prepares for
making the `MCSymbol`s in the `DwarfStringPool` optional.

(I'm looking at `llc` memory usage on `verify-uselistorder.lto.opt.bc`;
see r236629 for details.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238119 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-24 16:48:54 +00:00
Duncan P. N. Exon Smith
3755781deb AsmPrinter: Use DwarfStringPoolEntry in DwarfAccelTable, NFC
This is just an API change, but it prepares to stop using
`EmitLabelDifference()` when possible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238118 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-24 16:44:32 +00:00
Duncan P. N. Exon Smith
24ad5c9e05 AsmPrinter: Make DIEString small
Expose the `DwarfStringPool` entry in a header, and store a pointer to
it directly in `DIEString`.  Instead of choosing at creation time how to
emit it, use the `dwarf::Form` to determine that at emission time.
Besides avoiding the other `DIEValue`, this shaves two pointers off of
`DIEString`; the data is now a single pointer.  This is a nice cleanup
on its own -- and drops memory usage from 861 MB down to 853 MB, around
0.9% -- but it's also preparation for passing `DIEValue`s by value.

(I'm looking at `llc` memory usage on `verify-uselistorder.lto.opt.bc`;
see r236629 for details.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238117 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-24 16:40:47 +00:00
Duncan P. N. Exon Smith
1717728066 AsmPrinter: Extract DwarfStringPoolEntry from DwarfStringPool, NFC
Extract out `DwarfStringPoolEntry` and `DwarfStringPoolRef` from
`DwarfStringPool` so that downstream users can start using
`DwarfStringPool::getEntry()` directly.  This will allow users to delay
the decision between emitting a symbol or an offset until later.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238116 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-24 16:33:33 +00:00
Vince Harron
556ca517ab Remove log2 dependency when building against Android API-9 SDK
Android's API-9 SDK is missing log2 builtins. A previous commit added
support for building against this API revision but this requires log2l
to be present.  (And it doesn't seem to be defined, despite being in
the headers.)

Author: pasaulais (Pierre-Andre Saulais)

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238111 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-24 13:24:31 +00:00
Matt Arsenault
f44ed0919c Add target hook to allow merging stores of nonzero constants
On GPU targets, materializing constants is cheap and stores are
expensive, so only doing this for zero vectors was silly.

Most of the new testcases aren't optimally merged, and are for
later improvements.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238108 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-24 00:51:27 +00:00
Davide Italiano
c009e842cb [Support/ELF] Add missing DF_1_XXX bits.
In preparation for adding support for decoding DF_FLAGS_1 to
llvm-readobj.

Differential Revision:	http://reviews.llvm.org/D9955
Reviewed by:	echristo


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238107 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-23 23:08:28 +00:00
Benjamin Kramer
24b6dadf2d [AArch64] Move AArch64TargetStreamer out of MCStreamer.h
It doesn't belong in the shared MC layer. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238101 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-23 16:15:10 +00:00
Duncan P. N. Exon Smith
b5f8c9b2ec AsmPrinter: Remove the vtable-entry from DIEValue
Remove all virtual functions from `DIEValue`, dropping the vtable
pointer from its layout.  Instead, create "impl" functions on the
subclasses, and use the `DIEValue::Type` to implement the dynamic
dispatch.

This is necessary -- obviously not sufficient -- for passing `DIEValue`s
around by value.  However, this change stands on its own: we make tons
of these.  I measured a drop in memory usage from 888 MB down to 860 MB,
or around 3.2%.

(I'm looking at `llc` memory usage on `verify-uselistorder.lto.opt.bc`;
see r236629 for details.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238084 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-23 01:45:07 +00:00
Duncan P. N. Exon Smith
804c199b75 CodeGen: Remove redundant DIETypeSignature::dump(), NFC
We already have this in `DIEValue`; no reason to shadow it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238082 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-23 01:26:26 +00:00
Akira Hatanaka
01461204b3 Stop resetting NoFramePointerElim in TargetMachine::resetTargetOptions.
This is part of the work to remove TargetMachine::resetTargetOptions.

In this patch, instead of updating global variable NoFramePointerElim in
resetTargetOptions, its use in DisableFramePointerElim is replaced with a call
to TargetFrameLowering::noFramePointerElim. This function determines on a
per-function basis if frame pointer elimination should be disabled.

There is no change in functionality except that cl:opt option "disable-fp-elim"
can now override function attribute "no-frame-pointer-elim". 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238080 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-23 01:14:08 +00:00
Akira Hatanaka
c17da7166d Simplify and rename function overrideFunctionAttributes. NFC.
This is in preparation to making changes needed to stop resetting
NoFramePointerElim in resetTargetOptions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238079 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-23 01:12:26 +00:00
Rafael Espindola
58bf2827d3 Revert "make reciprocal estimate code generation more flexible by adding command-line options"
This reverts commit r238051.

It broke some bots:

http://lab.llvm.org:8011/builders/llvm-ppc64-linux1/builds/18190

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238075 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-23 00:22:44 +00:00
Philip Reames
e00c0df2c4 Extend EarlyCSE to handle basic cases from JumpThreading and CVP
This patch extends EarlyCSE to take advantage of the information that a controlling branch gives us about the value of a Value within this and dominated basic blocks. If the current block has a single predecessor with a controlling branch, we can infer what the branch condition must have been to execute this block. The actual change to support this is downright simple because EarlyCSE's existing scoped hash table logic deals with most of the complexity around merging.

The patch actually implements two optimizations.
1) The first is analogous to JumpThreading in that it enables EarlyCSE's CSE handling to fold branches which are exactly redundant due to a previous branch to branches on constants. (It doesn't actually replace the branch or change the CFG.) This is pretty clearly a win since it enables substantial CFG simplification before we start trying to inline.
2) The second is analogous to CVP in that it exploits the knowledge gained to replace dominated *uses* of the original value. EarlyCSE does not otherwise reason about specific uses, so this is the more arguable one. It does enable further simplication and constant folding within the rest of the visit by EarlyCSE.

In both cases, the added code only handles the easy dominance based case of each optimization. The general case is deferred to the existing passes.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238071 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-22 23:53:24 +00:00
Sanjay Patel
7e80a67d35 make reciprocal estimate code generation more flexible by adding command-line options
This patch adds a class for processing many recip codegen possibilities.
The TargetRecip class is intended to handle both command-line options to llc as well
as options passed in from a front-end such as clang with the -mrecip option.

The x86 backend is updated to use the new functionality.
Only -mcpu=btver2 with -ffast-math should see a functional change from this patch.
All other CPUs continue to *not* use reciprocal estimates by default with -ffast-math.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238051 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-22 21:10:06 +00:00
Renato Golin
84b1a805bb Adding profile and version parsers to ARMTargetParser
This allows us to match armv6m to default to thumb, but will also be used by
Clang's driver and remove the current incomplete copy in it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238036 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-22 18:17:55 +00:00
Sanjay Patel
08bac7b901 remove names from comments, fix typos; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238027 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-22 15:38:24 +00:00
Sanjay Patel
3e785f0ec1 fix typo, 80-col; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238026 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-22 15:32:33 +00:00
Sanjay Patel
27b0e0b7de fix typo in comment; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238025 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-22 15:31:47 +00:00
NAKAMURA Takumi
25103832b2 Reapply part of r237975, "Fix Clang -Wmissing-override warning", except for DIContext.h, to apease g++-4.7.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238012 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-22 10:11:07 +00:00
Puyan Lotfi
d9a08b08ac Compile time improvements to VirtRegRewriter.
This change to VirtRegRewriter::addMBBLiveIns adds live-in registers for each
MachineBasicBlock's LiveIns set without isLiveIn checks as they are being added
because doing so is expensive. After all live-in registers are added, the LiveIn
vectors are sorted and uniqued.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238008 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-22 08:11:26 +00:00
NAKAMURA Takumi
b6b98c12d5 Revert r237954, "Resubmit r237708 (MIR Serialization: print and parse LLVM IR using MIR format)."
It brought cyclic dependencies between LLVMCodeGen and LLVMMIR.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238007 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-22 07:17:07 +00:00
Duncan P. N. Exon Smith
f5e0674d06 MC: Shave a pointer off of MCSymbol::Name
Shave a pointer off of `MCSymbolName` by storing `StringMapEntry<bool>*`
instead of `StringRef`.  This brings `sizeof(MCSymbol)` down to 64 on
64-bit platforms, a nice round number.  My profile showed memory
dropping from 914 MB down to 908 MB, roughly 0.7%.  Other than memory
usage, no functionality change here.

(I'm looking at `llc` memory usage on `verify-uselistorder.lto.opt.bc`;
see r236629 for details.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238005 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-22 06:04:42 +00:00
Tobias Grosser
b7888bd5ea Revert "Fix Clang -Wmissing-override warning"
This reverts commit r237975. This seems also to break with gcc 4.7

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238004 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-22 06:01:04 +00:00
Duncan P. N. Exon Smith
005bf5f8b0 MC: Pack MCSymbol::Index in with the bitfield in MCSymbol
Save a pointer for each `MCSymbol`, bringing `llc` memory usage down
from 920 MB to 914 MB, around ~0.6%.

(I'm looking at `llc` memory usage on `verify-uselistorder.lto.opt.bc`;
see r236629 for details.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238003 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-22 05:59:05 +00:00
Duncan P. N. Exon Smith
6c3a7cbe54 MC: Lift MCSymbolData::Index up to MCSymbol::Index, NFC
Lift `MCSymbolData::Index` up a level to `MCSymbol`, as preparation for
packing it into the bitfield in `MCSymbol`.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238001 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-22 05:54:01 +00:00
NAKAMURA Takumi
117f3a66e8 Revert part of r237975, "Fix Clang -Wmissing-override warning" in DIContext.h, to appease g++-4.7.
llvm/include/llvm/DebugInfo/DIContext.h:144:11: error:   overriding ‘virtual llvm::LoadedObjectInfo::~LoadedObjectInfo() noexcept (true)’

It seems the destructor in the base class may not be "default".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238000 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-22 05:52:50 +00:00
Duncan P. N. Exon Smith
ec8c491a06 SDAG: Give SDDbgValues their own allocator (and reset it)
Previously `SDDbgValue`s used the general allocator that lives for all
of `SelectionDAG`.  Instead, give them their own allocator, and reset it
whenever `SDDbgInfo::clear()` is called, plugging a spiritual leak.

This drops `SelectionDAGBuilder::visitIntrinsicCall()` off of my heap
profile (was at around 2% of `llc` for codegen of `-flto -g`).  Thanks
to Pete Cooper for spotting the problem and suggesting the fix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237998 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-22 05:45:19 +00:00
Tobias Grosser
82967c0bcd Revert "unique_ptrify LoadedObjectInfo::clone"
This reverts commit r237976, which seems to break existing gcc 4.7 buildbots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237996 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-22 05:33:54 +00:00
David Blaikie
fcf7993d4a unique_ptrify LoadedObjectInfo::clone
As noted in the original review, this is unused in tree & is used by
Julia... that's problematic. This API coudl easily be deleted/modified
by accident without any validation that it remains correct.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237976 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-22 00:05:05 +00:00
David Blaikie
a89d43a2ce Fix Clang -Wmissing-override warning
& remove the duplication by introducing a CRTP base to implement the
clone behavior.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237975 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-22 00:00:00 +00:00