platform/upstream/llvm.git
9 years agoCall the destructors of the MCSections.
Rafael Espindola [Tue, 26 May 2015 00:32:28 +0000 (00:32 +0000)]
Call the destructors of the MCSections.

They now contain the fragments. If we don't call the destructors the
fragments leak.

Found by an asan bot.

llvm-svn: 238161

9 years agoStore a MCSection in MCFragment.
Rafael Espindola [Mon, 25 May 2015 23:48:22 +0000 (23:48 +0000)]
Store a MCSection in MCFragment.

Part of the work to merge MCSectionData into MCSection.

llvm-svn: 238160

9 years agoTurn MCSectionData into a field of MCSection.
Rafael Espindola [Mon, 25 May 2015 23:14:17 +0000 (23:14 +0000)]
Turn MCSectionData into a field of MCSection.

This also changes MCAssembler to store a vector of MCSections instead of an
iplist of MCSectionData.

llvm-svn: 238159

9 years agoMove MCSectionData to MCSection.h.
Rafael Espindola [Mon, 25 May 2015 22:57:48 +0000 (22:57 +0000)]
Move MCSectionData to MCSection.h.

Another step in merging MCSectionData and MCSection.

llvm-svn: 238158

9 years agoRemove dead code. NFC.
Rafael Espindola [Mon, 25 May 2015 22:07:33 +0000 (22:07 +0000)]
Remove dead code. NFC.

llvm-svn: 238157

9 years agoMake a few MCSectionELF& variables const. NFC.
Rafael Espindola [Mon, 25 May 2015 21:56:55 +0000 (21:56 +0000)]
Make a few MCSectionELF& variables const. NFC.

This just reduces the noise from another patch.

llvm-svn: 238156

9 years agoInsert MCSectionData into the section list directly in getOrCreateSectionData.
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.

llvm-svn: 238155

9 years agoUse range-based for loops. NFC.
Craig Topper [Mon, 25 May 2015 20:01:18 +0000 (20:01 +0000)]
Use range-based for loops. NFC.

llvm-svn: 238154

9 years agofixed missed arch renaming (from C.Bergstrom)
Andrey Churbanov [Mon, 25 May 2015 20:01:16 +0000 (20:01 +0000)]
fixed missed arch renaming (from C.Bergstrom)

llvm-svn: 238153

9 years agoRemove conflicting attributes before adding deduced readonly/readnone
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

llvm-svn: 238152

9 years ago[llvm-readobj/ELF] Teach how to decode DF_1_XXX flags
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

llvm-svn: 238151

9 years agoMove HasInstructions to MCSection.
Rafael Espindola [Mon, 25 May 2015 18:34:26 +0000 (18:34 +0000)]
Move HasInstructions to MCSection.

llvm-svn: 238150

9 years ago[X86][AVX2] Vectorized i16 shift operators
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

llvm-svn: 238149

9 years agoR600/SI: Remove some unnecessary patterns from VINTRP multiclass
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.

llvm-svn: 238148

9 years agoR600/SI: Fix bug with v_interp_p1_f32 instructions on 16 bank lds chips
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.

llvm-svn: 238147

9 years agoR600/SI: Use NAME rather than opName as the key to the MCOpcode tables
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.

llvm-svn: 238146

9 years agoThis patch adds support for the vector quadword add/sub instructions introduced
Kit Barton [Mon, 25 May 2015 15:52:45 +0000 (15:52 +0000)]
This patch adds support for the vector quadword add/sub instructions introduced
in POWER8.

These are the Clang-related changes for http://reviews.llvm.org/D9081

vadduqm
vaddeuqm
vaddcuq
vaddecuq
vsubuqm
vsubeuqm
vsubcuq
vsubecuq
All builtins are added in altivec.h, and guarded with the POWER8_VECTOR and
powerpc64 macros.

http://reviews.llvm.org/D9903

llvm-svn: 238145

9 years agoThis patch adds support for the vector quadword add/sub instructions introduced
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

llvm-svn: 238144

9 years agoMove bundle info from MCSectionData to MCSection.
Rafael Espindola [Mon, 25 May 2015 15:04:26 +0000 (15:04 +0000)]
Move bundle info from MCSectionData to MCSection.

llvm-svn: 238143

9 years agoAdd a isBundleLocked helper to MCELFStreamer.
Rafael Espindola [Mon, 25 May 2015 14:57:35 +0000 (14:57 +0000)]
Add a isBundleLocked helper to MCELFStreamer.

llvm-svn: 238142

9 years agoMove LayoutOrder to MCSection.
Rafael Espindola [Mon, 25 May 2015 14:25:28 +0000 (14:25 +0000)]
Move LayoutOrder to MCSection.

llvm-svn: 238141

9 years agoUse a simple initial value for the ordinal.
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.

llvm-svn: 238140

9 years agoStop forwarding getOrdinal and setOrdinal.
Rafael Espindola [Mon, 25 May 2015 14:12:48 +0000 (14:12 +0000)]
Stop forwarding getOrdinal and setOrdinal.

llvm-svn: 238139

9 years agoUse default member initializes. NFC.
Rafael Espindola [Mon, 25 May 2015 14:04:31 +0000 (14:04 +0000)]
Use default member initializes. NFC.

llvm-svn: 238138

9 years agoMove Ordinal from MCSectionData to MCSection. NFC.
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.

llvm-svn: 238137

9 years agoSimplify boolean conditional return statements.
Rafael Espindola [Mon, 25 May 2015 13:50:21 +0000 (13:50 +0000)]
Simplify boolean conditional return statements.

Patch by Richard <legalize@xmission.com>

llvm-svn: 238134

9 years agoRefactor: Simplify boolean conditional return statements in llvm/lib/DebugInfo/DWARF
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

llvm-svn: 238132

9 years ago[X86] When pattern-matching scalar FMA3 intrinsics, don't re-arrange the first and...
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

llvm-svn: 238131

9 years agoAdded promotion to EXTRACT_SUBVECTOR operand.
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

llvm-svn: 238130

9 years agoBug fix for PR23577 (https://llvm.org/bugs/show_bug.cgi?id=23577#c0).
Alexander Musman [Mon, 25 May 2015 11:21:20 +0000 (11:21 +0000)]
Bug fix for PR23577 (https://llvm.org/bugs/show_bug.cgi?id=23577#c0).
"1-4" specifiers are returned as numeric constants, not identifiers,
and should be treated as such. Currently pragma handler incorrectly
assumes that they are returned as identifiers.

Patch by Andrey Bokhanko.

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

llvm-svn: 238129

9 years agoQuiet compiler warnings about virtual and override not being consistent.
Greg Clayton [Mon, 25 May 2015 02:58:29 +0000 (02:58 +0000)]
Quiet compiler warnings about virtual and override not being consistent.

llvm-svn: 238128

9 years agoFix compiler warnings regarding size_t not always being 64 bit in the printf.
Greg Clayton [Mon, 25 May 2015 02:55:21 +0000 (02:55 +0000)]
Fix compiler warnings regarding size_t not always being 64 bit in the printf.

llvm-svn: 238127

9 years agoReformat.
NAKAMURA Takumi [Mon, 25 May 2015 01:43:34 +0000 (01:43 +0000)]
Reformat.

llvm-svn: 238126

9 years agoPrune CRLFs.
NAKAMURA Takumi [Mon, 25 May 2015 01:43:23 +0000 (01:43 +0000)]
Prune CRLFs.

llvm-svn: 238125

9 years ago[Unroll] Switch from an eagerly populated SCEV cache to one that is
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.

llvm-svn: 238124

9 years agoAsmPrinter: Make DIEValue::Ty private, NFC
Duncan P. N. Exon Smith [Sun, 24 May 2015 17:03:15 +0000 (17:03 +0000)]
AsmPrinter: Make DIEValue::Ty private, NFC

llvm-svn: 238123

9 years agoAsmPrinter: Avoid creating symbols in DwarfStringPool
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.)

llvm-svn: 238122

9 years agoAsmPrinter: Prune an include, NFC
Duncan P. N. Exon Smith [Sun, 24 May 2015 16:54:59 +0000 (16:54 +0000)]
AsmPrinter: Prune an include, NFC

llvm-svn: 238121

9 years agoAsmPrinter: Remove dead code, NFC
Duncan P. N. Exon Smith [Sun, 24 May 2015 16:51:29 +0000 (16:51 +0000)]
AsmPrinter: Remove dead code, NFC

llvm-svn: 238120

9 years agoAsmPrinter: Avoid EmitLabelDifference() in DwarfAccelTable
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.)

llvm-svn: 238119

9 years agoAsmPrinter: Use DwarfStringPoolEntry in DwarfAccelTable, NFC
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.

llvm-svn: 238118

9 years agoAsmPrinter: Make DIEString small
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.)

llvm-svn: 238117

9 years agoAsmPrinter: Extract DwarfStringPoolEntry from DwarfStringPool, NFC
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.

llvm-svn: 238116

9 years ago[ELF] Fix lld when no unique sections is used
Simon Atanasyan [Sun, 24 May 2015 16:19:27 +0000 (16:19 +0000)]
[ELF] Fix lld when no unique sections is used

Original patch of Shankar Easwaran with additional test case.
The yaml2obj does not allow to create an object file with non-unique
sections names so the fix uses a binary input object file in the test
case.

llvm-svn: 238115

9 years agoAsmPrinter: Emit the DwarfStringPool offset directly when possible
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.)

llvm-svn: 238114

9 years agoDebugInfo: Clarify test/DebugInfo/X86/stmt-list-multiple-compile-units.ll
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.

llvm-svn: 238113

9 years agoAsmPrinter: Refactor DwarfStringPool::getEntry(), NFC
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.

llvm-svn: 238112

9 years agoRemove log2 dependency when building against Android API-9 SDK
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

llvm-svn: 238111

9 years agoMove parseSubArch to ARMTargetParser. NFC
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.

llvm-svn: 238110

9 years ago[msan] Mprotect all inaccessible memory regions.
Evgeniy Stepanov [Sun, 24 May 2015 02:47:59 +0000 (02:47 +0000)]
[msan] Mprotect all inaccessible memory regions.

Fix 2 bugs in memory mapping setup:
- the invalid region at offset 0 was not protected because mmap at
  address 0 fails with EPERM on most Linux systems. We did not
  notice this because the check condition was flipped: the code was
  checking that mprotect has failed. And the test that was supposed
  to catch this was weakened by the mitigations in the mmap
  interceptor.
- when running without origins, the origin shadow range was left
  unprotected.

The new test ensures that mmap w/o MAP_FIXED always returns valid
application addresses.

llvm-svn: 238109

9 years agoAdd target hook to allow merging stores of nonzero constants
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.

llvm-svn: 238108

9 years ago[Support/ELF] Add missing DF_1_XXX bits.
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

llvm-svn: 238107

9 years ago[Driver] Unbreak hexagon build bots
David Majnemer [Sat, 23 May 2015 19:23:55 +0000 (19:23 +0000)]
[Driver] Unbreak hexagon build bots

AddHexagonTargetArgs didn't respect the driver flags by unconditionally
pushing -fno-signed-char.  Instead, add Hexagon handling to
isSignedCharDefault.

llvm-svn: 238106

9 years ago[Driver] Handle -fno-signed-char and -fno-unsigned-char
David Majnemer [Sat, 23 May 2015 18:48:37 +0000 (18:48 +0000)]
[Driver] Handle -fno-signed-char and -fno-unsigned-char

GCC maps -fno-unsigned-char to -fsigned-char and -fno-signed-char to
-funsigned-char.

llvm-svn: 238105

9 years agoBump SmallString to the minimum required amount for raw_ostream to avoid allocation.
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.

llvm-svn: 238104

9 years ago[Mips] Prefer Twine::utohexstr over utohexstr, saves a string copy.
Benjamin Kramer [Sat, 23 May 2015 16:53:07 +0000 (16:53 +0000)]
[Mips] Prefer Twine::utohexstr over utohexstr, saves a string copy.

NFC.

llvm-svn: 238103

9 years ago[AArch64] Clean up the ELF streamer a bit.
Benjamin Kramer [Sat, 23 May 2015 16:39:10 +0000 (16:39 +0000)]
[AArch64] Clean up the ELF streamer a bit.

llvm-svn: 238102

9 years ago[AArch64] Move AArch64TargetStreamer out of MCStreamer.h
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.

llvm-svn: 238101

9 years ago[llgo] cmd/llgoi: use line editor
Andrew Wilkins [Sat, 23 May 2015 15:16:09 +0000 (15:16 +0000)]
[llgo] cmd/llgoi: use line editor

Summary:
This diff adds line-editing to llgoi, by
vendoring and using github.com/peterh/liner.
I have only implemented the basics here;
follow-ups will come later to add persisted
history, and completion,

Reviewers: pcc

Reviewed By: pcc

Subscribers: axw, llvm-commits

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

llvm-svn: 238100

9 years agoSilencing a spurious -Wreturn-type warning; NFC.
Aaron Ballman [Sat, 23 May 2015 14:46:49 +0000 (14:46 +0000)]
Silencing a spurious -Wreturn-type warning; NFC.

llvm-svn: 238099

9 years ago[clang-tidy] Fix for llvm.org/PR23572
Szabolcs Sipos [Sat, 23 May 2015 14:21:01 +0000 (14:21 +0000)]
[clang-tidy] Fix for llvm.org/PR23572

misc-static-assert won't report asserts whose conditions contain calls to non constexpr functions.

llvm-svn: 238098

9 years ago[PowerPC] Fix fast-isel when compare is split from branch
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.

llvm-svn: 238097

9 years agoUpdate ExecutionEngine/LLVMBuild.txt, to add LLVMCodeGen.
NAKAMURA Takumi [Sat, 23 May 2015 10:44:30 +0000 (10:44 +0000)]
Update ExecutionEngine/LLVMBuild.txt, to add LLVMCodeGen.

llvm-svn: 238096

9 years agoGive more meaningful names than I and J to some for loop variables after converting...
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.

llvm-svn: 238095

9 years agoFix an unused variable warning in release builds.
Craig Topper [Sat, 23 May 2015 08:20:33 +0000 (08:20 +0000)]
Fix an unused variable warning in release builds.

llvm-svn: 238094

9 years agoUse range-based for loops. NFC.
Craig Topper [Sat, 23 May 2015 08:01:41 +0000 (08:01 +0000)]
Use range-based for loops. NFC.

llvm-svn: 238093

9 years agoRemove unnecessary indirection through SCEV
Tobias Grosser [Sat, 23 May 2015 05:58:30 +0000 (05:58 +0000)]
Remove unnecessary indirection through SCEV

llvm-svn: 238092

9 years agoUse unique_ptr to clarify ownershop of ScopArrayInfoMap
Tobias Grosser [Sat, 23 May 2015 05:58:27 +0000 (05:58 +0000)]
Use unique_ptr to clarify ownershop of ScopArrayInfoMap

llvm-svn: 238091

9 years agoUse unique_ptr to clarify ownership of ScopStmt
Tobias Grosser [Sat, 23 May 2015 05:14:09 +0000 (05:14 +0000)]
Use unique_ptr to clarify ownership of ScopStmt

llvm-svn: 238090

9 years agoDid some cleanup to stop us from leaking Pipe file descriptors.
Greg Clayton [Sat, 23 May 2015 03:54:53 +0000 (03:54 +0000)]
Did some cleanup to stop us from leaking Pipe file descriptors.

The main issue was the Communication::Disconnect() was calling its Connection::Disconnect() but this wouldn't release the pipes that the ConnectionFileDescriptor was using. We also have someone that is holding a strong reference to the Process so that when you re-run, target replaces its m_process_sp, but it doesn't get destructed because someone has a strong reference to it. I need to track that down. But, even if we have a strong reference to the a process that is outstanding, we need to call Process::Finalize() to have it release as much of its resources as possible to avoid memory bloat.

Removed the ProcessGDBRemote::SetExitStatus() override and replaced it with ProcessGDBRemote::DidExit().

Now we aren't leaking file descriptors and the stand alone test suite should run much better.

llvm-svn: 238089

9 years agoEnable scalar and PHI code generation for Polly
Tobias Grosser [Sat, 23 May 2015 03:34:41 +0000 (03:34 +0000)]
Enable scalar and PHI code generation for Polly

The feature itself has been committed by Johannes in r238070. As this is the
way forward, we now enable it to ensure we get test coverage.

Thank you Johannes for this nice work!

llvm-svn: 238088

9 years agoMake use of scalar/phi code generation explicit in the tests
Tobias Grosser [Sat, 23 May 2015 03:34:35 +0000 (03:34 +0000)]
Make use of scalar/phi code generation explicit in the tests

This ensures we pass all tests independently of how we set the options
-disable-polly-intra-scop-scalar-to-array and -polly-model-phi-nodes.

(At least if we enable both or disable both. Enabling them individually makes
 little sense, as they will hopefully disappear soon anyhow).

llvm-svn: 238087

9 years ago[lib/Fuzzer] doxygen-ify the comments for the user interface
Kostya Serebryany [Sat, 23 May 2015 02:12:05 +0000 (02:12 +0000)]
[lib/Fuzzer] doxygen-ify the comments for the user interface

llvm-svn: 238086

9 years ago[dfsan] ignore more __sanitizer callbacks
Kostya Serebryany [Sat, 23 May 2015 01:56:39 +0000 (01:56 +0000)]
[dfsan] ignore more __sanitizer callbacks

llvm-svn: 238085

9 years agoAsmPrinter: Remove the vtable-entry from DIEValue
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.)

llvm-svn: 238084

9 years ago[Sema] Don't use dyn_cast to detect an AtomicType
David Majnemer [Sat, 23 May 2015 01:32:17 +0000 (01:32 +0000)]
[Sema] Don't use dyn_cast to detect an AtomicType

An AtomicType might be hidden behind arbitrary levels of typedefs.
getAs<> will reliably walk through the sugar to get the underlying
AtomicType.

This fixes PR23638.

llvm-svn: 238083

9 years agoCodeGen: Remove redundant DIETypeSignature::dump(), NFC
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.

llvm-svn: 238082

9 years ago[lib/Fuzzer] fully get rid of std::cerr in libFuzzer
Kostya Serebryany [Sat, 23 May 2015 01:22:35 +0000 (01:22 +0000)]
[lib/Fuzzer] fully get rid of std::cerr in libFuzzer

llvm-svn: 238081

9 years agoStop resetting NoFramePointerElim in TargetMachine::resetTargetOptions.
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".

llvm-svn: 238080

9 years agoSimplify and rename function overrideFunctionAttributes. NFC.
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.

llvm-svn: 238079

9 years ago[lib/Fuzzer] start getting rid of std::cerr. Sadly, these parts of C++ library used...
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.

llvm-svn: 238078

9 years agoRemove unnecessary command line option "-disable-fp-elim".
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.

llvm-svn: 238077

9 years agoThis reverts commit r238064 and r238055.
Rafael Espindola [Sat, 23 May 2015 00:30:33 +0000 (00:30 +0000)]
This reverts commit r238064 and r238055.

They depend on a reverted llvm commit.

llvm-svn: 238076

9 years agoRevert "make reciprocal estimate code generation more flexible by adding command...
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

llvm-svn: 238075

9 years agoCorrect a mistaken comment from 238071 [NFC]
Philip Reames [Sat, 23 May 2015 00:05:43 +0000 (00:05 +0000)]
Correct a mistaken comment from 238071 [NFC]

llvm-svn: 238074

9 years agoProduce a single string table in a ELF .o
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.

llvm-svn: 238073

9 years ago[lld] Manage atom ordinals in the File class rather than using a static counter.
Lang Hames [Fri, 22 May 2015 23:56:44 +0000 (23:56 +0000)]
[lld] Manage atom ordinals in the File class rather than using a static counter.

This is a cleaner fix for the race-condition bug that was originally papered
over by r237857.

llvm-svn: 238072

9 years agoExtend EarlyCSE to handle basic cases from JumpThreading and CVP
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

llvm-svn: 238071

9 years agoAdd scalar and phi code generation
Johannes Doerfert [Fri, 22 May 2015 23:43:58 +0000 (23:43 +0000)]
Add scalar and phi code generation

  To reduce compile time and to allow more and better quality SCoPs in
  the long run we introduced scalar dependences and PHI-modeling. This
  patch will now allow us to generate code if one or both of those
  options are set. While the principle of demoting scalars as well as
  PHIs to memory in order to communicate their value stays the same,
  this allows to delay the demotion till the very end (the actual code
  generation). Consequently:
    - We __almost__ do not modify the code if we do not generate code
      for an optimized SCoP in the end. Thus, the early exit as well as
      the unprofitable option will now actually preven us from
      introducing regressions in case we will probably not get better
      code.
    - Polly can be used as a "pure" analyzer tool as long as the code
      generator is set to none.
    - The original SCoP is almost not touched when the optimized version
      is placed next to it. Runtime regressions if the runtime checks
      chooses the original are not to be expected and later
      optimizations do not need to revert the demotion for that part.
    - We will generate direct accesses to the demoted values, thus there
      are no "trivial GEPs" that select the first element of a scalar we
      demoted and treated as an array.

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

llvm-svn: 238070

9 years agoUse target's SIGSTOP and SIGINT when making decision about continue after async packet.
Oleksiy Vyalov [Fri, 22 May 2015 23:14:39 +0000 (23:14 +0000)]
Use target's SIGSTOP and SIGINT when making decision about continue after async packet.

http://reviews.llvm.org/D9857

llvm-svn: 238068

9 years ago[InstCombine] Don't eagerly propagate nsw for A*B+A*C => A*(B+C)
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

llvm-svn: 238066

9 years agoFix this module to work with current packects and also to be able to figure out avera...
Greg Clayton [Fri, 22 May 2015 23:00:59 +0000 (23:00 +0000)]
Fix this module to work with current packects and also to be able to figure out average packets speed and standard deviation.

llvm-svn: 238065

9 years agoadd missing include for TargetRecip
Sanjay Patel [Fri, 22 May 2015 22:59:27 +0000 (22:59 +0000)]
add missing include for TargetRecip

llvm-svn: 238064

9 years ago[lib/Fuzzer] remove -use_coverage_pairs=1, an experimental feature that is unlikely...
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

llvm-svn: 238063

9 years ago[lib/Fuzzer] mention the user-supplied mutators
Kostya Serebryany [Fri, 22 May 2015 22:43:05 +0000 (22:43 +0000)]
[lib/Fuzzer] mention the user-supplied mutators

llvm-svn: 238062

9 years agoFix doxygen comments
Jonathan Peyton [Fri, 22 May 2015 22:37:22 +0000 (22:37 +0000)]
Fix doxygen comments

These fixes make doxygen happy.

llvm-svn: 238061

9 years agoFix spelling errors
Jonathan Peyton [Fri, 22 May 2015 22:35:51 +0000 (22:35 +0000)]
Fix spelling errors

These spelling errors are in comments and some debug messages.

llvm-svn: 238060

9 years ago[lib/Fuzzer] extend the fuzzer interface to allow user-supplied mutators
Kostya Serebryany [Fri, 22 May 2015 22:35:31 +0000 (22:35 +0000)]
[lib/Fuzzer] extend the fuzzer interface to allow user-supplied mutators

llvm-svn: 238059

9 years agoCodeGen: Avoid a reserved name and fix the naming style of some arguments. NFC
Justin Bogner [Fri, 22 May 2015 22:16:55 +0000 (22:16 +0000)]
CodeGen: Avoid a reserved name and fix the naming style of some arguments. NFC

It's undefined to use reserved names like _Diags. Fix up the other
parameter names to consistently use a modern style while I'm here.

llvm-svn: 238058

9 years agobuiltins: mark functions as aapcs on Windows
Saleem Abdulrasool [Fri, 22 May 2015 21:47:24 +0000 (21:47 +0000)]
builtins: mark functions as aapcs on Windows

Windows does not use AAPCS, but rather AAPCS-VFP, and thus the functions which
are assumed to be AAPCS will cause invalid argument setup.  Ensure that the
functions are marked as AAPCS.

llvm-svn: 238056