oota-llvm.git
13 years agoAdd ARM fast-isel support for materializing the address of a global in cases where...
Eli Friedman [Fri, 3 Jun 2011 01:13:19 +0000 (01:13 +0000)]
Add ARM fast-isel support for materializing the address of a global in cases where the global uses an indirect symbol.

rdar://9431157

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

13 years agoBasic PassManager diagnostics.
Andrew Trick [Fri, 3 Jun 2011 00:48:58 +0000 (00:48 +0000)]
Basic PassManager diagnostics.

Added asserts whenever attempting to use a potentially
uninitialized pass. This helps people trying to develop a new pass and
people trying to understand the bug reports filed by the former people.

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

13 years agowhitespace
Andrew Trick [Fri, 3 Jun 2011 00:44:32 +0000 (00:44 +0000)]
whitespace

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

13 years agoTest case pasto (failed when run with IR verifier).
Andrew Trick [Thu, 2 Jun 2011 23:57:27 +0000 (23:57 +0000)]
Test case pasto (failed when run with IR verifier).

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

13 years agoAvoid calling TRI->getAllocatableSet in RAFast.
Jakob Stoklund Olesen [Thu, 2 Jun 2011 23:41:40 +0000 (23:41 +0000)]
Avoid calling TRI->getAllocatableSet in RAFast.

When compiling a program with lots of small functions like
483.xalancbmk, this makes RAFast 11% faster.

Add some comments to clarify the difference between unallocatable and
reserved registers. It's quite subtle.

The fast register allocator depends on EFLAGS' not being allocatable on
x86. That way it can completely avoid tracking liveness, and it won't
mind when there are multiple uses of a single def.

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

13 years agoHave LowerOperandForConstraint handle multiple character constraints.
Eric Christopher [Thu, 2 Jun 2011 23:16:42 +0000 (23:16 +0000)]
Have LowerOperandForConstraint handle multiple character constraints.

Part of rdar://9119939

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

13 years agoFlag unallocatable register classes instead of giving them empty
Jakob Stoklund Olesen [Thu, 2 Jun 2011 23:07:24 +0000 (23:07 +0000)]
Flag unallocatable register classes instead of giving them empty
allocation orders.

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

13 years agoMake it possible to have unallocatable register classes.
Jakob Stoklund Olesen [Thu, 2 Jun 2011 23:07:20 +0000 (23:07 +0000)]
Make it possible to have unallocatable register classes.

Some register classes are only used for instruction operand constraints.
They should never be used for virtual registers. Previously, those
register classes were given an empty allocation order, but now you can
say 'let isAllocatable=0' in the register class definition.

TableGen calculates if a register is part of any allocatable register
class, and makes that information available in TargetRegisterDesc::inAllocatableClass.

The goal here is to eliminate use cases for overriding allocation_order_*
methods.

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

13 years agoPreserve line number information while converting Invoke into a Call.
Devang Patel [Thu, 2 Jun 2011 22:46:58 +0000 (22:46 +0000)]
Preserve line number information while converting Invoke into a Call.

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

13 years agoThis should have been a C++ testcase.
Bill Wendling [Thu, 2 Jun 2011 22:26:15 +0000 (22:26 +0000)]
This should have been a C++ testcase.

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

13 years agoJust use a SmallVector.
Jakob Stoklund Olesen [Thu, 2 Jun 2011 22:22:43 +0000 (22:22 +0000)]
Just use a SmallVector.

I was confused whether new uint8_t[] would zero-initialize the returned
array, and it seems that so is gcc-4.0.

This should fix the test failures on darwin 9.

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

13 years agoTestcase for r132493.
Bill Wendling [Thu, 2 Jun 2011 22:12:42 +0000 (22:12 +0000)]
Testcase for r132493.

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

13 years agoUpdate for r132493 change.
Bill Wendling [Thu, 2 Jun 2011 22:11:49 +0000 (22:11 +0000)]
Update for r132493 change.

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

13 years agoRemove dead code.
Devang Patel [Thu, 2 Jun 2011 21:31:00 +0000 (21:31 +0000)]
Remove dead code.

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

13 years agoUpdate DBG_VALUEs while breaking anti dependencies.
Devang Patel [Thu, 2 Jun 2011 21:26:52 +0000 (21:26 +0000)]
Update DBG_VALUEs while breaking anti dependencies.

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

13 years agoFix encoding for VEXTdf.
Tanya Lattner [Thu, 2 Jun 2011 21:25:24 +0000 (21:25 +0000)]
Fix encoding for VEXTdf.

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

13 years agoPR10067: Add missing safety check to call return transformation in MemCpyOpt::process...
Eli Friedman [Thu, 2 Jun 2011 21:24:42 +0000 (21:24 +0000)]
PR10067: Add missing safety check to call return transformation in MemCpyOpt::processStore.  If something accesses the dest of the "copy" between the call and the copy, the performCallSlotOptzn transformation is not valid.

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

13 years agoDuring post RA scheduling, do not try to chase reg defs. to preserve DBG_VALUEs....
Devang Patel [Thu, 2 Jun 2011 20:07:12 +0000 (20:07 +0000)]
During post RA scheduling, do not try to chase reg defs. to preserve DBG_VALUEs. This approach has several downsides, for example, it does not work when dbg value is a constant integer, it does not work if reg is defined more than once, it places end of debug value range markers in the wrong place. It even causes misleading incorrect debug info when duplicate DBG_VALUE instructions point to same reg def.

Instead, use simpler approach and let DBG_VALUE follow its predecessor instruction. After live debug value analysis pass, all DBG_VALUE instruction are placed at the right place. Thanks Jakob for the hint!

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

13 years agoAdd test for PR10068.
Rafael Espindola [Thu, 2 Jun 2011 20:02:48 +0000 (20:02 +0000)]
Add test for PR10068.

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

13 years agoRevert 132424 to fix PR10068.
Rafael Espindola [Thu, 2 Jun 2011 19:57:47 +0000 (19:57 +0000)]
Revert 132424 to fix PR10068.

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

13 years agoAndy pointed out a dumb omission in this test case. Thanks Andy!
Stuart Hastings [Thu, 2 Jun 2011 19:26:49 +0000 (19:26 +0000)]
Andy pointed out a dumb omission in this test case.  Thanks Andy!

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

13 years agoAdd a new parse hint for multi-letter constraints in inline asm.
Eric Christopher [Thu, 2 Jun 2011 19:26:37 +0000 (19:26 +0000)]
Add a new parse hint for multi-letter constraints in inline asm.

Testcase will come when we use it.

Part of rdar://9119939

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

13 years agoJakob pointed out a dumb omission in this test case. Thanks Jakob!
Stuart Hastings [Thu, 2 Jun 2011 18:44:05 +0000 (18:44 +0000)]
Jakob pointed out a dumb omission in this test case.  Thanks Jakob!

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

13 years agoUse RegisterClassInfo::getOrder in RAFast.
Jakob Stoklund Olesen [Thu, 2 Jun 2011 18:35:30 +0000 (18:35 +0000)]
Use RegisterClassInfo::getOrder in RAFast.

This saves two virtual function calls and an Allocatable BitVector test,
making RAFast run 2% faster.

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

13 years ago.cfi directive register parsing flexibility.
Jim Grosbach [Thu, 2 Jun 2011 17:14:04 +0000 (17:14 +0000)]
.cfi directive register parsing flexibility.

Parsing a register name/number for .cfi directives can't assume that a
register name starts with a '%' token. Be more flexible and check for a
register number instead. Still unlikely to be perfect, but it allows us
to parse both plain identifiers as register names and integers as register
numbers, which is what we're wanting to support at this point.

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

13 years agoOmit unnecessary stack copy when x87 input is a load.
Stuart Hastings [Thu, 2 Jun 2011 15:57:11 +0000 (15:57 +0000)]
Omit unnecessary stack copy when x87 input is a load.
rdar://problem/6373334

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

13 years agoStart with a zeroed CSRNum map.
Benjamin Kramer [Thu, 2 Jun 2011 12:07:44 +0000 (12:07 +0000)]
Start with a zeroed CSRNum map.

Found by valgrind.

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

13 years agoInitialize members to fix problem found by valgrind.
Jakob Stoklund Olesen [Thu, 2 Jun 2011 05:43:49 +0000 (05:43 +0000)]
Initialize members to fix problem found by valgrind.

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

13 years agoUse TRI::has{Sub,Super}ClassEq() where possible.
Jakob Stoklund Olesen [Thu, 2 Jun 2011 05:43:46 +0000 (05:43 +0000)]
Use TRI::has{Sub,Super}ClassEq() where possible.

No functional change.

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

13 years agoTweak testcase for ARM bot. rdar://problem/5993888
Stuart Hastings [Thu, 2 Jun 2011 05:05:39 +0000 (05:05 +0000)]
Tweak testcase for ARM bot.  rdar://problem/5993888

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

13 years agoDon't hardcode the %reg format in the streamer.
Rafael Espindola [Thu, 2 Jun 2011 02:34:55 +0000 (02:34 +0000)]
Don't hardcode the %reg format in the streamer.

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

13 years agoAdd a RegisterClassInfo class that lazily caches information about
Jakob Stoklund Olesen [Thu, 2 Jun 2011 02:19:35 +0000 (02:19 +0000)]
Add a RegisterClassInfo class that lazily caches information about
register classes.

It provides information for each register class that cannot be
determined statically, like:

- The number of allocatable registers in a class after filtering out the
  reserved and invalid registers.

- The preferred allocation order with registers that overlap callee-saved
  registers last.

- The last callee-saved register that overlaps a given physical register.

This information usually doesn't change between functions, so it is
reused for compiling multiple functions when possible.  The many
possible combinations of reserved and callee saves registers makes it
unfeasible to compute this information statically in TableGen.

Use RegisterClassInfo to count available registers in various heuristics
in SimpleRegisterCoalescing, making the pass run 4% faster.

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

13 years agoDetect FI|cst pattern in MipsDAGToDAGISel::SelectAddr. Patch by Sasa Stankovic.
Akira Hatanaka [Thu, 2 Jun 2011 01:03:14 +0000 (01:03 +0000)]
Detect FI|cst pattern in MipsDAGToDAGISel::SelectAddr. Patch by Sasa Stankovic.

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

13 years agoTest case for r132444.
Akira Hatanaka [Thu, 2 Jun 2011 00:25:53 +0000 (00:25 +0000)]
Test case for r132444.

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

13 years agoCustom-lower FRAMEADDR. Patch by Sasa Stankovic.
Akira Hatanaka [Thu, 2 Jun 2011 00:24:44 +0000 (00:24 +0000)]
Custom-lower FRAMEADDR. Patch by Sasa Stankovic.

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

13 years agoWhen marking a block as being unanalyzable, use "Clobber" on the terminator instead...
Eli Friedman [Thu, 2 Jun 2011 00:08:52 +0000 (00:08 +0000)]
When marking a block as being unanalyzable, use "Clobber" on the terminator instead of the first instruction in the block.  This is a bit of a hack; "Clobber" isn't really the right marking in the first place.  memdep doesn't really have any way of properly expressing "unanalyzable" at the moment.  Using it on the terminator is much less ambiguous than using it on an arbitrary instruction, though.

In the given testcase, the "Clobber" was pointing to a load, and GVN was incorrectly assuming that meant that the "Clobber" load overlapped the load being analyzed (when they are actually unrelated).

The included testcase tests both this commit and r132434.

Part two of rdar://9429882.  (r132434 was mislabeled.)

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

13 years agoTypos.
Chad Rosier [Wed, 1 Jun 2011 23:32:40 +0000 (23:32 +0000)]
Typos.

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

13 years agoIn MemoryDependenceAnalysis::getNonLocalPointerDepFromBB, if a given block is is...
Eli Friedman [Wed, 1 Jun 2011 23:16:53 +0000 (23:16 +0000)]
In MemoryDependenceAnalysis::getNonLocalPointerDepFromBB, if a given block is is deemed unanalyzable (and we execute one of the "goto PredTranslationFailure" statements), make sure we don't put information about the predecessors of that block into the returned data structures; this can lead to, among other things, extraneous results (which will confuse passes using memdep).  Fixes an assert in GVN compiling ruby. Part of rdar://problem/9521954 .

Testcase coming up soon.

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

13 years agoA DBG_VALUE that truncates a range does not start another dbg value range.
Devang Patel [Wed, 1 Jun 2011 23:00:17 +0000 (23:00 +0000)]
A DBG_VALUE that truncates a range does not start another dbg value range.

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

13 years agoDo not drop constant values when a variable's content is described using .debug_loc...
Devang Patel [Wed, 1 Jun 2011 22:03:25 +0000 (22:03 +0000)]
Do not drop constant values when a variable's content is described using .debug_loc entries.

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

13 years agoRecommit 132404 with fixes. rdar://problem/5993888
Stuart Hastings [Wed, 1 Jun 2011 21:33:14 +0000 (21:33 +0000)]
Recommit 132404 with fixes.  rdar://problem/5993888

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

13 years agoAllow bitcasts between valid types of the same size and vector
Eric Christopher [Wed, 1 Jun 2011 19:55:10 +0000 (19:55 +0000)]
Allow bitcasts between valid types of the same size and vector
types if the vector type is legal.

Fixes rdar://9306086

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

13 years agoRevert 132404 to appease a buildbot. rdar://problem/5993888
Stuart Hastings [Wed, 1 Jun 2011 19:52:20 +0000 (19:52 +0000)]
Revert 132404 to appease a buildbot.  rdar://problem/5993888

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

13 years agoRefactor LegalizeTypes: Erase LegalizeAction and make the type legalizer use
Nadav Rotem [Wed, 1 Jun 2011 19:47:10 +0000 (19:47 +0000)]
Refactor LegalizeTypes: Erase LegalizeAction and make the type legalizer use
the TargetLowering enum.

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

13 years agoSCEV: missing null check fix for r132360, dragonegg crash.
Andrew Trick [Wed, 1 Jun 2011 19:14:56 +0000 (19:14 +0000)]
SCEV: missing null check fix for r132360, dragonegg crash.

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

13 years agoRevert r132358 "Simplify the eviction policy by making the failsafe explicit."
Jakob Stoklund Olesen [Wed, 1 Jun 2011 18:45:02 +0000 (18:45 +0000)]
Revert r132358 "Simplify the eviction policy by making the failsafe explicit."

This commit caused regressions in i386 flops-[568], matrix, salsa20,
256.bzip2, and enc-md5.

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

13 years agoFix double FGETSIGN to work on x86_32; followup to 132396.
Stuart Hastings [Wed, 1 Jun 2011 18:32:25 +0000 (18:32 +0000)]
Fix double FGETSIGN to work on x86_32; followup to 132396.
rdar://problem/5660695

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

13 years agoAdd a testcase, enabled only on arm, for llvm-gcc r132366.
Eric Christopher [Wed, 1 Jun 2011 18:23:56 +0000 (18:23 +0000)]
Add a testcase, enabled only on arm, for llvm-gcc r132366.

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

13 years agoCleanup test case. rdar://problem/5660695
Stuart Hastings [Wed, 1 Jun 2011 18:23:14 +0000 (18:23 +0000)]
Cleanup test case.  rdar://problem/5660695

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

13 years agoInitialize IssueWidth to zero.
Benjamin Kramer [Wed, 1 Jun 2011 17:19:08 +0000 (17:19 +0000)]
Initialize IssueWidth to zero.

Fixes valgrind errors in the CellSPU backend.

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

13 years agoAdd support for x86 CMPEQSS and friends. These instructions do a
Stuart Hastings [Wed, 1 Jun 2011 17:17:45 +0000 (17:17 +0000)]
Add support for x86 CMPEQSS and friends.  These instructions do a
floating-point comparison, generate a mask of 0s or 1s, and generally
DTRT with NaNs.  Only profitable when the user wants a materialized 0
or 1 at runtime.  rdar://problem/5993888

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

13 years agoReapply 132348 with fixes. rdar://problem/6501862
Stuart Hastings [Wed, 1 Jun 2011 16:42:47 +0000 (16:42 +0000)]
Reapply 132348 with fixes.  rdar://problem/6501862

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

13 years agoA forthcoming SSE patch will break this test; since the test is also
Stuart Hastings [Wed, 1 Jun 2011 16:13:09 +0000 (16:13 +0000)]
A forthcoming SSE patch will break this test; since the test is also
valid for x87, re-target to x87.  rdar://problem/5993888

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

13 years agoTest case for 132396. rdar://problem/5660695
Stuart Hastings [Wed, 1 Jun 2011 15:50:29 +0000 (15:50 +0000)]
Test case for 132396.  rdar://problem/5660695

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

13 years agoFix PR10059 and future variations by handling all register subclasses.
Jakob Stoklund Olesen [Wed, 1 Jun 2011 15:32:10 +0000 (15:32 +0000)]
Fix PR10059 and future variations by handling all register subclasses.

Add TargetRegisterInfo::hasSubClassEq and use it to check for compatible
register classes instead of trying to list all register classes in
X86's getLoadStoreRegOpcode.

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

13 years agoTurn on FGETSIGN for x86. Followup to 132388. rdar://problem/5660695
Stuart Hastings [Wed, 1 Jun 2011 14:04:17 +0000 (14:04 +0000)]
Turn on FGETSIGN for x86.  Followup to 132388. rdar://problem/5660695

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

13 years agoAdd new -d option to tblgen. It writes a make(1)-style dependency file.
Joerg Sonnenberger [Wed, 1 Jun 2011 13:10:15 +0000 (13:10 +0000)]
Add new -d option to tblgen. It writes a make(1)-style dependency file.

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

13 years agoThis patch is another step in the direction of adding vector select. In this
Nadav Rotem [Wed, 1 Jun 2011 12:51:46 +0000 (12:51 +0000)]
This patch is another step in the direction of adding vector select. In this
patch we add a flag to enable a new type legalization decision - to promote
integer elements in vectors. Currently, the rest of the codegen does not support
this kind of legalization.  This flag will be removed when the transition is
complete.

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

13 years agoFGETSIGN support for x86, using movmskps/pd. Will be enabled with a
Stuart Hastings [Wed, 1 Jun 2011 04:39:42 +0000 (04:39 +0000)]
FGETSIGN support for x86, using movmskps/pd.  Will be enabled with a
patch to TargetLowering.cpp.  rdar://problem/5660695

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

13 years agoAdd an issue width check to the postRA scheduler. Patch by Max Kazakov!
Andrew Trick [Wed, 1 Jun 2011 03:27:56 +0000 (03:27 +0000)]
Add an issue width check to the postRA scheduler. Patch by Max Kazakov!

For targets with no itinerary (x86) it is a nop by default. For
targets with issue width already expressed in the itinerary (ARM) it
bypasses a scoreboard check but otherwise does not affect the
schedule. It does make the code more consistent and complete and
allows new targets to specify their issue width in an arbitrary way.

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

13 years agoFirst, do no harm -- even if we can't find a selector for an enclosing
John McCall [Wed, 1 Jun 2011 02:17:11 +0000 (02:17 +0000)]
First, do no harm -- even if we can't find a selector for an enclosing
landing pad, forward llvm.eh.resume calls to it instead of turning them
invalidly into invokes.

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

13 years agoThe ARM stuff already calls the Resume function, not the Resume_or_Rethrow. It
Bill Wendling [Wed, 1 Jun 2011 01:49:35 +0000 (01:49 +0000)]
The ARM stuff already calls the Resume function, not the Resume_or_Rethrow. It
turns out that it could cause an infinite loop in some situations. If this code
is triggered and it converts a cleanup into a catchall, but that cleanup was in
already in a cleanup, then the _Unwind_SjLj_Resume could infinite loop. I.e.,
the code doesn't consume the exception object and passes it on to
_Unwind_SjLj_Resume. But _USjLjR expects it to be consumed (since it's landing
at a catchall instead of a cleanup). So it uses the values that are presently
there, which are the values that tell it to jump to the fake landing pad.
<rdar://problem/9508402>

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

13 years agoIncomplete type may not have corresponding DIE, so do not check DIEEntry eagerly.
Devang Patel [Wed, 1 Jun 2011 00:23:24 +0000 (00:23 +0000)]
Incomplete type may not have corresponding DIE, so do not check DIEEntry eagerly.

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

13 years agoRefactor.
Devang Patel [Tue, 31 May 2011 23:30:30 +0000 (23:30 +0000)]
Refactor.

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

13 years agoInclude global types, that are referenced through local variables, in debug_pubtypes...
Devang Patel [Tue, 31 May 2011 22:56:51 +0000 (22:56 +0000)]
Include global types, that are referenced through local variables, in debug_pubtypes list.

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

13 years agoIgnore Vim swap files
Jakob Stoklund Olesen [Tue, 31 May 2011 21:54:28 +0000 (21:54 +0000)]
Ignore Vim swap files

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

13 years agoReverted r132135 per Xerxes request. These tests are passing for his setup. Requires...
Galina Kistanova [Tue, 31 May 2011 21:50:33 +0000 (21:50 +0000)]
Reverted r132135 per Xerxes request. These tests are passing for his setup. Requires more research.

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

13 years agoscev: Better sign-extend removal. Normalize postincrement recurrences
Andrew Trick [Tue, 31 May 2011 21:17:47 +0000 (21:17 +0000)]
scev: Better sign-extend removal. Normalize postincrement recurrences
so that their sign extended forms are congruent when no overflow occurs.

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

13 years agoSimplify the eviction policy by making the failsafe explicit.
Jakob Stoklund Olesen [Tue, 31 May 2011 21:02:44 +0000 (21:02 +0000)]
Simplify the eviction policy by making the failsafe explicit.

When assigned ranges are evicted, they are put in the RS_Evicted stage and are
not allowed to evict anything else. That prevents looping automatically.

When evicting ranges just to get a cheaper register, use only spill weights to
find the possible candidates. Avoid breaking hints for this purpose, it is not
worth it.

Start implementing more complex eviction heuristics, guarded by the temporary
-complex-eviction flag. The initial version permits a heavier range to be
evicted if it doesn't have any uses where the evicting range is live. This makes
it a good candidate for live ranfge splitting.

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

13 years agollvm.memcpy.* has two distinct associated address spaces; the source address space...
Eli Friedman [Tue, 31 May 2011 20:40:16 +0000 (20:40 +0000)]
llvm.memcpy.* has two distinct associated address spaces; the source address space, and the destination address space.  Fix up the interface on MemIntrinsic and MemTransferInst to make this clear, and fix InstructionDereferencesPointer in LazyValueInfo.cpp to use the interface properly.

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

13 years agoFix uninitialized variables and silence warnings
Bruno Cardoso Lopes [Tue, 31 May 2011 20:25:26 +0000 (20:25 +0000)]
Fix uninitialized variables and silence warnings

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

13 years agoAdd a minor missing -verify check. Found by inspection.
Eli Friedman [Tue, 31 May 2011 20:12:07 +0000 (20:12 +0000)]
Add a minor missing -verify check.  Found by inspection.

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

13 years agoAlso remove -lLTO which should have been in r132349. I failed to apply this
Nick Lewycky [Tue, 31 May 2011 20:00:45 +0000 (20:00 +0000)]
Also remove -lLTO which should have been in r132349. I failed to apply this
from David Meyer's patch!

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

13 years agoRevert to pacify a buildbot. rdar://problem/6501862
Stuart Hastings [Tue, 31 May 2011 19:56:35 +0000 (19:56 +0000)]
Revert to pacify a buildbot.  rdar://problem/6501862

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

13 years agoMake the gold plugin build on Cygwin as well as Linux. Patch by David Meyer!
Nick Lewycky [Tue, 31 May 2011 19:53:26 +0000 (19:53 +0000)]
Make the gold plugin build on Cygwin as well as Linux. Patch by David Meyer!

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

13 years agoFollowup to 132316; accept arbitrary constants, add with a constant,
Stuart Hastings [Tue, 31 May 2011 19:29:55 +0000 (19:29 +0000)]
Followup to 132316; accept arbitrary constants, add with a constant,
sub with a non-constant.  Fix comments, enlarge test case.
rdar://problem/6501862

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

13 years agoFix html formatting.
Devang Patel [Tue, 31 May 2011 18:06:14 +0000 (18:06 +0000)]
Fix html formatting.

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

13 years agoClarify documentation and remove guarantees that are not fulfilled.
Devang Patel [Tue, 31 May 2011 17:45:27 +0000 (17:45 +0000)]
Clarify documentation and remove guarantees that are not fulfilled.

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

13 years agoFix 80 column violations.
Richard Osborne [Tue, 31 May 2011 16:30:33 +0000 (16:30 +0000)]
Fix 80 column violations.

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

13 years agoAdd XCore intrinsic for crc8.
Richard Osborne [Tue, 31 May 2011 16:24:49 +0000 (16:24 +0000)]
Add XCore intrinsic for crc8.

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

13 years agoAdd XCore intrinsic for crc32.
Richard Osborne [Tue, 31 May 2011 14:47:36 +0000 (14:47 +0000)]
Add XCore intrinsic for crc32.

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

13 years agoConvert test to FileCheck.
Richard Osborne [Tue, 31 May 2011 14:00:05 +0000 (14:00 +0000)]
Convert test to FileCheck.

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

13 years agoIntroduce PackedVector, useful for storing a vector of values using a specific number...
Argyrios Kyrtzidis [Tue, 31 May 2011 03:53:41 +0000 (03:53 +0000)]
Introduce PackedVector, useful for storing a vector of values using a specific number of bits for each
value. Both signed and unsigned types can be used, e.g

   PackedVector<signed, 2> vec;

will create a vector accepting values -2, -1, 0, 1. Any other value will hit an assertion.

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

13 years agoFix ssat and ssat16 encodings for ARM and Thumb. The bit position value
Bruno Cardoso Lopes [Tue, 31 May 2011 03:33:27 +0000 (03:33 +0000)]
Fix ssat and ssat16 encodings for ARM and Thumb. The bit position value
must be encoded decremented by one. Only add encoding tests for ssat16
because ssat can't be parsed yet.

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

13 years agoThis patch implements atomic intrinsics atomic.load.add (sub,and,or,xor,
Bruno Cardoso Lopes [Tue, 31 May 2011 02:54:07 +0000 (02:54 +0000)]
This patch implements atomic intrinsics atomic.load.add (sub,and,or,xor,
nand), atomic.swap and atomic.cmp.swap, all in i8, i16 and i32 versions.
The intrinsics are implemented by creating pseudo-instructions, which are
then expanded in the method MipsTargetLowering::EmitInstrWithCustomInserter.

Patch by Sasa Stankovic.

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

13 years agoThis patch implements the thread local storage. Implemented are General
Bruno Cardoso Lopes [Tue, 31 May 2011 02:53:58 +0000 (02:53 +0000)]
This patch implements the thread local storage. Implemented are General
Dynamic, Initial Exec and Local Exec TLS models.

Patch by Sasa Stankovic

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

13 years agoUse the dwarf->llvm mapping to print register names in the cfi
Rafael Espindola [Mon, 30 May 2011 20:20:15 +0000 (20:20 +0000)]
Use the dwarf->llvm mapping to print register names in the cfi
directives.

Fixes PR9826.

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

13 years ago(1 - X) * (-2) -> (x - 1) * 2, for all positive nonzero powers of 2
Stuart Hastings [Mon, 30 May 2011 20:00:33 +0000 (20:00 +0000)]
(1 - X) * (-2) -> (x - 1) * 2, for all positive nonzero powers of 2
rdar://problem/6501862

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

13 years agoSplit ppc dwarf regnums into ppc64 and ppc32 flavours.
Rafael Espindola [Mon, 30 May 2011 18:24:44 +0000 (18:24 +0000)]
Split ppc dwarf regnums into ppc64 and ppc32 flavours.

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

13 years agoIntroduce the DwarfRegAlias class for declaring that two registers have the
Rafael Espindola [Mon, 30 May 2011 17:49:59 +0000 (17:49 +0000)]
Introduce the DwarfRegAlias class for declaring that two registers have the
same dwarf number. This will be used for creating a dwarf number to register
mapping.

The only case that needs this so far is the XMM/YMM registers that unfortunately
do have the same numbers.

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

13 years agoMark the 32 bit registers as invalid in 64 bit mode. In 64 bit mode they are
Rafael Espindola [Mon, 30 May 2011 16:04:54 +0000 (16:04 +0000)]
Mark the 32 bit registers as invalid in 64 bit mode. In 64 bit mode they are
subregisters of the 64 bit ones.

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

13 years agoRemove the DwarfNumbers from the subregisters. They should use DW_OP_bit_piece
Rafael Espindola [Mon, 30 May 2011 15:56:04 +0000 (15:56 +0000)]
Remove the DwarfNumbers from the subregisters. They should use DW_OP_bit_piece
and for now the generic dwarf emission will automatically use the superregister
numbers.

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

13 years agoreplace the intro tutorial from 2004 with a more recent work.
Chris Lattner [Mon, 30 May 2011 03:36:58 +0000 (03:36 +0000)]
replace the intro tutorial from 2004 with a more recent work.

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

13 years agoReapply r132245 with a fix for the bug that broke the darwin9/i386 build.
Jakob Stoklund Olesen [Mon, 30 May 2011 01:33:26 +0000 (01:33 +0000)]
Reapply r132245 with a fix for the bug that broke the darwin9/i386 build.

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

13 years agoAdd the test case for phis in the outer landing pad during the inliner's
John McCall [Mon, 30 May 2011 01:08:04 +0000 (01:08 +0000)]
Add the test case for phis in the outer landing pad during the inliner's
forwarding of eh.resume that I promised yesterday.

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

13 years agoEmit the handler's data area. For GCC-style exceptions under Win64, the
Charles Davis [Mon, 30 May 2011 00:13:34 +0000 (00:13 +0000)]
Emit the handler's data area. For GCC-style exceptions under Win64, the
handler's data area starts with a 4-byte reference to the personality
function, followed by the DWARF LSDA.

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

13 years agoRevert r132245, "Create two BlockInfo entries when a live range is discontinuous...
Jakob Stoklund Olesen [Sun, 29 May 2011 21:24:39 +0000 (21:24 +0000)]
Revert r132245, "Create two BlockInfo entries when a live range is discontinuous through a block."

This commit seems to have broken a darwin 9 tester.

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

13 years agoFix PR10046 by updating LiveVariables kill info when splitting live ranges.
Jakob Stoklund Olesen [Sun, 29 May 2011 20:10:28 +0000 (20:10 +0000)]
Fix PR10046 by updating LiveVariables kill info when splitting live ranges.

This only affects targets like Mips where branch instructions may kill virtual
registers. Most other targets branch on flag values, so virtual registers are
not involved.

The problem is that MachineBasicBlock::updateTerminator deletes branches and
inserts new ones while LiveVariables keeps a list of pointers to instructions
that kill virtual registers. That list wasn't properly updated in
MBB::SplitCriticalEdge.

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

13 years agoOn Darwin ARM, set the UNWIND_RESUME libcall to _Unwind_SjLj_Resume.
John McCall [Sun, 29 May 2011 19:50:32 +0000 (19:50 +0000)]
On Darwin ARM, set the UNWIND_RESUME libcall to _Unwind_SjLj_Resume.
This is important for the correct lowering of unwind instructions
(which doesn't matter at all) and llvm.eh.resume calls (which does).

Take 2, now with more basic competence.

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

13 years ago...this is not a good commit day for me.
John McCall [Sun, 29 May 2011 19:44:55 +0000 (19:44 +0000)]
...this is not a good commit day for me.

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