Commit Graph

24160 Commits

Author SHA1 Message Date
Bob Wilson
bfb1922670 Do not treat ARM _MoveToCoprocessor* intrinsics as MSBuiltins.
Those builtins are now handled via ad-hoc code in clang with r240522 to
deal with reordering the arguments to fix PR22560.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240523 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-24 06:07:41 +00:00
Rafael Espindola
9073b8fb67 Don't repeat name in comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240516 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-24 03:19:35 +00:00
Pete Cooper
eab3c6548c Remove unused GlobalVariable::replaceUsesOfWithOnConstant. NFC.
The only caller of this method is Value::replaceAllUsesWith which
explicitly checks that we are not a GlobalValue.  So replace the
body with an unreachable to ensure that we never call it.

The unreachable itself is moved to GlobalValue not GlobalVariable
as that is the base class of all the globals we don't want to call
this method on.

Note, this patch is short lived as i'll soon refactor all callers
of this method.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240486 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-24 00:05:07 +00:00
Alex Lorenz
926d65d4f7 MIR Parser: Use correct source locations for machine instruction diagnostics.
This commit translates the source locations for MIParser diagnostics from
the locations in the machine instruction string to the locations in the
MIR file.

Reviewers: Duncan P. N. Exon Smith

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240474 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-23 22:39:23 +00:00
Pete Cooper
d621812aac Devirtualize Constant::destroyConstant.
This reorganizes destroyConstant and destroyConstantImpl.

Now there is only destroyConstant in Constant itself, while
subclasses are required to implement destroyConstantImpl.

destroyConstantImpl no longer calls delete but is instead only
responsible for removing the constant from any maps in which it
is contained.

Reviewed by Duncan Exon Smith.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240471 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-23 21:55:11 +00:00
Alexey Samsonov
a9a3bc268b Let llvm::ReplaceInstWithInst copy debug location from old to new instruction.
Currently some users of this function do this explicitly, and all the
rest forget to do this.

ThreadSanitizer was one of such users, and had missing debug
locations for calls into TSan runtime handling atomic operations,
eventually leading to poorly symbolized stack traces and malfunctioning
suppressions.

This is another change relevant to PR23837.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240460 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-23 21:00:08 +00:00
Sanjoy Das
ef42e1115f Revert "[FaultMaps] Move FaultMapParser to Object/"
This reverts commit r240364 (git c49542e5bb).  The issue r240364 was
trying to fix was fixed independently in r240362.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240448 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-23 20:09:03 +00:00
Alex Lorenz
1c5cf241af ADT: Add a string APSInt constructor.
This commit moves the APSInt initialization code that's used by
the LLLexer class into a new APSInt constructor that constructs
APSInts from strings.

This change is useful for MIR Serialization, as it would allow
the MILexer class to use the same APSInt initialization as 
LLexer when parsing immediate machine operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240436 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-23 18:22:10 +00:00
Alex Lorenz
d31dc69aa1 AsmParser: Extend the API to make the global value and metadata node slot mappings publicly accessible.
This commit creates a new structure called 'SlotMapping' in the AsmParser library.
This structure can be passed into the public parsing APIs from the AsmParser library
in order to extract the data structures that map from slot numbers to unnamed global
values and metadata nodes.

This change is useful for MIR Serialization, as the MIR Parser has to lookup the
unnamed global values and metadata nodes by their slot numbers.

Reviewers: Duncan P. N. Exon Smith

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240427 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-23 17:10:10 +00:00
Tom Stellard
3edc38d967 ELF: Fix defintion of STT_LOOS and STT_HIOS.
Reviewers: chandlerc, Bigcheese, rafael

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240426 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-23 16:41:57 +00:00
Benjamin Kramer
896353d663 [Option] Plug a leak when move-assigning an InputArgList.
The class has a non-trivial dtor so we have to clean up before we move
in new members. Remove misleading comment as a default move assignment
operator will never be synthesized for this class.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240417 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-23 15:28:10 +00:00
Benjamin Kramer
336ead08bd [MachineBasicBlock] Add getFirstNonDebugInstr to complement getLastNonDebugInstr
Use it in CodeGen where applicable. No functionality change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240414 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-23 14:47:29 +00:00
Benjamin Kramer
d18bb88b2e [MachineBasicBlock] Use the const_cast(this) trick to reduce duplication
NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240413 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-23 14:47:18 +00:00
Rafael Espindola
0e9288493a Remove unused arguments and move ManglerPrefixTy to the implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240408 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-23 14:11:09 +00:00
Rafael Espindola
9758b4ae95 Simplify the Mangler interface now that DataLayout is mandatory.
We only need to pass in a DataLayout when mangling a raw string, not when
constructing the mangler.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240405 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-23 13:59:29 +00:00
Rafael Espindola
7737c637f0 Don't repeat names in comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240396 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-23 12:29:52 +00:00
Rafael Espindola
b9ed9af341 Use MCSymbols for FastISel.
The summary is that it moves the mangling earlier and replaces a few
calls to .addExternalSymbol with addSym.

I originally wanted to replace all the uses of addExternalSymbol with
addSym, but noticed it was a lot of work and doesn't need to be done
all at once.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240395 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-23 12:21:54 +00:00
Daniel Jasper
b7f5b8b4b2 Revert r240302 ("Bring r240130 back.").
This causes errors like:

  ld: error: blah.o: requires dynamic R_X86_64_PC32 reloc against '' which
  may overflow at runtime; recompile with -fPIC
  blah.cc:function f(): error: undefined reference to ''
  blah.o:g(): error: undefined reference to ''

I have not yet come up with an appropriate reproduction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240394 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-23 11:31:32 +00:00
Alexander Kornienko
b7c46b5fc9 Revert r240271 (Fixed/added namespace ending comments using clang-tidy. NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240393 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-23 10:48:35 +00:00
Alexander Kornienko
cd52a7a381 Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC)
Apparently, the style needs to be agreed upon first.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240390 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-23 09:49:53 +00:00
Elena Demikhovsky
d96e362b3f AVX-512: Added all forms of VPABS instruction
Added all intrinsics, tests for encoding, tests for intrinsics.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240386 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-23 08:19:46 +00:00
Rafael Espindola
9e7539a79f Remove broken banner.
Thanks to Filipe Cabecinhas for noticing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240375 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-23 03:45:23 +00:00
Rafael Espindola
344dd6519e Extract an utility for computing symbol sizes on MachO and COFF.
I will add a second user in the next commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240366 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-23 02:08:48 +00:00
Sanjoy Das
c49542e5bb [FaultMaps] Move FaultMapParser to Object/
Summary:
That way llvm-objdump can rely on it without adding an extra dependency
on CodeGen.

This change duplicates the FaultKind enum and the code that serializes
it to a string.  I could not figure out a way to get around this without
adding a new dependency to Object

Reviewers: rafael, ab

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240364 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-23 01:05:26 +00:00
Sanjoy Das
14b492752c Fix a typo in a comment in FaultMaps.h. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240363 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-23 01:05:21 +00:00
Justin Bogner
b06f3b4a33 Re-apply "InstrProf: When reading, copy the data instead of taking a reference. NFC"
This version fixes a missing include that MSVC noticed and
clarifies the ownership of the counter buffer that's passed to
InstrProfRecord.

This restores r240206, which was reverted in r240208.

Patch by Betul Buyukkurt.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240360 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-22 23:58:05 +00:00
Pete Cooper
46a3ee7346 Create Value.def helper. NFC.
This is similar to Metadata.def and Instructions.def but for Value's.

It will be used in upcoming commits to devirtualize the Value class.

Reviewed by Duncan Exon Smith.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240358 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-22 23:48:35 +00:00
David Blaikie
0c17f95006 Modify ParseArgs to return the InputArgList by value - there's no need for dynamic allocation/ownership here
The one caller that does anything other than keep this variable on the
stack is the single use of DerivedArgList in Clang, which is a bit more
interesting but can probably be cleaned up/simplified a bit further
(have DerivedArgList take ownership of the InputArgList rather than
needing to reference its Args indirectly) which I'll try to after this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240345 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-22 22:06:37 +00:00
Joseph Tremoulet
864619a387 Fix line endings (NFC)
I inadvertently checked these in with Windows-style line
endings in r240288.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240340 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-22 21:37:34 +00:00
Frederic Riss
11fcb49922 [Object] Search for architecures by name in MachOUniversalBinary::getObjectForArch()
The reason we need to search by name rather than by Triple::ArchType
is to handle subarchitecture correclty. There is no different ArchType
for the x86_64h architecture (it identifies itself as x86_64), or for
the various ARM subarches. The only way to get to the subarch slice
in an universal binary is to search by name.

This issue led to hard to debug and transient symbolication failures
in Asan tests (it mostly works, because the files are very similar).

This also affects the Profiling infrastucture as it is the other user
of that API.

Reviewers: samsonov, bogner

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240339 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-22 21:33:24 +00:00
Tom Stellard
b53953a84f Support/ELF: Add EM_AMDGPU
Summary: This will be used by the R600 backend.

Reviewers: chandlerc, rafael

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240329 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-22 21:03:47 +00:00
Pete Cooper
8b4b91acd8 Move MCSymbol Value in to the union of Offset and CommonSize.
This is a reapplication of r239440 which was reverted in r239441.
There are no changes to this patch from then, but this had instead exposed
a bug in .thumb_set which was fixed in r240318.  Having fixed that bug, it
is now safe to re-apply this code.

Original commit message below:

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@240320 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-22 19:57:33 +00:00
Pete Cooper
54d0bc35fe Change .thumb_set to have the same error checks as .set.
According to the documentation, .thumb_set is 'the equivalent of a .set directive'.

We didn't have equivalent behaviour in terms of all the errors we could throw, for
example, when a symbol is redefined.

This change refactors parseAssignment so that it can be used by .set and .thumb_set
and implements tests for .thumb_set for all the errors thrown by that method.

Reviewed by Rafael Espíndola.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240318 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-22 19:35:57 +00:00
Krzysztof Parzyszek
18693ad79a Remove "const" from the MachineFunction reference in VLIWPacketizerList
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240317 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-22 18:59:44 +00:00
Sanjoy Das
060e38ab9f Fix MSVC build (again!).
Remove two `typename`s that I should have removed in r240307 but left in
by mistake.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240309 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-22 18:24:50 +00:00
Sanjoy Das
e0ef46e5e7 [FaultMaps] Add a parser for the __llvm__faultmaps section.
Summary:
The parser is exercised by llvm-objdump using -print-fault-maps.  As is
probably obvious, the code itself was "heavily inspired" by
http://reviews.llvm.org/D10434.

Reviewers: reames, atrick, JosephTremoulet

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240304 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-22 18:03:02 +00:00
Rafael Espindola
afd779f72d Bring r240130 back.
Now that pr23900 is fixed, we can bring it back with no changes.

Original message:

Make all temporary symbols unnamed.

What this does is make all symbols that would otherwise start with a .L
(or L on MachO) unnamed.

Some of these symbols still show up in the symbol table, but we can just
make them unnamed.

In order to make sure we produce identical results when going thought assembly,
all .L (not just the compiler produced ones), are now unnamed.

Running llc on llvm-as.opt.bc, the peak memory usage goes from 208.24MB to
205.57MB.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240302 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-22 17:52:52 +00:00
Rafael Espindola
09bbd16112 Avoid a Symbol -> Name -> Symbol conversion.
Before this we were producing a TargetExternalSymbol from a MCSymbol.
That meant extracting the symbol name and fetching the symbol again
down the pipeline.

This patch adds a DAG.getMCSymbol that lets the MCSymbol pass unchanged on the
DAG.

Doing so removes the need for MO_NOPREFIX and fixes the root cause of pr23900,
allowing r240130 to be committed again.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240300 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-22 17:46:53 +00:00
Alex Lorenz
2f801faafb MIR Serialization: Serialize machine instruction names.
This commit implements initial machine instruction serialization. It
serializes machine instruction names. The instructions are represented
using a YAML sequence of string literals and are a part of machine
basic block YAML mapping.

This commit introduces a class called 'MIParser' which will be used to
parse the machine instructions and operands.

Reviewers: Duncan P. N. Exon Smith

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240295 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-22 17:02:30 +00:00
Joseph Tremoulet
c29284e6c3 [ORC] Add NullResolver
Summary:
This is an implementation of RuntimeDyld::SymbolResolver that simply
rejects all resolution requests; useful for clients that do not have any
cross-object symbol references.

Reviewers: lhames

Reviewed By: lhames

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240288 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-22 15:27:58 +00:00
Elena Demikhovsky
114489ab24 AVX-512: added VPSHUFB instruction - all SKX forms
Added intrinsics and encoding tests.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240277 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-22 13:00:42 +00:00
Alexander Kornienko
948713ad4f Fixed/added namespace ending comments using clang-tidy. NFC
A few more files that were fixed while preparing r240270.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240271 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-22 09:57:54 +00:00
Elena Demikhovsky
c768510422 AVX-512: Added intrinsics for VPERMT2W/D/Q/PS/PD and
VPERMI2W/D/Q/PS/PD instructions.
Added tests.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240256 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-22 06:45:48 +00:00
Chandler Carruth
1e3557de0d [PM/AA] Hoist the AliasResult enum out of the AliasAnalysis class.
This will allow classes to implement the AA interface without deriving
from the class or referencing an internal enum of some other class as
their return types.

Also, to a pretty fundamental extent, concepts such as 'NoAlias',
'MayAlias', and 'MustAlias' are first class concepts in LLVM and we
aren't saving anything by scoping them heavily.

My mild preference would have been to use a scoped enum, but that
feature is essentially completely broken AFAICT. I'm extremely
disappointed. For example, we cannot through any reasonable[1] means
construct an enum class (or analog) which has scoped names but converts
to a boolean in order to test for the possibility of aliasing.

[1]: Richard Smith came up with a "solution", but it requires class
templates, and lots of boilerplate setting up the enumeration multiple
times. Something like Boost.PP could potentially bundle this up, but
even that would be quite painful and it doesn't seem realistically worth
it. The enum class solution would probably work without the need for
a bool conversion.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240255 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-22 02:16:51 +00:00
Chandler Carruth
ab6ddadac7 [PM/AA] Rework the names and comments in AliasSetTracker to more
accurately describe what is being tracked.

While these two enums do track mod/ref information and aliasing
information, they don't represent the exact same things as either the
mod/ref enums or the alias result enum in AA. They're definitions are
dominated by the structure of their lattice and the bit's various
semantics. This patch just calls them what they are and tries to spell
out usefully distinct names for these things.

This will clear the path for using a raw unscoped enum to represent some
of these concepts across LLVM's analysis library.

No functionality changed here.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240254 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-22 02:12:52 +00:00
NAKAMURA Takumi
b87f6217b3 OptTable.h: Prune a couple of \param(s), since Arg has been ArrayRef-ized. [-Wdocumentation]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240240 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-21 13:44:46 +00:00
David Blaikie
caca524562 Devirtualize ArgList's dtor now that -Wvirtual-dtor and C++11 allow a better way to describe this situation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240238 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-21 06:51:35 +00:00
David Blaikie
fa6a5de95b ArrayRef-ify libDriverMain
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240234 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-21 06:31:56 +00:00
David Blaikie
006bce7764 ArrayRef-ify ParseArgs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240233 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-21 06:31:53 +00:00
Rui Ueyama
87ae2e8ab0 Object: Add load configuration structure for 64 bit PE/COFF.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240230 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-21 01:12:32 +00:00
NAKAMURA Takumi
41144b12f0 TargetInstrInfo.h: Fix r240192. [-Wdocumentation]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240210 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-20 03:53:18 +00:00
Justin Bogner
9cbe7b76e6 Revert "InstrProf: When reading, copy the data instead of taking a reference. NFC"
Seems like MSVC doesn't like this:

  InstrProf.h(49) : error C2614: 'llvm::InstrProfRecord' : illegal member initialization: 'Hash' is not a base or member

This reverts r240206.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240208 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-20 01:37:56 +00:00
Justin Bogner
9edccc8b40 InstrProf: When reading, copy the data instead of taking a reference. NFC
This consolidates the logic to read instrprof records into the on disk
hash table's lookup trait and makes us copy the counter data instead
of taking references to it as we read. This will simplify further
changes to the format.

Patch by Betul Buyukkurt.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240206 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-20 01:26:04 +00:00
Keno Fischer
bea6fb975e [MCJIT] Add a FindGlobalVariableNamed utility
Summary: This adds FindGlobalVariableNamed to ExecutionEngine
(plus implementation in MCJIT), which is an analog of
FindFunctionNamed for GlobalVariables.

Reviewers: lhames

Reviewed By: lhames

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240202 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-20 00:55:58 +00:00
Sanjoy Das
ac9af6c151 [Statepoint] Remove unnecessary argument from Statepoint::getRelocates
NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240198 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-20 00:01:03 +00:00
Sanjoy Das
62d9678d09 [Statepoint][NFC] Fix include guard style.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240197 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-20 00:00:58 +00:00
Nico Weber
7081f6fc99 Revert 240130, it caused crashes (repro in PR23900).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240193 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-19 23:43:47 +00:00
Sanjay Patel
30c3b2a4c2 name change: hasPattern() -> getMachineCombinerPatterns() ; NFC
This was suggested as part of D10460, but it's independent of
any functional change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240192 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-19 23:21:42 +00:00
Rafael Espindola
7edd010739 Improve error handling of getRelocationAddend.
This patch changes getRelocationAddend to use ErrorOr and considers it an error
to try to get the addend of a REL section.

If, for example, a x86_64 file has a REL section, that file is corrupted and
we should reject it.

Using ErrorOr is not ideal since we check the section type once per relocation
instead of once per section.

Checking once per section would involve getRelocationAddend just asserting and
callers checking the section before iterating over the relocations.

In any case, this is an improvement and includes a test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240176 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-19 20:58:43 +00:00
Rafael Espindola
6c3277aea4 Delete dead code. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240160 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-19 19:07:59 +00:00
Matt Arsenault
5452b3ddbd AMDGPU: Fix filename in comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240151 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-19 17:56:51 +00:00
Rafael Espindola
776f86420e Make getRelocationSection MachO only.
There are 3 types of relocations on MachO
* Scattered
* Section based
* Symbol based

On ELF and COFF relocations are symbol based.

We were in the strange situation that we abstracted over two of them. This makes
section based relocations MachO only.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240149 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-19 17:54:28 +00:00
Alex Lorenz
260366437c MIR Serialization: Serialize the list of machine basic blocks with simple attributes.
This commit implements the initial serialization of machine basic blocks in a
machine function. Only the simple, scalar MBB attributes are serialized. The 
reference to LLVM IR's basic block is preserved when that basic block has a name.

Reviewers: Duncan P. N. Exon Smith

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240145 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-19 17:43:07 +00:00
Matt Arsenault
826539160c AMDGPU: Fix some places missed in rename
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240143 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-19 17:39:03 +00:00
Alex Lorenz
75708d8749 MIR Serialization: use default member initializers to initialize yaml::MachineFunction. NFC.
Default member initializers are permitted since r236244.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240142 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-19 17:36:02 +00:00
Alexander Kornienko
cf0db29df2 Fixed/added namespace ending comments using clang-tidy. NFC
The patch is generated using this command:

tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \
  -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \
  llvm/lib/


Thanks to Eugene Kosov for the original patch!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240137 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-19 15:57:42 +00:00
Rafael Espindola
2ba51f8c56 Replace EM_486 with EM_IAMCU.
This matches the current
http://www.sco.com/developers/gabi/latest/ch4.eheader.html#machine

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240132 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-19 14:22:16 +00:00
Alexander Potapenko
e9149f4f8c [ASan] Initial support for Kernel AddressSanitizer
This patch adds initial support for the -fsanitize=kernel-address flag to Clang.
Right now it's quite restricted: only out-of-line instrumentation is supported, globals are not instrumented, some GCC kasan flags are not supported.
Using this patch I am able to build and boot the KASan tree with LLVMLinux patches from github.com/ramosian-glider/kasan/tree/kasan_llvmlinux.
To disable KASan instrumentation for a certain function attribute((no_sanitize("kernel-address"))) can be used.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240131 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-19 12:19:07 +00:00
Rafael Espindola
ec77d9ad83 Make all temporary symbols unnamed.
What this does is make all symbols that would otherwise start with a .L
(or L on MachO) unnamed.

Some of these symbols still show up in the symbol table, but we can just
make them unnamed.

In order to make sure we produce identical results when going thought assembly,
all .L (not just the compiler produced ones), are now unnamed.

Running llc on llvm-as.opt.bc, the peak memory usage goes from 208.24MB to
205.57MB.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240130 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-19 12:16:55 +00:00
Tobias Grosser
8921b2797f IRBuilder: Allow globals to be constructed in a specific address space
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240113 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-19 02:12:07 +00:00
Eric Christopher
933d2bd391 Fix "the the" in comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240112 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-19 01:53:21 +00:00
Alex Lorenz
5f0fc6da46 MIR Serialization: initialize the fields without the default initializers in yaml::MachineFunction
My commit r239790 which introduced serialization for simple machine function attributes didn't
initialize them when parsing because I have misread the documentation for YAML IO's mapOptional
method. The mapOptional method doesn't actually set the values to the values returned by the
default constructor for that type when the key value pair is missing, it just doesn't modify
those values, so they still contain the value that was set during initialization by the default
constructor. But the fields in yaml::MachineFunction with types like unsigned and bool are not
initialized by default, and thus they can still be uninitialized after mapOptional during parsing.
This commit adds default initialization for those fields to prevent this. 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240054 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-18 20:57:41 +00:00
Colin LeMahieu
4b61d2618c [MC] Adding prettyPrintAsm to MCTargetStreamer to allow targets to specialize how instructions are printed to asm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240050 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-18 20:43:22 +00:00
Sanjoy Das
aabacb67c3 [CallGraph] Teach the CallGraph about non-leaf intrinsics.
Summary:
Currently intrinsics don't affect the creation of the call graph.
This is not accurate with respect to statepoint and patchpoint
intrinsics -- these do call (or invoke) LLVM level functions.

This change fixes this inconsistency by adding a call to the external
node for call sites that call these non-leaf intrinsics.  This coupled
with the fact that these intrinsics also escape the function pointer
they call gives us a conservatively correct call graph.

Reviewers: reames, chandlerc, atrick, pgavlin

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240039 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-18 19:28:26 +00:00
Sanjay Patel
75a43c6c6b don't repeat function / variable names in comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240035 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-18 18:28:20 +00:00
James Y Knight
d280420ee9 [SPARC] Repair GOT references to internal symbols.
They had been getting emitted as a section + offset reference, which
is bogus since the value needs to be the offset within the GOT, not
the actual address of the symbol's object.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240020 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-18 15:05:15 +00:00
Asaf Badouh
bc5667c7ac [AVX512]
add instructions: VPAVGB and VPAVGW


review
http://reviews.llvm.org/D10504

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240012 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-18 12:30:53 +00:00
Daniel Jasper
5146cbf940 Update LLVM bindings after r239940. Apparently these aren't included in
any tests and I even don't know how to run the tests. This seems like a
minimal change to make them work again, although I can't really verify
at this point. Additionally, it probably makes sense to propagate the
personality parameter removal further.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240010 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-18 11:51:16 +00:00
Peter Collingbourne
e86e4ec406 LTO: Introduce LTOModule::getSymbolGV().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239993 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-18 05:10:06 +00:00
NAKAMURA Takumi
e520b7069e [autoconf] Detect OLE32 for mingw.
It has been done in CMake build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239989 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-18 04:16:05 +00:00
NAKAMURA Takumi
3c1e805769 config.h.*: Rework r210144. Don't edit config.h.in manually.
- Generate #include in configure.ac.
  - Resurrect the copy of llvm-config.h.cmake into config.h.cmake.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239987 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-18 04:08:20 +00:00
NAKAMURA Takumi
8c6343bf99 Reorder LLVM_ENABLE_ABI_BREAKING_CHECKS in llvm-config.h.*.
FIXME: Could we unify the description of LLVM_ENABLE_ABI_BREAKING_CHECKS between *.in and *.cmake?

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239986 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-18 04:07:12 +00:00
Alex Lorenz
c5f2ede9f6 Revert r239972 (YAML: Assign a value returned by the default constructor to the value in an optional mapping).
This change breaks clang-format tests.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239976 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-17 23:48:06 +00:00
Alex Lorenz
15db0fbcc8 YAML: Assign a value returned by the default constructor to the value in an optional mapping.
This commit ensures that a value that's passed into YAML's IO mapOptional method
is going to be assigned a value returned by the default constructor for that
value's type when the appropriate key is not present in the YAML mapping.

Reviewers: Duncan P. N. Exon Smith

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239972 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-17 23:26:01 +00:00
Pete Cooper
c821cef882 Devirtualize and pack MCFragment to reduce memory usage.
MCFragment didn't really need vtables.  The majority of virtual methods were just getters and setters.

This removes the vtables and uses dispatch on the kind to do things like delete which needs to
get the appropriate class.

This reduces memory on the verify use list order test case by about 2MB out of 800MB.

Reviewed by Rafael Espíndola

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239952 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-17 22:01:28 +00:00
Benjamin Kramer
cf1e4a26ad Add missing include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239946 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-17 21:08:22 +00:00
Benjamin Kramer
3cab8a1193 [Bitcode] Replace hand-coded little endian handling with Endian.h functions.
No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239944 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-17 20:55:30 +00:00
David Majnemer
cc714e2142 Move the personality function from LandingPadInst to Function
The personality routine currently lives in the LandingPadInst.

This isn't desirable because:
- All LandingPadInsts in the same function must have the same
  personality routine.  This means that each LandingPadInst beyond the
  first has an operand which produces no additional information.

- There is ongoing work to introduce EH IR constructs other than
  LandingPadInst.  Moving the personality routine off of any one
  particular Instruction and onto the parent function seems a lot better
  than have N different places a personality function can sneak onto an
  exceptional function.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239940 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-17 20:52:32 +00:00
Rafael Espindola
a1e31b45cc Move IsUsedInReloc from MCSymbolELF to MCSymbol.
There is a free bit is MCSymbol and MachO needs the same information.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239933 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-17 20:08:20 +00:00
Diego Novillo
5057ee8357 Add documentation for new backedge mass propagation in irregular loops.
Tweak test cases and rename headerIndexFor -> getHeaderIndex.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239915 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-17 16:28:22 +00:00
Rafael Espindola
b306ae3bf3 Use named temporaries for directional labels.
Directional labels can show up in symbol tables (and we have a llvm-mc test for
that). Given that, we need to make sure they are named.

With that out of the way, use setUseNamesOnTempLabels in llvm-mc so that it
too benefits from the memory saving.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239914 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-17 16:26:47 +00:00
James Y Knight
4dd3b87048 Tweak wording of alignment static_assert messages.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239907 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-17 13:53:12 +00:00
Igor Breger
a066970605 AVX-512: cvtusi2ss/d intrinsics.
Change builtin function name and signature ( add third parameter - rounding mode ).
Added tests for intrinsics.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239888 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-17 07:23:57 +00:00
Chandler Carruth
2cdca0c4e4 [PM/AA] Remove the UnknownSize static member from AliasAnalysis.
This is now living in MemoryLocation, which is what it pertains to. It
is also an enum there rather than a static data member which is left
never defined.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239886 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-17 07:21:38 +00:00
Chandler Carruth
4d7ed3960c [PM/AA] Remove the Location typedef from the AliasAnalysis class now
that it is its own entity in the form of MemoryLocation, and update all
the callers.

This is an entirely mechanical change. References to "Location" within
AA subclases become "MemoryLocation", and elsewhere
"AliasAnalysis::Location" becomes "MemoryLocation". Hope that helps
out-of-tree folks update.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239885 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-17 07:18:54 +00:00
Chandler Carruth
c179a41142 [PM/AA] Split the location computation out of getArgLocation so the
virtual interface on AliasAnalysis only deals with ModRef information.

This interface was both computing memory locations by using TLI and
other tricks to estimate the size of memory referenced by an operand,
and computing ModRef information through similar investigations. This
change narrows the scope of the virtual interface on AliasAnalysis
slightly.

Note that all of this code could live in BasicAA, and be done with
a single investigation of the argument, if it weren't for the fact that
the generic code in AliasAnalysis::getModRefBehavior for a callsite
calls into the virtual aspect of (now) getArgModRefInfo. But this
patch's arrangement seems a not terrible way to go for now.

The other interesting wrinkle is how we could reasonably extend LLVM
with support for custom memory location sizes and mod/ref behavior for
library routines. After discussions with Hal on the review, the
conclusion is that this would be best done by fleshing out the much
desired support for extensions to TLI, and support these types of
queries in that interface where we would likely be doing other library
API recognition and analysis.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239884 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-17 07:12:40 +00:00
James Y Knight
4a80b4b0c0 Fix alignment issues in LLVM.
Adds static_asserts to ensure alignment of concatenated objects is
correct, and fixes them where they are not.

Also changes the definition of AlignOf to use constexpr, except on
MSVC, to avoid enum comparison warnings from GCC.

(There's not too much of this in llvm itself, most of the fun is in
clang).

This seems to make LLVM actually work without Bus Error on 32bit
sparc.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239872 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-17 01:21:20 +00:00
Rafael Espindola
4a4558e436 Use std::unique_ptr to manage the DataStreamer in bitcode parsing.
We were already deleting it, this just makes it explicit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239867 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-16 23:29:49 +00:00
Rafael Espindola
3fea1651f6 Rename and improve emitSectionOffset.
Different object formats represent references from dwarf in different ways.

ELF uses a relocation to the referenced point (except for .dwo) and
COFF/MachO use the offset of the referenced point inside its section.

This patch renames emitSectionOffset because

* It doesn't produce an offset on ELF.
* It changes behavior depending on how DWARF is represented, so adding
dwarf to its name is probably a good thing.

The patch also adds an option to force the use of offsets.That avoids
funny looking code like

  if (!UseOffsets)
    Asm->emitSectionOffset....

It was correct, but read as if the ! was inverted.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239866 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-16 23:22:02 +00:00
Tyler Nowicki
363eaff049 Refactor RecurrenceInstDesc
Moved RecurrenceInstDesc into RecurrenceDescriptor to simplify the namespaces.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239862 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-16 22:59:45 +00:00