oota-llvm.git
12 years agoSCEV: Use AssertingVH to catch dangling BasicBlock* when passes forget
Andrew Trick [Wed, 3 Aug 2011 18:32:11 +0000 (18:32 +0000)]
SCEV: Use AssertingVH to catch dangling BasicBlock* when passes forget
to notify SCEV of a change. Add forgetLoop in a couple of those places.

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

12 years agowhitespace
Andrew Trick [Wed, 3 Aug 2011 18:28:21 +0000 (18:28 +0000)]
whitespace

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

12 years agoExplain how clauses are applied.
Bill Wendling [Wed, 3 Aug 2011 17:17:06 +0000 (17:17 +0000)]
Explain how clauses are applied.

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

12 years agoHandle IMPLICIT_DEF instructions in X86FloatingPoint.
Jakob Stoklund Olesen [Wed, 3 Aug 2011 16:33:19 +0000 (16:33 +0000)]
Handle IMPLICIT_DEF instructions in X86FloatingPoint.

This fixes PR10575.

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

12 years agoUse cast<> instead of a C-style cast to get some free assertions.
Jay Foad [Wed, 3 Aug 2011 10:05:04 +0000 (10:05 +0000)]
Use cast<> instead of a C-style cast to get some free assertions.

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

12 years agofix PR10286, a problem with the .ll printer handling block addresses that are out...
Chris Lattner [Wed, 3 Aug 2011 06:15:41 +0000 (06:15 +0000)]
fix PR10286, a problem with the .ll printer handling block addresses that are out-of-scope.

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

12 years agoUse byte offset, instead of element number, to access merged global.
Devang Patel [Wed, 3 Aug 2011 01:25:46 +0000 (01:25 +0000)]
Use byte offset, instead of element number, to access merged global.

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

12 years agoSmall cleanups:
Nick Lewycky [Wed, 3 Aug 2011 01:11:40 +0000 (01:11 +0000)]
Small cleanups:
  - use SmallVectorImpl& for the function argument.
  - ignore the operands on the GEP, even if they aren't constant! Much as we
    pretend the malloc succeeds, we pretend that malloc + whatever-you-GEP'd-by
    is not null. It's magic!

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

12 years agoAdd this back in for now. There are still a few passes which create unwind instructio...
Bill Wendling [Wed, 3 Aug 2011 01:07:57 +0000 (01:07 +0000)]
Add this back in for now. There are still a few passes which create unwind instructions at the moment.

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

12 years agoFix logical error when detecting lifetime intrinsics.
Nick Lewycky [Wed, 3 Aug 2011 00:43:35 +0000 (00:43 +0000)]
Fix logical error when detecting lifetime intrinsics.

Don't replace a gep/bitcast with 'undef' because that will form a "free(undef)"
which in turn means "unreachable". What we wanted was a no-op. Instead, analyze
the whole tree and look for all the instructions we need to delete first, then
delete them second, not relying on the use_list to stay consistent.

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

12 years agoReplace the 'UnwindInst' check with a check for 'ResumeInst', which also exits
Bill Wendling [Wed, 3 Aug 2011 00:30:19 +0000 (00:30 +0000)]
Replace the 'UnwindInst' check with a check for 'ResumeInst', which also exits
the function, because the UnwindInst is going away.

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

12 years agoUse the precomputed def presence in RAGreedy::calcSpillCost.
Jakob Stoklund Olesen [Tue, 2 Aug 2011 23:04:08 +0000 (23:04 +0000)]
Use the precomputed def presence in RAGreedy::calcSpillCost.

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

12 years agoInform SpillPlacement about blocks with defs.
Jakob Stoklund Olesen [Tue, 2 Aug 2011 23:04:06 +0000 (23:04 +0000)]
Inform SpillPlacement about blocks with defs.

This information is not used for anything yet.

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

12 years agoRename {First,Last}Use to {First,Last}Instr.
Jakob Stoklund Olesen [Tue, 2 Aug 2011 22:54:14 +0000 (22:54 +0000)]
Rename {First,Last}Use to {First,Last}Instr.

With a 'FirstDef' field right there, it is very confusing that FirstUse
refers to an instruction that may be a def.

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

12 years agolldb doesn't need the edis dylib any more.
Evan Cheng [Tue, 2 Aug 2011 22:53:48 +0000 (22:53 +0000)]
lldb doesn't need the edis dylib any more.

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

12 years agoARM backend support for atomicrmw and cmpxchg with non-monotonic ordering. Not espec...
Eli Friedman [Tue, 2 Aug 2011 22:44:16 +0000 (22:44 +0000)]
ARM backend support for atomicrmw and cmpxchg with non-monotonic ordering.  Not especially pretty, but seems to work well enough.  If this looks okay, I'll put together similar patches for Mips, PPC, and Alpha.

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

12 years agoAdd a BlockInfo::FirstDef field.
Jakob Stoklund Olesen [Tue, 2 Aug 2011 22:37:22 +0000 (22:37 +0000)]
Add a BlockInfo::FirstDef field.

This is either an invalid SlotIndex, or valno->def for the first value
defined inside the block. PHI values are not counted as defined inside
the block.

The FirstDef field will be used when estimating the cost of spilling
around a block.

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

12 years agoDelete BlockInfo::LiveThrough. It wasn't used any more.
Jakob Stoklund Olesen [Tue, 2 Aug 2011 22:37:20 +0000 (22:37 +0000)]
Delete BlockInfo::LiveThrough. It wasn't used any more.

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

12 years agoTeach InstCombine that lifetime intrincs aren't a real user on the result of a
Nick Lewycky [Tue, 2 Aug 2011 22:08:01 +0000 (22:08 +0000)]
Teach InstCombine that lifetime intrincs aren't a real user on the result of a
malloc call.

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

12 years agoExtend the SpillPlacement interface with two new features.
Jakob Stoklund Olesen [Tue, 2 Aug 2011 21:53:03 +0000 (21:53 +0000)]
Extend the SpillPlacement interface with two new features.

The PrefBoth constraint is used for blocks that ideally want a live-in
value both on the stack and in a register. This would be used by a block
that has a use before interference forces a spill.

Secondly, add the ChangesValue flag to BlockConstraint. This tells
SpillPlacement if a live-in value on the stack can be reused as a
live-out stack value for free. If the block redefines the virtual
register, a spill would be required for that.

This extra information will be used by SpillPlacement to more accurately
calculate spill costs when a value can exist both on the stack and in a
register.

The simplest example is a basic block that reads the virtual register,
but doesn't change its value. Spilling around such a block requires a
reload, but no spill in the block.

The spiller already knows this, but the spill placer doesn't. That can
sometimes lead to suboptimal regions.

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

12 years agoAdd the documentation for the 'landingpad' instruction. Improve the 'invoke'
Bill Wendling [Tue, 2 Aug 2011 21:52:38 +0000 (21:52 +0000)]
Add the documentation for the 'landingpad' instruction. Improve the 'invoke'
instruction's documentation to reference the landingpad and resume instructions.

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

12 years agoMove methods in PassManagerBuilder offline.
Rafael Espindola [Tue, 2 Aug 2011 21:50:27 +0000 (21:50 +0000)]
Move methods in PassManagerBuilder offline.

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

12 years agomove PassManagerBuilder.h to IPO. This is a non intuitive place to put it,
Rafael Espindola [Tue, 2 Aug 2011 21:50:24 +0000 (21:50 +0000)]
move PassManagerBuilder.h to IPO. This is a non intuitive place to put it,
but it solves a layering violation since things in Support are not supposed to
use things in Transforms.

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

12 years agoAdd new atomic instructions to SCCP. No functional change, but stops debug spam.
Eli Friedman [Tue, 2 Aug 2011 21:35:16 +0000 (21:35 +0000)]
Add new atomic instructions to SCCP.  No functional change, but stops debug spam.

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

12 years agoLifetime intrinsics on undef are dead.
Nick Lewycky [Tue, 2 Aug 2011 21:19:27 +0000 (21:19 +0000)]
Lifetime intrinsics on undef are dead.

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

12 years agoUpdate the default bug report url in autoconf.
Chad Rosier [Tue, 2 Aug 2011 20:53:43 +0000 (20:53 +0000)]
Update the default bug report url in autoconf.

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

12 years agono need to count the terminators.
Chris Lattner [Tue, 2 Aug 2011 20:29:13 +0000 (20:29 +0000)]
no need to count the terminators.

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

12 years agoAssume .cfi_startproc is the first thing in a function. If the function is
Rafael Espindola [Tue, 2 Aug 2011 20:24:22 +0000 (20:24 +0000)]
Assume .cfi_startproc is the first thing in a function. If the function is
externally visable, create a local symbol to use in the CFE. If not, use the
function label itself.

Fixes PR10420.

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

12 years agoDon't create a ridiculous EXTRACT_ELEMENT. PR10563.
Eli Friedman [Tue, 2 Aug 2011 18:38:35 +0000 (18:38 +0000)]
Don't create a ridiculous EXTRACT_ELEMENT.  PR10563.

The testcase looks extremely fragile, so I'm adding an assertion which should catch any cases like this.

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

12 years agoFix the broken encodings for the VFP vmov.f32 and vmov.f64 instructions, as well...
Owen Anderson [Tue, 2 Aug 2011 18:30:00 +0000 (18:30 +0000)]
Fix the broken encodings for the VFP vmov.f32 and vmov.f64 instructions, as well as the comments that explain them incorrectly.

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

12 years agoTidy up. 80 columns.
Jim Grosbach [Tue, 2 Aug 2011 18:16:36 +0000 (18:16 +0000)]
Tidy up. 80 columns.

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

12 years agoARM: rename addrmode7 to addr_offset_none.
Jim Grosbach [Tue, 2 Aug 2011 18:07:32 +0000 (18:07 +0000)]
ARM: rename addrmode7 to addr_offset_none.

Use a more descriptive name so the code is more self-documenting.

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

12 years agoComment out the PPC relocation offset adjustment. It must be done differently.
Roman Divacky [Tue, 2 Aug 2011 16:15:32 +0000 (16:15 +0000)]
Comment out the PPC relocation offset adjustment. It must be done differently.

This unbreaks some tests.

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

12 years agoMake this kind of lowering to be supported by 256-bit instructions:
Bruno Cardoso Lopes [Tue, 2 Aug 2011 16:06:18 +0000 (16:06 +0000)]
Make this kind of lowering to be supported by 256-bit instructions:
  shuffle (scalar_to_vector (load (ptr + 4))), undef, <0, 0, 0, 0>
To:
  shuffle (vload ptr)), undef, <1, 1, 1, 1>
Fix PR10494

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

12 years agoRemove trailing semicolon.
Roman Divacky [Tue, 2 Aug 2011 15:54:03 +0000 (15:54 +0000)]
Remove trailing semicolon.

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

12 years agoSketch out PowerPC ELF writer. This is enough to get clang -integrated-as
Roman Divacky [Tue, 2 Aug 2011 15:51:38 +0000 (15:51 +0000)]
Sketch out PowerPC ELF writer. This is enough to get clang -integrated-as
to compile a working hello world on FreeBSD/PPC32.

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

12 years agoDuncan's english is better than mine. :-)
Bill Wendling [Tue, 2 Aug 2011 06:39:13 +0000 (06:39 +0000)]
Duncan's english is better than mine. :-)

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

12 years agoRemove the LLVMBuildUnwind C API function.
Bill Wendling [Tue, 2 Aug 2011 06:20:17 +0000 (06:20 +0000)]
Remove the LLVMBuildUnwind C API function.

The 'unwind' function is going away with the new EH rewrite. This is step 0 in
keeping front-ends from using it.

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

12 years agoUse consistent terminology for loop exit/exiting blocks. Name change only.
Andrew Trick [Tue, 2 Aug 2011 04:23:35 +0000 (04:23 +0000)]
Use consistent terminology for loop exit/exiting blocks. Name change only.

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

12 years agoRemove empty test.
Benjamin Kramer [Tue, 2 Aug 2011 02:47:45 +0000 (02:47 +0000)]
Remove empty test.

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

12 years agoRevert r136503 and r136480 in an effort to fix non-determinism in the llvm-gcc buildb...
Owen Anderson [Tue, 2 Aug 2011 02:23:42 +0000 (02:23 +0000)]
Revert r136503 and r136480 in an effort to fix non-determinism in the llvm-gcc buildbots on i386.  Devang is looking into the root cause.

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

12 years agoI am the code owner for Clang's IR generation; this has been true
John McCall [Tue, 2 Aug 2011 01:38:19 +0000 (01:38 +0000)]
I am the code owner for Clang's IR generation;  this has been true
for awhile, but it's good to make this official.

Just to be clear, Doug and Ted "elected" me to this position.

Might as well add myself to the credits list while I'm at it.

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

12 years agoMinor wording tweak for memory model.
Eli Friedman [Tue, 2 Aug 2011 01:15:34 +0000 (01:15 +0000)]
Minor wording tweak for memory model.

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

12 years agoFix a couple silly typos in IRBuilder in the new atomic instructions.
Eli Friedman [Tue, 2 Aug 2011 00:45:35 +0000 (00:45 +0000)]
Fix a couple silly typos in IRBuilder in the new atomic instructions.

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

12 years agoBail from FastISel when we encounter a volatile memset intrinsic. Patch by Ivan
Nick Lewycky [Tue, 2 Aug 2011 00:40:16 +0000 (00:40 +0000)]
Bail from FastISel when we encounter a volatile memset intrinsic. Patch by Ivan
Krasin!

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

12 years agoMake the FixedLengthDecoderEmitter smart enough to autogenerate decoders for encoding...
Owen Anderson [Mon, 1 Aug 2011 22:45:43 +0000 (22:45 +0000)]
Make the FixedLengthDecoderEmitter smart enough to autogenerate decoders for encodings like "let Inst{11-7} = foo;", where the RHS has no bitwidth specifiers.

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

12 years agoMove imm0_255 to ARMInstrInfo.td with the other immediate predicates.
Jim Grosbach [Mon, 1 Aug 2011 22:02:20 +0000 (22:02 +0000)]
Move imm0_255 to ARMInstrInfo.td with the other immediate predicates.

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

12 years agoFix comments.
Jim Grosbach [Mon, 1 Aug 2011 21:55:12 +0000 (21:55 +0000)]
Fix comments.

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

12 years agoAdd v4f64 -> v2f32 fp_round support. Also add a testcase to exercise
Bruno Cardoso Lopes [Mon, 1 Aug 2011 21:54:09 +0000 (21:54 +0000)]
Add v4f64 -> v2f32 fp_round support. Also add a testcase to exercise
the legalizer. This commit together with the two previous ones fixes
PR10495.

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

12 years agoTeach PreprocessISelDAG to be aware of vector types and to not process them.
Bruno Cardoso Lopes [Mon, 1 Aug 2011 21:54:05 +0000 (21:54 +0000)]
Teach PreprocessISelDAG to be aware of vector types and to not process them.

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

12 years agoLower CONCAT_VECTORS to use two VINSERTF128 instructions instead of
Bruno Cardoso Lopes [Mon, 1 Aug 2011 21:54:02 +0000 (21:54 +0000)]
Lower CONCAT_VECTORS to use two VINSERTF128 instructions instead of
using a stack store.

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

12 years agoFix a typo.
Roman Divacky [Mon, 1 Aug 2011 20:38:27 +0000 (20:38 +0000)]
Fix a typo.

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

12 years agoThe FixedLenDecoder needs to gracefully handle failing per-instruction decoder hooks...
Owen Anderson [Mon, 1 Aug 2011 20:06:49 +0000 (20:06 +0000)]
The FixedLenDecoder needs to gracefully handle failing per-instruction decoder hooks in addition to per-operand decoder hooks.

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

12 years agoActually finish switching to the new system for Target sublibrary
Chandler Carruth [Mon, 1 Aug 2011 19:55:11 +0000 (19:55 +0000)]
Actually finish switching to the new system for Target sublibrary
TableGen deps introduced in r136023. This completes the fixing that
dgregor started in r136621. Sorry for missing these the first time
around.

This should fix some of the random race-condition failures people are
still seeing with CMake.

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

12 years agoSince vectors with all ones can't be created with a 256-bit instruction,
Bruno Cardoso Lopes [Mon, 1 Aug 2011 19:51:53 +0000 (19:51 +0000)]
Since vectors with all ones can't be created with a 256-bit instruction,
avoid returning early for v8i32 types, which would only be valid for
vector with all zeros. Also split the handling of zeros and ones into separate
checking logic since they are handled differently. This fixes PR10547

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

12 years agoSet endianess and pointer size for PPC Linux. Bug noticed by Roman Divacky.
Evan Cheng [Mon, 1 Aug 2011 19:43:05 +0000 (19:43 +0000)]
Set endianess and pointer size for PPC Linux. Bug noticed by Roman Divacky.

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

12 years agoChange SmallVector to SmallPtrSet in BranchProbabilityInfo. Handle cases where
Jakub Staszak [Mon, 1 Aug 2011 19:16:26 +0000 (19:16 +0000)]
Change SmallVector to SmallPtrSet in BranchProbabilityInfo. Handle cases where
one than one successor goes to the same block.

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

12 years agoEnhance the fixed length disassembler to better handle operand decoding failures.
Owen Anderson [Mon, 1 Aug 2011 18:44:37 +0000 (18:44 +0000)]
Enhance the fixed length disassembler to better handle operand decoding failures.

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

12 years agoAdd a clear() operation to MCInst, to drop all of its operands. Useful for the disas...
Owen Anderson [Mon, 1 Aug 2011 18:43:18 +0000 (18:43 +0000)]
Add a clear() operation to MCInst, to drop all of its operands.  Useful for the disassembler, where we may realize fairly late into decoding that something is wrong and need to reset.

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

12 years agoFix crash with varargs function with no named parameters.
Richard Osborne [Mon, 1 Aug 2011 16:45:59 +0000 (16:45 +0000)]
Fix crash with varargs function with no named parameters.

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

12 years agoUpdate CMake target names for tablegen-generated data in the X86 and ARM targets...
Douglas Gregor [Mon, 1 Aug 2011 16:29:27 +0000 (16:29 +0000)]
Update CMake target names for tablegen-generated data in the X86 and ARM targets. This should fix the CMake build with MSVC.

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

12 years agoAdd BlockFrequency::getEntryFrequency()
Jakub Staszak [Mon, 1 Aug 2011 15:22:10 +0000 (15:22 +0000)]
Add BlockFrequency::getEntryFrequency()

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

12 years agoAdd braces.
Jay Foad [Mon, 1 Aug 2011 12:48:54 +0000 (12:48 +0000)]
Add braces.

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

12 years agoSimplify printAlias.
Jay Foad [Mon, 1 Aug 2011 12:29:14 +0000 (12:29 +0000)]
Simplify printAlias.

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

12 years agoMicro-optimisation in getAliasedGlobal.
Jay Foad [Mon, 1 Aug 2011 12:28:01 +0000 (12:28 +0000)]
Micro-optimisation in getAliasedGlobal.

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

12 years agoRemove an unnecessary cast.
Jay Foad [Mon, 1 Aug 2011 12:27:15 +0000 (12:27 +0000)]
Remove an unnecessary cast.

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

12 years agoThe operands of a GlobalAlias are always Constants. Simplify things
Jay Foad [Mon, 1 Aug 2011 12:20:36 +0000 (12:20 +0000)]
The operands of a GlobalAlias are always Constants. Simplify things
accordingly.

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

12 years agoI mis-interpreted the MCDisassembler's intended dependencies. Now to fix
Chandler Carruth [Sun, 31 Jul 2011 22:00:40 +0000 (22:00 +0000)]
I mis-interpreted the MCDisassembler's intended dependencies. Now to fix
them properly. Specifically, the disassembler clearly attempts to
initialiaze all TargetInfo, MCTargeDesc, AsmParser, and Disassembler
sublibraries of registered targets. This makes the CMakeLists accurately
reflect this intent in the code.

This should fix the last of the link errors that I have gotten reports
of on OS X, but if anyone continues to see link errors, continue to
pester me and I'll look into it.

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

12 years agoFix some validation errors.
Bill Wendling [Sun, 31 Jul 2011 06:47:33 +0000 (06:47 +0000)]
Fix some validation errors.

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

12 years agoFix some validation errors.
Bill Wendling [Sun, 31 Jul 2011 06:45:03 +0000 (06:45 +0000)]
Fix some validation errors.

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

12 years agoAdd the 'resume' instruction for the new EH rewrite.
Bill Wendling [Sun, 31 Jul 2011 06:30:59 +0000 (06:30 +0000)]
Add the 'resume' instruction for the new EH rewrite.

This adds the 'resume' instruction class, IR parsing, and bitcode reading and
writing. The 'resume' instruction resumes propagation of an existing (in-flight)
exception whose unwinding was interrupted with a 'landingpad' instruction (to be
added later).

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

12 years agoDo not handle cases with >= and <= predicates.
Jakub Staszak [Sun, 31 Jul 2011 05:54:04 +0000 (05:54 +0000)]
Do not handle cases with >= and <= predicates.

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

12 years agoRemove untrue comment.
Jakub Staszak [Sun, 31 Jul 2011 04:51:14 +0000 (04:51 +0000)]
Remove untrue comment.

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

12 years agoDo not handle case where LHS is equal to zero, because InstCombiner always moves
Jakub Staszak [Sun, 31 Jul 2011 04:47:20 +0000 (04:47 +0000)]
Do not handle case where LHS is equal to zero, because InstCombiner always moves
it to RHS anyway.

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

12 years agoAdd a small gep optimization I noticed was missing while reading some IL.
Rafael Espindola [Sun, 31 Jul 2011 04:43:41 +0000 (04:43 +0000)]
Add a small gep optimization I noticed was missing while reading some IL.

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

12 years agoTime the emission of debug values.
Jakob Stoklund Olesen [Sun, 31 Jul 2011 03:53:42 +0000 (03:53 +0000)]
Time the emission of debug values.

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

12 years agoAdd Zero Heurestics to BranchProbabilityInfo. If we compare value to zero we
Jakub Staszak [Sun, 31 Jul 2011 03:27:24 +0000 (03:27 +0000)]
Add Zero Heurestics to BranchProbabilityInfo. If we compare value to zero we
decide whether condition is likely to be true this way:

x == 0  ->  false
x <  0  ->  false
x <= 0  ->  false
x != 0  ->  true
x >  0  ->  true
x >= 0  ->  true

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

12 years agoRemove InvalidateStructLayoutInfo from the ocaml bindings.
Benjamin Kramer [Sun, 31 Jul 2011 01:12:39 +0000 (01:12 +0000)]
Remove InvalidateStructLayoutInfo from the ocaml bindings.

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

12 years agoRevert r136528 "Enable compact region splitting by default."
Jakob Stoklund Olesen [Sat, 30 Jul 2011 17:19:14 +0000 (17:19 +0000)]
Revert r136528 "Enable compact region splitting by default."

While this generally helped x86-64, there was some large regressions
for i386.

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

12 years agoSwitch another of the old dependencies on implicitly produced synthetic
Chandler Carruth [Sat, 30 Jul 2011 10:10:23 +0000 (10:10 +0000)]
Switch another of the old dependencies on implicitly produced synthetic
rules to the new explicitly listed TableGen rules. Somehow I missed this
in my original sweep.

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

12 years agoRemove yet another buried and hidden implicit dependency: every single
Chandler Carruth [Sat, 30 Jul 2011 08:47:05 +0000 (08:47 +0000)]
Remove yet another buried and hidden implicit dependency: every single
sub-library for the targets depended on the core target CodeGen library.
This completely undermined the careful work to separate the those
libraries, especially the MC-layer ones. This surfaced as circular
dependencies when the libraries were built as shared libraries where
CMake doesn't allow cycles.

This should fix PR10537. I'll watch the bots to see if there is fallout
on other platforms.

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

12 years agoRevert r136253, r136263, r136269, r136313, r136325, r136326, r136329, r136338,
Bill Wendling [Sat, 30 Jul 2011 05:42:50 +0000 (05:42 +0000)]
Revert r136253, r136263, r136269, r136313, r136325, r136326, r136329, r136338,
r136339, r136341, r136369, r136387, r136392, r136396, r136429, r136430, r136444,
r136445, r136446, r136253 pending review.

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

12 years agoAdded several architecture names.
Sean Callanan [Sat, 30 Jul 2011 01:29:54 +0000 (01:29 +0000)]
Added several architecture names.

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

12 years agoRevert "Don't check liveness of unallocatable registers."
Jakob Stoklund Olesen [Sat, 30 Jul 2011 00:57:25 +0000 (00:57 +0000)]
Revert "Don't check liveness of unallocatable registers."

The ARM target depends on CPSR liveness being tracked after register
allocation.

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

12 years agoMake my attempt to build up global deps variables actually utilize
Chandler Carruth [Fri, 29 Jul 2011 23:52:01 +0000 (23:52 +0000)]
Make my attempt to build up global deps variables actually utilize
globally scoped constructs. Also, round-trip these dependencies through
the LLVMConfig.cmake.in file thata is used by CMake-based clients of
"installed" (or built) LLVM trees.

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

12 years agoDon't check liveness of unallocatable registers.
Jakob Stoklund Olesen [Fri, 29 Jul 2011 23:36:21 +0000 (23:36 +0000)]
Don't check liveness of unallocatable registers.

This includes registers like EFLAGS and ST0-ST7. We don't check for
liveness issues in the verifier and scavenger because registers will
never be allocated from these classes.

While in SSA form, we do care about the liveness of unallocatable
unreserved registers. Liveness of EFLAGS and ST0 neds to be correct for
MachineDCE and MachineSinking.

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

12 years agoCheck for multiple defs in the machine code verifier.
Jakob Stoklund Olesen [Fri, 29 Jul 2011 23:02:48 +0000 (23:02 +0000)]
Check for multiple defs in the machine code verifier.

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

12 years agoCorrectly handle scattered operands where the bits of the operand are contiguous...
Owen Anderson [Fri, 29 Jul 2011 23:01:18 +0000 (23:01 +0000)]
Correctly handle scattered operands where the bits of the operand are contiguous, but out of order.

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

12 years agoAdd an isSSA() flag to MachineRegisterInfo.
Jakob Stoklund Olesen [Fri, 29 Jul 2011 22:51:22 +0000 (22:51 +0000)]
Add an isSSA() flag to MachineRegisterInfo.

This flag is true from isel to register allocation when the machine
function is required to be in SSA form.  The TwoAddressInstructionPass
and PHIElimination passes clear the flag.

The SSA flag wil be used by the machine code verifier to check for SSA
form, and eventually an assertion can enforce it in +Asserts builds.
This will catch the common target error of creating machine code with
multiple defs of a virtual register.

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

12 years agoUnconstify Inits
David Greene [Fri, 29 Jul 2011 22:43:06 +0000 (22:43 +0000)]
Unconstify Inits

Remove const qualifiers from Init references, per Chris' request.

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

12 years agoDo not lose branch weights when lowering SwitchInst.
Jakub Staszak [Fri, 29 Jul 2011 22:25:21 +0000 (22:25 +0000)]
Do not lose branch weights when lowering SwitchInst.

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

12 years agoEnable compact region splitting by default.
Jakob Stoklund Olesen [Fri, 29 Jul 2011 22:10:27 +0000 (22:10 +0000)]
Enable compact region splitting by default.

This helps generate better code in functions with high register
pressure.

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

12 years agoAdd support for the 'Q' constraint.
Eric Christopher [Fri, 29 Jul 2011 21:18:58 +0000 (21:18 +0000)]
Add support for the 'Q' constraint.

Fixes rdar://9866494

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

12 years agoRemove a blank line from the top.
David Greene [Fri, 29 Jul 2011 20:50:18 +0000 (20:50 +0000)]
Remove a blank line from the top.

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

12 years agohave the verifier catch gep's into opaque struct types. PR10473
Chris Lattner [Fri, 29 Jul 2011 20:32:28 +0000 (20:32 +0000)]
have the verifier catch gep's into opaque struct types.  PR10473

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

12 years agoARM SRS instruction parsing, diassembly and encoding support.
Jim Grosbach [Fri, 29 Jul 2011 20:26:09 +0000 (20:26 +0000)]
ARM SRS instruction parsing, diassembly  and encoding support.

Fix the instruction encoding for operands. Refactor mode to use explicit
instruction definitions per FIXME to be more consistent with loads/stores.
Fix disassembler accordingly. Add tests.

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

12 years agoOn mac, it seems the MC disassembler is actually using the targetinfo
Chandler Carruth [Fri, 29 Jul 2011 20:23:34 +0000 (20:23 +0000)]
On mac, it seems the MC disassembler is actually using the targetinfo
for targets that don't have an MC-ized disassembler. I'm suspicious that
this shouldn't actually be happening, but hoping to fix the CMake build
on macs first, and investigate why second.

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

12 years agoRemove unneeded const_cast.
Jakub Staszak [Fri, 29 Jul 2011 20:05:36 +0000 (20:05 +0000)]
Remove unneeded const_cast.

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

12 years agoARM CPS mode immediate is 5 bits, not 4.
Jim Grosbach [Fri, 29 Jul 2011 20:02:39 +0000 (20:02 +0000)]
ARM CPS mode immediate is 5 bits, not 4.

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

12 years agoClear DbgValues in the end.
Devang Patel [Fri, 29 Jul 2011 19:49:58 +0000 (19:49 +0000)]
Clear DbgValues in the end.

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