7 years ago[Orc] Fix a bug in the CompileOnDemand layer where stub decls were not cloned
Lang Hames [Fri, 12 Jun 2015 21:31:15 +0000 (21:31 +0000)]
[Orc] Fix a bug in the CompileOnDemand layer where stub decls were not cloned
into partitions. Also, add an option to clone stub definitions (not just decls)
into partitions: these definitions could be inlined in some places to avoid the
overhead of calling via the stub.

Found by inspection - no test case yet, although I plan to add a unit test for
this once the CompileOnDemand layer refactoring settles down.

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

7 years agoR600/SI: Add assembler support for FLAT instructions
Tom Stellard [Fri, 12 Jun 2015 20:47:06 +0000 (20:47 +0000)]
R600/SI: Add assembler support for FLAT instructions

- Add glc, slc, and tfe operands to flat instructions
- Add missing flat instructions
- Fix the encoding of flat_load_dwordx3 and flat_store_dwordx3.

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

7 years agoRangify several for loops in ValueEnumerator constructor.
Yaron Keren [Fri, 12 Jun 2015 20:18:20 +0000 (20:18 +0000)]
Rangify several for loops in ValueEnumerator constructor.

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

7 years ago[Hexagon] Making intrinsic tests agnostic to register allocation. Narrowing intrinsi...
Colin LeMahieu [Fri, 12 Jun 2015 19:57:32 +0000 (19:57 +0000)]
[Hexagon] Making intrinsic tests agnostic to register allocation.  Narrowing intrinsic parameters to appropriate width.

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

7 years agoWrap some long lines in LLVMBuild files. NFC
Douglas Katzman [Fri, 12 Jun 2015 18:44:57 +0000 (18:44 +0000)]
Wrap some long lines in LLVMBuild files. NFC

As suggested by jroelofs in a prior review (D9752),
it makes sense to generally prefer multi-line format.

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

7 years agoAdd 'shave' processor name to Triple
Douglas Katzman [Fri, 12 Jun 2015 18:31:38 +0000 (18:31 +0000)]
Add 'shave' processor name to Triple

Based on ArchType, Clang's driver can select a non-Clang compiler.
String parsing in Clang would have sufficed if it were only that,
however this change anticipates true llvm support.

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

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

7 years agoRefix a use of explicit pointer types in GEP constant folding
David Blaikie [Fri, 12 Jun 2015 18:22:03 +0000 (18:22 +0000)]
Refix a use of explicit pointer types in GEP constant folding

In the glorious future of opaque pointer types, it won't be possible to
retrieve the pointee type of a pointer type which is what's being done
in this GEP loop - but the first iteration is always a pointer type and
the loop doesn't care about that case, except whether or not the index
is a constant.

So pull that special case out before the loop and start at the second
iteration (index 1) instead.

Originally committed in r236670 and reverted with a test case in
r239015. This change keeps the test case working while also avoiding
depending on pointee types.

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

7 years agoFix a typo in a comment in MemCpyOpt (test commit)
Matt Wala [Fri, 12 Jun 2015 18:16:51 +0000 (18:16 +0000)]
Fix a typo in a comment in MemCpyOpt (test commit)

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

7 years agoRangify two for loops in BitcodeReader.cpp.
Yaron Keren [Fri, 12 Jun 2015 18:13:20 +0000 (18:13 +0000)]
Rangify two for loops in BitcodeReader.cpp.

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

7 years agoRemove unnecessary MCExpr.h include from MCSymbol.h
Pete Cooper [Fri, 12 Jun 2015 18:07:34 +0000 (18:07 +0000)]
Remove unnecessary MCExpr.h include from MCSymbol.h

MCSymbol.h already forwards declares MCExpr and only uses MCExpr* so doesn't
need to include the header.

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

7 years agoRemove a bunch of inline keywords from User. NFC.
Pete Cooper [Fri, 12 Jun 2015 17:48:21 +0000 (17:48 +0000)]
Remove a bunch of inline keywords from User.  NFC.

This came up in the patch review for http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20150608/281362.html.

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

7 years agoMove OperandList to be allocated prior to User for hung off subclasses.
Pete Cooper [Fri, 12 Jun 2015 17:48:18 +0000 (17:48 +0000)]
Move OperandList to be allocated prior to User for hung off subclasses.

For hung off uses, we need a Use* to tell use where the operands are.
This was User::OperandList but we want to remove that to save space
of all subclasses which aren't making use of 'hung off uses'.

Hung off uses now allocate their own 'OperandList' Use* in the
User::new which they call.

getOperandList() now uses the hung off uses bit to work out where the
Use* for the OperandList lives.  If a User has hung off uses, then this
bit tells them to go back a single Use* from the User* and use that
value as the OperandList.

If a User has no hung off uses, then we get the first operand by
subtracting (NumOperands * sizeof(Use)) from the User this pointer.

This saves a pointer from User and all subclasses.  Given the average
size of a subclass of User is 112 or 128 bytes, this saves around 7% of space
With malloc tending to align to 16-bytes the real saving is typically more like 3.5%.

On 'opt -O2 verify-uselistorder.lto.bc', peak memory usage prior to this change
is 149MB and after is 143MB so the savings are around 2.5% of peak.

Looking at some passes which allocate many Instructions and Values, parseIR drops
from 54.25MB to 52.21MB while the Inliner calls to Instruction::clone() drops
from 28.20MB to 27.05MB.

Reviewed by Duncan Exon Smith.

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

7 years agoAdded a version of User::new for hung off uses.
Pete Cooper [Fri, 12 Jun 2015 17:48:14 +0000 (17:48 +0000)]
Added a version of User::new for hung off uses.

There are now 2 versions of User::new.  The first takes a size_t and is the current
implementation for subclasses which need 0 or more Use's allocated for their operands.

The new version takes no extra arguments to say that this subclass needs 'hung off uses'.
The HungOffUses bool is now set in this version of User::new and we can assert in
allocHungOffUses that we are allowed to have hung off uses.
This ensures we call the correct version of User::new for subclasses which need hung off uses.

A future commit will then allocate space for a single Use* which will be used
in place of User::OperandList once that field has been removed.

Reviewed by Duncan Exon Smith.

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

7 years agoRename NumOperands to make it clear its managed by the User. NFC.
Pete Cooper [Fri, 12 Jun 2015 17:48:10 +0000 (17:48 +0000)]
Rename NumOperands to make it clear its managed by the User. NFC.

This is to try make it very clear that subclasses shouldn't be changing
the value directly.  Now that OperandList for normal instructions is computed
using the NumOperands, its critical that the NumOperands is accurate or we
could compute the wrong offset to the first operand.

I looked over all places which update NumOperands and they are all safe.
Hung off use User's don't use NumOperands to compute the OperandList so they
are safe to continue to manipulate it.  The only other User which changed it
was GlobalVariable which has an optional init list but always allocated space
for a single Use.  It was correctly setting NumOperands to 1 before setting an
initializer, and setting it to 0 after clearing the init list, so the order was safe.

Added some comments to that code to make sure that this isn't changed in future
without being aware of this constraint.

Reviewed by Duncan Exon Smith.

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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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.

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

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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

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

7 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

7 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.


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

7 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

7 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

7 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

7 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

7 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

7 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.

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

7 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

7 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

7 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

7 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

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

7 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

7 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

7 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

7 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

7 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

7 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

7 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.

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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

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

7 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

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

7 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

7 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

7 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
       %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
       %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

7 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

7 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

7 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

7 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:

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

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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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.

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

7 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.

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

7 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.

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

7 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


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

7 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

7 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

7 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

7 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

7 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

7 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