oota-llvm.git
10 years agoCOFF: Don't oversize COMMON symbols when targeting BFD ld
David Majnemer [Wed, 8 Oct 2014 06:38:53 +0000 (06:38 +0000)]
COFF: Don't oversize COMMON symbols when targeting BFD ld

COFF normally doesn't allow us to describe the alignment of COMMON
symbols.

It turns out that most linkers use the symbol size as a hint as to how
aligned the symbol should be.

However the BFD folks have added a .drectve command, which we
now support as of r219229, that allows us to specify the alignment
precisely.  With this in mind, stop rounding sizes up.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219281 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agollvm-dwarfdump: Add support for some COFF relocations
David Majnemer [Wed, 8 Oct 2014 06:38:50 +0000 (06:38 +0000)]
llvm-dwarfdump: Add support for some COFF relocations

DWARF in COFF utilizes several relocations.  Implement support for them
in RelocVisitor to support llvm-dwarfdump.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219280 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[AArch64] Generate vector signed/unsigned mul and mla/mls long.
Chad Rosier [Wed, 8 Oct 2014 02:31:24 +0000 (02:31 +0000)]
[AArch64] Generate vector signed/unsigned mul and mla/mls long.

Phabricator Revision: http://reviews.llvm.org/D5589
Patch by Balaram Makam <bmakam@codeaurora.org>!!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219276 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agollvm-readobj: add test for r219228
Rui Ueyama [Wed, 8 Oct 2014 02:06:11 +0000 (02:06 +0000)]
llvm-readobj: add test for r219228

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219274 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoCache SelectionDAGISel TargetInstrInfo lookups on the class and
Eric Christopher [Wed, 8 Oct 2014 01:58:03 +0000 (01:58 +0000)]
Cache SelectionDAGISel TargetInstrInfo lookups on the class and
propagate. Also use the TargetSubtargetInfo and the MachineFunction
and move TargetRegisterInfo query closer to uses.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219273 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoReset the target options and optimization level as the first
Eric Christopher [Wed, 8 Oct 2014 01:58:01 +0000 (01:58 +0000)]
Reset the target options and optimization level as the first
thing we do inside selection dag. This code needs to be
migrated to queries on the function rather than global
data, but this organizes things before we start grabbing
the subtarget.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219271 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoHave the selection dag grab TargetLowering off of the subtarget
Eric Christopher [Wed, 8 Oct 2014 01:57:58 +0000 (01:57 +0000)]
Have the selection dag grab TargetLowering off of the subtarget
inside init rather than have it passed in as an argument.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219270 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRevert r219175 - [InstCombine] re-commit r218721 icmp-select-icmp optimization
Hans Wennborg [Wed, 8 Oct 2014 01:05:57 +0000 (01:05 +0000)]
Revert r219175 - [InstCombine] re-commit r218721 icmp-select-icmp optimization

This seems to have caused PR21199.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219264 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoHave SelectionDAG's subtarget TargetSelectionDAGInfo be set
Eric Christopher [Wed, 8 Oct 2014 00:32:59 +0000 (00:32 +0000)]
Have SelectionDAG's subtarget TargetSelectionDAGInfo be set
during init rather than construction time.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219262 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[DebugInfo] Pass DWARFSection down to DWARFUnit constructor (NFC).
Alexey Samsonov [Wed, 8 Oct 2014 00:24:41 +0000 (00:24 +0000)]
[DebugInfo] Pass DWARFSection down to DWARFUnit constructor (NFC).

Keep the actual section contents and the relocation map together.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219261 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[Support] Add MemoryBuffer::getFileSlice()
Nick Kledzik [Wed, 8 Oct 2014 00:22:18 +0000 (00:22 +0000)]
[Support] Add MemoryBuffer::getFileSlice()

mach-o supports "fat" files which are a header/table-of-contents followed by a
concatenation of mach-o files built for different architectures. Currently,
MemoryBuffer has no easy way to map a subrange (slice) of a file which lld
will need to select a mach-o slice of a fat file. The new function provides
an easy way to map a slice of a file into a MemoryBuffer. Test case included.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219260 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[DebugInfo] Pass DWARFSection into DWARFUnitSection constructor (NFC).
Alexey Samsonov [Wed, 8 Oct 2014 00:07:53 +0000 (00:07 +0000)]
[DebugInfo] Pass DWARFSection into DWARFUnitSection constructor (NFC).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219259 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[X86] Fix a bug with fetch_add(INT32_MIN)
Robin Morisset [Tue, 7 Oct 2014 23:53:57 +0000 (23:53 +0000)]
[X86] Fix a bug with fetch_add(INT32_MIN)

Summary:
Fix pr21099

The pseudocode of what we were doing (spread through two functions) was:
if (operand.doesNotFitIn32Bits())
  Opc.initializeWithFoo();
if (operand < 0)
  operand = -operand;
if (operand.doesFitIn8Bits())
  Opc.initializeWithBar();
else if (operand.doesFitIn32Bits())
  Opc.initializeWithBlah();
doStuff(Opc);

So for operand == INT32_MIN, Opc was never initialized because the operand changes
from fitting in 32 bits to not fitting, causing the various bugs/error messages
noted by pr21099.

This patch adds an extra test at the beginning for this case, and an
llvm_unreachable to have better error message if the operand ends up
not fitting in 32-bits at the end.

Test Plan: new test + make check

Reviewers: jfb

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219257 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoR600/SI: Refactor VOP3 instruction defs
Tom Stellard [Tue, 7 Oct 2014 23:51:41 +0000 (23:51 +0000)]
R600/SI: Refactor VOP3 instruction defs

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219256 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoR600/SI: Refactor VOPC instruction defs
Tom Stellard [Tue, 7 Oct 2014 23:51:39 +0000 (23:51 +0000)]
R600/SI: Refactor VOPC instruction defs

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219255 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoR600/SI: Refactor VOP2 instruction defs
Tom Stellard [Tue, 7 Oct 2014 23:51:38 +0000 (23:51 +0000)]
R600/SI: Refactor VOP2 instruction defs

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219254 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoR600/SI: Refactor VOP1 instruction defs
Tom Stellard [Tue, 7 Oct 2014 23:51:34 +0000 (23:51 +0000)]
R600/SI: Refactor VOP1 instruction defs

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219253 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[DebugInfo] Turn DWARFContext::Section into DWARFSection (NFC).
Alexey Samsonov [Tue, 7 Oct 2014 23:45:11 +0000 (23:45 +0000)]
[DebugInfo] Turn DWARFContext::Section into DWARFSection (NFC).

It would be more convenient to pass DWARFSection into DWARFUnitSection
constructor, instead of passing its components (Data and RelocAddrMap)
as a separate arguments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219252 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAdd return value and negative checks to MapVector::erase from r219240.
Kaelyn Takata [Tue, 7 Oct 2014 23:11:49 +0000 (23:11 +0000)]
Add return value and negative checks to MapVector::erase from r219240.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219250 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoDebugInfo+DFSan: Ensure that debug info references to llvm::Functions remain pointing...
David Blaikie [Tue, 7 Oct 2014 22:59:46 +0000 (22:59 +0000)]
DebugInfo+DFSan: Ensure that debug info references to llvm::Functions remain pointing to the underlying function when wrappers are created

This is somewhat the inverse of how similar bugs in DAE and ArgPromo
manifested and were addressed. In those passes, individual call sites
were visited explicitly, and then the old function was deleted. This
left the debug info with a null llvm::Function* that needed to be
updated to point to the new function.

In the case of DFSan, it RAUWs the old function with the wrapper, which
includes debug info. So now the debug info refers to the wrapper, which
doesn't actually have any instructions with debug info in it, so it is
ignored entirely - resulting in a DW_TAG_subprogram with no high/low pc,
etc. Instead, fix up the debug info to refer to the original function
after the RAUW messed it up.

Reviewed/discussed with Peter Collingbourne on the llvm-dev mailing
list.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219249 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[Bugpoint] Close error log in ProcessFailure. Bugpoint had been failing to close
Lang Hames [Tue, 7 Oct 2014 21:47:23 +0000 (21:47 +0000)]
[Bugpoint] Close error log in ProcessFailure. Bugpoint had been failing to close
this, and in some circumstances (e.g. reducing particularly large test-cases)
this was causing bugpoint to be killed for hitting open file-handle limits.

No test case: I was only able to trigger this with test cases taking upwards of
10 mins to run.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219244 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoR600: Remove dead code
Matt Arsenault [Tue, 7 Oct 2014 21:29:56 +0000 (21:29 +0000)]
R600: Remove dead code

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219242 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoLoopUnroll: Create sub-loops in LoopInfo
Duncan P. N. Exon Smith [Tue, 7 Oct 2014 21:19:00 +0000 (21:19 +0000)]
LoopUnroll: Create sub-loops in LoopInfo

`LoopUnrollPass` says that it preserves `LoopInfo` -- make it so.  In
particular, tell `LoopInfo` about copies of inner loops when unrolling
the outer loop.

Conservatively, also tell `ScalarEvolution` to forget about the original
versions of these loops, since their inputs may have changed.

Fixes PR20987.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219241 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAdd size_t MapVector::erase(KeyT) similar to the one in std::map.
Kaelyn Takata [Tue, 7 Oct 2014 21:15:51 +0000 (21:15 +0000)]
Add size_t MapVector::erase(KeyT) similar to the one in std::map.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219240 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoLoopUnroll: Only check for ScalarEvolution analysis once, NFC
Duncan P. N. Exon Smith [Tue, 7 Oct 2014 21:12:44 +0000 (21:12 +0000)]
LoopUnroll: Only check for ScalarEvolution analysis once, NFC

A follow-up commit will add use to a tight loop.  We might as well just
find it once anyway.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219239 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoR600: Remove some redundant initializations from AMDGPUMCAsmInfo
Tom Stellard [Tue, 7 Oct 2014 21:09:25 +0000 (21:09 +0000)]
R600: Remove some redundant initializations from AMDGPUMCAsmInfo

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219238 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoR600: Use MCAsmInfoELF as AMDGPUMCAsmInfo base class
Tom Stellard [Tue, 7 Oct 2014 21:09:23 +0000 (21:09 +0000)]
R600: Use MCAsmInfoELF as AMDGPUMCAsmInfo base class

The main reason for this is that the MCAsmInfo class,
which we were previously using as the base class, sets
PrivateGlobalPrefix to "L", which causes all global
functions that start with L to be treated as local symbols.

MCAsmInfoELF sets PrivateGlobalPrefix to ".L", which is what
we want, and it is probably a good idea to use this as the
base class anyway, since we are emitting ELF binaries.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219237 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoR600/SI: Remove assertion in SIInstrInfo::areLoadsFromSameBasePtr()
Tom Stellard [Tue, 7 Oct 2014 21:09:20 +0000 (21:09 +0000)]
R600/SI: Remove assertion in SIInstrInfo::areLoadsFromSameBasePtr()

Added a FIXME coment instead, we need to handle the case where the
two DS instructions being compared have different numbers of operands.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219236 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoDon't check for null after calling COFFObjectFile::toSec.
Rafael Espindola [Tue, 7 Oct 2014 21:03:22 +0000 (21:03 +0000)]
Don't check for null after calling COFFObjectFile::toSec.

It can only return null if passed a corrupted reference with a null Ref.p.
Checking for null is then an issue for asserts to check for internal
consistency, not control flow to check for invalid input.

I didn't add an assert(sec != nullptr) because toSec itself has a far more
complete assert.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219235 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoOptimize COFFObjectFile::sectionContainsSymbol a bit.
Rafael Espindola [Tue, 7 Oct 2014 20:42:47 +0000 (20:42 +0000)]
Optimize COFFObjectFile::sectionContainsSymbol a bit.

There is no need to compute the coff_section of the symbol just to compare the
pointer.

Inspired by the ELF implementation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219233 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMC: add support for -aligncomm GNU extension
Saleem Abdulrasool [Tue, 7 Oct 2014 19:37:57 +0000 (19:37 +0000)]
MC: add support for -aligncomm GNU extension

The GNU linker supports an -aligncomm directive that allows for power-of-2
alignment of common data.  Add support to emit this directive.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219229 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agollvm-readobj: add support to dump (COFF) directives
Saleem Abdulrasool [Tue, 7 Oct 2014 19:37:52 +0000 (19:37 +0000)]
llvm-readobj: add support to dump (COFF) directives

PE/COFF has a special section (.drectve) which can be used to pass options to
the linker (similar to LC_LINKER_OPTION).  Add support to llvm-readobj to print
the contents of the section for tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219228 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRemove the IsVolatileSize parameter of getOpenFileSlice.
Rafael Espindola [Tue, 7 Oct 2014 19:09:05 +0000 (19:09 +0000)]
Remove the IsVolatileSize parameter of getOpenFileSlice.

getOpenFileSlice gets passed the map size, so it makes no sense to say that
the size is volatile. The code will not even compute the size.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219226 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoBe consistent about using "const Twine &" for filenames.
Rafael Espindola [Tue, 7 Oct 2014 18:58:55 +0000 (18:58 +0000)]
Be consistent about using "const Twine &" for filenames.

On this file we had a mix of
* Twine
* const char *
* StringRef

The two that make sense are
* const Twine & (caller convenience)
* consc char * (that is what will eventually be passed to open.

Given that sys::fs::openFileForRead takes a "const Twine &", I picked that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219224 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoTwo case switch to select optimization
Marcello Maggioni [Tue, 7 Oct 2014 18:16:44 +0000 (18:16 +0000)]
Two case switch to select optimization

This optimization tries to convert switch instructions that are used to select a value with only 2 unique cases + default block
to a select or a couple of selects (depending if the default block is reachable or not).

The typical case this optimization wants to be able to optimize is this one:

Example:
switch (a) {
  case 10:                %0 = icmp eq i32 %a, 10
    return 10;            %1 = select i1 %0, i32 10, i32 4
  case 20:        ---->   %2 = icmp eq i32 %a, 20
    return 2;             %3 = select i1 %2, i32 2, i32 %1
  default:
    return 4;
}

It also sets the base for further optimizations that are planned and being reviewed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219223 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agotypos
Sanjay Patel [Tue, 7 Oct 2014 17:38:33 +0000 (17:38 +0000)]
typos

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219221 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agotypos
Sanjay Patel [Tue, 7 Oct 2014 17:36:50 +0000 (17:36 +0000)]
typos

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219220 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agodon't repeat function name in comments
Sanjay Patel [Tue, 7 Oct 2014 17:28:04 +0000 (17:28 +0000)]
don't repeat function name in comments

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219218 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agotypos
Sanjay Patel [Tue, 7 Oct 2014 17:00:16 +0000 (17:00 +0000)]
typos

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219216 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoDebugInfo: Ensure that all debug location scope chains from instructions within a...
David Blaikie [Tue, 7 Oct 2014 16:56:20 +0000 (16:56 +0000)]
DebugInfo: Ensure that all debug location scope chains from instructions within a function, lead to the function itself.

Let me tell you a tale...

Originally committed in r211723 after discovering a nasty case of weird
scoping due to inlining, this was reverted in r211724 after it fired in
ASan/compiler-rt.

(minor diversion where I accidentally committed/reverted again in
r211871/r211873)

After further testing and fixing bugs in ArgumentPromotion (r211872) and
Inlining (r212065) it was recommitted in r212085. Reverted in r212089
after the sanitizer buildbots still showed problems.

Fixed another bug in ArgumentPromotion (r212128) found by this
assertion.

Recommitted in r212205, reverted in r212226 after it crashed some more
on sanitizer buildbots.

Fix clang some more in r212761.

Recommitted in r212776, reverted in r212793. ASan failures.
Recommitted in r213391, reverted in r213432, trying to reproduce flakey
ASan build failure.

Fixed bugs in r213805 (ArgPromo + DebugInfo), r213952
(LiveDebugVariables strips dbg_value intrinsics in functions not
described by debug info).

Recommitted in r214761, reverted in r214999, flakey failure on Windows
buildbot.

Fixed DeadArgElimination + DebugInfo bug in r219210.

Recommitting and hoping that's the last of it.

[That one burned down, fell over, then sank into the swamp.]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219215 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoDebugInfo+DeadArgElimination: Ensure llvm::Function*s from debug info are updated...
David Blaikie [Tue, 7 Oct 2014 15:10:23 +0000 (15:10 +0000)]
DebugInfo+DeadArgElimination: Ensure llvm::Function*s from debug info are updated even when DAE removes both varargs and non-varargs arguments on the same function.

After some stellar (& inspired) help from Reid Kleckner providing a test
case for some rather unstable undefined behavior showing up as
assertions produced by r214761, I was able to fix this issue in DAE
involving the application of both varargs removal, followed by normal
argument removal.

Indeed I introduced this same bug into ArgumentPromotion (r212128) by
copying the code from DAE, and when I fixed the bug in ArgPromo
(r213805) and commented in that patch that I didn't need to address the
same issue in DAE because it was a single pass. Turns out it's two pass,
one for the varargs and one for the normal arguments, so the same fix is
needed (at least during varargs removal). So here it is.

(the observable/net effect of this bug, even when it didn't result in
assertion failure, is that debug info would describe the DAE'd function
in the abstract, but wouldn't provide high/low_pc, variable locations,
line table, etc (it would appear as though the function had been
entirely optimized away), see the original PR14016 for details of the
general problem)

I'm not recommitting the assertion just yet, as there's been another
regression of it since I last tried. It might just be a few test cases
weren't adequately updated after Adrian or Duncan's recent schema
changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219210 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoReformat if statement to comply with LLVM standards. NFC.
Suyog Sarda [Tue, 7 Oct 2014 12:04:07 +0000 (12:04 +0000)]
Reformat if statement to comply with LLVM standards. NFC.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219203 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoReformat to comply with LLVM coding standards using clang-format.
Suyog Sarda [Tue, 7 Oct 2014 11:56:06 +0000 (11:56 +0000)]
Reformat to comply with LLVM coding standards using clang-format.
NFC.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219202 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRemove Extra lines. NFC.
Suyog Sarda [Tue, 7 Oct 2014 11:31:31 +0000 (11:31 +0000)]
Remove Extra lines. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219201 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[asan-asm-instrumentation] CFI directives are generated for .S files.
Yuri Gorshenin [Tue, 7 Oct 2014 11:03:09 +0000 (11:03 +0000)]
[asan-asm-instrumentation] CFI directives are generated for .S files.

Summary: CFI directives are generated for .S files.

Reviewers: eugenis

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219199 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[InstCombine] Reformat if statements to comply with LLVM Coding Standards.
Tilmann Scheller [Tue, 7 Oct 2014 10:19:34 +0000 (10:19 +0000)]
[InstCombine] Reformat if statements to comply with LLVM Coding Standards.

Patch by Sonam Kumari!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219198 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[mips] Return {f128} correctly for N32/N64.
Daniel Sanders [Tue, 7 Oct 2014 09:29:59 +0000 (09:29 +0000)]
[mips] Return {f128} correctly for N32/N64.

Summary:
According to the ABI documentation, f128 and {f128} should both be returned
in $f0 and $f2. However, this doesn't match GCC's behaviour which is to
return f128 in $f0 and $f2, but {f128} in $f0 and $f1.

Reviewers: vmedic

Reviewed By: vmedic

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219196 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[X86] Fix a bug where the disassembler was ignoring the VEX.W bit in 32-bit mode...
Craig Topper [Tue, 7 Oct 2014 07:29:50 +0000 (07:29 +0000)]
[X86] Fix a bug where the disassembler was ignoring the VEX.W bit in 32-bit mode for certain instructions it shouldn't.

Unfortunately, this isn't easy to fix since there's no simple way to figure out from the disassembler tables whether the W-bit is being used to select a 64-bit GPR or if its a required part of the opcode. The fix implemented here just looks for "64" in the instruction name and ignores the W-bit in 32-bit mode if its present.

Fixes PR21169.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219194 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFormatting fixes. Most putting 'else' on the same line as the preceding curly brace.
Craig Topper [Tue, 7 Oct 2014 07:29:48 +0000 (07:29 +0000)]
Formatting fixes. Most putting 'else' on the same line as the preceding curly brace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219193 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFix filename in header and use C++ version of the C header files.
Craig Topper [Tue, 7 Oct 2014 07:29:46 +0000 (07:29 +0000)]
Fix filename in header and use C++ version of the C header files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219192 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoGlobalDCE: Don't drop any COMDAT members
David Majnemer [Tue, 7 Oct 2014 07:07:19 +0000 (07:07 +0000)]
GlobalDCE: Don't drop any COMDAT members

If we require a single member of a comdat, require all of the other
members as well.

This fixes PR20981.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219191 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAttempt to calm down buildbots
David Majnemer [Tue, 7 Oct 2014 05:56:45 +0000 (05:56 +0000)]
Attempt to calm down buildbots

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219190 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoSupport: Don't call close again if we get EINTR
David Majnemer [Tue, 7 Oct 2014 05:48:40 +0000 (05:48 +0000)]
Support: Don't call close again if we get EINTR

Most Unix-like operating systems guarantee that the file descriptor is
closed after a call to close(2), even if close comes back with EINTR.
For these systems, calling close _again_ will either do nothing or close
some other file descriptor open(2)'d by another thread. (Linux)

However, some operating systems do not have this behavior.  They require
at least another call to close(2) before guaranteeing that the
descriptor is closed. (HP-UX)

And some operating systems have an unpredictable blend of the two
behaviors! (xnu)

Avoid this disaster by blocking all signals before we call close(2).
This ensures that a signal will not be delivered to the thread and
close(2) will not give us back EINTR.  We restore the signal mask once
the operation is done.

N.B. This isn't a problem on Windows, it doesn't have a notion of EINTR
because signals always get delivered to dedicated signal handling
threads.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219189 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agogold plugin: Handle gold selecting a linkonce GV when a weak is present.
Rafael Espindola [Tue, 7 Oct 2014 04:06:13 +0000 (04:06 +0000)]
gold plugin: Handle gold selecting a linkonce GV when a weak is present.

The plugin API doesn't have the notion of linkonce, only weak. It is up to the
plugin to figure out if a symbol used only for the symbol table can be dropped.
In particular, it has to avoid dropping a linkonce_odr selected by gold if there
is also a weak_odr.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219188 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[FastISel][AArch64] Teach the address computation code to also fold sign-/zero-extends.
Juergen Ributzka [Tue, 7 Oct 2014 03:40:06 +0000 (03:40 +0000)]
[FastISel][AArch64] Teach the address computation code to also fold sign-/zero-extends.

The code already folds sign-/zero-extends, but only if they are arguments to
mul and shift instructions. This extends the code to also fold them when they
are direct inputs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219187 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[FastISel][AArch64] Teach the address computation to also fold sub instructions.
Juergen Ributzka [Tue, 7 Oct 2014 03:40:03 +0000 (03:40 +0000)]
[FastISel][AArch64] Teach the address computation to also fold sub instructions.

Tiny enhancement to the address computation code to also fold sub instructions
if the rhs is constant and can be folded into the offset.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219186 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[FastISel][AArch64] Fix "Fold sign-/zero-extends into the load instruction."
Juergen Ributzka [Tue, 7 Oct 2014 03:39:59 +0000 (03:39 +0000)]
[FastISel][AArch64] Fix "Fold sign-/zero-extends into the load instruction."

This commit fixes an issue with sign-/zero-extending loads that was discovered
by Richard Barton.

We use now the correct load instructions for sign-extending loads to 64bit. Also
updated and added more unit tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219185 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agogold plugin: create internal replacement with original linkage first.
Rafael Espindola [Tue, 7 Oct 2014 03:19:55 +0000 (03:19 +0000)]
gold plugin: create internal replacement with original linkage first.

The call to copyAttributesFrom will copy the visibility, which might assert
if it were to produce something invalid like "internal hidden". We avoid it
by first creating the replacement with the original linkage and then setting
it to internal affter the call to copyAttributesFrom.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219184 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agogold plugin: Remap function arguments when creating a replacement function.
Rafael Espindola [Tue, 7 Oct 2014 00:47:38 +0000 (00:47 +0000)]
gold plugin: Remap function arguments when creating a replacement function.

When creating an internal function replacement for use in an alias we were
not remapping the argument uses in the instructions to point to the new
arguments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219177 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[InstCombine] re-commit r218721 icmp-select-icmp optimization
Gerolf Hoflehner [Tue, 7 Oct 2014 00:16:12 +0000 (00:16 +0000)]
[InstCombine] re-commit r218721 icmp-select-icmp optimization

Takes care of the assert that caused build fails.
Rather than asserting the code checks now that the definition
and use are in the same block, and does not attempt
to optimize when that is not the case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219175 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoARMInstPrinter.cpp: Suppress a warning for -Asserts. [-Wunused-variable]
NAKAMURA Takumi [Mon, 6 Oct 2014 23:48:04 +0000 (23:48 +0000)]
ARMInstPrinter.cpp: Suppress a warning for -Asserts. [-Wunused-variable]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219172 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agollvm/test/lit.cfg: Suppress dwarf stuff for targeting x86_64-mingw32 while investigat...
NAKAMURA Takumi [Mon, 6 Oct 2014 23:29:06 +0000 (23:29 +0000)]
llvm/test/lit.cfg: Suppress dwarf stuff for targeting x86_64-mingw32 while investigating since r219108.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219171 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoSupport: Add a utility to remap std{in,out,err} to /dev/null if closed
David Majnemer [Mon, 6 Oct 2014 23:16:18 +0000 (23:16 +0000)]
Support: Add a utility to remap std{in,out,err} to /dev/null if closed

It's possible to start a program with one (or all) of the standard file
descriptors closed.  Subsequent open system calls will give the program
a low-numbered file descriptor.

This is problematic because we may believe we are writing to standard
out instead of a file.

Introduce Process::FixupStandardFileDescriptors, a helper function to
remap standard file descriptors to /dev/null if they were closed before
the program started.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219170 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRecognize aarch64_be as valid architecture.
Joerg Sonnenberger [Mon, 6 Oct 2014 23:05:04 +0000 (23:05 +0000)]
Recognize aarch64_be as valid architecture.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219168 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agorange-for some loops in DAE
David Blaikie [Mon, 6 Oct 2014 22:59:29 +0000 (22:59 +0000)]
range-for some loops in DAE

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219167 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoLoopUnroll: Change code order of changes to new basic blocks
Duncan P. N. Exon Smith [Mon, 6 Oct 2014 22:05:02 +0000 (22:05 +0000)]
LoopUnroll: Change code order of changes to new basic blocks

Add new basic blocks to `LoopInfo` earlier.  No functionality change
intended (simplifies upcoming bugfix patch).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219150 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoSink comment, NFC
Duncan P. N. Exon Smith [Mon, 6 Oct 2014 22:04:59 +0000 (22:04 +0000)]
Sink comment, NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219149 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[DAGCombine] Remove SIGN_EXTEND-related inf-loop
Hal Finkel [Mon, 6 Oct 2014 20:19:47 +0000 (20:19 +0000)]
[DAGCombine] Remove SIGN_EXTEND-related inf-loop

The patch's author points out that, despite the function's documentation,
getSetCCResultType is only used to get the SETCC result type (with one
here-removed problematic exception). In one case, getSetCCResultType was being
used to get the predicate type to use for a SELECT node, and then
SIGN_EXTENDing (or truncating) to get the input predicate to match that type.
Unfortunately, this was happening inside visitSIGN_EXTEND, and creating new
SIGN_EXTEND nodes was causing an infinite loop. In addition, this behavior was
wrong if a target was not using ZeroOrNegativeOneBooleanContent. Lastly, the
extension/truncation seems unnecessary here: SELECT is defined as:

  Select(COND, TRUEVAL, FALSEVAL). If the type of the boolean COND is not i1
  then the high bits must conform to getBooleanContents.

So here we remove this use of getSetCCResultType and update
getSetCCResultType's documentation to reflect its actual uses.

Patch by deadal nix!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219141 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFast-math fold: x / (y * sqrt(z)) -> x * (rsqrt(z) / y)
Sanjay Patel [Mon, 6 Oct 2014 19:31:18 +0000 (19:31 +0000)]
Fast-math fold:  x / (y * sqrt(z)) -> x * (rsqrt(z) / y)

The motivation is to recognize code such as this from /llvm/projects/test-suite/SingleSource/Benchmarks/BenchmarkGame/n-body.c:

float distance = sqrt(dx * dx + dy * dy + dz * dz);
float mag = dt / (distance * distance * distance);

Without this patch, we don't match the sqrt as a reciprocal sqrt, so for PPC the new testcase in this patch produces:

   addis 3, 2, .LCPI4_2@toc@ha
   lfs 4, .LCPI4_2@toc@l(3)
   addis 3, 2, .LCPI4_1@toc@ha
   lfs 0, .LCPI4_1@toc@l(3)
   fcmpu 0, 1, 4
   beq 0, .LBB4_2
# BB#1:
   frsqrtes 4, 1
   addis 3, 2, .LCPI4_0@toc@ha
   lfs 5, .LCPI4_0@toc@l(3)
   fnmsubs 13, 1, 5, 1
   fmuls 6, 4, 4
   fmadds 1, 13, 6, 5
   fmuls 1, 4, 1
   fres 4, 1                <--- reciprocal of reciprocal square root
   fnmsubs 1, 1, 4, 0
   fmadds 4, 4, 1, 4
.LBB4_2:
   fmuls 1, 4, 2
   fres 2, 1
   fnmsubs 0, 1, 2, 0
   fmadds 0, 2, 0, 2
   fmuls 1, 3, 0
   blr

After the patch, this simplifies to:

frsqrtes 0, 1
addis 3, 2, .LCPI4_1@toc@ha
fres 5, 2
lfs 4, .LCPI4_1@toc@l(3)
addis 3, 2, .LCPI4_0@toc@ha
lfs 7, .LCPI4_0@toc@l(3)
fnmsubs 13, 1, 4, 1
fmuls 6, 0, 0
fnmsubs 2, 2, 5, 7
fmadds 1, 13, 6, 4
fmadds 2, 5, 2, 5
fmuls 0, 0, 1
fmuls 0, 0, 2
fmuls 1, 3, 0
blr

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219139 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[BasicAA] Revert "Revert r218714 - Make better use of zext and sign information."
Hal Finkel [Mon, 6 Oct 2014 18:37:59 +0000 (18:37 +0000)]
[BasicAA] Revert "Revert r218714 - Make better use of zext and sign information."

This reverts r218944, which reverted r218714, plus a bug fix.

Description of the bug in r218714 (by Nick)

The original patch forgot to check if the Scale in VariableGEPIndex flipped the
sign of the variable. The BasicAA pass iterates over the instructions in the
order they appear in the function, and so BasicAliasAnalysis::aliasGEP is
called with the variable it first comes across as parameter GEP1. Adding a
%reorder label puts the definition of %a after %b so aliasGEP is called with %b
as the first parameter and %a as the second. aliasGEP later calculates that %a
== %b + 1 - %idxprom where %idxprom >= 0 (if %a was passed as the first
parameter it would calculate %b == %a - 1 + %idxprom where %idxprom >= 0) -
ignoring that %idxprom is scaled by -1 here lead the patch to incorrectly
conclude that %a > %b.

Revised patch by Nick White, thanks! Thanks to Lang to isolating the bug.
Slightly modified by me to add an early exit from the loop and avoid
unnecessary, but expensive, function calls.

Original commit message:

Two related things:

 1. Fixes a bug when calculating the offset in GetLinearExpression. The code
    previously used zext to extend the offset, so negative offsets were converted
    to large positive ones.

 2. Enhance aliasGEP to deduce that, if the difference between two GEP
    allocations is positive and all the variables that govern the offset are also
    positive (i.e. the offset is strictly after the higher base pointer), then
    locations that fit in the gap between the two base pointers are NoAlias.

Patch by Nick White!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219135 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoUpdate documentation with link to Sea Islands documentation
Matt Arsenault [Mon, 6 Oct 2014 18:31:09 +0000 (18:31 +0000)]
Update documentation with link to Sea Islands documentation

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219134 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoBFI: Improve assertion message, since it's actually firing
Duncan P. N. Exon Smith [Mon, 6 Oct 2014 17:42:00 +0000 (17:42 +0000)]
BFI: Improve assertion message, since it's actually firing

This assertion is firing because -loop-unroll is failing to preserve
-loop-info (see PR20987).  Improve it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219130 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoARM: silence unused variable warning
Tim Northover [Mon, 6 Oct 2014 17:26:36 +0000 (17:26 +0000)]
ARM: silence unused variable warning

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219128 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoARM: remove dead InstPrinting code
Tim Northover [Mon, 6 Oct 2014 17:10:13 +0000 (17:10 +0000)]
ARM: remove dead InstPrinting code

This instruction form is handled by different AsmOperands now, so the code is
completely dead (and wrong anyway).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219127 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMachObjectWriter: optimize the string table for common suffices
Hans Wennborg [Mon, 6 Oct 2014 17:05:19 +0000 (17:05 +0000)]
MachObjectWriter: optimize the string table for common suffices

This is a follow-up to r207670 (ELF) and r218636 (COFF).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219126 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFix dumping codeview line tables when there are multiple debug sections
Timur Iskhodzhanov [Mon, 6 Oct 2014 16:59:44 +0000 (16:59 +0000)]
Fix dumping codeview line tables when there are multiple debug sections

Codeview line tables for functions in different sections refer to a common
STRING_TABLE_SUBSECTION for filenames.
This happens when building with -Gy or with inline functions with MSVC.

Original patch by Jeff Muizelaar!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219125 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoDbgValueHistoryCalculator: Store modified registers in a BitVector instead of std...
Benjamin Kramer [Mon, 6 Oct 2014 15:31:04 +0000 (15:31 +0000)]
DbgValueHistoryCalculator: Store modified registers in a BitVector instead of std::set.

And iterate over the smaller map instead of the larger set first.  Reduces the time spent in
calculateDbgValueHistory by 30-40%.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219123 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[CFL-AA] Update for handling of globals and more tests
Hal Finkel [Mon, 6 Oct 2014 14:42:56 +0000 (14:42 +0000)]
[CFL-AA] Update for handling of globals and more tests

We used to return PartialAlias if *either* variable being queried interacted
with arguments or globals. AFAICT, we can change this to only returning
MayAlias iff *both* variables being queried interacted with arguments or
globals.

Also, adding some basic functionality tests: some basic IPA tests, checking
that we give conservative responses with arguments/globals thrown in the mix,
and ensuring that we trace values through stores and loads.

Note that saying that 'x' interacted with arguments or globals means that the
Attributes of the StratifiedSet that 'x' belongs to has any bits set.

Patch by George Burgess IV, thanks!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219122 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMake the MD5 result name consistent between functions, header and source.
Yaron Keren [Mon, 6 Oct 2014 13:48:07 +0000 (13:48 +0000)]
Make the MD5 result name consistent between functions, header and source.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219121 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoNote that a gold bug has been fixed.
Rafael Espindola [Mon, 6 Oct 2014 12:33:27 +0000 (12:33 +0000)]
Note that a gold bug has been fixed.

We should be able to stop working around it at some point in the future.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219115 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoX86: Drop the isConvertibleTo3Addr bit from shufps/shufpd now that we don't convert...
Benjamin Kramer [Mon, 6 Oct 2014 09:56:40 +0000 (09:56 +0000)]
X86: Drop the isConvertibleTo3Addr bit from shufps/shufpd now that we don't convert them anymore.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219112 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFor biendian targets like ARM and AArch64, it is useful to have the
Eric Christopher [Mon, 6 Oct 2014 07:06:03 +0000 (07:06 +0000)]
For biendian targets like ARM and AArch64, it is useful to have the
output of the llvm-dwarfdump and llvm-objdump report the endianness
used when the object files were generated.

Patch by Charlie Turner.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219110 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAdd support for ARM and AArch64 big endian objects to
Eric Christopher [Mon, 6 Oct 2014 07:02:58 +0000 (07:02 +0000)]
Add support for ARM and AArch64 big endian objects to
RelocVisitor.

Patch by Charlie Turner.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219109 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRefactor RelocVisitor to take an object. This removes some
Eric Christopher [Mon, 6 Oct 2014 06:55:55 +0000 (06:55 +0000)]
Refactor RelocVisitor to take an object. This removes some
string comparisons and makes it a bit easier to check individual
targets.

Patch by Charlie Turner.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219108 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAdd some tests for RelocVisitor.
Eric Christopher [Mon, 6 Oct 2014 06:52:52 +0000 (06:52 +0000)]
Add some tests for RelocVisitor.

Patch by Charlie Turner.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219107 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAdd subtarget caches to aarch64, arm, ppc, and x86.
Eric Christopher [Mon, 6 Oct 2014 06:45:36 +0000 (06:45 +0000)]
Add subtarget caches to aarch64, arm, ppc, and x86.
These will make it easier to test further changes to the
code generation and optimization pipelines as those are
moved to subtargets initialized with target feature and
target cpu.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219106 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoResolve ambiguity between llvm::make_unique and std::make_unique.
Yaron Keren [Mon, 6 Oct 2014 06:39:57 +0000 (06:39 +0000)]
Resolve ambiguity between llvm::make_unique and std::make_unique.

Intorduced in r219098.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219105 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoDebugInfo: Sink constructImportedEntityDIE down into DwarfUnit from DwarfDebug.
David Blaikie [Mon, 6 Oct 2014 05:37:24 +0000 (05:37 +0000)]
DebugInfo: Sink constructImportedEntityDIE down into DwarfUnit from DwarfDebug.

It was just calling a bunch of DwarfUnit functions anyway, as can be
seen by the simplification of removing "TheCU" from all the function
calls in the implementation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219103 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[dwarfdump] Print the name for referenced specification of abstract_origin DIEs.
Frederic Riss [Mon, 6 Oct 2014 03:36:31 +0000 (03:36 +0000)]
[dwarfdump] Print the name for referenced specification of abstract_origin DIEs.

Reviewers: dblaikie, samsonov, echristo, aprantl

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219099 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFactor the Unit section parsing into the DWARFUnitSection class.
Frederic Riss [Mon, 6 Oct 2014 03:36:18 +0000 (03:36 +0000)]
Factor the Unit section parsing into the DWARFUnitSection class.

Summary: No functional change.

Reviewers: dblaikie, samsonov

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219098 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[PM] Remove an unused and rather expensive mapping from an analysis
Chandler Carruth [Mon, 6 Oct 2014 00:30:59 +0000 (00:30 +0000)]
[PM] Remove an unused and rather expensive mapping from an analysis
group's interface to all of the implementations of that analysis group.
The groups themselves can and do manage this anyways, the pass registry
needn't involve itself.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219097 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[PM] Remove the (deeply misguided) 'unregister' functionality from the
Chandler Carruth [Mon, 6 Oct 2014 00:13:25 +0000 (00:13 +0000)]
[PM] Remove the (deeply misguided) 'unregister' functionality from the
pass registry.

This style of registry is somewhat questionable, but it being
non-monotonic is crazy. No one is (or should be) unloading DSOs with
passes and unregistering them here. I've checked with a few folks and
I don't know of anyone using this functionality or any important use
case where it is necessary.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219096 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[cleanup] Switch to using range-based for loops in two very obvious
Chandler Carruth [Mon, 6 Oct 2014 00:06:48 +0000 (00:06 +0000)]
[cleanup] Switch to using range-based for loops in two very obvious
places.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219095 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[cleanup] Fix up trailing whitespace and formatting in the pass regitsry
Chandler Carruth [Sun, 5 Oct 2014 23:59:03 +0000 (23:59 +0000)]
[cleanup] Fix up trailing whitespace and formatting in the pass regitsry
code prior to hacking on it more significantly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219094 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoGive the Reassociate pass a bit more flexibility and autonomy when optimizing express...
Owen Anderson [Sun, 5 Oct 2014 23:41:26 +0000 (23:41 +0000)]
Give the Reassociate pass a bit more flexibility and autonomy when optimizing expressions.
Particularly, it addresses cases where Reassociate breaks Subtracts but then fails to optimize combinations like I1 + -I2 where I1 and I2 have the same rank and are identical.

Patch by Dmitri Shtilman.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219092 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[x86] Remove the 2-addr-to-3-addr "optimization" from shufps to pshufd.
Chandler Carruth [Sun, 5 Oct 2014 22:57:31 +0000 (22:57 +0000)]
[x86] Remove the 2-addr-to-3-addr "optimization" from shufps to pshufd.

This trades a (register-renamer-friendly) movaps for a floating point
/ integer domain cross. That is a very bad trade, even on architectures
where domain crossing is relatively fast. On any chip where there is
even a cycle stall, this is a Very Bad Idea. It doesn't even seem likely
to cause a spill to be introduced because the reason for the copy is to
destructively shuffle in place.

Thanks to Ben Kramer for fixing a bug in this code that my new shuffle
lowering exposed and highlighting that perhaps it should just go away.
=]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219090 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[x86, dag] Teach the DAG combiner to prune inputs toa vector_shuffle
Chandler Carruth [Sun, 5 Oct 2014 19:14:34 +0000 (19:14 +0000)]
[x86, dag] Teach the DAG combiner to prune inputs toa vector_shuffle
that are unused.

This allows the combiner to delete math feeding shuffles where the math
isn't actually necessary. This improves some of the vperm2x128 tests
that regressed when the vector shuffle lowering started actually
generating vperm instructions rather than forcibly decomposing them.

Sadly, this isn't enough to get this *really* right because we still
form a completely unnecessary permutation. To fix that, we also need to
fold shuffles which just rearrange concatenated or inserted subvectors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219086 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRemove unused map
David Blaikie [Sun, 5 Oct 2014 16:31:13 +0000 (16:31 +0000)]
Remove unused map

This became unnecessary/unused in r208636

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219085 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoX86: Don't drop half of the mask when converting 2-address shufps into 3-address...
Benjamin Kramer [Sun, 5 Oct 2014 16:14:29 +0000 (16:14 +0000)]
X86: Don't drop half of the mask when converting 2-address shufps into 3-address pshufd.

It's debatable whether this transform is useful at all, but for now make sure
we don't generate invalid asm.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219084 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAVX-512-SKX: Added instruction VPMOVM2B/W/D/Q.
Elena Demikhovsky [Sun, 5 Oct 2014 14:11:08 +0000 (14:11 +0000)]
AVX-512-SKX: Added instruction VPMOVM2B/W/D/Q.
This instruction allows to broadacst mask vector to data vector.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219083 91177308-0d34-0410-b5e6-96231b3b80d8