oota-llvm.git
8 years agoReplace all accesses to User::OperandList with getter and setter methods. NFC.
Pete Cooper [Fri, 12 Jun 2015 17:48:05 +0000 (17:48 +0000)]
Replace all accesses to User::OperandList with getter and setter methods. NFC.

We don't want anyone to access OperandList directly as its going to be removed
and computed instead.  This uses getter's and setter's instead in which we
can later change the underlying implementation of OperandList.

Reviewed by Duncan Exon Smith.

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

8 years agoHave the ELF symbol predicates match more directly the spec.
Rafael Espindola [Fri, 12 Jun 2015 17:23:39 +0000 (17:23 +0000)]
Have the ELF symbol predicates match more directly the spec.

The underlaying issues is that this code can't really know if an OS specific or
processor specific section number should return true or false.

One option would be to assert or return an error, but that looks like over
engineering since extensions are not that common.

It seems better to have these be direct implementation of the ELF spec so that
they are natural for someone familiar with ELF reading the code.

Code that does have to handle OS/Architecture specific values can do it at
a higher level.

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

8 years agoDon't create instructions from ConstantExpr's in CFLAliasAnalysis.
Pete Cooper [Fri, 12 Jun 2015 16:13:54 +0000 (16:13 +0000)]
Don't create instructions from ConstantExpr's in CFLAliasAnalysis.

The CFLAA code currently calls ConstantExpr::getAsInstruction which creates an instruction from a constant expr.

We then pass that instruction to the InstVisitor to analyze it.

Its not necessary to create these instructions as we can just cast from Constant to Operator in the visitor.  This is how other InstVisitor’s such as SelectionDAGBuilder handle ConstantExpr.

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

8 years agoIn MSVC builds embed a VERSIONINFO resource in our exe and DLL files.
Greg Bedwell [Fri, 12 Jun 2015 15:58:29 +0000 (15:58 +0000)]
In MSVC builds embed a VERSIONINFO resource in our exe and DLL files.

This reinstates my commits r238740/r238741 which I reverted due to a failure
in the clang-cl selfhost tests on Windows.  I've now fixed the issue in
clang-cl that caused the failure so hopefully all should be well now.

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

8 years agoRemove a hack that tries to align '*'.
Rafael Espindola [Fri, 12 Jun 2015 12:42:13 +0000 (12:42 +0000)]
Remove a hack that tries to align '*'.

The alignment is not required, so we can just remove it for now.

The old code is a hack as it depends on the buffer management to find
the current column.

If the alignment is really desirable, the proper way to do it is
to pass in a formatted_raw_stream that knows the current column.

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

8 years agoDon't depend on the interleaving of stdout and stderr.
Rafael Espindola [Fri, 12 Jun 2015 12:20:03 +0000 (12:20 +0000)]
Don't depend on the interleaving of stdout and stderr.

That can change as we change the buffering.

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

8 years ago[ASan] format AddressSanitizer.cpp with `clang-format -style=Google`, NFC
Alexander Potapenko [Fri, 12 Jun 2015 11:27:06 +0000 (11:27 +0000)]
[ASan] format AddressSanitizer.cpp with `clang-format -style=Google`, NFC

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

8 years ago[ARM] Disabling vfp4 should disable fp16
John Brawn [Fri, 12 Jun 2015 09:38:51 +0000 (09:38 +0000)]
[ARM] Disabling vfp4 should disable fp16

ARMTargetParser::getFPUFeatures should disable fp16 whenever it
disables vfp4, as otherwise something like -mcpu=cortex-a7 -mfpu=none
leaves us with fp16 enabled (though the only effect that will have is
a wrong build attribute).

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

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

8 years agoReplace duplicated iplist<T> types with the corresponding typedefs.
Yaron Keren [Fri, 12 Jun 2015 08:19:32 +0000 (08:19 +0000)]
Replace duplicated iplist<T> types with the corresponding typedefs.

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

8 years agoRangify for loops, NFC.
Yaron Keren [Fri, 12 Jun 2015 05:15:27 +0000 (05:15 +0000)]
Rangify for loops, NFC.

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

8 years agoLowerBitSets: Give names to aliases of unnamed bitset element objects.
Peter Collingbourne [Fri, 12 Jun 2015 03:25:05 +0000 (03:25 +0000)]
LowerBitSets: Give names to aliases of unnamed bitset element objects.

It is valid for globals to be unnamed, but aliases must have a name. To avoid
creating invalid IR, we need to assign names to any aliases we create that
point to unnamed objects that have been moved into combined globals.

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

8 years agoRevert commit r239480 as it causes https://code.google.com/p/chromium/issues/detail...
Teresa Johnson [Fri, 12 Jun 2015 03:12:00 +0000 (03:12 +0000)]
Revert commit r239480 as it causes https://code.google.com/p/chromium/issues/detail?id=499508#c3.

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

8 years agoAdd missing #include, found by modules build.
Richard Smith [Fri, 12 Jun 2015 02:13:45 +0000 (02:13 +0000)]
Add missing #include, found by modules build.

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

8 years ago[SanitizerCoverage] Use llvm::getDISubprogram() to get location of the entry basic...
Alexey Samsonov [Fri, 12 Jun 2015 01:48:47 +0000 (01:48 +0000)]
[SanitizerCoverage] Use llvm::getDISubprogram() to get location of the entry basic block.

DebugLoc::getFnDebugLoc() should soon be removed. Also,
getDISubprogram() might become more effective soon and wouldn't need to
scan debug locations at all, if function-level metadata would be emitted
by Clang.

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

8 years ago[GVN] Use a simpler form of IRBuilder constructor.
Alexey Samsonov [Fri, 12 Jun 2015 01:39:48 +0000 (01:39 +0000)]
[GVN] Use a simpler form of IRBuilder constructor.

Summary:
A side effect of this change is that it IRBuilder now automatically
created debug info locations for new instructions, which is the
same as debug location of insertion point. This is fine for the
functions in questions (GetStoreValueForLoad and
GetMemInstValueForLoad), as they are used in two situations:
  * GVN::processLoad, which tries to eliminate a load. In this case
    new instructions would have the same debug location as the load they
    eventually replace;
  * MaterializeAdjustedValue, which adds new instructions to the end
    of the basic blocks, which could later be used to replace the load
    definition. In this case we don't yet know the way the load would
    be eventually replaced (either by assembling the precomputed values
    via PHI, or by using them directly), so just using the basic block
    strategy seems to be reasonable. There is also a special case
    in the code that *would* adjust the location of the last
    instruction replacing the load definition to the location of the
    load.

Test Plan: regression test suite

Reviewers: echristo, dberlin, dblaikie

Subscribers: llvm-commits

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

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

8 years ago[GVN] Use IRBuilder more actively instead of creating instructions manually.
Alexey Samsonov [Fri, 12 Jun 2015 01:39:45 +0000 (01:39 +0000)]
[GVN] Use IRBuilder more actively instead of creating instructions manually.

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

8 years ago[WinEH] Put finally pointers in the handler scope table field
Reid Kleckner [Thu, 11 Jun 2015 23:37:18 +0000 (23:37 +0000)]
[WinEH] Put finally pointers in the handler scope table field

We were putting them in the filter field, which is correct for 64-bit
but wrong for 32-bit.

Also switch the order of scope table entry emission so outermost entries
are emitted first, and fix an obvious state assignment bug.

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

8 years agoMC: Prune \return corresponding to r239552. [-Wdocumentation]
NAKAMURA Takumi [Thu, 11 Jun 2015 23:04:56 +0000 (23:04 +0000)]
MC: Prune \return corresponding to r239552. [-Wdocumentation]

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

8 years ago[Orc] Attempted fix for GCC ICE on Polly builder.
Lang Hames [Thu, 11 Jun 2015 22:51:01 +0000 (22:51 +0000)]
[Orc] Attempted fix for GCC ICE on Polly builder.

Along the same lines as the fix in r228568.

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

8 years ago[Stackmaps][X86] Remove EFLAGS and IP registers from the live-out mask.
Juergen Ributzka [Thu, 11 Jun 2015 22:40:04 +0000 (22:40 +0000)]
[Stackmaps][X86] Remove EFLAGS and IP registers from the live-out mask.

Remove the EFLAGS from the stackmap live-out mask. The EFLAGS register is not
supposed to be part of that set, because the X86 calling conventions mark the
register as NOT preserved.

Also remove the IP registers, since spilling and restoring those doesn't really
make any sense.

Related to rdar://problem/21019635.

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

8 years ago[WinEH] Create an llvm.x86.seh.exceptioninfo intrinsic
Reid Kleckner [Thu, 11 Jun 2015 22:32:23 +0000 (22:32 +0000)]
[WinEH] Create an llvm.x86.seh.exceptioninfo intrinsic

This intrinsic is like framerecover plus a load. It recovers the EH
registration stack allocation from the parent frame and loads the
exception information field out of it, giving back a pointer to an
EXCEPTION_POINTERS struct. It's designed for clang to use in SEH filter
expressions instead of accessing the EXCEPTION_POINTERS parameter that
is available on x64.

This required a minor change to MC to allow defining a label variable to
another absolute framerecover label variable.

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

8 years ago[Support] Fix a race initializing a static local in MSVC
Reid Kleckner [Thu, 11 Jun 2015 22:22:45 +0000 (22:22 +0000)]
[Support] Fix a race initializing a static local in MSVC

static local initialization isn't thread safe with MSVC and a race was
reported in PR23817. We can't use std::atomic because it's not trivially
constructible, so instead do some lame volatile global integer
manipulation.

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

8 years agoUpdate stale comment before analyzeLoopUnrollCost. NFC.
Michael Zolotukhin [Thu, 11 Jun 2015 22:17:39 +0000 (22:17 +0000)]
Update stale comment before analyzeLoopUnrollCost. NFC.

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

8 years ago[Orc] Remove some unnecesary includes and whitespace that slipped in to r239561.
Lang Hames [Thu, 11 Jun 2015 22:12:24 +0000 (22:12 +0000)]
[Orc] Remove some unnecesary includes and whitespace that slipped in to r239561.

NFC.

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

8 years ago[Orc] Make partition identification in the CompileOnDemand layer lazy.
Lang Hames [Thu, 11 Jun 2015 21:45:19 +0000 (21:45 +0000)]
[Orc] Make partition identification in the CompileOnDemand layer lazy.

This also breaks out the logical dylib symbol resolution logic.

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

8 years agoObject: Prepend __imp_ when mangling a dllimport symbol in IRObjectFile.
Peter Collingbourne [Thu, 11 Jun 2015 21:42:18 +0000 (21:42 +0000)]
Object: Prepend __imp_ when mangling a dllimport symbol in IRObjectFile.

We cannot prepend __imp_ in the IR mangler because a function reference may
be emitted unmangled in a constant initializer. The linker is expected to
resolve such references to thunks. This is covered by the new test case.

Strictly speaking we ought to emit two undefined symbols, one with __imp_ and
one without, as we cannot know which symbol the final object file will refer
to. However, this would require rather intrusive changes to IRObjectFile,
and lld works fine without it for now.

This reimplements r239437, which was reverted in r239502.

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

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

8 years agoLTO: expose LTO_SYMBOL_COMDAT flag, which indicates that the definition is part of...
Peter Collingbourne [Thu, 11 Jun 2015 21:41:27 +0000 (21:41 +0000)]
LTO: expose LTO_SYMBOL_COMDAT flag, which indicates that the definition is part of a comdat group.

Reviewers: rafael

Subscribers: llvm-commits, ruiu

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

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

8 years agoFix English usage in command line flag help string.
Douglas Katzman [Thu, 11 Jun 2015 20:03:23 +0000 (20:03 +0000)]
Fix English usage in command line flag help string.

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

8 years ago[ELF] Introduce getValue() for ELF Symbols.
Davide Italiano [Thu, 11 Jun 2015 19:59:04 +0000 (19:59 +0000)]
[ELF] Introduce getValue() for ELF Symbols.

Differential Revision: http://reviews.llvm.org/D10328
Reviewed by: rafael

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

8 years agoReplace string GNU Triples with llvm::Triple in TargetMachine. NFC.
Daniel Sanders [Thu, 11 Jun 2015 19:41:26 +0000 (19:41 +0000)]
Replace string GNU Triples with llvm::Triple in TargetMachine. NFC.

Summary:
For the moment, TargetMachine::getTargetTriple() still returns a StringRef.

This continues the patch series to eliminate StringRef forms of GNU triples
from the internals of LLVM that began in r239036.

Reviewers: rengolin

Reviewed By: rengolin

Subscribers: ted, llvm-commits, rengolin, jholewinski

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

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

8 years ago[CodeGen] ArrayRef'ize cond/pred in various TII APIs. NFC.
Ahmed Bougacha [Thu, 11 Jun 2015 19:30:37 +0000 (19:30 +0000)]
[CodeGen] ArrayRef'ize cond/pred in various TII APIs. NFC.

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

8 years agoGeneralize emitAbsoluteSymbolDiff.
Rafael Espindola [Thu, 11 Jun 2015 18:58:08 +0000 (18:58 +0000)]
Generalize emitAbsoluteSymbolDiff.

This makes emitAbsoluteSymbolDiff always succeed and moves logic from the asm
printer to it.

The object one now also works on ELF. If two symbols are in the same fragment,
we will never move them apart.

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

8 years agoSet proper debug location for branch added in BasicBlock::splitBasicBlock().
Alexey Samsonov [Thu, 11 Jun 2015 18:25:54 +0000 (18:25 +0000)]
Set proper debug location for branch added in BasicBlock::splitBasicBlock().

This improves debug locations in passes that do a lot of basic block
transformations. Important case is LoopUnroll pass, the test for correct
debug locations accompanies this change.

Test Plan: regression test suite

Reviewers: dblaikie, sanjoy

Subscribers: llvm-commits

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

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

8 years ago[LoopUnroll] Use IRBuilder to create branch instructions.
Alexey Samsonov [Thu, 11 Jun 2015 18:25:44 +0000 (18:25 +0000)]
[LoopUnroll] Use IRBuilder to create branch instructions.

Use IRBuilder::Create(Cond)?Br instead of constructing instructions
manually with BranchInst::Create(). It's consistent with other
uses of IRBuilder in this pass, and has an additional important
benefit:

Using IRBuilder will ensure that new branch instruction will get
the same debug location as original terminator instruction it will
eventually replace.

For now I'm not adding a testcase, as currently original terminator
instruction also lack debug location due to missing debug location
propagation in BasicBlock::splitBasicBlock. That is, the testcase
will accompany the fix for the latter I'm going to mail soon.

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

8 years agoReplace an instance of custom atomics with standard ones.
Benjamin Kramer [Thu, 11 Jun 2015 17:30:34 +0000 (17:30 +0000)]
Replace an instance of custom atomics with standard ones.

Eventually I want to get rid of them entirely, but Statistic.h is still blocked
on MSVC bugs. No functionality change.

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

8 years agoThis reverts commit r239529 and r239514.
Rafael Espindola [Thu, 11 Jun 2015 17:30:33 +0000 (17:30 +0000)]
This reverts commit r239529 and  r239514.

Revert "[AArch64] Match interleaved memory accesses into ldN/stN instructions."
Revert "Fixing MSVC 2013 build error."

The  test/CodeGen/AArch64/aarch64-interleaved-accesses.ll test was failing on OS X.

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

8 years agoRevert "Fix merges of non-zero vector stores"
Reid Kleckner [Thu, 11 Jun 2015 17:25:24 +0000 (17:25 +0000)]
Revert "Fix merges of non-zero vector stores"

This reverts commit r239539.

It was causing SDAG assertions while building freetype.

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

8 years agoFix comment typos.
Douglas Katzman [Thu, 11 Jun 2015 16:46:27 +0000 (16:46 +0000)]
Fix comment typos.

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

8 years agoSLSR: Pass address space to isLegalAddressingMode
Matt Arsenault [Thu, 11 Jun 2015 16:13:39 +0000 (16:13 +0000)]
SLSR: Pass address space to isLegalAddressingMode

This only updates one of the uses. The other is used in cases
that may never touch memory, so I'm not sure why this is even
calling it. Perhaps there should be a new, similar hook for such
cases or pass -1 for unknown address space.

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

8 years agoFix merges of non-zero vector stores
Matt Arsenault [Thu, 11 Jun 2015 16:03:52 +0000 (16:03 +0000)]
Fix merges of non-zero vector stores

Now actually stores the non-zero constant instead of 0.
I somehow forgot to include this part of r238108.

The test change was just an independent instruction order swap,
so just add another check line to satisfy CHECK-NEXT.

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

8 years agoReplace string GNU Triples with llvm::Triple in computeDataLayout(). NFC.
Daniel Sanders [Thu, 11 Jun 2015 15:34:59 +0000 (15:34 +0000)]
Replace string GNU Triples with llvm::Triple in computeDataLayout(). NFC.

Summary:
This continues the patch series to eliminate StringRef forms of GNU triples
from the internals of LLVM that began in r239036.

Reviewers: rengolin

Reviewed By: rengolin

Subscribers: llvm-commits, jfb, rengolin

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

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

8 years agoR600/SI: Define latency for flat instructions
Tom Stellard [Thu, 11 Jun 2015 14:51:50 +0000 (14:51 +0000)]
R600/SI: Define latency for flat instructions

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

8 years agoR600/SI: Move flat instruction defs to CIInstructions.td
Tom Stellard [Thu, 11 Jun 2015 14:51:49 +0000 (14:51 +0000)]
R600/SI: Move flat instruction defs to CIInstructions.td

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

8 years agoR600/SI: Add -mcpu=bonaire to a test that uses flat address space
Tom Stellard [Thu, 11 Jun 2015 14:51:46 +0000 (14:51 +0000)]
R600/SI: Add -mcpu=bonaire to a test that uses flat address space

Flat instructions don't exist on SI, but there is a bug in the backend that
allows them to be selected.

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

8 years agoremove function names from comments; NFC
Sanjay Patel [Thu, 11 Jun 2015 14:26:49 +0000 (14:26 +0000)]
remove function names from comments; NFC

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

8 years agoFixing MSVC 2013 build error.
Aaron Ballman [Thu, 11 Jun 2015 13:06:02 +0000 (13:06 +0000)]
Fixing MSVC 2013 build error.

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

8 years agoRecommit "[mips] [IAS] Add support for BNE and BEQ with an immediate operand." (r239396).
Toma Tabacu [Thu, 11 Jun 2015 10:36:10 +0000 (10:36 +0000)]
Recommit "[mips] [IAS] Add support for BNE and BEQ with an immediate operand." (r239396).

Apparently, Arcanist didn't include some of my local changes in my previous
commit attempt.

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

8 years ago[mips][microMIPS] Implement ERET and ERETNC instructions
Zoran Jovanovic [Thu, 11 Jun 2015 10:22:46 +0000 (10:22 +0000)]
[mips][microMIPS] Implement ERET and ERETNC instructions
http://reviews.llvm.org/D10091

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

8 years ago[mips] Change existing uimm10 operand to restrict the accepted immediates
Zoran Jovanovic [Thu, 11 Jun 2015 09:51:58 +0000 (09:51 +0000)]
[mips] Change existing uimm10 operand to restrict the accepted immediates
http://reviews.llvm.org/D10312

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

8 years ago[mips][microMIPSr6] Change disassembler tests to one line format
Zoran Jovanovic [Thu, 11 Jun 2015 09:42:10 +0000 (09:42 +0000)]
[mips][microMIPSr6] Change disassembler tests to one line format

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

8 years ago[LoopVectorize] Revert the enabling of interleaved memory access in Loop Vectorizor...
Hao Liu [Thu, 11 Jun 2015 09:18:07 +0000 (09:18 +0000)]
[LoopVectorize] Revert the enabling of interleaved memory access in Loop Vectorizor, which was wrongly committed in r239514.

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

8 years ago[AArch64] Match interleaved memory accesses into ldN/stN instructions.
Hao Liu [Thu, 11 Jun 2015 09:05:02 +0000 (09:05 +0000)]
[AArch64] Match interleaved memory accesses into ldN/stN instructions.

Add a pass AArch64InterleavedAccess to identify and match interleaved memory accesses. This pass transforms an interleaved load/store into ldN/stN intrinsic. As Loop Vectorizor disables optimization on interleaved accesses by default, this optimization is also disabled by default. To enable it by "-aarch64-interleaved-access-opt=true"

E.g. Transform an interleaved load (Factor = 2):
       %wide.vec = load <8 x i32>, <8 x i32>* %ptr
       %v0 = shuffle %wide.vec, undef, <0, 2, 4, 6>  ; Extract even elements
       %v1 = shuffle %wide.vec, undef, <1, 3, 5, 7>  ; Extract odd elements
     Into:
       %ld2 = { <4 x i32>, <4 x i32> } call aarch64.neon.ld2(%ptr)
       %v0 = extractelement { <4 x i32>, <4 x i32> } %ld2, i32 0
       %v1 = extractelement { <4 x i32>, <4 x i32> } %ld2, i32 1

E.g. Transform an interleaved store (Factor = 2):
       %i.vec = shuffle %v0, %v1, <0, 4, 1, 5, 2, 6, 3, 7>  ; Interleaved vec
       store <8 x i32> %i.vec, <8 x i32>* %ptr
     Into:
       %v0 = shuffle %i.vec, undef, <0, 1, 2, 3>
       %v1 = shuffle %i.vec, undef, <4, 5, 6, 7>
       call void aarch64.neon.st2(%v0, %v1, %ptr)

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

8 years ago[LiveVariables] Improve isLiveOut runtime performances. NFC.
Arnaud A. de Grandmaison [Thu, 11 Jun 2015 07:50:21 +0000 (07:50 +0000)]
[LiveVariables] Improve isLiveOut runtime performances. NFC.

On large goto table based interpreters, where phi nodes can have (very) large
fan-ins, isLiveOut exhibited poor performances: about 40% of the full
codegen time was spent in PHIElim, sorting MachineBasicBlock addresses.

This patch improve the performances for such cases, and does not show
compile time regressions on the LNT, at bootstrap (llvm+clang+lldb) or
any other benchmarks we have in-house.

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

8 years ago[X86][SSE] Vectorized i8 and i16 shift operators
Simon Pilgrim [Thu, 11 Jun 2015 07:46:37 +0000 (07:46 +0000)]
[X86][SSE] Vectorized i8 and i16 shift operators

This patch ensures that SHL/SRL/SRA shifts for i8 and i16 vectors avoid scalarization. It builds on the existing i8 SHL vectorized implementation of moving the shift bits up to the sign bit position and separating the 4, 2 & 1 bit shifts with several improvements:

1 - SSE41 targets can use (v)pblendvb directly with the sign bit instead of performing a comparison to feed into a VSELECT node.
2 - pre-SSE41 targets were masking + comparing with an 0x80 constant - we avoid this by using the fact that a set sign bit means a negative integer which can be compared against zero to then feed into VSELECT, avoiding the need for a constant mask (zero generation is much cheaper).
3 - SRA i8 needs to be unpacked to the upper byte of a i16 so that the i16 psraw instruction can be correctly used for sign extension - we have to do more work than for SHL/SRL but perf tests indicate that this is still beneficial.

The i16 implementation is similar but simpler than for i8 - we have to do 8, 4, 2 & 1 bit shifts but less shift masking is involved. SSE41 use of (v)pblendvb requires that the i16 shift amount is splatted to both bytes however.

Tested on SSE2, SSE41 and AVX machines.

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

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

8 years ago[PHIElim] Use ranges and const-ify, NFC.
Arnaud A. de Grandmaison [Thu, 11 Jun 2015 07:45:05 +0000 (07:45 +0000)]
[PHIElim] Use ranges and const-ify, NFC.

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

8 years agoLLVM support for vector quad bit permute and gather instructions through builtins
Nemanja Ivanovic [Thu, 11 Jun 2015 06:21:25 +0000 (06:21 +0000)]
LLVM support for vector quad bit permute and gather instructions through builtins

This patch corresponds to review:
http://reviews.llvm.org/D10096

This is the back end portion of the patch related to D10095.
The patch adds the instructions and back end intrinsics for:
vbpermq
vgbbd

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

8 years agoRevert "Move dllimport name mangling to IR mangler."
Reid Kleckner [Thu, 11 Jun 2015 01:31:48 +0000 (01:31 +0000)]
Revert "Move dllimport name mangling to IR mangler."

This reverts commit r239437.

This broke clang-cl self-hosts. We'd end up calling the __imp_ symbol
directly instead of using it to do an indirect function call.

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

8 years agoRemove MachineModuleInfo::UsedFunctions as it has no users.
Pete Cooper [Thu, 11 Jun 2015 01:04:56 +0000 (01:04 +0000)]
Remove MachineModuleInfo::UsedFunctions as it has no users.

It hasn't been used since r130964.

This also removes MachineModuleInfo::isUsedFunction and
MachineModuleInfo::AnalyzeModule, both of which were only
there to support UsedFunctions.

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

8 years agochange assert that will never fire to llvm_unreachable
Sanjay Patel [Wed, 10 Jun 2015 23:27:33 +0000 (23:27 +0000)]
change assert that will never fire to llvm_unreachable

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

8 years ago[NFC] added a missing space
Jingyue Wu [Wed, 10 Jun 2015 22:54:02 +0000 (22:54 +0000)]
[NFC] added a missing space

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

8 years agoStop returning a Use* from allocHungOffUses.
Pete Cooper [Wed, 10 Jun 2015 22:38:46 +0000 (22:38 +0000)]
Stop returning a Use* from allocHungOffUses.

This always just set the User::OperandList which is now set
in that method instead of being returned.

Reviewed by Duncan Exon Smith.

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

8 years agoAdd User::growHungoffUses and use it to grow the hung off uses. NFC.
Pete Cooper [Wed, 10 Jun 2015 22:38:41 +0000 (22:38 +0000)]
Add User::growHungoffUses and use it to grow the hung off uses. NFC.

PhiNode, SwitchInst, LandingPad and IndirectBr all had virtually identical
logic for growing the hung off uses.
Move it to User so that they can all call a single shared implementation.

Their destructors were all empty after this change and were deleted.  They all
have virtual clone_impl methods which can be used as vtable anchors.

Reviewed by Duncan Exon Smith.

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

8 years agoDelete User::dropHungOffUses and move it in to ~User which is the only caller. NFC.
Pete Cooper [Wed, 10 Jun 2015 22:38:38 +0000 (22:38 +0000)]
Delete User::dropHungOffUses and move it in to ~User which is the only caller. NFC.

Now that the subclasses which care about hung off uses let ~User clean it up,
there's no need for a separate method.  Just inline it to ~User and delete it.

Reviewed by Duncan Exon Smith.

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

8 years agoMake User track whether a class has 'hung off uses' and delete them in its destructor.
Pete Cooper [Wed, 10 Jun 2015 22:38:34 +0000 (22:38 +0000)]
Make User track whether a class has 'hung off uses' and delete them in its destructor.

Currently all of the logic for deleting hung off uses, which PHI/switch/etc use,
is in their classes.

This adds a bit to Value which tracks whether that user had hung off uses,
then User can be responsible for clearing them instead of the sub classes.

Note, the bit used here was taken from NumOperands which was 30-bits.
Given the reduction to 29 bits, and the average User being just over 100 bytes,
a single User with 29-bits of num operands would need 50GB of RAM for itself
so its reasonable to assume that 29-bits is enough for now.

This is a step towards hiding all the hung off uses logic in the User.

Reviewed by Duncan Exon Smith.

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

8 years agoMove the special Phi logic for hung off uses in to User::allocHungOffUses. NFC.
Pete Cooper [Wed, 10 Jun 2015 22:38:30 +0000 (22:38 +0000)]
Move the special Phi logic for hung off uses in to User::allocHungOffUses. NFC.

PhiNode's need to allocate space for an array of Use[N] and then BasicBlock*[N].

They had their own allocHungOffUses to handle all of this.  This moves the logic
in to User::allocHungOffUses and PhiNode passes in a bool to say to allocate
the BB* space too.

Reviewed by Duncan Exon Smith.

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

8 years agoArgumentPromotion: Drop sret attribute on functions that are only called directly.
Peter Collingbourne [Wed, 10 Jun 2015 21:14:34 +0000 (21:14 +0000)]
ArgumentPromotion: Drop sret attribute on functions that are only called directly.

If the first argument to a function is a 'this' argument and the second
has the sret attribute, the ArgumentPromotion pass may promote the 'this'
argument to more than one argument, violating the IR constraint that 'sret'
may only be applied to the first or second argument.

Although this IR constraint is arguably unnecessary, it highlighted the fact
that ArgPromotion does not need to preserve this attribute. Dropping the
attribute reduces register pressure in the backend by avoiding the register
copy required by sret. Because sret implies noalias, we also replace the
former with the latter.

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

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

8 years ago[x86] Add a reassociation optimization to increase ILP via the MachineCombiner pass
Sanjay Patel [Wed, 10 Jun 2015 20:32:21 +0000 (20:32 +0000)]
[x86] Add a reassociation optimization to increase ILP via the MachineCombiner pass

This is a reimplementation of D9780 at the machine instruction level rather than the DAG.

Use the MachineCombiner pass to reassociate scalar single-precision AVX additions (just a
starting point; see the TODO comments) to increase ILP when it's safe to do so.

The code is closely based on the existing MachineCombiner optimization that is implemented
for AArch64.

This patch should not cause the kind of spilling tragedy that led to the reversion of r236031.

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

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

8 years agopunctuation policing; NFC
Sanjay Patel [Wed, 10 Jun 2015 19:52:58 +0000 (19:52 +0000)]
punctuation policing; NFC

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

8 years ago[WinEH] _except_handlerN uses 0 instead of 1 to indicate catch-all
Reid Kleckner [Wed, 10 Jun 2015 18:14:07 +0000 (18:14 +0000)]
[WinEH] _except_handlerN uses 0 instead of 1 to indicate catch-all

Our usage of 1 was a holdover from __C_specific_handler.

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

8 years agoAdd new EliminateAvailableExternally module pass, which is performed in
Teresa Johnson [Wed, 10 Jun 2015 17:49:28 +0000 (17:49 +0000)]
Add new EliminateAvailableExternally module pass, which is performed in
O2 compiles just before GlobalDCE, unless we are preparing for LTO.

This pass eliminates available externally globals (turning them into
declarations), regardless of whether they are dead/unreferenced, since
we are guaranteed to have a copy available elsewhere at link time.
This enables additional opportunities for GlobalDCE.

If we are preparing for LTO (e.g. a -flto -c compile), the pass is not
included as we want to preserve available externally functions for possible
link time inlining. The FE indicates whether we are doing an -flto compile
via the new PrepareForLTO flag on the PassManagerBuilder.

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

8 years ago[GVN] Set proper debug locations for some instructions created by GVN.
Alexey Samsonov [Wed, 10 Jun 2015 17:37:38 +0000 (17:37 +0000)]
[GVN] Set proper debug locations for some instructions created by GVN.

Determining proper debug locations for instructions created in
PHITransAddr is tricky. We use a simple approach here and simply copy
debug locations from instructions computing load address to
"corresponding" instructions re-creating the address computation
in predecessor basic blocks.

This may not always be correct, given all the rearrangement and
simplification going on, and debug locations may jump around a lot,
as the basic blocks we copy locations between may be very far from
each other.

Still, this would work good in most simple cases (e.g. when chain
of address computing instruction is short, or our mapping turns out
to be 1-to-1), and we desire to have *some* reasonable debug locations
associated with newly inserted instructions.

See http://reviews.llvm.org/D10351 review thread for more details.

Test Plan: regression test suite

Reviewers: spatel, dblaikie

Subscribers: llvm-commits

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

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

8 years agofix typo in comment; NFC
Sanjay Patel [Wed, 10 Jun 2015 17:08:12 +0000 (17:08 +0000)]
fix typo in comment; NFC

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

8 years ago[Hexagon] Adding decoders for signed operands and ensuring all signed operand types...
Colin LeMahieu [Wed, 10 Jun 2015 16:52:32 +0000 (16:52 +0000)]
[Hexagon] Adding decoders for signed operands and ensuring all signed operand types disassemble correctly.

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

8 years ago[Hexagon] Make global arrays 'static const'. NFC.
Benjamin Kramer [Wed, 10 Jun 2015 14:43:59 +0000 (14:43 +0000)]
[Hexagon] Make global arrays 'static const'. NFC.

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

8 years ago[Statepoints] Add test case to check that statepoint is marked with Throwable attribute.
Igor Laevsky [Wed, 10 Jun 2015 13:24:00 +0000 (13:24 +0000)]
[Statepoints] Add test case to check that statepoint is marked with Throwable attribute.

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

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

8 years ago[StatepointLowering] Reuse stack slots across basic blocks
Igor Laevsky [Wed, 10 Jun 2015 12:31:53 +0000 (12:31 +0000)]
[StatepointLowering] Reuse stack slots across basic blocks

During statepoint lowering we can sometimes avoid spilling of the value if we know that it was already spilled for previous statepoint.
We were doing this by checking if incoming statepoint value was lowered into load from stack slot. This was working only in boundaries of one basic block.

But instead of looking at the lowered node we can look directly at the llvm-ir value and if it was gc.relocate (or some simple modification of it) look up stack slot for it's derived pointer and reuse stack slot from it. This allows us to look across basic block boundaries.

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

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

8 years agoReplace string GNU Triples with llvm::Triple in MCSubtargetInfo and create*MCSubtarge...
Daniel Sanders [Wed, 10 Jun 2015 12:11:26 +0000 (12:11 +0000)]
Replace string GNU Triples with llvm::Triple in MCSubtargetInfo and create*MCSubtargetInfo(). NFC.

Summary:
This continues the patch series to eliminate StringRef forms of GNU triples
from the internals of LLVM that began in r239036.

Reviewers: rafael

Reviewed By: rafael

Subscribers: rafael, ted, jfb, llvm-commits, rengolin, jholewinski

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

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

8 years agoReplace string GNU Triples with llvm::Triple in create*MCRelocationInfo(). NFC.
Daniel Sanders [Wed, 10 Jun 2015 10:54:40 +0000 (10:54 +0000)]
Replace string GNU Triples with llvm::Triple in create*MCRelocationInfo(). NFC.

Summary:
This continues the patch series to eliminate StringRef forms of GNU triples
from the internals of LLVM that began in r239036.

Reviewers: rafael

Reviewed By: rafael

Subscribers: rafael, llvm-commits, rengolin

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

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

8 years agoReplace string GNU Triples with llvm::Triple in MCAsmBackend subclasses and create...
Daniel Sanders [Wed, 10 Jun 2015 10:35:34 +0000 (10:35 +0000)]
Replace string GNU Triples with llvm::Triple in MCAsmBackend subclasses and create*AsmBackend(). NFC.

Summary:
This continues the patch series to eliminate StringRef forms of GNU triples
from the internals of LLVM that began in r239036.

Reviewers: echristo, rafael

Reviewed By: rafael

Subscribers: rafael, llvm-commits, rengolin

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

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

8 years agoAVX-512: Fixed a bug in comparison of i1 vectors.
Elena Demikhovsky [Wed, 10 Jun 2015 06:49:28 +0000 (06:49 +0000)]
AVX-512: Fixed a bug in comparison of i1 vectors.
cmp eq should give kxnor instruction
cmp neq should give kxor

https://llvm.org/bugs/show_bug.cgi?id=23631

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

8 years agoReplace magic number 19 with the constant GlobalValueSubClassDataBits.
Yaron Keren [Wed, 10 Jun 2015 06:00:59 +0000 (06:00 +0000)]
Replace magic number 19 with the constant GlobalValueSubClassDataBits.

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

8 years agofix crash
Alexei Starovoitov [Wed, 10 Jun 2015 03:06:06 +0000 (03:06 +0000)]
fix crash

fix segfault by checking for UnknownArch, since
getArchTypePrefix() will return nullptr for UnknownArch.

This fixes regression caused by r238424.

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

8 years agoRemove unnecessary conversion from StringRef to std::string and back to StringRef...
Craig Topper [Wed, 10 Jun 2015 02:07:37 +0000 (02:07 +0000)]
Remove unnecessary conversion from StringRef to std::string and back to StringRef. NFC.

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

8 years ago[WinEH] Call llvm.stackrestore in __except blocks
Reid Kleckner [Wed, 10 Jun 2015 01:34:54 +0000 (01:34 +0000)]
[WinEH] Call llvm.stackrestore in __except blocks

We have to do this manually, the runtime only sets up ebp. Fixes a crash
when returning after catching an exception.

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

8 years agoRemove safeseh debug print and remove extra braces
Reid Kleckner [Wed, 10 Jun 2015 01:13:44 +0000 (01:13 +0000)]
Remove safeseh debug print and remove extra braces

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

8 years ago[WinEH] Emit .safeseh directives for all 32-bit exception handlers
Reid Kleckner [Wed, 10 Jun 2015 01:02:30 +0000 (01:02 +0000)]
[WinEH] Emit .safeseh directives for all 32-bit exception handlers

Use a "safeseh" string attribute to do this. You would think we chould
just accumulate the set of personalities like we do on dwarf, but this
fails to account for the LSDA-loading thunks we use for
__CxxFrameHandler3. Each of those needs to make it into .sxdata as well.
The string attribute seemed like the most straightforward approach.

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

8 years agoFix -Wsign-compare warning in WinException.cpp
Reid Kleckner [Wed, 10 Jun 2015 00:04:53 +0000 (00:04 +0000)]
Fix -Wsign-compare warning in WinException.cpp

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

8 years agoFix warning of comparing different enums. NFC
Pete Cooper [Tue, 9 Jun 2015 23:33:35 +0000 (23:33 +0000)]
Fix warning of comparing different enums.  NFC

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

8 years agoAdd explicit -mtriple=arm-unknown to llvm/test/CodeGen/ARM/disable-tail-calls.ll...
NAKAMURA Takumi [Tue, 9 Jun 2015 23:33:25 +0000 (23:33 +0000)]
Add explicit -mtriple=arm-unknown to llvm/test/CodeGen/ARM/disable-tail-calls.ll, to satisfy *-win32.

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

8 years agoRevert "Move MCSymbol Value in to the union of Offset and CommonSize."
Pete Cooper [Tue, 9 Jun 2015 22:35:55 +0000 (22:35 +0000)]
Revert "Move MCSymbol Value in to the union of Offset and CommonSize."

This reverts commit 2e449ec5bcdf67b52b315b16c2128aaf25d5b73c.

This was svn r239440.  Its currently failing an ARM test so reverting while I work out
what to do next.

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

8 years agoMove MCSymbol Value in to the union of Offset and CommonSize.
Pete Cooper [Tue, 9 Jun 2015 22:21:37 +0000 (22:21 +0000)]
Move MCSymbol Value in to the union of Offset and CommonSize.

It wasn't possible to have a variable Symbol with offset or 'isCommon' so
this just enables better packing of the MCSymbol class.

Reviewed by Rafael Espindola.

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

8 years ago[RegisterScavenger] Fix handling of predicated instructions
Tobias Edler von Koch [Tue, 9 Jun 2015 22:10:58 +0000 (22:10 +0000)]
[RegisterScavenger] Fix handling of predicated instructions

Summary:
The RegisterScavenger explicitly ignores <kill> flags on operands of
predicated instructions and therefore assumes that such registers remain
live. When it then scavenges such a register, it inserts a spill of this
(killed) register. This is invalid code and gets flagged up by the
verifier.

Nowadays kill flags are set correctly on predicated instructions. This
patch makes the Scavenger respect them.

The bug has so far only been triggered by an internal pass, so I don't
have a test case unfortunately.

Fixes PR23119.

Reviewers: hfinkel, tobiasvk_caf

Subscribers: llvm-commits

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

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

8 years ago[BasicBlockUtils] Set debug locations for instructions created in SplitBlockPredecessors.
Alexey Samsonov [Tue, 9 Jun 2015 22:10:29 +0000 (22:10 +0000)]
[BasicBlockUtils] Set debug locations for instructions created in SplitBlockPredecessors.

Test Plan: regression test suite

Reviewers: eugenis, dblaikie

Subscribers: llvm-commits

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

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

8 years agoMove dllimport name mangling to IR mangler.
Peter Collingbourne [Tue, 9 Jun 2015 22:09:53 +0000 (22:09 +0000)]
Move dllimport name mangling to IR mangler.

This ensures that LTO clients see the correct external symbol name.

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

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

8 years ago[NVPTX] fix a crash bug in NVPTXFavorNonGenericAddrSpaces
Jingyue Wu [Tue, 9 Jun 2015 21:50:32 +0000 (21:50 +0000)]
[NVPTX] fix a crash bug in NVPTXFavorNonGenericAddrSpaces

Summary:
We used to assume V->RAUW only modifies the operand list of V's user.
However, if V and V's user are Constants, RAUW may replace and invalidate V's
user entirely.

This patch fixes the above issue by letting the caller replace the
operand instead of calling RAUW on Constants.

Test Plan: @nested_const_expr and @rauw in access-non-generic.ll

Reviewers: broune, jholewinski

Reviewed By: broune, jholewinski

Subscribers: jholewinski, llvm-commits

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

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

8 years agoLibDriver, llvm-lib: introduce.
Peter Collingbourne [Tue, 9 Jun 2015 21:50:22 +0000 (21:50 +0000)]
LibDriver, llvm-lib: introduce.

llvm-lib is intended to be a lib.exe compatible utility that also
understands bitcode. The implementation lives in a library so that
lld can use it to implement /lib.

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

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

8 years ago[WinEH] Add 32-bit SEH state table emission prototype
Reid Kleckner [Tue, 9 Jun 2015 21:42:19 +0000 (21:42 +0000)]
[WinEH] Add 32-bit SEH state table emission prototype

This gets all the handler info through to the asm printer and we can
look at the .xdata tables now. I've convinced one small catch-all test
case to work, but other than that, it would be a stretch to say this is
functional.

The state numbering algorithm avoids doing any scope reconstruction as
we do for C++ to simplify the implementation.

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

8 years ago[AArch64] Remove an overly conservative check when generating store pairs.
Chad Rosier [Tue, 9 Jun 2015 20:59:41 +0000 (20:59 +0000)]
[AArch64] Remove an overly conservative check when generating store pairs.

Store instructions do not modify register values and therefore it's safe
to form a store pair even if the source register has been read in between
the two store instructions.

Previously, the read of w1 (see below) prevented the formation of a stp.

        str      w0, [x2]
        ldr     w8, [x2, #8]
        add      w0, w8, w1
        str     w1, [x2, #4]
        ret

We now generate the following code.

        stp      w0, w1, [x2]
        ldr     w8, [x2, #8]
        add      w0, w8, w1
        ret

All correctness tests with -Ofast on A57 with Spec200x and EEMBC pass.
Performance results for SPEC2K were within noise.

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

8 years agoUse AlignOf traits to enable static_assert.
Pete Cooper [Tue, 9 Jun 2015 20:58:03 +0000 (20:58 +0000)]
Use AlignOf traits to enable static_assert.

This is better than runtime asserts.  Thanks to David Blaikie for the help here.

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

8 years agoReplace loop with std::equal. NFC intended.
Benjamin Kramer [Tue, 9 Jun 2015 20:41:21 +0000 (20:41 +0000)]
Replace loop with std::equal. NFC intended.

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