oota-llvm.git
11 years agoSLPVectorizer: Strength reduce SmallVectors to ArrayRefs.
Benjamin Kramer [Sat, 20 Apr 2013 09:49:10 +0000 (09:49 +0000)]
SLPVectorizer: Strength reduce SmallVectors to ArrayRefs.

Avoids a couple of copies and allows more flexibility in the clients.

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

11 years agoSLPVectorizer: Reduce the compile time by eliminating the search for some of the...
Nadav Rotem [Sat, 20 Apr 2013 07:29:34 +0000 (07:29 +0000)]
SLPVectorizer: Reduce the compile time by eliminating the search for some of the more expensive patterns. After this change will only check basic arithmetic trees that start at cmpinstr.

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

11 years agorefactor tryToVectorizePair to a new method that supports vectorization of lists.
Nadav Rotem [Sat, 20 Apr 2013 07:22:58 +0000 (07:22 +0000)]
refactor tryToVectorizePair to a new method that supports vectorization of lists.

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

11 years agoFix an unused variable warning.
Nadav Rotem [Sat, 20 Apr 2013 06:40:28 +0000 (06:40 +0000)]
Fix an unused variable warning.

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

11 years agoSLPVectorizer: Improve the cost model for loop invariant broadcast values.
Nadav Rotem [Sat, 20 Apr 2013 06:13:47 +0000 (06:13 +0000)]
SLPVectorizer: Improve the cost model for loop invariant broadcast values.

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

11 years agoReport the number of stores that were found in the debug message.
Nadav Rotem [Sat, 20 Apr 2013 05:23:11 +0000 (05:23 +0000)]
Report the number of stores that were found in the debug message.

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

11 years agoFix the header comment.
Nadav Rotem [Sat, 20 Apr 2013 05:18:51 +0000 (05:18 +0000)]
Fix the header comment.

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

11 years agoUse 64bit arithmetic for calculating distance between pointers.
Nadav Rotem [Sat, 20 Apr 2013 05:17:47 +0000 (05:17 +0000)]
Use 64bit arithmetic for calculating distance between pointers.

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

11 years agoMove PPC getSwappedPredicate for reuse
Hal Finkel [Sat, 20 Apr 2013 05:16:26 +0000 (05:16 +0000)]
Move PPC getSwappedPredicate for reuse

The getSwappedPredicate function can be used in other places (such as in
improvements to the PPCCTRLoops pass). Instead of trapping it as a static
function in PPCInstrInfo, move it into PPCPredicates with other
predicate-related things.

No functionality change intended.

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

11 years agoAdd CodeGen support for functions that always return arguments via a new parameter...
Stephen Lin [Sat, 20 Apr 2013 05:14:40 +0000 (05:14 +0000)]
Add CodeGen support for functions that always return arguments via a new parameter attribute 'returned', which is taken advantage of in target-independent tail call opportunity detection and in ARM call lowering (when placed on an integral first parameter).

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

11 years agoAllow tail call opportunity detection through nested and/or multiple iterations of...
Stephen Lin [Sat, 20 Apr 2013 04:27:51 +0000 (04:27 +0000)]
Allow tail call opportunity detection through nested and/or multiple iterations of extractelement/insertelement indirection

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

11 years agoThese can be void.
Rafael Espindola [Sat, 20 Apr 2013 03:33:09 +0000 (03:33 +0000)]
These can be void.

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

11 years agoRename obj2yaml local namespace to avoid conflicts with llvm::yaml.
Rafael Espindola [Sat, 20 Apr 2013 03:16:59 +0000 (03:16 +0000)]
Rename obj2yaml local namespace to avoid conflicts with llvm::yaml.

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

11 years agoRemove local namespace yaml to avoid confusion with llvm::yaml.
Rafael Espindola [Sat, 20 Apr 2013 03:13:00 +0000 (03:13 +0000)]
Remove local namespace yaml to avoid confusion with llvm::yaml.

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

11 years agoSmall obj2yaml cleanups.
Rafael Espindola [Sat, 20 Apr 2013 02:55:00 +0000 (02:55 +0000)]
Small obj2yaml cleanups.

* using namespace llvm.
* whitespace.
* early return.

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

11 years agoRemove COFFYAML::Header.
Rafael Espindola [Sat, 20 Apr 2013 02:02:25 +0000 (02:02 +0000)]
Remove COFFYAML::Header.

Instead, use MappingNormalization to directly parse COFF::header. Also change
the naming convention of the helper classes to be a bit shorter.

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

11 years agoTest commit
Stephen Lin [Sat, 20 Apr 2013 00:47:48 +0000 (00:47 +0000)]
Test commit

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

11 years agoSimplify the code in FastISel::tryToFoldLoad, add an assertion and fix a comment.
Eli Bendersky [Fri, 19 Apr 2013 23:26:18 +0000 (23:26 +0000)]
Simplify the code in FastISel::tryToFoldLoad, add an assertion and fix a comment.

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

11 years ago[mips] Instruction selection patterns for DSP-ASE vector shifts.
Akira Hatanaka [Fri, 19 Apr 2013 23:21:32 +0000 (23:21 +0000)]
[mips] Instruction selection patterns for DSP-ASE vector shifts.

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

11 years agoMergeFunc: Make pointer and integer types generate the same hash.
Benjamin Kramer [Fri, 19 Apr 2013 23:06:44 +0000 (23:06 +0000)]
MergeFunc: Make pointer and integer types generate the same hash.

The logic that actually compares the types considers pointers and integers the
same if they are of the same size. This created a strange mismatch between hash
and reality and made the test case for this fail on some platforms (yay,
test cases).

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

11 years agoMake variable match any name.
Bill Wendling [Fri, 19 Apr 2013 22:30:43 +0000 (22:30 +0000)]
Make variable match any name.

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

11 years agoMove TryToFoldFastISelLoad to FastISel, where it belongs. In general, I'm
Eli Bendersky [Fri, 19 Apr 2013 22:29:18 +0000 (22:29 +0000)]
Move TryToFoldFastISelLoad to FastISel, where it belongs. In general, I'm
trying to move as much FastISel logic as possible out of the main path in
SelectionDAGISel - intermixing them just adds confusion.

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

11 years agoArrayRefize getMachineNode(). No functionality change.
Michael Liao [Fri, 19 Apr 2013 22:22:57 +0000 (22:22 +0000)]
ArrayRefize getMachineNode(). No functionality change.

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

11 years agoFix PPC optimizeCompareInstr swapped-sub argument handling
Hal Finkel [Fri, 19 Apr 2013 22:08:38 +0000 (22:08 +0000)]
Fix PPC optimizeCompareInstr swapped-sub argument handling

When matching a compare with a subtract where the arguments of the compare are
swapped w.r.t. the arguments of the subtract, we need to negate the predicates
(or CR bit indices) of the users. This, however, is not the same as inverting
the predicate (negating LT -> GT, but inverting LT -> GE, for example). The ARM
backend seems to do this correctly, but when I adapted the code for the PPC
backend, I introduced an error in this logic.

Comparison optimization is now enabled again by default.

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

11 years agoAdd an MRI::verifyUseLists() function.
Jakob Stoklund Olesen [Fri, 19 Apr 2013 21:40:57 +0000 (21:40 +0000)]
Add an MRI::verifyUseLists() function.

This checks the sanity of the register use lists in the MI intermediate
representation.

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

11 years agoUse dbgs() consistently for -debug printouts
Eli Bendersky [Fri, 19 Apr 2013 21:37:07 +0000 (21:37 +0000)]
Use dbgs() consistently for -debug printouts

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

11 years agoRemove COFFYAML::Relocation.
Rafael Espindola [Fri, 19 Apr 2013 21:28:07 +0000 (21:28 +0000)]
Remove COFFYAML::Relocation.

Use MappingNormalization to read a COFF::relocation directly.

No functionality change.

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

11 years agoTry explicitly setting the target triple to see if this gets it to pass on ARM.
Bill Wendling [Fri, 19 Apr 2013 21:24:51 +0000 (21:24 +0000)]
Try explicitly setting the target triple to see if this gets it to pass on ARM.

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

11 years agoDo not mangle in MS-way the globals with magic \001 in the name.
Anton Korobeynikov [Fri, 19 Apr 2013 21:20:56 +0000 (21:20 +0000)]
Do not mangle in MS-way the globals with magic \001 in the name.
Based on the patch by David Nadlinger!

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

11 years agoMake test slightly more readable.
Bill Wendling [Fri, 19 Apr 2013 21:14:59 +0000 (21:14 +0000)]
Make test slightly more readable.

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

11 years agoAdd a testcase to make sure we generate the proper compact unwind section for a funct...
Bill Wendling [Fri, 19 Apr 2013 21:07:11 +0000 (21:07 +0000)]
Add a testcase to make sure we generate the proper compact unwind section for a function that cannot produce a compact unwind encoding.

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

11 years agoLoopVectorizer: Use matcher from PatternMatch.h for the min/max patterns
Arnold Schwaighofer [Fri, 19 Apr 2013 21:03:36 +0000 (21:03 +0000)]
LoopVectorizer: Use matcher from PatternMatch.h for the min/max patterns

Also make some static function class functions to avoid having to mention the
class namespace for enums all the time.

No functionality change intended.

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

11 years ago80-col fixup.
Eric Christopher [Fri, 19 Apr 2013 20:37:12 +0000 (20:37 +0000)]
80-col fixup.

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

11 years agoReformat and nuke trailing whitespace.
Eric Christopher [Fri, 19 Apr 2013 20:37:09 +0000 (20:37 +0000)]
Reformat and nuke trailing whitespace.

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

11 years agoRename ClassType to the more accurate UnderlyingType and document its purpose.
Adrian Prantl [Fri, 19 Apr 2013 19:56:02 +0000 (19:56 +0000)]
Rename ClassType to the more accurate UnderlyingType and document its purpose.
rdar://problem/13463793

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

11 years ago[ms-inline asm] Make code layout more canonical with iniline asm handled last.
Chad Rosier [Fri, 19 Apr 2013 19:29:50 +0000 (19:29 +0000)]
[ms-inline asm] Make code layout more canonical with iniline asm handled last.

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

11 years agoAttempt to pacify this test for the buildbots.
Chad Rosier [Fri, 19 Apr 2013 19:27:33 +0000 (19:27 +0000)]
Attempt to pacify this test for the buildbots.

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

11 years ago[mips] First patch which adds support for micromips.
Akira Hatanaka [Fri, 19 Apr 2013 19:03:11 +0000 (19:03 +0000)]
[mips] First patch which adds support for micromips.

This patch adds support for recoded (meaning assembly-language compatible to
standard mips32) arithmetic 32-bit instructions.

Patch by Zoran Jovanovic.

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

11 years ago[mips] Fix InstAlias of XOR and OR macros. Set EmitAlias flag and change
Akira Hatanaka [Fri, 19 Apr 2013 18:47:40 +0000 (18:47 +0000)]
[mips] Fix InstAlias of XOR and OR macros. Set EmitAlias flag and change
operand type to uimm16.

Patch by Vladimir Medic.

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

11 years ago[ms-inline asm] Refactor the parsing of identifiers. No functional change
Chad Rosier [Fri, 19 Apr 2013 18:39:50 +0000 (18:39 +0000)]
[ms-inline asm] Refactor the parsing of identifiers.  No functional change
indended.
Part of rdar://13663589

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

11 years agoAdd test to make sure that a int-to-ptr can be merged correctly.
Bill Wendling [Fri, 19 Apr 2013 18:16:06 +0000 (18:16 +0000)]
Add test to make sure that a int-to-ptr can be merged correctly.

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

11 years ago[ms-inline asm] Remove these asserts. C++ variables that use namespace
Chad Rosier [Fri, 19 Apr 2013 17:37:05 +0000 (17:37 +0000)]
[ms-inline asm] Remove these asserts. C++ variables that use namespace
qualifiers don't necessarily begin with an identifier (e.g., ::foo::bar).

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

11 years ago[ms-inline asm] Move this variable into the scope in which it is used.
Chad Rosier [Fri, 19 Apr 2013 17:32:29 +0000 (17:32 +0000)]
[ms-inline asm] Move this variable into the scope in which it is used.

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

11 years ago[ms-inline asm] Make this a hard error.
Chad Rosier [Fri, 19 Apr 2013 17:31:39 +0000 (17:31 +0000)]
[ms-inline asm] Make this a hard error.

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

11 years agoConstantFolding: ComputeMaskedBits wants the scalar size for vectors.
Benjamin Kramer [Fri, 19 Apr 2013 16:56:24 +0000 (16:56 +0000)]
ConstantFolding: ComputeMaskedBits wants the scalar size for vectors.

Fixes PR15791.

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

11 years ago[ms-inline asm] Cleanup the dot operator implementation.
Chad Rosier [Fri, 19 Apr 2013 15:57:00 +0000 (15:57 +0000)]
[ms-inline asm] Cleanup the dot operator implementation.

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

11 years agoARM: Permit "sp" in ARM variant of STREXD instructions
Tim Northover [Fri, 19 Apr 2013 15:44:32 +0000 (15:44 +0000)]
ARM: Permit "sp" in ARM variant of STREXD instructions

Patch from Mihail Popa

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

11 years agorefactor the struct byte swapping to a helper function.
Rafael Espindola [Fri, 19 Apr 2013 13:45:05 +0000 (13:45 +0000)]
refactor the struct byte swapping to a helper function.

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

11 years agoOnly run the tests in test/Object/ARM if we have ARM support.
Rafael Espindola [Fri, 19 Apr 2013 12:47:53 +0000 (12:47 +0000)]
Only run the tests in test/Object/ARM if we have ARM support.

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

11 years agoAttributes: Don't print trailing whitespace on the function attribute comment.
Benjamin Kramer [Fri, 19 Apr 2013 11:43:21 +0000 (11:43 +0000)]
Attributes: Don't print trailing whitespace on the function attribute comment.

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

11 years agoDon't read one command past the end.
Rafael Espindola [Fri, 19 Apr 2013 11:36:47 +0000 (11:36 +0000)]
Don't read one command past the end.

Thanks to Evgeniy Stepanov for reporting this.

It might be a good idea to add a command iterator abstraction to MachO.h, but
this fixes the bug for now.

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

11 years agoARM: permit "sp" in ARM variants of MOVW/MOVT instructions
Tim Northover [Fri, 19 Apr 2013 09:58:09 +0000 (09:58 +0000)]
ARM: permit "sp" in ARM variants of MOVW/MOVT instructions

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

11 years agoRevert 179826. Tests were worthless.
Jakub Staszak [Fri, 19 Apr 2013 09:32:30 +0000 (09:32 +0000)]
Revert 179826. Tests were worthless.

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

11 years agoRevert "PR14606: debug info imported_module support"
Eric Christopher [Fri, 19 Apr 2013 07:47:16 +0000 (07:47 +0000)]
Revert "PR14606: debug info imported_module support"

This reverts commit r179836 as it seems to have caused test failures.

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

11 years agoPR14606: debug info imported_module support
David Blaikie [Fri, 19 Apr 2013 06:57:04 +0000 (06:57 +0000)]
PR14606: debug info imported_module support

Adding another CU-wide list, in this case of imported_modules (since they
should be relatively rare, it seemed better to add a list where each element
had a "context" value, rather than add a (usually empty) list to every scope).
This takes care of DW_TAG_imported_module, but to fully address PR14606 we'll
need to expand this to cover DW_TAG_imported_declaration too.

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

11 years agoAdd support for index resources (for a SlotIndex) to be relinquished.
Lang Hames [Fri, 19 Apr 2013 04:31:49 +0000 (04:31 +0000)]
Add support for index resources (for a SlotIndex) to be relinquished.

When the SlotIndexes pass was introduced it was intended to support insertion
of code during register allocation. Removal of code was a minor consideration
(and raised the question of what to do about dangling SlotIndex objects pointing
to the erased index), so I opted to keep all indexes around indefinitely and
simply null out those that weren't being used.

Nowadays people are moving more code around (e.g. via HandleMove), which means
more zombie indexes. I want to start killing off indexes when we're done with
them to reclaim the resources they use up.

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

11 years agoUse 'array_lengthof' as possible to avoid magic numbers
Michael Liao [Fri, 19 Apr 2013 04:03:37 +0000 (04:03 +0000)]
Use 'array_lengthof' as possible to avoid magic numbers

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

11 years agoR600: Add pattern for the BFI_INT instruction
Tom Stellard [Fri, 19 Apr 2013 02:11:06 +0000 (02:11 +0000)]
R600: Add pattern for the BFI_INT instruction

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

11 years agoR600/SI: Use InstFlag for VOP3 modifier operands
Tom Stellard [Fri, 19 Apr 2013 02:11:00 +0000 (02:11 +0000)]
R600/SI: Use InstFlag for VOP3 modifier operands

InstFlag has a default value of 0 and will simplify the VOP3 patterns.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179829 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600: Reorganize lit tests and document how they should be organized
Tom Stellard [Fri, 19 Apr 2013 02:10:53 +0000 (02:10 +0000)]
R600: Reorganize lit tests and document how they should be organized

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

11 years agoKeep coding stanard. Don't use "else if" after "return".
Jakub Staszak [Fri, 19 Apr 2013 01:18:04 +0000 (01:18 +0000)]
Keep coding stanard. Don't use "else if" after "return".

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

11 years agoDon't run expensive -O2 and -O3 in tests.
Jakub Staszak [Fri, 19 Apr 2013 01:10:45 +0000 (01:10 +0000)]
Don't run expensive -O2 and -O3 in tests.

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

11 years agoAdd some more stats for fast isel vs. SelectionDAG, w.r.t lowering function
Eli Bendersky [Fri, 19 Apr 2013 01:04:40 +0000 (01:04 +0000)]
Add some more stats for fast isel vs. SelectionDAG, w.r.t lowering function
arguments in entry BBs.

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

11 years agoUse an enum instead of magic constants to improve readability.
Bill Wendling [Fri, 19 Apr 2013 00:05:59 +0000 (00:05 +0000)]
Use an enum instead of magic constants to improve readability.

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

11 years agoImplement a better fix for PR15185.
Bill Wendling [Thu, 18 Apr 2013 23:34:17 +0000 (23:34 +0000)]
Implement a better fix for PR15185.

If the return type is a pointer and the call returns an integer, then do the
inttoptr convertions. And vice versa.

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

11 years agoRelax this assert. It may not hold in all cases.
Bill Wendling [Thu, 18 Apr 2013 23:16:46 +0000 (23:16 +0000)]
Relax this assert. It may not hold in all cases.

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

11 years ago[ms-inline asm] Apply the condition code mnemonic aliases to both the Intel and
Chad Rosier [Thu, 18 Apr 2013 23:16:12 +0000 (23:16 +0000)]
[ms-inline asm] Apply the condition code mnemonic aliases to both the Intel and
AT&T dialect.  Test case for r179804 as well.
rdar://13674398 and PR13340.

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

11 years agoAssert if we're trying to generate a null compact unwind entry.
Bill Wendling [Thu, 18 Apr 2013 22:56:05 +0000 (22:56 +0000)]
Assert if we're trying to generate a null compact unwind entry.

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

11 years agoSet the compact unwind encoding to 'requires EH DWARF' if we cannot generate a CU...
Bill Wendling [Thu, 18 Apr 2013 22:55:29 +0000 (22:55 +0000)]
Set the compact unwind encoding to 'requires EH DWARF' if we cannot generate a CU encoding.

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

11 years agoDisable PPC comparison optimization by default
Hal Finkel [Thu, 18 Apr 2013 22:54:25 +0000 (22:54 +0000)]
Disable PPC comparison optimization by default

This seems to cause a stage-2 LLVM compile failure (by crashing TableGen); do
I'm disabling this for now.

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

11 years ago[asm parser] Add support for predicating MnemonicAlias based on the assembler
Chad Rosier [Thu, 18 Apr 2013 22:35:36 +0000 (22:35 +0000)]
[asm parser] Add support for predicating MnemonicAlias based on the assembler
variant/dialect.  Addresses a FIXME in the emitMnemonicAliases function.
Use and test case to come shortly.
rdar://13688439 and part of PR13340.

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

11 years agoImplement optimizeCompareInstr for PPC
Hal Finkel [Thu, 18 Apr 2013 22:15:08 +0000 (22:15 +0000)]
Implement optimizeCompareInstr for PPC

Many PPC instructions have a so-called 'record form' which stores to a specific
condition register the result of comparing the result of the instruction with
zero (always as a signed comparison). For integer operations on PPC64, this is
always a 64-bit comparison.

This implementation is derived from the implementation in the ARM backend;
there are some differences because PPC condition registers are allocatable
virtual registers (although the record forms always use a specific one), and we
look for a matching subtraction instruction after the compare (but before the
first use) in addition to before it.

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

11 years agoMake the TargetIndependent flag have the right boolean value.
Bill Wendling [Thu, 18 Apr 2013 21:45:04 +0000 (21:45 +0000)]
Make the TargetIndependent flag have the right boolean value.

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

11 years agoX86: Add an SSE2 lowering for 64 bit compares when pcmpgtq (SSE4.2) isn't available.
Benjamin Kramer [Thu, 18 Apr 2013 21:37:45 +0000 (21:37 +0000)]
X86: Add an SSE2 lowering for 64 bit compares when pcmpgtq (SSE4.2) isn't available.

This pattern started popping up in vectorized min/max reductions.

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

11 years agoFix typo
Eli Bendersky [Thu, 18 Apr 2013 20:49:17 +0000 (20:49 +0000)]
Fix typo

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

11 years agoCleanup patch:
Bill Wendling [Thu, 18 Apr 2013 20:17:28 +0000 (20:17 +0000)]
Cleanup patch:

Semantics of parameters named Index and Idx were inconsistent between
"include/llvm/IR/Attributes.h", "lib/IR/AttributeImpl.h" and
"lib/IR/Attributes.cpp": sometimes these were fixed 1-based indexes of IR
parameters (or AttributeSet::ReturnIndex for IR return values or
AttributeSet::FunctionIndex for IR functions), other times they were the
internal slot for storage in the underlying AttributeSetImpl. I renamed usage of
the former to "Index" and usage of the latter to "Slot" ("Slot" was already
being used consistently for the latter in a subset of cases)

Patch by Stephen Lin!

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

11 years agoThis patch addresses two cleanup issues:
Bill Wendling [Thu, 18 Apr 2013 20:15:25 +0000 (20:15 +0000)]
This patch addresses two cleanup issues:

1. Verify::VerifyParameterAttrs in "lib/IR/Verifier.cpp" and
   AttrBuilder::removeFunctionOnlyAttrs in "lib/IR/Attributes.cpp" (only called
   by Verify::VerifyFunctionAttrs) separately maintained a list of function-only
   attribute types. I've consolidated the logic into a new function used for
   both cases in "lib/IR/Verifier.cpp", so this logic is in one place (other
   than the AsmParser front-end)

2. Various functions in "lib/IR/Verifier.cpp" passed AttributeSet around by
   reference needlessly, as it's just a handle to an immutable pimpl body.

Patch by Stephen Lin!

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

11 years agoFix a -Wdocumentation warning
Dmitri Gribenko [Thu, 18 Apr 2013 20:13:04 +0000 (20:13 +0000)]
Fix a -Wdocumentation warning

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

11 years agoIn the function InstCombiner::visitExtractElementInst() removed the limitation that...
Anat Shemer [Thu, 18 Apr 2013 19:56:44 +0000 (19:56 +0000)]
In the function InstCombiner::visitExtractElementInst() removed the limitation that extract is promoted over a cast only if the cast has only one use.

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

11 years agoC API: Fix coding style
Tom Stellard [Thu, 18 Apr 2013 19:50:53 +0000 (19:50 +0000)]
C API: Fix coding style

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

11 years agoAdded a function scalarizePHI() that sclarizes a vector phi instruction if it has...
Anat Shemer [Thu, 18 Apr 2013 19:35:39 +0000 (19:35 +0000)]
Added a function scalarizePHI() that sclarizes a vector phi instruction if it has only 2 uses: one to promote the vector phi in a loop and the other use is an extract operation of one element at a constant location.

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

11 years agoFix comment. Patch by Stephen Lin.
Bill Wendling [Thu, 18 Apr 2013 18:30:16 +0000 (18:30 +0000)]
Fix comment. Patch by Stephen Lin.

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

11 years agoAt Jim Grosbach's request detemplate Object/MachO.h.
Rafael Espindola [Thu, 18 Apr 2013 18:08:55 +0000 (18:08 +0000)]
At Jim Grosbach's request detemplate Object/MachO.h.

We are still able to handle mixed endian objects by swapping one struct at a
time.

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

11 years agoFix a comment, PR15777.
Chris Lattner [Thu, 18 Apr 2013 17:42:14 +0000 (17:42 +0000)]
Fix a comment, PR15777.

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

11 years agoAllow misaligned stores in x86 fast-isel.
Derek Schuff [Thu, 18 Apr 2013 17:41:08 +0000 (17:41 +0000)]
Allow misaligned stores in x86 fast-isel.

In X86FastISel::X86SelectStore(), improperly aligned stores are rejected and
handled by the DAG-based ISel.  However, X86FastISel::X86SelectLoad() makes
no such requirement.  There doesn't appear to be an x86 architectural
correctness issue with allowing potentially unaligned store instructions.
This patch removes this restriction.

Patch by Jim Stichnot.

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

11 years agoLoopVectorizer: Recognize min/max reductions
Arnold Schwaighofer [Thu, 18 Apr 2013 17:22:34 +0000 (17:22 +0000)]
LoopVectorizer: Recognize min/max reductions

A min/max operation is represented by a select(cmp(lt/le/gt/ge, X, Y), X, Y)
sequence in LLVM. If we see such a sequence we can treat it just as any other
commutative binary instruction and reduce it.

This appears to help bzip2 by about 1.5% on an imac12,2.

radar://12960601

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

11 years agoFix grammar in LLVMBuild.rst
Eli Bendersky [Thu, 18 Apr 2013 16:39:32 +0000 (16:39 +0000)]
Fix grammar in LLVMBuild.rst

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

11 years ago[ms-inline asm] Simplify some logic and add a FIXME for unhandled unary minus.
Chad Rosier [Thu, 18 Apr 2013 16:28:19 +0000 (16:28 +0000)]
[ms-inline asm] Simplify some logic and add a FIXME for unhandled unary minus.

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

11 years agoMake this private method.
Chad Rosier [Thu, 18 Apr 2013 16:13:18 +0000 (16:13 +0000)]
Make this private method.

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

11 years agoFixes to LangRef.rst: incorrect attributes syntax and misplaced 'nobuiltin'
Eli Bendersky [Thu, 18 Apr 2013 16:11:44 +0000 (16:11 +0000)]
Fixes to LangRef.rst: incorrect attributes syntax and misplaced 'nobuiltin'

Patch by Stephen Lin

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

11 years agoFix comment spacing.
Chad Rosier [Thu, 18 Apr 2013 15:19:45 +0000 (15:19 +0000)]
Fix comment spacing.

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

11 years agoLoopVectorize: Use a set to avoid longer cycles in the reduction chain too.
Benjamin Kramer [Thu, 18 Apr 2013 14:29:13 +0000 (14:29 +0000)]
LoopVectorize: Use a set to avoid longer cycles in the reduction chain too.

Fixes PR15748.

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

11 years agoFix for PR14824, An ARM Load/Store Optimization bug
Hao Liu [Thu, 18 Apr 2013 09:11:08 +0000 (09:11 +0000)]
Fix for PR14824, An ARM Load/Store Optimization bug

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

11 years agoRevert "Combine bit test + conditional or into simple math"
David Majnemer [Thu, 18 Apr 2013 08:42:33 +0000 (08:42 +0000)]
Revert "Combine bit test + conditional or into simple math"

It is causing stage2 builds to fail, let's get them running again.

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

11 years agoCombine bit test + conditional or into simple math
David Majnemer [Thu, 18 Apr 2013 07:30:07 +0000 (07:30 +0000)]
Combine bit test + conditional or into simple math

Simplify:
(select (icmp eq (and X, C1), 0), Y, (or Y, C2))

Into:
(or (shl (and X, C1), C3), y)

Where:
C3 = Log(C2) - Log(C1)

If:
C1 and C2 are both powers of two

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

11 years ago[objc-arc] Do not mismatch up retains inside a for loop with releases outside said...
Michael Gottesman [Thu, 18 Apr 2013 05:39:45 +0000 (05:39 +0000)]
[objc-arc] Do not mismatch up retains inside a for loop with releases outside said for loop in the presense of differing provenance caused by escaping blocks.

This occurs due to an alloca representing a separate ownership from the
original pointer. Thus consider the following pseudo-IR:

  objc_retain(%a)
  for (...) {
    objc_retain(%a)
    %block <- %a
    F(%block)
    objc_release(%block)
  }
  objc_release(%a)

From the perspective of the optimizer, the %block is a separate
provenance from the original %a. Thus the optimizer pairs up the inner
retain for %a and the outer release from %a, resulting in segfaults.

This is fixed by noting that the signature of a mismatch of
retain/releases inside the for loop is a Use/CanRelease top down with an
None bottom up (since bottom up the Retain-CanRelease-Use-Release
sequence is completed by the inner objc_retain, but top down due to the
differing provenance from the objc_release said sequence is not
completed). In said case in CheckForCFGHazards, we now clear the state
of %a implying that no pairing will occur.

Additionally a test case is included.

rdar://12969722

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

11 years agoRemoved trailing whitespace.
Michael Gottesman [Thu, 18 Apr 2013 04:34:11 +0000 (04:34 +0000)]
Removed trailing whitespace.

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

11 years agoStreamline arc-annotation test (removing some cases which do not add any extra covera...
Michael Gottesman [Thu, 18 Apr 2013 04:34:06 +0000 (04:34 +0000)]
Streamline arc-annotation test (removing some cases which do not add any extra coverage) and set it up to use FileCheck variables to make the test more robust.

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

11 years ago[mips] Rename function.
Akira Hatanaka [Thu, 18 Apr 2013 01:00:46 +0000 (01:00 +0000)]
[mips] Rename function.

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

11 years ago[mips] DSP-ASE move from HI/LO register instructions.
Akira Hatanaka [Thu, 18 Apr 2013 00:52:44 +0000 (00:52 +0000)]
[mips] DSP-ASE move from HI/LO register instructions.

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