oota-llvm.git
13 years agofix an oversight which caused us to compile the testcase (and other
Chris Lattner [Sun, 17 Apr 2011 17:12:08 +0000 (17:12 +0000)]
fix an oversight which caused us to compile the testcase (and other
less trivial things) into a dummy lea.  Before we generated:

_test:                                  ## @test
movq _G@GOTPCREL(%rip), %rax
leaq (%rax), %rax
ret

now we produce:

_test:                                  ## @test
movq _G@GOTPCREL(%rip), %rax
ret

This is part of rdar://9289558

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

13 years agotidy up and reduce indentation.
Chris Lattner [Sun, 17 Apr 2011 17:05:12 +0000 (17:05 +0000)]
tidy up and reduce indentation.

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

13 years agoFix rdar://9289512 - not folding load into compare at -O0
Chris Lattner [Sun, 17 Apr 2011 06:35:44 +0000 (06:35 +0000)]
Fix rdar://9289512 - not folding load into compare at -O0

The basic issue here is that bottom-up isel is matching the branch
and compare, and was failing to fold the load into the branch/compare
combo.  Fixing this (by allowing folding into any instruction of a
sequence that is selected) allows us to produce things like:

cmpb    $0, 52(%rax)
je      LBB4_2

instead of:

movb    52(%rax), %cl
cmpb    $0, %cl
je      LBB4_2

This makes the generated -O0 code run a bit faster, but also speeds up
compile time by putting less pressure on the register allocator and
generating less code.

This was one of the biggest classes of missing load folding.  Implementing
this shrinks 176.gcc's c-decl.s (as a random example) by about 4% in (verbose-asm)
line count.

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

13 years agosplit a complex predicate out to a helper function. Simplify two for loops,
Chris Lattner [Sun, 17 Apr 2011 06:03:19 +0000 (06:03 +0000)]
split a complex predicate out to a helper function.  Simplify two for loops,
which don't need to check for falling off the end of a block *and* end of phi
nodes, since terminators are never phis.

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

13 years agoRemove working entry from README.
Eli Friedman [Sun, 17 Apr 2011 02:36:27 +0000 (02:36 +0000)]
Remove working entry from README.

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

13 years agofix rdar://9289583 - fast isel should handle non-canonical commutative binops
Chris Lattner [Sun, 17 Apr 2011 01:16:47 +0000 (01:16 +0000)]
fix rdar://9289583 - fast isel should handle non-canonical commutative binops
allowing us to fold the immediate into the 'and' in this case:

int test1(int i) {
  return 8&i;
}

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

13 years agoPR9055: extend the fix to PR4050 (r70179) to apply to zext and anyext.
Eli Friedman [Sat, 16 Apr 2011 23:25:34 +0000 (23:25 +0000)]
PR9055: extend the fix to PR4050 (r70179) to apply to zext and anyext.
Returning a new node makes the code try to replace the old node, which
in the included testcase is killed by CSE.

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

13 years agoRename a misleadingly-named variable.
Frits van Bommel [Sat, 16 Apr 2011 14:32:34 +0000 (14:32 +0000)]
Rename a misleadingly-named variable.

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

13 years agoAdd test cases for Jay's r129641 and fix a 32-bit-centric testcase in a file with...
Frits van Bommel [Sat, 16 Apr 2011 14:31:50 +0000 (14:31 +0000)]
Add test cases for Jay's r129641 and fix a 32-bit-centric testcase in a file with a 64-bit datalayout.

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

13 years agoUnbreak the MSVC 2010 build.
Francois Pichet [Sat, 16 Apr 2011 14:20:39 +0000 (14:20 +0000)]
Unbreak the MSVC 2010 build.
For further information on this particular issue see: http://connect.microsoft.com/VisualStudio/feedback/details/520043/error-converting-from-null-to-a-pointer-type-in-std-pair

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

13 years agoFix bug when checking phi operands in InstCombiner::visitPHINode(),
Jay Foad [Sat, 16 Apr 2011 14:17:37 +0000 (14:17 +0000)]
Fix bug when checking phi operands in InstCombiner::visitPHINode(),
found by code inspection.

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

13 years agoMSVC needs the return 0 to compile.
Francois Pichet [Sat, 16 Apr 2011 13:59:23 +0000 (13:59 +0000)]
MSVC needs the return 0 to compile.

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

13 years agoRemove unused variable.
Benjamin Kramer [Sat, 16 Apr 2011 10:30:47 +0000 (10:30 +0000)]
Remove unused variable.

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

13 years agoWrite out uint64_t as i{0..32},i{33..64} instead of i{0..32},0.
Benjamin Kramer [Sat, 16 Apr 2011 10:25:32 +0000 (10:25 +0000)]
Write out uint64_t as i{0..32},i{33..64} instead of i{0..32},0.

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

13 years agoDon't use C++ comments in C code.
Nick Lewycky [Sat, 16 Apr 2011 04:25:36 +0000 (04:25 +0000)]
Don't use C++ comments in C code.

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

13 years agoPut each personality function in a section. This fixes the gnu ld warning:
Rafael Espindola [Sat, 16 Apr 2011 03:51:21 +0000 (03:51 +0000)]
Put each personality function in a section. This fixes the gnu ld warning:

  error in foo.o; no .eh_frame_hdr table will be created.

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

13 years agoCorrect result when a branch condition is live across a block
Stuart Hastings [Sat, 16 Apr 2011 03:31:26 +0000 (03:31 +0000)]
Correct result when a branch condition is live across a block
boundary.  <rdar://problem/8933028>

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

13 years agoFix divmod libcall lowering. Convert to {S|U}DIVREM first and then expand the node...
Evan Cheng [Sat, 16 Apr 2011 03:08:26 +0000 (03:08 +0000)]
Fix divmod libcall lowering. Convert to {S|U}DIVREM first and then expand the node to a libcall. rdar://9280991

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

13 years agoFix cmake build.
Rafael Espindola [Sat, 16 Apr 2011 02:06:46 +0000 (02:06 +0000)]
Fix cmake build.

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

13 years agoMove the re-stemming function up top and use it where it's currently inlined.
Nick Lewycky [Sat, 16 Apr 2011 02:05:18 +0000 (02:05 +0000)]
Move the re-stemming function up top and use it where it's currently inlined.
Break the arc-profile code out to a function like the notes emission code is,
and reorder the functions in the file.

The only functionality change is that we no longer modify the Module when the
Module has no debug info to use.

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

13 years agoRename LineProfiling to GCOVProfiling to more accurately represent what it
Nick Lewycky [Sat, 16 Apr 2011 01:20:23 +0000 (01:20 +0000)]
Rename LineProfiling to GCOVProfiling to more accurately represent what it
does. Also mostly implement it. Still a work-in-progress, but generates legal
output on crafted test cases.

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

13 years agoIntroduce support to encode Objective-C property information in debugging information...
Devang Patel [Sat, 16 Apr 2011 00:11:51 +0000 (00:11 +0000)]
Introduce support to encode Objective-C property information in debugging information generated for an interface.

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

13 years agoThumb2 BFC was insufficiently encoded.
Johnny Chen [Fri, 15 Apr 2011 22:52:15 +0000 (22:52 +0000)]
Thumb2 BFC was insufficiently encoded.

rdar://problem/9292717

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

13 years agoA8.6.315 VLD3 (single 3-element structure to all lanes)
Johnny Chen [Fri, 15 Apr 2011 22:49:08 +0000 (22:49 +0000)]
A8.6.315 VLD3 (single 3-element structure to all lanes)
The a bit must be encoded as 0.

rdar://problem/9292625

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

13 years agoRe-enable test o32_cc_vararg.ll.
Akira Hatanaka [Fri, 15 Apr 2011 22:23:09 +0000 (22:23 +0000)]
Re-enable test o32_cc_vararg.ll.

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

13 years agoInitial work to improve documentation for Clang's diagnostics, from Matthieu Monrocq
Douglas Gregor [Fri, 15 Apr 2011 22:04:07 +0000 (22:04 +0000)]
Initial work to improve documentation for Clang's diagnostics, from Matthieu Monrocq

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

13 years agoReverse unnecessary changes made in r129606 and r129608. There is no change in functi...
Akira Hatanaka [Fri, 15 Apr 2011 21:51:11 +0000 (21:51 +0000)]
Reverse unnecessary changes made in r129606 and r129608. There is no change in functionality.

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

13 years agoAdd ORR and EOR to the CMP peephole optimizer. It's hard to get isel to generate
Cameron Zwarich [Fri, 15 Apr 2011 21:24:38 +0000 (21:24 +0000)]
Add ORR and EOR to the CMP peephole optimizer. It's hard to get isel to generate
a case involving EOR, so I only added a test for ORR.

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

13 years agoFix some broken links, from Matthieu Monrocq
Douglas Gregor [Fri, 15 Apr 2011 21:21:31 +0000 (21:21 +0000)]
Fix some broken links, from Matthieu Monrocq

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

13 years agoFix lines that exceed 80 columns. There is no change in functionality.
Akira Hatanaka [Fri, 15 Apr 2011 21:06:38 +0000 (21:06 +0000)]
Fix lines that exceed 80 columns. There is no change in functionality.

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

13 years agoAdd this test back for Darwin.
Rafael Espindola [Fri, 15 Apr 2011 21:06:27 +0000 (21:06 +0000)]
Add this test back for Darwin.

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

13 years agoFix lines that have incorrect indentation or exceed 80 columns. There is no change...
Akira Hatanaka [Fri, 15 Apr 2011 21:00:26 +0000 (21:00 +0000)]
Fix lines that have incorrect indentation or exceed 80 columns. There is no change in functionality.

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

13 years agoThe AND instruction leaves the V flag unmodified, so it falls victim to the same
Cameron Zwarich [Fri, 15 Apr 2011 20:45:00 +0000 (20:45 +0000)]
The AND instruction leaves the V flag unmodified, so it falls victim to the same
problem as all of the other instructions we fold with CMPs.

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

13 years agoFix cmake build.
Rafael Espindola [Fri, 15 Apr 2011 20:34:45 +0000 (20:34 +0000)]
Fix cmake build.

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

13 years agoSome refactoring suggested by Anton Korobeynikov.
Rafael Espindola [Fri, 15 Apr 2011 20:32:03 +0000 (20:32 +0000)]
Some refactoring suggested by Anton Korobeynikov.

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

13 years agoAdd missing register forms of instructions to the ARM CMP-folding code. This
Cameron Zwarich [Fri, 15 Apr 2011 20:28:28 +0000 (20:28 +0000)]
Add missing register forms of instructions to the ARM CMP-folding code. This
fixes <rdar://problem/9287901>.

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

13 years agoAdd pass that expands pseudo instructions into target instructions after register...
Akira Hatanaka [Fri, 15 Apr 2011 19:52:08 +0000 (19:52 +0000)]
Add pass that expands pseudo instructions into target instructions after register allocation. Define pseudos that get expanded into mtc1 or mfc1 instructions.

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

13 years agoIncrease SubtargetFeatureKV Value and Implies fields to 64 bits since some targets...
Evan Cheng [Fri, 15 Apr 2011 19:35:46 +0000 (19:35 +0000)]
Increase SubtargetFeatureKV Value and Implies fields to 64 bits since some targets are getting very close to 32 subtarget features. Also teach tablegen to error when there are more than 64 features to guard against undefined behavior. rdar://9282332

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

13 years agoAdd encoding tests for flds/filds
Joerg Sonnenberger [Fri, 15 Apr 2011 19:25:31 +0000 (19:25 +0000)]
Add encoding tests for flds/filds

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

13 years agoImplements StringRef::compare with bounds. It is behaves similarly to strncmp()....
Lenny Maiorani [Fri, 15 Apr 2011 17:56:50 +0000 (17:56 +0000)]
Implements StringRef::compare with bounds. It is behaves similarly to strncmp(). Unit tests also included.

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

13 years agoTeach the SplitKit blitter to handle multiply defined values as well.
Jakob Stoklund Olesen [Fri, 15 Apr 2011 17:24:49 +0000 (17:24 +0000)]
Teach the SplitKit blitter to handle multiply defined values as well.

The transferValues() function can now handle both singly and multiply defined
values, as long as the resulting live range is known. Only rematerialized values
have their live range recomputed by extendRange().

The updateSSA() function can now insert PHI values in bulk across multiple
values in multiple target registers in one pass. The list of blocks received
from transferValues() is in layout order which seems to work well for the
iterative algorithm. Blocks from extendRange() are still in reverse BFS order,
but this function is used so rarely now that it doesn't matter.

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

13 years agoRemember to set flag.
Jakob Stoklund Olesen [Fri, 15 Apr 2011 17:24:46 +0000 (17:24 +0000)]
Remember to set flag.

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

13 years agoAdd 129518 back with a fix for when we are producing eh just because of debug info.
Rafael Espindola [Fri, 15 Apr 2011 15:11:06 +0000 (15:11 +0000)]
Add 129518 back with a fix for when we are producing eh just because of debug info.
Change ELF systems to use CFI for producing the EH tables. This reduces the
size of the clang binary in Debug builds from 690MB to 679MB.

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

13 years agoFix a ton of comment typos found by codespell. Patch by
Chris Lattner [Fri, 15 Apr 2011 05:18:47 +0000 (05:18 +0000)]
Fix a ton of comment typos found by codespell.  Patch by
Luis Felipe Strano Moraes!

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

13 years agoRevert r129518, "Change ELF systems to use CFI for producing the EH tables. This...
NAKAMURA Takumi [Fri, 15 Apr 2011 03:35:57 +0000 (03:35 +0000)]
Revert r129518, "Change ELF systems to use CFI for producing the EH tables. This reduces the"

It broke several builds.

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

13 years agoFix another fcopysign lowering bug. If src is f64 and destination is f32, don't
Evan Cheng [Fri, 15 Apr 2011 01:31:00 +0000 (01:31 +0000)]
Fix another fcopysign lowering bug. If src is f64 and destination is f32, don't
forget to right shift the source by 32 first. rdar://9287902

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

13 years agoFor t2BFI, both Inst{26} and Inst{5} "should" be 0.
Johnny Chen [Fri, 15 Apr 2011 00:35:08 +0000 (00:35 +0000)]
For t2BFI, both Inst{26} and Inst{5} "should" be 0.

Ref: I.1 Instruction encoding diagrams and pseudocode

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

13 years agoAdd 3DNow! intrinsics.
Michael J. Spencer [Fri, 15 Apr 2011 00:32:41 +0000 (00:32 +0000)]
Add 3DNow! intrinsics.

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

13 years agoThe ARM disassembler did not handle the alignment correctly for VLD*DUP* instructions
Johnny Chen [Fri, 15 Apr 2011 00:10:45 +0000 (00:10 +0000)]
The ARM disassembler did not handle the alignment correctly for VLD*DUP* instructions
(single element or n-element structure to all lanes).

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

13 years agoFollow up on r127913. Fix Thumb revsh isel. rdar://9286766
Evan Cheng [Thu, 14 Apr 2011 23:27:44 +0000 (23:27 +0000)]
Follow up on r127913. Fix Thumb revsh isel. rdar://9286766

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

13 years agoAdd an instcombine for constructs like a | -(b != c); a select is more
Eli Friedman [Thu, 14 Apr 2011 22:41:27 +0000 (22:41 +0000)]
Add an instcombine for constructs like a | -(b != c); a select is more
canonical, and generally leads to better code.  Found while looking at
an article about saturating arithmetic.

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

13 years agoFix an infinite alternation in JumpThreading where two transforms would repeatedly...
Owen Anderson [Thu, 14 Apr 2011 21:35:50 +0000 (21:35 +0000)]
Fix an infinite alternation in JumpThreading where two transforms would repeatedly undo each other.  The solution is to perform more aggressive constant folding to make one of the edges just folded away rather than trying to thread it.
Fixes <rdar://problem/9284786>.

Discovered with CSmith.

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

13 years agoCleanup r129509 based on comments by Chris
Mon P Wang [Thu, 14 Apr 2011 19:20:42 +0000 (19:20 +0000)]
Cleanup r129509 based on comments by Chris

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

13 years agoAdd sanity checkings for Thumb2 Load/Store Register Exclusive family of operations.
Johnny Chen [Thu, 14 Apr 2011 19:13:28 +0000 (19:13 +0000)]
Add sanity checkings for Thumb2 Load/Store Register Exclusive family of operations.

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

13 years agomove PR9661 out to here.
Chris Lattner [Thu, 14 Apr 2011 18:47:18 +0000 (18:47 +0000)]
move PR9661 out to here.

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

13 years agoFix another instance of the DAG combiner not using the correct type for the RHS of...
Owen Anderson [Thu, 14 Apr 2011 17:30:49 +0000 (17:30 +0000)]
Fix another instance of the DAG combiner not using the correct type for the RHS of a shift.

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

13 years agotests: Remove a FrontendC test which is no longer valid.
Daniel Dunbar [Thu, 14 Apr 2011 15:21:16 +0000 (15:21 +0000)]
tests: Remove a FrontendC test which is no longer valid.

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

13 years agoChange ELF systems to use CFI for producing the EH tables. This reduces the
Rafael Espindola [Thu, 14 Apr 2011 15:18:53 +0000 (15:18 +0000)]
Change ELF systems to use CFI for producing the EH tables. This reduces the
size of the clang binary in Debug builds from 690MB to 679MB.

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

13 years agoFix whitespace and tabs.
Michael J. Spencer [Thu, 14 Apr 2011 14:33:36 +0000 (14:33 +0000)]
Fix whitespace and tabs.

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

13 years agoCleanup r129472 by using a utility routine as suggested by Eli.
Mon P Wang [Thu, 14 Apr 2011 08:04:01 +0000 (08:04 +0000)]
Cleanup r129472 by using a utility routine as suggested by Eli.

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

13 years agoIn the pre-RA scheduler, maintain cmp+br proximity.
Andrew Trick [Thu, 14 Apr 2011 05:15:06 +0000 (05:15 +0000)]
In the pre-RA scheduler, maintain cmp+br proximity.

This is done by pushing physical register definitions close to their
use, which happens to handle flag definitions if they're not glued to
the branch. This seems to be generally a good thing though, so I
didn't need to add a target hook yet.

The primary motivation is to generate code closer to what people
expect and rule out missed opportunity from enabling macro-op
fusion. As a side benefit, we get several 2-5% gains on x86
benchmarks. There is one regression:
SingleSource/Benchmarks/Shootout/lists slows down be -10%. But this is
an independent scheduler bug that will be tracked separately.
See rdar://problem/9283108.

Incidentally, pre-RA scheduling is only half the solution. Fixing the
later passes is tracked by:
<rdar://problem/8932804> [pre-RA-sched] on x86, attempt to schedule CMP/TEST adjacent with condition jump

Fixes:
<rdar://problem/9262453> Scheduler unnecessary break of cmp/jump fusion

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

13 years agoDocumented bugpoint --compile-custom --compile-command.
Andrew Trick [Thu, 14 Apr 2011 05:05:36 +0000 (05:05 +0000)]
Documented bugpoint --compile-custom --compile-command.

I've used it a few times to reduce unit tests and gotten one request for information on it. It's not easy to use correctly because bugpoint doesn't tell you when you're doing it wrong.

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

13 years agoadd a minor missed dag combine that is blocking mid-level optimization
Chris Lattner [Thu, 14 Apr 2011 04:21:42 +0000 (04:21 +0000)]
add a minor missed dag combine that is blocking mid-level optimization
improvements, that will lead to fixing PR6627.

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

13 years agosink a call into its only use.
Chris Lattner [Thu, 14 Apr 2011 04:12:47 +0000 (04:12 +0000)]
sink a call into its only use.

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

13 years agorework FoldBranchToCommonDest to exit earlier when there is a bonus
Chris Lattner [Thu, 14 Apr 2011 02:44:53 +0000 (02:44 +0000)]
rework FoldBranchToCommonDest to exit earlier when there is a bonus
instruction around, reducing work.

Greatly simplify handling of debug instructions.  There is no need to
build up a vector of them and then move them into the one predecessor
if we're processing a block.  Instead just rescan the block and *copy*
them into the pred.  If a block gets merged into multiple preds, this
will retain more debug info.

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

13 years agofix a couple -Wsign-compare warnings.
Chris Lattner [Thu, 14 Apr 2011 02:27:25 +0000 (02:27 +0000)]
fix a couple -Wsign-compare warnings.

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

13 years agoAs Dan pointed out, movzbl, movsbl, and friends are nicer than their alias
Bill Wendling [Thu, 14 Apr 2011 01:46:37 +0000 (01:46 +0000)]
As Dan pointed out, movzbl, movsbl, and friends are nicer than their alias
(movzx/movsx) because they give more information. Revert that part of the patch.

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

13 years agoHave the X86 back-end emit the alias instead of what's being aliased. In most
Bill Wendling [Thu, 14 Apr 2011 01:11:51 +0000 (01:11 +0000)]
Have the X86 back-end emit the alias instead of what's being aliased. In most
cases, it's much nicer and more informative reading the alias.

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

13 years agoAdd an option to not print the alias of an instruction. It defaults to "print
Bill Wendling [Wed, 13 Apr 2011 23:36:21 +0000 (23:36 +0000)]
Add an option to not print the alias of an instruction. It defaults to "print
the alias".

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

13 years agoDuring post-legalization DAG combining, be careful to only create shifts where the...
Owen Anderson [Wed, 13 Apr 2011 23:22:23 +0000 (23:22 +0000)]
During post-legalization DAG combining, be careful to only create shifts where the RHS is of the legal type for the new operation.

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

13 years agoThumb disassembler did not handle tBRIND (indirect branch) properly.
Johnny Chen [Wed, 13 Apr 2011 21:59:01 +0000 (21:59 +0000)]
Thumb disassembler did not handle tBRIND (indirect branch) properly.

rdar://problem/9280370

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

13 years agoVectors with different number of elements of the same element type can have
Mon P Wang [Wed, 13 Apr 2011 21:40:02 +0000 (21:40 +0000)]
Vectors with different number of elements of the same element type can have
the same allocation size but different primitive sizes(e.g., <3xi32> and
<4xi32>).  When ScalarRepl promotes them, it can't use a bit cast but
should use a shuffle vector instead.

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

13 years agoCheck for unallocated instruction encodings when disassembling Thumb Branch instructi...
Johnny Chen [Wed, 13 Apr 2011 21:35:49 +0000 (21:35 +0000)]
Check for unallocated instruction encodings when disassembling Thumb Branch instructions (tBcc and t2Bcc).

rdar://problem/9280470

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

13 years agoThe LDR*T/STR*T (unpriviledged load/store) operations don't take SP or PC as Rt.
Johnny Chen [Wed, 13 Apr 2011 21:04:32 +0000 (21:04 +0000)]
The LDR*T/STR*T (unpriviledged load/store) operations don't take SP or PC as Rt.

rdar://problem/9279440

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

13 years agoFix a typo in an ARM-specific DAG combine. This fixes <rdar://problem/9278274>.
Cameron Zwarich [Wed, 13 Apr 2011 21:01:19 +0000 (21:01 +0000)]
Fix a typo in an ARM-specific DAG combine. This fixes <rdar://problem/9278274>.

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

13 years agoFix format string warning.
Benjamin Kramer [Wed, 13 Apr 2011 20:41:43 +0000 (20:41 +0000)]
Fix format string warning.

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

13 years agoFix a regression caused by r102515 where explicit alignment on globals is
Cameron Zwarich [Wed, 13 Apr 2011 20:36:04 +0000 (20:36 +0000)]
Fix a regression caused by r102515 where explicit alignment on globals is
ignored. There was a test to catch this, but it was just blindly updated in
a large change. This fixes another part of <rdar://problem/9275290>.

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

13 years agoFix debug message.
Devang Patel [Wed, 13 Apr 2011 19:47:41 +0000 (19:47 +0000)]
Fix debug message.

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

13 years agoCheck the corner cases for t2LDRSHi12 correctly and mark invalid encodings as such.
Johnny Chen [Wed, 13 Apr 2011 19:46:05 +0000 (19:46 +0000)]
Check the corner cases for t2LDRSHi12 correctly and mark invalid encodings as such.

rdar://problem/9276651

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

13 years agoRemove extra bytes that were added for gdb. We do not have good poiner to understand...
Devang Patel [Wed, 13 Apr 2011 19:41:17 +0000 (19:41 +0000)]
Remove extra bytes that were added for gdb.  We do not have good poiner to understand actual reason behind this fixme. Spot checking suggest that newer gdb does not need this.

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

13 years agoUse positive values since the value type is unsigned. Fixes a warning on the
Nick Lewycky [Wed, 13 Apr 2011 18:46:22 +0000 (18:46 +0000)]
Use positive values since the value type is unsigned. Fixes a warning on the
llvm-gcc-native-mingw32 builder.

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

13 years agoFix a bug where for t2MOVCCi disassembly, the TIED_TO register operand was not proper...
Johnny Chen [Wed, 13 Apr 2011 17:51:02 +0000 (17:51 +0000)]
Fix a bug where for t2MOVCCi disassembly, the TIED_TO register operand was not properly handled.

rdar://problem/9276427

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

13 years agoForgot to add this change for http://llvm.org/viewvc/llvm-project?view=rev&revision...
Johnny Chen [Wed, 13 Apr 2011 16:56:08 +0000 (16:56 +0000)]
Forgot to add this change for llvm.org/viewvc/llvm-project?view=rev&revision=129387.

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

13 years agoFixed the revision 129449.
Junjie Gu [Wed, 13 Apr 2011 16:45:49 +0000 (16:45 +0000)]
Fixed the revision 129449.

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

13 years agoPassing unroll parameters (unroll-count, threshold, and partial unroll) via LoopUnrol...
Junjie Gu [Wed, 13 Apr 2011 16:15:29 +0000 (16:15 +0000)]
Passing unroll parameters (unroll-count, threshold, and partial unroll) via LoopUnroll class's ctor. Doing so
will allow multiple context with different loop unroll parameters to run.  This is a minor change and no effect
on existing application.

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

13 years agoLoad multiple object files and link them via RuntimeDyld in llvm-rtdyld.
Jim Grosbach [Wed, 13 Apr 2011 15:49:40 +0000 (15:49 +0000)]
Load multiple object files and link them via RuntimeDyld in llvm-rtdyld.

Relocations between the object modules are properly resolved, as in the
following trivial example:

$ cat t.c
int foo();
int main() {
    return foo();
}
$ cat foo.c
int foo() {
    return 65;
}
$ clang -c t.c -fno-asynchronous-unwind-tables
$ clang -c foo.c -fno-asynchronous-unwind-tables
$ llvm-rtdyld t.o foo.o ; echo $?
loaded '_main' at: 0x10015c000
65

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

13 years agoAdd the alias analysis to the C api.
Rafael Espindola [Wed, 13 Apr 2011 15:44:58 +0000 (15:44 +0000)]
Add the alias analysis to the C api.

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

13 years agoAllow user-specified program entry point for llvm-rtdyld.
Jim Grosbach [Wed, 13 Apr 2011 15:38:30 +0000 (15:38 +0000)]
Allow user-specified program entry point for llvm-rtdyld.

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

13 years agoMCJIT relocation resolution.
Jim Grosbach [Wed, 13 Apr 2011 15:28:10 +0000 (15:28 +0000)]
MCJIT relocation resolution.

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

13 years agoExport LLVM_TARGETS_WITH_JIT in LLVMConfig.cmake.in. Without this,
Oscar Fuentes [Wed, 13 Apr 2011 15:25:31 +0000 (15:25 +0000)]
Export LLVM_TARGETS_WITH_JIT in LLVMConfig.cmake.in. Without this,
component names such as "engine" do not expand to "jit" and hence to
the native target libraries for external users.

Thanks to arrowdodger for reporting and diagnosing the problem.

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

13 years agoPR9214: Convert ConstantExpr::getIndices() to return an ArrayRef, plus
Jay Foad [Wed, 13 Apr 2011 15:22:40 +0000 (15:22 +0000)]
PR9214: Convert ConstantExpr::getIndices() to return an ArrayRef, plus
related tweaks to ExprMapKeyType.

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

13 years agoStop using dead function.
Jakob Stoklund Olesen [Wed, 13 Apr 2011 15:00:11 +0000 (15:00 +0000)]
Stop using dead function.

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

13 years agoRemove some redundant llvm:: prefixes.
Jay Foad [Wed, 13 Apr 2011 14:39:42 +0000 (14:39 +0000)]
Remove some redundant llvm:: prefixes.

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

13 years agoFix a comment.
Jay Foad [Wed, 13 Apr 2011 13:48:09 +0000 (13:48 +0000)]
Fix a comment.

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

13 years agoPR9214: Convert ConstantExpr::getWithOperands() to use ArrayRef.
Jay Foad [Wed, 13 Apr 2011 13:46:01 +0000 (13:46 +0000)]
PR9214: Convert ConstantExpr::getWithOperands() to use ArrayRef.

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

13 years agoFix typo.
Jay Foad [Wed, 13 Apr 2011 13:03:56 +0000 (13:03 +0000)]
Fix typo.

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

13 years agoFix typo in comment.
Jay Foad [Wed, 13 Apr 2011 12:50:47 +0000 (12:50 +0000)]
Fix typo in comment.

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

13 years agoLike the coding standards say, do not use "using namespace std".
Jay Foad [Wed, 13 Apr 2011 12:46:01 +0000 (12:46 +0000)]
Like the coding standards say, do not use "using namespace std".

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

13 years agoFix an obvious problem with an alignment computation. AsmPrinter actually does
Cameron Zwarich [Wed, 13 Apr 2011 09:02:43 +0000 (09:02 +0000)]
Fix an obvious problem with an alignment computation. AsmPrinter actually does
the max itself, so it is not easy to write a test case for this, but I added a
test case that would fail if the code in AsmPrinter were removed.

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

13 years agoFix a typo.
Cameron Zwarich [Wed, 13 Apr 2011 06:39:16 +0000 (06:39 +0000)]
Fix a typo.

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