9 years ago[python bindings] Added code to get the length of a memory buffer. Tests are included.
Michael Gottesman [Tue, 10 Sep 2013 06:57:57 +0000 (06:57 +0000)]
[python bindings] Added code to get the length of a memory buffer. Tests are included.

This is a part of a series of patches that have been sitting fallow on a
personal branch that I have been messing with for a bit.

The patches start to flesh out the python llvm-c wrapper to the point where you can:

1. Load Modules from Bitcode/Dump/Print them.
2. Iterate over Functions from those modules/get their names/dump them.
3. Iterate over the BasicBlocks from said function/get the BB's name/dump it.
4. Iterate over the Instructions in said BasicBlocks/get the instructions
   name/dump the instruction.

My main interest in developing this was to be able to gather statistics about
LLVM IR using python scripts to speed up statistical profiling of different IR
level transformations (hence the focus on printing/dumping/getting names).

This is a gift from me to the LLVM community = ).

I am going to be committing the patches slowly over the next bit as I have time
to prepare the patches.

The overall organization follows the c-api like the bindings that are already

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

9 years agoMCObjectFileInfo.cpp: Fix a couple of possible typo(s), s/DwarfPub/DwarfGnuPub/,...
NAKAMURA Takumi [Tue, 10 Sep 2013 06:01:56 +0000 (06:01 +0000)]
MCObjectFileInfo.cpp: Fix a couple of possible typo(s), s/DwarfPub/DwarfGnuPub/, in r190344.

XFAIL can be removed. (in r190374)

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

9 years agoDon't use getSetCCResultType for creating a vselect
Matt Arsenault [Tue, 10 Sep 2013 00:41:56 +0000 (00:41 +0000)]
Don't use getSetCCResultType for creating a vselect

The vselect mask isn't a setcc.

This breaks in the case when the result of getSetCCResultType
is larger than the vector operands

e.g. %tmp = select i1 %cmp <2 x i8> %a, <2 x i8> %b
when getSetCCResultType returns <2 x i32>, the assertion
that the (MaskTy.getSizeInBits() == Op1.getValueType().getSizeInBits())
is hit.

No test since I don't think I can hit this with any of the current
targets. The R600/SI implementation would break, since it returns a
vector of i1 for this, but it doesn't reach ExpandSELECT for other

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

9 years agoUse StringRef::npos for StringRef instead of std::string one
Matt Arsenault [Tue, 10 Sep 2013 00:41:53 +0000 (00:41 +0000)]
Use StringRef::npos for StringRef instead of std::string one

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

9 years agollvm/test/DebugInfo/dwarf-public-names.ll: Mark it as XFAIL for PECOFF targets, for...
NAKAMURA Takumi [Tue, 10 Sep 2013 00:28:23 +0000 (00:28 +0000)]
llvm/test/DebugInfo/dwarf-public-names.ll: Mark it as XFAIL for PECOFF targets, for now. Investigating.

FIXME: llvm-dwarfdump doesn't handle PECOFF.

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

9 years agoRevert r190366. It was breaking build bots.
Bill Wendling [Tue, 10 Sep 2013 00:20:27 +0000 (00:20 +0000)]
Revert r190366. It was breaking build bots.

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

9 years agoEnable -misched-cyclicpath by default.
Andrew Trick [Mon, 9 Sep 2013 23:31:14 +0000 (23:31 +0000)]
Enable -misched-cyclicpath by default.

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

9 years agoUse a default value for the prologue's debug location.
Bill Wendling [Mon, 9 Sep 2013 23:28:15 +0000 (23:28 +0000)]
Use a default value for the prologue's debug location.

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

9 years agoDebug Info: In DIBuilder, the context fields of a TAG_inheritance and a
Manman Ren [Mon, 9 Sep 2013 23:07:58 +0000 (23:07 +0000)]
Debug Info: In DIBuilder, the context fields of a TAG_inheritance and a
TAG_friend are updated to use scope reference.

Added testing cases to verify that class with inheritance can be uniqued.

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

9 years agoDebug Info: move DIScope::getContext back from DwarfDebug.
Manman Ren [Mon, 9 Sep 2013 22:35:23 +0000 (22:35 +0000)]
Debug Info: move DIScope::getContext back from DwarfDebug.

This partially reverts r190330. DIScope::getContext now returns DIScopeRef
instead of DIScope. We construct a DIScopeRef from DIScope when we are
dealing with subprogram, lexical block or name space.

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

9 years agomi-sched: smooth out the cyclicpath heuristic.
Andrew Trick [Mon, 9 Sep 2013 22:28:08 +0000 (22:28 +0000)]
mi-sched: smooth out the cyclicpath heuristic.

Arnold's idea.

I generally try to avoid stateful heuristics because it can make
debugging harder. However, we need a way to prevent the latency
priority from dominating, and it somewhat makes sense to schedule
aggressively for latency only within an issue group.

Swift in particular likes this, and it doesn't hurt anyone else:
| Benchmarks/MiBench/consumer-lame              |  10.39% |
| Benchmarks/Misc/himenobmtxpa                  |   9.63% |

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

9 years agowhite spaces and long lines
Jack Carter [Mon, 9 Sep 2013 22:02:08 +0000 (22:02 +0000)]
white spaces and long lines

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

9 years agoDon't shrink atomic ops to bool in GlobalOpt.
Eli Friedman [Mon, 9 Sep 2013 22:00:13 +0000 (22:00 +0000)]
Don't shrink atomic ops to bool in GlobalOpt.

LLVM IR doesn't currently allow atomic bool load/store operations, and the
transformation is dubious anyway because it isn't profitable on all platforms.


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

9 years agoSet the encoding to '0' if we don't have an MAB.
Bill Wendling [Mon, 9 Sep 2013 21:22:44 +0000 (21:22 +0000)]
Set the encoding to '0' if we don't have an MAB.

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

9 years ago[InstCombiner] Expose opportunities to merge subtract and comparison.
Quentin Colombet [Mon, 9 Sep 2013 20:56:48 +0000 (20:56 +0000)]
[InstCombiner] Expose opportunities to merge subtract and comparison.

Several architectures use the same instruction to perform both a comparison and
a subtract. The instruction selection framework does not allow to consider
different basic blocks to expose such fusion opportunities.

Therefore, these instructions are “merged” by CSE at MI IR level.

To increase the likelihood of CSE to apply in such situation, we reorder the
operands of the comparison, when they have the same complexity, so that they
matches the order of the most frequent subtract.

icmp A, B
sub B, A


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

9 years agoDebug Info Testing: remove a commented out line.
Manman Ren [Mon, 9 Sep 2013 20:45:34 +0000 (20:45 +0000)]
Debug Info Testing: remove a commented out line.

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

9 years agoAnother attempt to fix windows buildbots.
Bill Wendling [Mon, 9 Sep 2013 20:29:32 +0000 (20:29 +0000)]
Another attempt to fix windows buildbots.

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

9 years agoAttempt to fix buildbots by giving an explicit output to the llvm-mc command.
Bill Wendling [Mon, 9 Sep 2013 20:22:38 +0000 (20:22 +0000)]
Attempt to fix buildbots by giving an explicit output to the llvm-mc command.

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

9 years agoExpand test to make sure that we can generate compact unwind from an ASM file.
Bill Wendling [Mon, 9 Sep 2013 20:12:36 +0000 (20:12 +0000)]
Expand test to make sure that we can generate compact unwind from an ASM file.

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

9 years agoExpand test to make sure that we can generate compact unwind from an ASM file.
Bill Wendling [Mon, 9 Sep 2013 20:10:54 +0000 (20:10 +0000)]
Expand test to make sure that we can generate compact unwind from an ASM file.

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

9 years agoAlways add global names. We're adding them in the rest of the code
Eric Christopher [Mon, 9 Sep 2013 20:03:20 +0000 (20:03 +0000)]
Always add global names. We're adding them in the rest of the code
as well as types.

No functional change as they're not emitted unless the option
is true anyhow.

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

9 years agoRename for consistency.
Eric Christopher [Mon, 9 Sep 2013 20:03:17 +0000 (20:03 +0000)]
Rename for consistency.

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

9 years agoAdd the gnu pubnames and pubtypes sections to the mc object file
Eric Christopher [Mon, 9 Sep 2013 20:03:14 +0000 (20:03 +0000)]
Add the gnu pubnames and pubtypes sections to the mc object file

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

9 years agoAdd constant defines for gnu pubnames and gnu pubtypes - they're used
Eric Christopher [Mon, 9 Sep 2013 20:03:11 +0000 (20:03 +0000)]
Add constant defines for gnu pubnames and gnu pubtypes - they're used
for the gdb index as the names convey.

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

9 years agoFormatting.
Eric Christopher [Mon, 9 Sep 2013 20:03:08 +0000 (20:03 +0000)]

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

9 years agoCall generateCompactUnwindEncodings() right before we need to output the frame inform...
Bill Wendling [Mon, 9 Sep 2013 19:48:37 +0000 (19:48 +0000)]
Call generateCompactUnwindEncodings() right before we need to output the frame information.

There are more than one paths to where the frame information is emitted. Place
the call to generateCompactUnwindEncodings() into the method which outputs the
frame information, thus ensuring that the encoding is there for every path. This
involved threading the MCAsmBackend object through to this method.


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

9 years agoDebug Info: Use DIScopeRef for DIType::getContext.
Manman Ren [Mon, 9 Sep 2013 19:47:11 +0000 (19:47 +0000)]
Debug Info: Use DIScopeRef for DIType::getContext.

In DIBuilder, the context field of a TAG_member is updated to use the
scope reference. Verifier is updated accordingly.

DebugInfoFinder now needs to generate a type identifier map to have
access to the actual scope. Same applies for BreakpointPrinter.

processModule of DebugInfoFinder is called during initialization phase
of the verifier to make sure the type identifier map is constructed early

We are now able to unique a simple class as demonstrated by the added
testing case.

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

9 years agoUpdate CMake file to fix buildbots.
Bob Wilson [Mon, 9 Sep 2013 19:25:11 +0000 (19:25 +0000)]
Update CMake file to fix buildbots.

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

9 years agoDebug Info: move DIScope::getContext to DwarfDebug.
Manman Ren [Mon, 9 Sep 2013 19:23:58 +0000 (19:23 +0000)]
Debug Info: move DIScope::getContext to DwarfDebug.

DIScope::getContext is a wrapper function that calls the specific getContext
method on each subclass. When we switch DIType::getContext to return DIScopeRef
instead of DIScope, DIScope::getContext can no longer return a DIScope without
a type identifier map.

DIScope::getContext is only used by DwarfDebug, so we move it to DwarfDebug
to have easy access to the type identifier map.

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

9 years agoRevert patches to add case-range support for PR1255.
Bob Wilson [Mon, 9 Sep 2013 19:14:35 +0000 (19:14 +0000)]
Revert patches to add case-range support for PR1255.

The work on this project was left in an unfinished and inconsistent state.
Hopefully someone will eventually get a chance to implement this feature, but
in the meantime, it is better to put things back the way the were.  I have
left support in the bitcode reader to handle the case-range bitcode format,
so that we do not lose bitcode compatibility with the llvm 3.3 release.

This reverts the following commits: 155464, 156374, 156377, 156613, 156704,
156757, 156804 156808, 156985, 157046, 157112, 157183, 157315, 157384, 157575,
157576, 157586, 157612, 157810, 157814, 157815, 157880, 157881, 157882, 157884,
157887, 157901, 158979, 157987, 157989, 158986, 158997, 159076, 159101, 159100,
159200, 159201, 159207, 159527, 159532, 159540, 159583, 159618, 159658, 159659,
159660, 159661, 159703, 159704, 160076, 167356, 172025, 186736

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

9 years ago[docs] Fix Sphinx warning.
Sean Silva [Mon, 9 Sep 2013 19:13:28 +0000 (19:13 +0000)]
[docs] Fix Sphinx warning.

Adornments need to be at least as long as the thing they adorn.

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

9 years ago[docs] Fix some Sphinx toctree warnings.
Sean Silva [Mon, 9 Sep 2013 19:09:00 +0000 (19:09 +0000)]
[docs] Fix some Sphinx toctree warnings.

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

9 years agoDebug Info: Move isSubprogramContext from DebugInfo to DwarfDebug.
Manman Ren [Mon, 9 Sep 2013 19:05:21 +0000 (19:05 +0000)]
Debug Info: Move isSubprogramContext from DebugInfo to DwarfDebug.

This helper function needs the type identifier map when we switch
DIType::getContext to return DIScopeRef instead of DIScope.

Since isSubprogramContext is used by DwarfDebug only, We move it to DwarfDebug
to have easy access to the map.

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

9 years ago[docs] Some typographical fixes.
Sean Silva [Mon, 9 Sep 2013 19:05:03 +0000 (19:05 +0000)]
[docs] Some typographical fixes.

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

9 years agoDebug Info: Rename DITypeRef to DIScopeRef.
Manman Ren [Mon, 9 Sep 2013 19:03:51 +0000 (19:03 +0000)]
Debug Info: Rename DITypeRef to DIScopeRef.

A reference to a scope is more general than a reference to a type since
DIType is a subclass of DIScope.

A reference to a type can be either an identifier for the type or
the DIType itself, while a reference to a scope can be either an
identifier for the type (when the scope is indeed a type) or the
DIScope itself. A reference to a type and a reference to a scope
will be resolved in the same way. The only difference is in the
verifier when a field is a reference to a type (i.e. the containing
type field of a DICompositeType) or a field is a reference to a scope
(i.e. the context field of a DIType).

This is to get ready for switching DIType::getContext to return
DIScopeRef instead of DIScope.

Tighten up isTypeRef and isScopeRef to make sure the identifier is not
empty and the MDNode is DIType for TypeRef and DIScope for ScopeRef.

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

9 years agoDebug Info: Update isScope to make sure DIType is a scope and
Manman Ren [Mon, 9 Sep 2013 19:00:55 +0000 (19:00 +0000)]
Debug Info: Update isScope to make sure DIType is a scope and
TAG_file_type is also a scope.

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

9 years ago[mips] When double precision loads and stores are split into two i32 loads and
Akira Hatanaka [Mon, 9 Sep 2013 17:59:32 +0000 (17:59 +0000)]
[mips] When double precision loads and stores are split into two i32 loads and
stores, make sure the load or store that accesses the higher half does not have
an alignment that is larger than the offset from the original address.

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

9 years ago[stackprotector] Modernize code with IRBuilder
Benjamin Kramer [Mon, 9 Sep 2013 17:38:01 +0000 (17:38 +0000)]
[stackprotector] Modernize code with IRBuilder

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

9 years ago[ARMv8] Prevent generation of deprecated IT blocks on ARMv8 in Thumb mode.
Joey Gouly [Mon, 9 Sep 2013 14:21:49 +0000 (14:21 +0000)]
[ARMv8] Prevent generation of deprecated IT blocks on ARMv8 in Thumb mode.
IT blocks can only be one instruction lonf, and can only contain a subset of
the 16 instructions.

Patch by Artyom Skrobov!

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

9 years agoA better way to silence the warning in MSVC (replaces r190304).
Aaron Ballman [Mon, 9 Sep 2013 14:17:30 +0000 (14:17 +0000)]
A better way to silence the warning in MSVC (replaces r190304).

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

9 years agoSilencing a warning about control flow reaching the end of a non-void function.
Aaron Ballman [Mon, 9 Sep 2013 13:22:45 +0000 (13:22 +0000)]
Silencing a warning about control flow reaching the end of a non-void function.

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

9 years agoXCore handling of thread local lowering
Robert Lytton [Mon, 9 Sep 2013 10:42:11 +0000 (10:42 +0000)]
XCore handling of thread local lowering

Fix XCoreLowerThreadLocal trying to initialise globals
which have no initializer.

Add handling of const expressions containing thread local variables.
These need to be replaced with instructions, as the thread ID is
used to access the thread local variable.

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

9 years agoXCore target: change to Sched::Source
Robert Lytton [Mon, 9 Sep 2013 10:42:05 +0000 (10:42 +0000)]
XCore target: change to Sched::Source

This sidesteps a bug in PrescheduleNodesWithMultipleUses() which
does not check if callResources will be affected by the transformation.

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

9 years agoXCore target: fix weak linkage attribute handling
Robert Lytton [Mon, 9 Sep 2013 10:41:57 +0000 (10:41 +0000)]
XCore target: fix weak linkage attribute handling

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

9 years agoGenerate compact unwind encoding from CFI directives.
Bill Wendling [Mon, 9 Sep 2013 02:37:14 +0000 (02:37 +0000)]
Generate compact unwind encoding from CFI directives.

We used to generate the compact unwind encoding from the machine
instructions. However, this had the problem that if the user used `-save-temps'
or compiled their hand-written `.s' file (with CFI directives), we wouldn't
generate the compact unwind encoding.

Move the algorithm that generates the compact unwind encoding into the
MCAsmBackend. This way we can generate the encoding whether the code is from a
`.ll' or `.s' file.


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

9 years agoImplement aarch64 neon instruction set AdvSIMD (3V Diff), covering the following...
Jiangning Liu [Mon, 9 Sep 2013 02:20:27 +0000 (02:20 +0000)]
Implement aarch64 neon instruction set AdvSIMD (3V Diff), covering the following 26 instructions,


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

9 years agoDebug Info Testing: use null instead of an empty string in context field.
Manman Ren [Mon, 9 Sep 2013 00:12:17 +0000 (00:12 +0000)]
Debug Info Testing: use null instead of an empty string in context field.

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

9 years agoCross-compilation doc
Renato Golin [Sun, 8 Sep 2013 20:44:48 +0000 (20:44 +0000)]
Cross-compilation doc

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

9 years agoBring back the build of libprofile_rt on Sparc. It is now working correctly. See:
Sylvestre Ledru [Sun, 8 Sep 2013 09:15:09 +0000 (09:15 +0000)]
Bring back the build of libprofile_rt on Sparc. It is now working correctly. See:

Thanks to Luca Falavigna for the patch

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

9 years agoRevert r190269 to fix dragonegg failures.
Manman Ren [Sun, 8 Sep 2013 06:02:56 +0000 (06:02 +0000)]
Revert r190269 to fix dragonegg failures.

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

9 years agoDebug Info: use null instead of "i32 0" in DIBuilder.
Manman Ren [Sun, 8 Sep 2013 06:00:42 +0000 (06:00 +0000)]
Debug Info: use null instead of "i32 0" in DIBuilder.

For context field of subroutine_type and when creating artificial types.

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

9 years agoDebug Info: pass in DIScope instead of DIDescriptor in createMemberType.
Manman Ren [Sun, 8 Sep 2013 04:07:59 +0000 (04:07 +0000)]
Debug Info: pass in DIScope instead of DIDescriptor in createMemberType.

Improve readability. No functionality change.

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

9 years agoDebug Info Testing: update context from empty string to null.
Manman Ren [Sun, 8 Sep 2013 03:11:54 +0000 (03:11 +0000)]
Debug Info Testing: update context from empty string to null.

Context should be either null or MDNode.

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

9 years agoAdd neverHasSideEffects=1 on a couple move instructions.
Craig Topper [Sun, 8 Sep 2013 00:50:45 +0000 (00:50 +0000)]
Add neverHasSideEffects=1 on a couple move instructions.

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

9 years agoUsing popcount should check the popcount feature flag not the SSE41 feature flag.
Craig Topper [Sun, 8 Sep 2013 00:47:31 +0000 (00:47 +0000)]
Using popcount should check the popcount feature flag not the SSE41 feature flag.

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

9 years agoRun clang-format on these header files. Part of a WIP.
Bill Wendling [Sat, 7 Sep 2013 11:55:36 +0000 (11:55 +0000)]
Run clang-format on these header files. Part of a WIP.

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

9 years ago[mips] Fix typos.
Akira Hatanaka [Sat, 7 Sep 2013 01:14:42 +0000 (01:14 +0000)]
[mips] Fix typos.

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

9 years ago[mips] Enhance command line option "-mno-ldc1-sdc1" to expand base+index double
Akira Hatanaka [Sat, 7 Sep 2013 00:52:30 +0000 (00:52 +0000)]
[mips] Enhance command line option "-mno-ldc1-sdc1" to expand base+index double
precision loads and stores as well as reg+imm double precision loads and stores.

Previously, expansion of loads and stores was done after register allocation,
but now it takes place during legalization. As a result, users will see double
precision stores and loads being emitted to spill and restore 64-bit FP registers.

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

9 years ago[mips] Place parentheses around && to silence warning.
Akira Hatanaka [Sat, 7 Sep 2013 00:26:26 +0000 (00:26 +0000)]
[mips] Place parentheses around && to silence warning.

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

9 years agoRemove verifier check that attribute 'builtin' is only applied to calls to
Richard Smith [Sat, 7 Sep 2013 00:25:48 +0000 (00:25 +0000)]
Remove verifier check that attribute 'builtin' is only applied to calls to
functions marked 'nobuiltin'. That approach doesn't play well with LTO, and
there's no harm in marking a call as 'builtin' if it was going to be a builtin

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

9 years ago[mips] Add definition of instruction "drotr32" (double rotate right plus 32).
Akira Hatanaka [Sat, 7 Sep 2013 00:18:01 +0000 (00:18 +0000)]
[mips] Add definition of instruction "drotr32" (double rotate right plus 32).

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

9 years agoDebug Info: Use identifier to reference DIType in containing type field of
Manman Ren [Sat, 7 Sep 2013 00:04:05 +0000 (00:04 +0000)]
Debug Info: Use identifier to reference DIType in containing type field of
a DISubprogram.

Verifier is updated accordingly.

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

9 years ago[mips] Use uimm5 and uimm6 instead of shamt and imm, if the immediate has to fit
Akira Hatanaka [Sat, 7 Sep 2013 00:02:02 +0000 (00:02 +0000)]
[mips] Use uimm5 and uimm6 instead of shamt and imm, if the immediate has to fit
into a 5-bit or 6-bit field.

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

9 years agoDebug Info: pass in VTableHolder as DIType instead of MDNode *.
Manman Ren [Fri, 6 Sep 2013 23:54:23 +0000 (23:54 +0000)]
Debug Info: pass in VTableHolder as DIType instead of MDNode *.

Remove one cast and improve readability. No functionality change.

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

9 years ago[mips] Define "trap" as a pseudo instruction that turns into "break 0, 0".
Akira Hatanaka [Fri, 6 Sep 2013 23:52:46 +0000 (23:52 +0000)]
[mips] Define "trap" as a pseudo instruction that turns into "break 0, 0".

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

9 years ago[mips] Delete unused classes and defs.
Akira Hatanaka [Fri, 6 Sep 2013 23:42:58 +0000 (23:42 +0000)]
[mips] Delete unused classes and defs.

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

9 years ago[mips] Make "b" (unconditional branch) a pseudo. "b" is an assembly idiom, which is
Akira Hatanaka [Fri, 6 Sep 2013 23:40:15 +0000 (23:40 +0000)]
[mips] Make "b" (unconditional branch) a pseudo. "b" is an assembly idiom, which is
equivalent to "beq $zero, $zero, offset".

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

9 years ago[mips] Set instruction itineraries of loads, stores and conditional moves.
Akira Hatanaka [Fri, 6 Sep 2013 23:28:24 +0000 (23:28 +0000)]
[mips] Set instruction itineraries of loads, stores and conditional moves.

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

9 years agoTBAA: add isTBAAVtableAccess to MDNode so clients can call the function
Manman Ren [Fri, 6 Sep 2013 22:47:05 +0000 (22:47 +0000)]
TBAA: add isTBAAVtableAccess to MDNode so clients can call the function
instead of having its own implementation.

The implementation of isTBAAVtableAccess is in TypeBasedAliasAnalysis.cpp
since it is related to the format of TBAA metadata.

The path for struct-path tbaa will be exercised by
test/Instrumentation/ThreadSanitizer/read_from_global.ll, vptr_read.ll, and
vptr_update.ll when struct-path tbaa is on by default.

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

9 years agoDebug Info Testing: updated to use NULL instead of "i32 0" in a few fields.
Manman Ren [Fri, 6 Sep 2013 21:03:58 +0000 (21:03 +0000)]
Debug Info Testing: updated to use NULL instead of "i32 0" in a few fields.

Field 2 of DIType (Context), field 9 of DIDerivedType (TypeDerivedFrom),
field 12 of DICompositeType (ContainingType), fields 2, 7, 12 of DISubprogram
(Context, Type, ContainingType).

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

9 years agoR600: Add support for LDS atomic subtract
Aaron Watry [Fri, 6 Sep 2013 20:17:42 +0000 (20:17 +0000)]
R600: Add support for LDS atomic subtract

Signed-off-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190200 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDebug Info: Use identifier to reference DIType in containing type field of
Manman Ren [Fri, 6 Sep 2013 18:46:00 +0000 (18:46 +0000)]
Debug Info: Use identifier to reference DIType in containing type field of
a DICompositeType.

Verifier is updated accordingly.

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

9 years agoDebug Info: Move a helper function getTypeIdentifier from DIBuilder to be part
Manman Ren [Fri, 6 Sep 2013 18:27:00 +0000 (18:27 +0000)]
Debug Info: Move a helper function getTypeIdentifier from DIBuilder to be part
of DIType.

Implement DIType::generateRef to return a type reference. This function will be
used in setContaintingType and in DIBuilder to generete the type reference.

No functionality change.

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

9 years agoDebug Info Testing: Updated to use null instead of "i32 0" for containing-type
Manman Ren [Fri, 6 Sep 2013 18:13:59 +0000 (18:13 +0000)]
Debug Info Testing: Updated to use null instead of "i32 0" for containing-type
field of DICompositeType.

This will help the follow-on patch of using DITypeRef for containing-type field.

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

9 years agodebuginfo-tests: Add support for an lldb wrapper script
Adrian Prantl [Fri, 6 Sep 2013 18:12:01 +0000 (18:12 +0000)]
debuginfo-tests: Add support for an lldb wrapper script
to be used on darwin in lieu of gdb.

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

9 years agomi-sched: cleanup register pressure update, remove a FIXME.
Andrew Trick [Fri, 6 Sep 2013 17:32:47 +0000 (17:32 +0000)]
mi-sched: cleanup register pressure update, remove a FIXME.

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

9 years agomi-sched: improve regpressure tracing.
Andrew Trick [Fri, 6 Sep 2013 17:32:44 +0000 (17:32 +0000)]
mi-sched: improve regpressure tracing.

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

9 years agomi-sched: print tree size in -view-misched-dags
Andrew Trick [Fri, 6 Sep 2013 17:32:42 +0000 (17:32 +0000)]
mi-sched: print tree size in -view-misched-dags

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

9 years agomi-sched: register pressure update tracing.
Andrew Trick [Fri, 6 Sep 2013 17:32:39 +0000 (17:32 +0000)]
mi-sched: register pressure update tracing.

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

9 years agomi-sched: Reorder Cyclicpath (latency) and CriticalMax (pressure) heuristics.
Andrew Trick [Fri, 6 Sep 2013 17:32:36 +0000 (17:32 +0000)]
mi-sched: Reorder Cyclicpath (latency) and CriticalMax (pressure) heuristics.

The latency based scheduling could induce spills in some cases.

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

9 years agoAdded MachineSchedPolicy.
Andrew Trick [Fri, 6 Sep 2013 17:32:34 +0000 (17:32 +0000)]
Added MachineSchedPolicy.

Allow subtargets to customize the generic scheduling strategy.
This is convenient for targets that don't need to add new heuristics
by specializing the strategy.

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

9 years agomsbuild integration: provide separate files for VS2010 and VS2012
Hans Wennborg [Fri, 6 Sep 2013 17:05:46 +0000 (17:05 +0000)]
msbuild integration: provide separate files for VS2010 and VS2012

The previous msbuild integration only worked if VS2010 was installed. This patch
renames the current integration to LLVM-vs2010 and adds LLVM-vs2012.

Differential Revision: http://llvm-reviews.chandlerc.com/D1614

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

9 years agoavoid unnecessary direct access to LiveInterval::ranges
Matthias Braun [Fri, 6 Sep 2013 16:44:32 +0000 (16:44 +0000)]
avoid unnecessary direct access to LiveInterval::ranges

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

9 years agoremove unused argument from LiveRanges::join()
Matthias Braun [Fri, 6 Sep 2013 16:44:29 +0000 (16:44 +0000)]
remove unused argument from LiveRanges::join()

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

9 years agoremove pointless assert
Matthias Braun [Fri, 6 Sep 2013 16:44:27 +0000 (16:44 +0000)]
remove pointless assert

The if above it ensures the property anyway.

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

9 years agofix comment
Matthias Braun [Fri, 6 Sep 2013 16:44:25 +0000 (16:44 +0000)]
fix comment

There's no 'B3' in the example.

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

9 years agofix typo in comment
Matthias Braun [Fri, 6 Sep 2013 16:19:22 +0000 (16:19 +0000)]
fix typo in comment

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

9 years ago[mips][msa] Indentation
Daniel Sanders [Fri, 6 Sep 2013 13:25:06 +0000 (13:25 +0000)]
[mips][msa] Indentation

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

9 years ago[mips][msa] Requires<[HasMSA]> is redundant, it is also supplied via inheritance
Daniel Sanders [Fri, 6 Sep 2013 13:15:05 +0000 (13:15 +0000)]
[mips][msa] Requires<[HasMSA]> is redundant, it is also supplied via inheritance

Tested with 'llvm-tblgen -print-records' which outputs identical records before
and after this patch.

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

9 years agoThis patch adds support for microMIPS Multiply and Add/Sub instructions. Test cases...
Vladimir Medic [Fri, 6 Sep 2013 13:08:00 +0000 (13:08 +0000)]
This patch adds support for microMIPS Multiply and Add/Sub instructions. Test cases are included in patch.

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

9 years ago[mips][msa] Made the operand register sets optional for the VEC formats
Daniel Sanders [Fri, 6 Sep 2013 13:01:47 +0000 (13:01 +0000)]
[mips][msa] Made the operand register sets optional for the VEC formats

Their default is to be the same as the result register set.

No functional change

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

9 years agoThis patch adds support for microMIPS Move to/from HI/LO instructions. Test cases...
Vladimir Medic [Fri, 6 Sep 2013 12:53:21 +0000 (12:53 +0000)]
This patch adds support for microMIPS Move to/from HI/LO instructions. Test cases are included in patch.

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

9 years ago[mips][msa] Made the operand register sets optional for the ELM_INSVE formats
Daniel Sanders [Fri, 6 Sep 2013 12:50:52 +0000 (12:50 +0000)]
[mips][msa] Made the operand register sets optional for the ELM_INSVE formats

Their default is to be the same as the result register set.

No functional change

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

9 years ago[mips][msa] Made the operand register sets optional for the 3RF_4RF format
Daniel Sanders [Fri, 6 Sep 2013 12:44:13 +0000 (12:44 +0000)]
[mips][msa] Made the operand register sets optional for the 3RF_4RF format

Their default is to be the same as the result register set.

No functional change

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

9 years agoThis patch adds support for microMIPS Move Conditional instructions. Test cases are...
Vladimir Medic [Fri, 6 Sep 2013 12:41:17 +0000 (12:41 +0000)]
This patch adds support for microMIPS Move Conditional instructions. Test cases are included in patch.

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

9 years agoSelectionDAG: create correct BooleanContent constants
Tim Northover [Fri, 6 Sep 2013 12:38:12 +0000 (12:38 +0000)]
SelectionDAG: create correct BooleanContent constants

Occasionally DAGCombiner can spot that a SETCC operation is completely
redundant and reduce it to "all true" or "all false". If this happens to a
vector, the value produced has to take account of what a normal comparison
would have produced, which may be an all-1s bitmask.

The fix in SelectionDAG.cpp is tested, however, as far as I can see the code in
TargetLowering.cpp is possibly unreachable and almost certainly irrelevant when
triggered so there are no tests. However, I believe it's still clearly the
right change and may save someone else some hassle if it suddenly becomes
reachable. So I'm doing it anyway.

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

9 years ago[mips][msa] Made the operand register sets optional for the 3RF formats
Daniel Sanders [Fri, 6 Sep 2013 12:32:57 +0000 (12:32 +0000)]
[mips][msa] Made the operand register sets optional for the 3RF formats

Their default is to be the same as the result register set.

No functional change

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

9 years ago[mips][msa] Made the operand register sets optional for the 3R_4R format
Daniel Sanders [Fri, 6 Sep 2013 12:30:43 +0000 (12:30 +0000)]
[mips][msa] Made the operand register sets optional for the 3R_4R format

Their default is to be the same as the result register set.

No functional change

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

9 years agoThis patch adds support for microMIPS disassembler and disassembler make check tests.
Vladimir Medic [Fri, 6 Sep 2013 12:30:36 +0000 (12:30 +0000)]
This patch adds support for microMIPS disassembler and disassembler make check tests.

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

9 years ago[mips][msa] Made the operand register sets optional for the 2RF format
Daniel Sanders [Fri, 6 Sep 2013 12:28:13 +0000 (12:28 +0000)]
[mips][msa] Made the operand register sets optional for the 2RF format

Their default is to be the same as the result register set.

No functional change

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