Rafael Espindola [Mon, 25 May 2015 20:39:23 +0000 (20:39 +0000)]
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
Craig Topper [Mon, 25 May 2015 20:01:18 +0000 (20:01 +0000)]
Use range-based for loops. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238154
91177308-0d34-0410-b5e6-
96231b3b80d8
Bjorn Steinbrink [Mon, 25 May 2015 19:46:38 +0000 (19:46 +0000)]
Remove conflicting attributes before adding deduced readonly/readnone
Summary:
In case of functions that have a pointer argument and only pass it to
each other, the function attributes pass deduces that the pointer should
get the readnone attribute, but fails to remove a readonly attribute
that may already have been present.
Reviewers: nlewycky
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D9995
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238152
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Mon, 25 May 2015 19:12:18 +0000 (19:12 +0000)]
[llvm-readobj/ELF] Teach how to decode DF_1_XXX flags
llvm-readobj -dynamic-table output.
Before:
0x000000006FFFFFFB unknown
After:
0x000000006FFFFFFB FLAGS_1 NOW ORIGIN
Differential Revision: http://reviews.llvm.org/D9958
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238151
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 25 May 2015 18:34:26 +0000 (18:34 +0000)]
Move HasInstructions to MCSection.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238150
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Mon, 25 May 2015 17:49:13 +0000 (17:49 +0000)]
[X86][AVX2] Vectorized i16 shift operators
Part of D9474, this patch extends AVX2 v16i16 types to 2 x 8i32 vectors and uses i32 shift variable shifts before packing back to i16.
Adds AVX2 tests for v8i16 and v16i16
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238149
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Mon, 25 May 2015 16:15:56 +0000 (16:15 +0000)]
R600/SI: Remove some unnecessary patterns from VINTRP multiclass
DisableEncoding and Constraints can be set using let statements around
the multiclass defs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238148
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Mon, 25 May 2015 16:15:54 +0000 (16:15 +0000)]
R600/SI: Fix bug with v_interp_p1_f32 instructions on 16 bank lds chips
The src and dst register cannot be the same on chips with 16 lds banks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238147
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Mon, 25 May 2015 16:15:50 +0000 (16:15 +0000)]
R600/SI: Use NAME rather than opName as the key to the MCOpcode tables
This lets us drop a parameter the opName parameter to the VINTRP
multiclass and makes it possible to create multiple VINTRP defs
with the same asm mnemonic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238146
91177308-0d34-0410-b5e6-
96231b3b80d8
Kit Barton [Mon, 25 May 2015 15:49:26 +0000 (15:49 +0000)]
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
Rafael Espindola [Mon, 25 May 2015 15:04:26 +0000 (15:04 +0000)]
Move bundle info from MCSectionData to MCSection.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238143
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 25 May 2015 14:57:35 +0000 (14:57 +0000)]
Add a isBundleLocked helper to MCELFStreamer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238142
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 25 May 2015 14:25:28 +0000 (14:25 +0000)]
Move LayoutOrder to MCSection.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238141
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 25 May 2015 14:18:24 +0000 (14:18 +0000)]
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
Rafael Espindola [Mon, 25 May 2015 14:12:48 +0000 (14:12 +0000)]
Stop forwarding getOrdinal and setOrdinal.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238139
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 25 May 2015 14:04:31 +0000 (14:04 +0000)]
Use default member initializes. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238138
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 25 May 2015 14:00:56 +0000 (14:00 +0000)]
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
Rafael Espindola [Mon, 25 May 2015 13:50:21 +0000 (13:50 +0000)]
Simplify boolean conditional return statements.
Patch by Richard <legalize@xmission.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238134
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Mon, 25 May 2015 13:28:03 +0000 (13:28 +0000)]
Refactor: Simplify boolean conditional return statements in llvm/lib/DebugInfo/DWARF
Use clang-tidy to simplify boolean conditional return statements. Patch by
Richard Thomson <legalize@xmission.com>!
Differential Revision: http://reviews.llvm.org/D9972
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238132
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Kuperstein [Mon, 25 May 2015 12:35:25 +0000 (12:35 +0000)]
[X86] When pattern-matching scalar FMA3 intrinsics, don't re-arrange the first and second operands.
The semantics of the scalar FMA intrinsics are that the high vector elements are copied from the first source.
The existing pattern switches src1 and src2 around, to match the "213" order, which ends up tying the original src2 to the dest. Since the actual scalar fma3 instructions copy the high elements from the dest register, the wrong values are copied.
This modifies the pattern to leave src1 and src2 in their original order.
Differential Revision: http://reviews.llvm.org/D9908
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238131
91177308-0d34-0410-b5e6-
96231b3b80d8
Elena Demikhovsky [Mon, 25 May 2015 11:33:13 +0000 (11:33 +0000)]
Added promotion to EXTRACT_SUBVECTOR operand.
I encountered with this case in one of KNL tests for i1 vectors.
v16i1 = EXTRACT_SUBVECTOR v32i1, x
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238130
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Mon, 25 May 2015 01:43:34 +0000 (01:43 +0000)]
Reformat.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238126
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Mon, 25 May 2015 01:43:23 +0000 (01:43 +0000)]
Prune CRLFs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238125
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Mon, 25 May 2015 01:00:46 +0000 (01:00 +0000)]
[Unroll] Switch from an eagerly populated SCEV cache to one that is
lazily built.
Also, make it a much more generic SCEV cache, which today exposes only
a reduced GEP model description but could be extended in the future to
do other profitable caching of SCEV information.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238124
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Sun, 24 May 2015 17:03:15 +0000 (17:03 +0000)]
AsmPrinter: Make DIEValue::Ty private, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238123
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Sun, 24 May 2015 16:58:59 +0000 (16:58 +0000)]
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
Duncan P. N. Exon Smith [Sun, 24 May 2015 16:54:59 +0000 (16:54 +0000)]
AsmPrinter: Prune an include, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238121
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Sun, 24 May 2015 16:51:29 +0000 (16:51 +0000)]
AsmPrinter: Remove dead code, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238120
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Sun, 24 May 2015 16:48:54 +0000 (16:48 +0000)]
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
Duncan P. N. Exon Smith [Sun, 24 May 2015 16:44:32 +0000 (16:44 +0000)]
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
Duncan P. N. Exon Smith [Sun, 24 May 2015 16:40:47 +0000 (16:40 +0000)]
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
Duncan P. N. Exon Smith [Sun, 24 May 2015 16:33:33 +0000 (16:33 +0000)]
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
Duncan P. N. Exon Smith [Sun, 24 May 2015 16:14:59 +0000 (16:14 +0000)]
AsmPrinter: Emit the DwarfStringPool offset directly when possible
Change `DwarfStringPool` to calculate byte offsets on-the-fly, and
update `DwarfUnit::getLocalString()` to use a `DIEInteger` instead of a
`DIEDelta` when Dwarf doesn't use relocations (i.e., Mach-O). This
eliminates another call to `EmitLabelDifference()`, and drops memory
usage from 865 MB down to 861 MB, around 0.5%.
(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@238114
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Sun, 24 May 2015 16:10:35 +0000 (16:10 +0000)]
DebugInfo: Clarify test/DebugInfo/X86/stmt-list-multiple-compile-units.ll
This test was relying on the numbering of preceding .set directives, but
an upcoming commit is going to remove some of them. Make the CHECKs
more nuanced.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238113
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Sun, 24 May 2015 16:06:08 +0000 (16:06 +0000)]
AsmPrinter: Refactor DwarfStringPool::getEntry(), NFC
Move `DwarfStringPool`'s `getEntry()` to the header (and make it a
member function) in preparation for calculating symbol offsets
on-the-fly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238112
91177308-0d34-0410-b5e6-
96231b3b80d8
Vince Harron [Sun, 24 May 2015 13:24:31 +0000 (13:24 +0000)]
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
Renato Golin [Sun, 24 May 2015 11:18:44 +0000 (11:18 +0000)]
Move parseSubArch to ARMTargetParser. NFC
Using getCanonicalArchName() is the right way to parse ARM arch names.
Mapping ARMTargetParser IDs to Triple Arch IDs is temporary, until they
are merged into a TargetDescription class.
This was the last LLVM FIXME to move things to ARMTargetParser. Now on
to Clang and beyond.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238110
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Sun, 24 May 2015 00:51:27 +0000 (00:51 +0000)]
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
Davide Italiano [Sat, 23 May 2015 23:08:28 +0000 (23:08 +0000)]
[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
Benjamin Kramer [Sat, 23 May 2015 17:20:53 +0000 (17:20 +0000)]
Bump SmallString to the minimum required amount for raw_ostream to avoid allocation.
NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238104
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 23 May 2015 16:53:07 +0000 (16:53 +0000)]
[Mips] Prefer Twine::utohexstr over utohexstr, saves a string copy.
NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238103
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 23 May 2015 16:39:10 +0000 (16:39 +0000)]
[AArch64] Clean up the ELF streamer a bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238102
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 23 May 2015 16:15:10 +0000 (16:15 +0000)]
[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
Aaron Ballman [Sat, 23 May 2015 14:46:49 +0000 (14:46 +0000)]
Silencing a spurious -Wreturn-type warning; NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238099
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Sat, 23 May 2015 12:18:10 +0000 (12:18 +0000)]
[PowerPC] Fix fast-isel when compare is split from branch
When the compare feeding a branch was in a different BB from the branch, we'd
try to "regenerate" the compare in the block with the branch, possibly trying
to make use of values not available there. Copy a page from AArch64's play book
here to fix the problem (at least in terms of correctness).
Fixes PR23640.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238097
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Sat, 23 May 2015 10:44:30 +0000 (10:44 +0000)]
Update ExecutionEngine/LLVMBuild.txt, to add LLVMCodeGen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238096
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 23 May 2015 08:45:10 +0000 (08:45 +0000)]
Give more meaningful names than I and J to some for loop variables after converting to range-based loops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238095
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 23 May 2015 08:20:33 +0000 (08:20 +0000)]
Fix an unused variable warning in release builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238094
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 23 May 2015 08:01:41 +0000 (08:01 +0000)]
Use range-based for loops. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238093
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Sat, 23 May 2015 02:12:05 +0000 (02:12 +0000)]
[lib/Fuzzer] doxygen-ify the comments for the user interface
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238086
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Sat, 23 May 2015 01:45:07 +0000 (01:45 +0000)]
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
Duncan P. N. Exon Smith [Sat, 23 May 2015 01:26:26 +0000 (01:26 +0000)]
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
Kostya Serebryany [Sat, 23 May 2015 01:22:35 +0000 (01:22 +0000)]
[lib/Fuzzer] fully get rid of std::cerr in libFuzzer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238081
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Sat, 23 May 2015 01:14:08 +0000 (01:14 +0000)]
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
Akira Hatanaka [Sat, 23 May 2015 01:12:26 +0000 (01:12 +0000)]
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
Kostya Serebryany [Sat, 23 May 2015 01:07:46 +0000 (01:07 +0000)]
[lib/Fuzzer] start getting rid of std::cerr. Sadly, these parts of C++ library used in libFuzzer badly interract with the same code used in the target function and also with dfsan. It's easier to just not use std::cerr than to defeat these issues.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238078
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Sat, 23 May 2015 00:31:56 +0000 (00:31 +0000)]
Remove unnecessary command line option "-disable-fp-elim".
This option currently has no effect as function attribute
"no-frame-pointer-elim=false" overrides it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238077
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Sat, 23 May 2015 00:22:44 +0000 (00:22 +0000)]
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
Philip Reames [Sat, 23 May 2015 00:05:43 +0000 (00:05 +0000)]
Correct a mistaken comment from 238071 [NFC]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238074
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 22 May 2015 23:58:30 +0000 (23:58 +0000)]
Produce a single string table in a ELF .o
Normally an ELF .o has two string tables, one for symbols, one for section
names.
With the scheme of naming sections like ".text.foo" where foo is a symbol,
there is a big potential saving in using a single one.
Building llvm+clang+lld with master and with this patch the results were:
master: 193,267,008 bytes
patch: 186,107,952 bytes
master non unique section names: 183,260,192 bytes
patch non unique section names: 183,118,632 bytes
So using non usique saves 10,006,816 bytes, and the patch saves 7,159,056 while
still using distinct names for the sections.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238073
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Fri, 22 May 2015 23:53:24 +0000 (23:53 +0000)]
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
David Majnemer [Fri, 22 May 2015 23:02:11 +0000 (23:02 +0000)]
[InstCombine] Don't eagerly propagate nsw for A*B+A*C => A*(B+C)
InstCombine transforms A *nsw B +nsw A *nsw C to A *nsw (B + C).
This is incorrect -- e.g. if A = -1, B = 1, C = INT_SMAX. Then
nothing in the LHS overflows, but the multiplication in RHS overflows.
We need to first make sure that we won't multiple by INT_SMAX + 1.
Test case `add_of_mul` contributed by Sanjoy Das.
This fixes PR23635.
Differential Revision: http://reviews.llvm.org/D9629
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238066
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Fri, 22 May 2015 22:47:03 +0000 (22:47 +0000)]
[lib/Fuzzer] remove -use_coverage_pairs=1, an experimental feature that is unlikely to ever scale
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238063
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Fri, 22 May 2015 22:43:05 +0000 (22:43 +0000)]
[lib/Fuzzer] mention the user-supplied mutators
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238062
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Fri, 22 May 2015 22:35:31 +0000 (22:35 +0000)]
[lib/Fuzzer] extend the fuzzer interface to allow user-supplied mutators
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238059
91177308-0d34-0410-b5e6-
96231b3b80d8
Ahmed Bougacha [Fri, 22 May 2015 21:37:17 +0000 (21:37 +0000)]
[AArch64][CGP] Sink zext feeding stxr/stlxr into the same block.
The usual CodeGenPrepare trickery, on a target-specific intrinsic.
Without this, the expansion of atomics will usually have the zext
be hoisted out of the loop, defeating the various patterns we have
to catch this precise case.
Differential Revision: http://reviews.llvm.org/D9930
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238054
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 22 May 2015 21:37:13 +0000 (21:37 +0000)]
Relax these tests a bit.
It is not relevant where in the string table the name is located.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238053
91177308-0d34-0410-b5e6-
96231b3b80d8
Ahmed Bougacha [Fri, 22 May 2015 21:35:14 +0000 (21:35 +0000)]
[AArch64] Robustize atomic cmpxchg test a little more. NFC.
We changed the test to test non-constant values in r238049.
We can also use CHECK-NEXT to be a little stricter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238052
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Fri, 22 May 2015 21:10:06 +0000 (21:10 +0000)]
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
Ahmed Bougacha [Fri, 22 May 2015 21:08:15 +0000 (21:08 +0000)]
[AArch64] Robustize atomic cmpxchg test. NFC.
Constants are easy to get right the wrong way.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238049
91177308-0d34-0410-b5e6-
96231b3b80d8
Renato Golin [Fri, 22 May 2015 20:43:30 +0000 (20:43 +0000)]
Reinforce ARMTargetParser::getCanonicalArchName validation
Before, getCanonicalArchName was relying on parseArch() to validate the arch
name, which was a problem when other methods, that also needed to call it,
were duplicating the steps.
But to dissociate getCanonicalArchName from parseArch, we needed to make
getCanonicalArchName more robust in detecting valid arch names. It's still
not perfect, but will do for the time being, until we merge Triple with
TargetParser into a TargetDescription mega class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238047
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Fri, 22 May 2015 20:07:34 +0000 (20:07 +0000)]
Use new MachineInstr mayLoadOrStore() API. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238044
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexei Starovoitov [Fri, 22 May 2015 18:47:33 +0000 (18:47 +0000)]
[bpf] emit jmp fixups in little endian
The 'off' field of 'struct bpf_insn' is in cpu-endianness,
since the rest is emitted as little endian, make sure
that 'off' field is little endian as well.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238038
91177308-0d34-0410-b5e6-
96231b3b80d8
Renato Golin [Fri, 22 May 2015 18:17:55 +0000 (18:17 +0000)]
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
Quentin Colombet [Fri, 22 May 2015 18:10:47 +0000 (18:10 +0000)]
Reapply r238011 with a fix for the trap instruction.
The problem was that I slipped a change required for shrink-wrapping, namely I
used getFirstTerminator instead of the getLastNonDebugInstr that was here before
the refactoring, whereas the surrounding code is not yet patched for that.
Original message:
[X86] Refactor the prologue emission to prepare for shrink-wrapping.
- Add a late pass to expand pseudo instructions (tail call and EH returns).
Instead of doing it in the prologue emission.
- Factor some static methods in X86FrameLowering to ease code sharing.
NFC.
Related to <rdar://problem/
20821487>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238035
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 22 May 2015 17:41:35 +0000 (17:41 +0000)]
[Unroll] Separate the logic for testing each iteration of the loop,
accumulating estimated cost, and other loop-centric logic from the logic
used to analyze instructions in a particular iteration.
This makes the visitor very narrow in scope -- all it does is visit
instructions, update a map of simplified values, and return whether it
is able to optimize away a particular instruction.
The two cost metrics are now returned as an optional struct. When the
optional is left unengaged, there is no information about the unrolled
cost of the loop, when it is engaged the cost metrics are available to
run against the thresholds.
No functionality changed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238033
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Schmidt [Fri, 22 May 2015 16:44:10 +0000 (16:44 +0000)]
[PPC64] Add support for clrbhrb, mfbhrbe, rfebb.
This patch adds support for the ISA 2.07 additions involving the
branch history rolling buffer and event-based branching. These will
not be used by typical applications, so built-in support is not
required. They will only be available via inline assembly.
Assembly/disassembly tests are included in the patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238032
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 22 May 2015 15:43:00 +0000 (15:43 +0000)]
Stop inventing symbol sizes.
MachO and COFF quite reasonably only define the size for common symbols.
We used to try to figure out the "size" by computing the gap from one symbol to
the next.
This would not be correct in general, since a part of a section can belong to no
visible symbol (padding, private globals).
It was also really expensive, since we would walk every symbol to find the size
of one.
If a caller really wants this, it can sort all the symbols once and get all the
gaps ("size") in O(n log n) instead of O(n^2).
On MachO this also has the advantage of centralizing all the checks for an
invalid n_sect.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238028
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Fri, 22 May 2015 15:38:24 +0000 (15:38 +0000)]
remove names from comments, fix typos; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238027
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Fri, 22 May 2015 15:32:33 +0000 (15:32 +0000)]
fix typo, 80-col; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238026
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Fri, 22 May 2015 15:31:47 +0000 (15:31 +0000)]
fix typo in comment; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238025
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 22 May 2015 14:59:27 +0000 (14:59 +0000)]
Detect invalid section indexes when we first read them.
We still detect the same errors, but now we do it earlier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238024
91177308-0d34-0410-b5e6-
96231b3b80d8
John Brawn [Fri, 22 May 2015 14:16:22 +0000 (14:16 +0000)]
[ARM] Fix typo in subtarget feature list for 7em triple
The list of subtarget features for the 7em triple contains 't2xtpk',
which actually disables that subtarget feature. Correct that to
'+t2xtpk' and test that the instructions enabled by that feature do
actually work.
Differential Revision: http://reviews.llvm.org/D9936
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238022
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 22 May 2015 13:28:35 +0000 (13:28 +0000)]
Fix llvm-nm -S option.
It is explicitly documented to have no effect on object formats where symbols
don't have sizes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238019
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 22 May 2015 13:17:31 +0000 (13:17 +0000)]
Make this test stricter. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238018
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Fri, 22 May 2015 10:11:07 +0000 (10:11 +0000)]
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
Tamas Berghammer [Fri, 22 May 2015 10:01:56 +0000 (10:01 +0000)]
Revert "[X86] Fix a variable name for r237977 so that it works with every compilers."
Revert "[X86] Refactor the prologue emission to prepare for shrink-wrapping."
This reverts commit
6b3b93fc8b68a2c806aa992ee4bd3d7f61898d4b.
This reverts commit
ab0b15dff8539826283a59c2dd700a18a9680e0f.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238011
91177308-0d34-0410-b5e6-
96231b3b80d8
Puyan Lotfi [Fri, 22 May 2015 08:11:26 +0000 (08:11 +0000)]
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
NAKAMURA Takumi [Fri, 22 May 2015 07:17:07 +0000 (07:17 +0000)]
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
Duncan P. N. Exon Smith [Fri, 22 May 2015 06:04:42 +0000 (06:04 +0000)]
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
Tobias Grosser [Fri, 22 May 2015 06:01:04 +0000 (06:01 +0000)]
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
Duncan P. N. Exon Smith [Fri, 22 May 2015 05:59:05 +0000 (05:59 +0000)]
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
Duncan P. N. Exon Smith [Fri, 22 May 2015 05:54:01 +0000 (05:54 +0000)]
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
NAKAMURA Takumi [Fri, 22 May 2015 05:52:50 +0000 (05:52 +0000)]
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
Duncan P. N. Exon Smith [Fri, 22 May 2015 05:45:19 +0000 (05:45 +0000)]
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
Duncan P. N. Exon Smith [Fri, 22 May 2015 05:35:53 +0000 (05:35 +0000)]
SDAG: Cleanup initialization of SDDbgValue, NFC
Cleanup how `SDDbgValue` is initialized, and rearrange the fields to
save two pointers in the struct layout. No real functionality change
though (and I doubt the memory savings would show up in a profile).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237997
91177308-0d34-0410-b5e6-
96231b3b80d8
Tobias Grosser [Fri, 22 May 2015 05:33:54 +0000 (05:33 +0000)]
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
David Majnemer [Fri, 22 May 2015 03:56:46 +0000 (03:56 +0000)]
[InstSimplify] Handle some overflow intrinsics in InstSimplify
This change does a few things:
- Move some InstCombine transforms to InstSimplify
- Run SimplifyCall from within InstCombine::visitCallInst
- Teach InstSimplify to fold [us]mul_with_overflow(X, undef) to 0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237995
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 22 May 2015 03:07:28 +0000 (03:07 +0000)]
[Unroll] Replace a hand-wavy FIXME with a FIXME that explains the actual
problem instead of suggesting doing something that is trivial to do but
incorrect given the current design of the libraries.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237994
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 22 May 2015 03:02:22 +0000 (03:02 +0000)]
[Unroll] Extract the logic for caching SCEV-modeled GEPs with their
simplified model for use simulating each iteration into a separate
helper function that just returns the cache.
Building this cache had nothing to do with the rest of the unroll
analysis and so this removes an unnecessary coupling, etc. It should
also make it easier to think about the concept of providing fast cached
access to basic SCEV models as an orthogonal concept to the overall
unroll simulation.
I'd really like to see this kind of caching logic folded into SCEV
itself, it seems weird for us to provide it at this layer rather than
making repeated queries into SCEV fast all on their own.
No functionality changed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237993
91177308-0d34-0410-b5e6-
96231b3b80d8