oota-llvm.git
13 years agoSimplify.
Devang Patel [Thu, 14 Jul 2011 01:52:45 +0000 (01:52 +0000)]
Simplify.

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

13 years agoDon't emit a bit test if there is only one case the test can yield false. A simple...
Benjamin Kramer [Thu, 14 Jul 2011 01:38:42 +0000 (01:38 +0000)]
Don't emit a bit test if there is only one case the test can yield false. A simple SETNE is sufficient.

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

13 years agoSimplify and delay extracting DebugLoc elements, scope and InlinedAt, as much as...
Devang Patel [Thu, 14 Jul 2011 01:14:57 +0000 (01:14 +0000)]
Simplify and delay extracting DebugLoc elements, scope and InlinedAt, as much as possible.

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

13 years agoAdd a dag combine pattern for folding C2-(A+C1) -> (C2-C1)-A
Eric Christopher [Thu, 14 Jul 2011 01:12:15 +0000 (01:12 +0000)]
Add a dag combine pattern for folding C2-(A+C1) -> (C2-C1)-A

Fixes rdar://9761830

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

13 years agoRevert r135121 which broke a gcc-4.2 builder.
Jakob Stoklund Olesen [Thu, 14 Jul 2011 00:58:38 +0000 (00:58 +0000)]
Revert r135121 which broke a gcc-4.2 builder.

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

13 years agoCount references to interference cache entries.
Jakob Stoklund Olesen [Thu, 14 Jul 2011 00:31:14 +0000 (00:31 +0000)]
Count references to interference cache entries.

Each InterferenceCache::Cursor instance references a cache entry. A
non-zero reference count guarantees that the entry won't be reused for a
new register.

This makes it possible to have multiple live cursors examining
interference for different physregs.

The total number of live cursors into a cache must be kept below
InterferenceCache::getMaxCursors().

Code generation should be unaffected by this change, and it doesn't seem
to affect the cache replacement strategy either.

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

13 years agoFix up assertion in r135018 so it doesn't trigger on 32-bit; when we're in 32-bit...
Eli Friedman [Thu, 14 Jul 2011 00:22:31 +0000 (00:22 +0000)]
Fix up assertion in r135018 so it doesn't trigger on 32-bit; when we're in 32-bit, it doesn't matter whether the operation overflows because the computed address is not wider than the immediate.

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

13 years agoARM tests for EOR instruction parsing and encoding.
Jim Grosbach [Thu, 14 Jul 2011 00:22:21 +0000 (00:22 +0000)]
ARM tests for EOR instruction parsing and encoding.

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

13 years agoSimplify. Compile unit check inside hasValidLocation() did not add any value.
Devang Patel [Thu, 14 Jul 2011 00:20:24 +0000 (00:20 +0000)]
Simplify. Compile unit check inside hasValidLocation() did not add any value.

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

13 years agoRemove duplicate tests.
Jim Grosbach [Thu, 14 Jul 2011 00:19:19 +0000 (00:19 +0000)]
Remove duplicate tests.

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

13 years agoARM Assembler support for DSB instruction.
Jim Grosbach [Thu, 14 Jul 2011 00:18:13 +0000 (00:18 +0000)]
ARM Assembler support for DSB instruction.

Add instalias for default 'sy' option. Add tests.

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

13 years agoReapply r135074 and r135080 with a fix.
Jakob Stoklund Olesen [Thu, 14 Jul 2011 00:17:10 +0000 (00:17 +0000)]
Reapply r135074 and r135080 with a fix.

The cache entry referenced by the best split candidate could become
clobbered by an unsuccessful candidate.

The correct fix here is to use reference counts on the cache entries.
Coming up.

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

13 years agoDMB instalias needs the same predicate as the instruction.
Jim Grosbach [Thu, 14 Jul 2011 00:10:26 +0000 (00:10 +0000)]
DMB instalias needs the same predicate as the instruction.

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

13 years agoFix typo in DEBUG message.
Devang Patel [Thu, 14 Jul 2011 00:04:53 +0000 (00:04 +0000)]
Fix typo in DEBUG message.

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

13 years agoAdd DEBUG messages.
Devang Patel [Thu, 14 Jul 2011 00:03:58 +0000 (00:03 +0000)]
Add DEBUG messages.

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

13 years agoARM Assembler support for DMB instruction.
Jim Grosbach [Wed, 13 Jul 2011 23:40:38 +0000 (23:40 +0000)]
ARM Assembler support for DMB instruction.

Flesh out the options supported for the instruction. Shuffle tests a bit and
add entries for the rest of the options. Add an alias to handle the default
operand of "sy".

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

13 years agoUpdate comments. These are for assembler, too.
Jim Grosbach [Wed, 13 Jul 2011 23:33:10 +0000 (23:33 +0000)]
Update comments. These are for assembler, too.

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

13 years agoAdd a target-indepedent entry to MCInstrDesc to describe the encoded size of an opcod...
Owen Anderson [Wed, 13 Jul 2011 23:22:26 +0000 (23:22 +0000)]
Add a target-indepedent entry to MCInstrDesc to describe the encoded size of an opcode.  Switch ARM over to using that rather than its own special MCInstrDesc bits.

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

13 years agoAdd code to handle a "frameless" unwind stack.
Bill Wendling [Wed, 13 Jul 2011 23:03:31 +0000 (23:03 +0000)]
Add code to handle a "frameless" unwind stack.

The frameless unwind stack has a special encoding, the algorithm for which is in
"permuteEncode".

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

13 years agoARM Assembler support for DBG instruction.
Jim Grosbach [Wed, 13 Jul 2011 22:59:38 +0000 (22:59 +0000)]
ARM Assembler support for DBG instruction.

Add range checking and testing for parsing and encoding of DBG instruction.

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

13 years agoWe already support 256-bit packed ADD, SUB, DIV, MUL. Add testcases.
Bruno Cardoso Lopes [Wed, 13 Jul 2011 22:28:55 +0000 (22:28 +0000)]
We already support 256-bit packed ADD, SUB, DIV, MUL. Add testcases.

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

13 years agoARM parsing and encoding tests for CMN/CMP.
Jim Grosbach [Wed, 13 Jul 2011 22:26:58 +0000 (22:26 +0000)]
ARM parsing and encoding tests for CMN/CMP.

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

13 years agostruct Init -> class Init
David Greene [Wed, 13 Jul 2011 22:25:51 +0000 (22:25 +0000)]
struct Init -> class Init

Rename struct Init to class Init for consistency and in preparation
for making Init a FoldingSetNode.

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

13 years agoRevert r135074 and r135080. They broke clamscan.
Jakob Stoklund Olesen [Wed, 13 Jul 2011 22:20:09 +0000 (22:20 +0000)]
Revert r135074 and r135080. They broke clamscan.

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

13 years agoShuffle ARM assembly tests a bit.
Jim Grosbach [Wed, 13 Jul 2011 22:19:10 +0000 (22:19 +0000)]
Shuffle ARM assembly tests a bit.

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

13 years agoRevert 135093. Think-o.
Jim Grosbach [Wed, 13 Jul 2011 22:06:11 +0000 (22:06 +0000)]
Revert 135093. Think-o.

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

13 years agoCorrect range for thumb co-processor immediate
Jim Grosbach [Wed, 13 Jul 2011 22:03:11 +0000 (22:03 +0000)]
Correct range for thumb co-processor immediate

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

13 years agoRange checking for CDP[2] immediates.
Jim Grosbach [Wed, 13 Jul 2011 22:01:08 +0000 (22:01 +0000)]
Range checking for CDP[2] immediates.

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

13 years agoMake X86ISD::ANDNP more general and Codegen 256-bit VANDNP. A more
Bruno Cardoso Lopes [Wed, 13 Jul 2011 21:36:51 +0000 (21:36 +0000)]
Make X86ISD::ANDNP more general and Codegen 256-bit VANDNP. A more
general version of X86ISD::ANDNP also opened the room for a little bit
of refactoring.

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

13 years agoThe target specific node PANDN name is misleading. That happens because
Bruno Cardoso Lopes [Wed, 13 Jul 2011 21:36:47 +0000 (21:36 +0000)]
The target specific node PANDN name is misleading. That happens because
it's later selected to a ANDNPD/ANDNPS instruction instead of the PANDN
instruction. Rename it.

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

13 years agoCleanup Thumb co-processor instructions a bit.
Jim Grosbach [Wed, 13 Jul 2011 21:35:10 +0000 (21:35 +0000)]
Cleanup Thumb co-processor instructions a bit.

Combine redundant base classes and such. No indended functional change.

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

13 years agoMake sure we don't combine a large displacement and a frame index in the same address...
Eli Friedman [Wed, 13 Jul 2011 21:29:53 +0000 (21:29 +0000)]
Make sure we don't combine a large displacement and a frame index in the same addressing mode on x86-64.  It can overflow, leading to a crash/miscompile.

<rdar://problem/9763308>

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

13 years agoParameterize away the ARM T1Cop class.
Jim Grosbach [Wed, 13 Jul 2011 21:17:59 +0000 (21:17 +0000)]
Parameterize away the ARM T1Cop class.

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

13 years agoFix predicates for Thumb co-processor instructions.
Jim Grosbach [Wed, 13 Jul 2011 21:14:23 +0000 (21:14 +0000)]
Fix predicates for Thumb co-processor instructions.

They're all Thumb2 only, not just some of them. More refactoring cleanup
coming.

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

13 years agoOnly keep the global split candidates that work out.
Jakob Stoklund Olesen [Wed, 13 Jul 2011 20:49:46 +0000 (20:49 +0000)]
Only keep the global split candidates that work out.

Some pysical registers create split solutions that would spill anywhere.
They should not even be considered in future multi-way global splits.

This does not affect code generation (yet).

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

13 years agoRefactor out checking for displacements on x86-64 addressing modes. No functionality...
Eli Friedman [Wed, 13 Jul 2011 20:44:23 +0000 (20:44 +0000)]
Refactor out checking for displacements on x86-64 addressing modes.  No functionality change.  Refactoring in preparation for an additional safety check in FoldOffsetIntoAddress.

Part of <rdar://problem/9763308>.

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

13 years agoTestcases for ARM assembly BX/BXJ instructions.
Jim Grosbach [Wed, 13 Jul 2011 20:25:46 +0000 (20:25 +0000)]
Testcases for ARM assembly BX/BXJ instructions.

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

13 years agoFix encoding for ARM BXJ instruction.
Jim Grosbach [Wed, 13 Jul 2011 20:25:01 +0000 (20:25 +0000)]
Fix encoding for ARM BXJ instruction.

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

13 years agoFix encoding of predicate bits on ARM BX_pred.
Jim Grosbach [Wed, 13 Jul 2011 20:21:31 +0000 (20:21 +0000)]
Fix encoding of predicate bits on ARM BX_pred.

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

13 years agoMove the InterferenceCache cursor into the GlobalSplitCand struct.
Jakob Stoklund Olesen [Wed, 13 Jul 2011 20:14:52 +0000 (20:14 +0000)]
Move the InterferenceCache cursor into the GlobalSplitCand struct.

This is in preparation of supporting multiple global split candidates in
a single live range split operation.

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

13 years agoTestcases for ARM assembly BLX/BL instructions.
Jim Grosbach [Wed, 13 Jul 2011 20:11:04 +0000 (20:11 +0000)]
Testcases for ARM assembly BLX/BL instructions.

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

13 years agoRange checking for 16-bit immediates in ARM assembly.
Jim Grosbach [Wed, 13 Jul 2011 20:10:10 +0000 (20:10 +0000)]
Range checking for 16-bit immediates in ARM assembly.

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

13 years agoRevert r135042. As Chris pointed out, it had no effect, and was based on
Jay Foad [Wed, 13 Jul 2011 20:05:31 +0000 (20:05 +0000)]
Revert r135042. As Chris pointed out, it had no effect, and was based on
a complete misunderstanding of the code.

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

13 years agoFix up TargetLoweringObjectFile ctors to properly initialize fields.
Evan Cheng [Wed, 13 Jul 2011 19:54:59 +0000 (19:54 +0000)]
Fix up TargetLoweringObjectFile ctors to properly initialize fields.

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

13 years agoGive the ARM BKPT instruction the right operand type.
Jim Grosbach [Wed, 13 Jul 2011 19:24:09 +0000 (19:24 +0000)]
Give the ARM BKPT instruction the right operand type.

The immediate is of limited range and the operand type should reflect that.

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

13 years agoChange test case, one that actually failed before my commit.
Evan Cheng [Wed, 13 Jul 2011 19:19:44 +0000 (19:19 +0000)]
Change test case, one that actually failed before my commit.

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

13 years agoAdd tests for ARM parsing of 'BKPT' instruction.
Jim Grosbach [Wed, 13 Jul 2011 19:17:36 +0000 (19:17 +0000)]
Add tests for ARM parsing of 'BKPT' instruction.

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

13 years agoFix copy-pasto.
Jim Grosbach [Wed, 13 Jul 2011 19:16:30 +0000 (19:16 +0000)]
Fix copy-pasto.

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

13 years agoAdd tests for ARM parsing of 'BIC' instruction.
Jim Grosbach [Wed, 13 Jul 2011 19:12:32 +0000 (19:12 +0000)]
Add tests for ARM parsing of 'BIC' instruction.

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

13 years agoAdd some FIXMEs.
Jim Grosbach [Wed, 13 Jul 2011 19:10:23 +0000 (19:10 +0000)]
Add some FIXMEs.

Keeping the instructions in alphabetical order, just like in the ARM ARM.
Adding FIXMEs for skipped instructions when adding tests out of order.

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

13 years agoRevert accidental commit.
Evan Cheng [Wed, 13 Jul 2011 19:09:08 +0000 (19:09 +0000)]
Revert accidental commit.

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

13 years agoIt's not safe to fold (fptrunc (sqrt (fpext x))) to (sqrtf x) if there is another...
Evan Cheng [Wed, 13 Jul 2011 19:08:16 +0000 (19:08 +0000)]
It's not safe to fold (fptrunc (sqrt (fpext x))) to (sqrtf x) if there is another use of sqrt. rdar://9763193

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

13 years agoAdd tests for ARM parsing of 'AND' instruction.
Jim Grosbach [Wed, 13 Jul 2011 18:55:14 +0000 (18:55 +0000)]
Add tests for ARM parsing of 'AND' instruction.

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

13 years agoImprove ARM assembly parsing diagnostics a bit.
Jim Grosbach [Wed, 13 Jul 2011 18:49:30 +0000 (18:49 +0000)]
Improve ARM assembly parsing diagnostics a bit.

Catch potential cascading errors on a malformed so_reg operand and bail after
the first error.

Add some tests for the diagnostics we do want.

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

13 years agoAdd tests for ARM parsing of 'ADD' instruction
Jim Grosbach [Wed, 13 Jul 2011 18:12:46 +0000 (18:12 +0000)]
Add tests for ARM parsing of 'ADD' instruction

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

13 years agoDestination register operand is optional for ADC and SBC ARM.
Jim Grosbach [Wed, 13 Jul 2011 17:57:17 +0000 (17:57 +0000)]
Destination register operand is optional for ADC and SBC ARM.

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

13 years agoFlesh out ARM Parser support for shifted-register operands.
Jim Grosbach [Wed, 13 Jul 2011 17:50:29 +0000 (17:50 +0000)]
Flesh out ARM Parser support for shifted-register operands.

Now works for parsing register shifted register and register shifted
immediate arithmetic instructions, including the 'rrx' rotate with extend.

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

13 years ago80 columns.
Jim Grosbach [Wed, 13 Jul 2011 17:25:55 +0000 (17:25 +0000)]
80 columns.

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

13 years agoUpdate MCParsedAsmOperand debug methods.
Jim Grosbach [Wed, 13 Jul 2011 15:34:57 +0000 (15:34 +0000)]
Update MCParsedAsmOperand debug methods.

Update the debug output interface for MCParsedAsmOperand to have a print()
method which takes an output stream argument, an << operator which invokes
the print method using the given stream, and a dump() method which prints
the operand to the dbgs() stream. This makes the interface more consistent
with the rest of LLVM, and more convenient to use at the debugger command
line.

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

13 years agoReally cache function types and anonymous struct types.
Jay Foad [Wed, 13 Jul 2011 10:39:49 +0000 (10:39 +0000)]
Really cache function types and anonymous struct types.

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

13 years agoConvert InsertValueInst and ExtractValueInst APIs to use ArrayRef.
Jay Foad [Wed, 13 Jul 2011 10:26:04 +0000 (10:26 +0000)]
Convert InsertValueInst and ExtractValueInst APIs to use ArrayRef.

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

13 years agoAdd some bits that I found useful when converting InsertValueInst and
Jay Foad [Wed, 13 Jul 2011 09:15:05 +0000 (09:15 +0000)]
Add some bits that I found useful when converting InsertValueInst and
ExtractValueInst APIs to use ArrayRef: a new constructor taking a
(begin, end) range, and operators == and != for element-wise comparison.

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

13 years agoAdd to RuntimeDyld support different object formats
Danil Malyshev [Wed, 13 Jul 2011 07:57:58 +0000 (07:57 +0000)]
Add to RuntimeDyld support different object formats

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

13 years agostop leaking all named struct types with an empty name. Thanks
Chris Lattner [Wed, 13 Jul 2011 04:22:39 +0000 (04:22 +0000)]
stop leaking all named struct types with an empty name.  Thanks
to Benjamin Kramer for steering me in the right direction here.

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

13 years agoAdd an entry.
Evan Cheng [Wed, 13 Jul 2011 01:33:00 +0000 (01:33 +0000)]
Add an entry.

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

13 years agoAVX Codegen support for 256-bit versions of vandps, vandpd, vorps, vorpd, vxorps...
Bruno Cardoso Lopes [Wed, 13 Jul 2011 01:15:33 +0000 (01:15 +0000)]
AVX Codegen support for 256-bit versions of vandps, vandpd, vorps, vorpd, vxorps, vxorpd

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

13 years agoDon't emit the FDE end label if the last thing emitted was a compact unwind and
Bill Wendling [Wed, 13 Jul 2011 00:49:09 +0000 (00:49 +0000)]
Don't emit the FDE end label if the last thing emitted was a compact unwind and
not the FDE

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

13 years agoAdd an assert (which should never trigger) that triggers on a testcase I'm looking at.
Eli Friedman [Wed, 13 Jul 2011 00:44:29 +0000 (00:44 +0000)]
Add an assert (which should never trigger) that triggers on a testcase I'm looking at.

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

13 years agoImprove codegen for select's:
Evan Cheng [Wed, 13 Jul 2011 00:42:17 +0000 (00:42 +0000)]
Improve codegen for select's:
if (x != 0) x = 1
if (x == 1) x = 1

Previous codegen looks like this:
        mov     r1, r0
        cmp     r1, #1
        mov     r0, #0
        moveq   r0, #1

The naive lowering select between two different values. It should recognize the
test is equality test so it's more a conditional move rather than a select:
        cmp     r0, #1
        movne   r0, #0

rdar://9758317

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

13 years agoAssign variable before we test it.
Bill Wendling [Wed, 13 Jul 2011 00:23:39 +0000 (00:23 +0000)]
Assign variable before we test it.

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

13 years agoFix obvious think-o.
Bill Wendling [Wed, 13 Jul 2011 00:20:09 +0000 (00:20 +0000)]
Fix obvious think-o.

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

13 years agoClean up the handling of an EBP/RBP unwind frame pointer. In particular, don't
Bill Wendling [Wed, 13 Jul 2011 00:16:14 +0000 (00:16 +0000)]
Clean up the handling of an EBP/RBP unwind frame pointer. In particular, don't
assert when the frame pointer is -1 (i.e., the function is "frameless").

Still to do: "frameless" unwind information.

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

13 years agoThere is a cyclic dependency between MC and Target if this method is out-of-line.
Bill Wendling [Tue, 12 Jul 2011 22:35:01 +0000 (22:35 +0000)]
There is a cyclic dependency between MC and Target if this method is out-of-line.

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

13 years agoRemove the const from Type after of Jay deconstify work.
Francois Pichet [Tue, 12 Jul 2011 22:04:11 +0000 (22:04 +0000)]
Remove the const from Type after of Jay deconstify work.

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

13 years agoDelete StructType bodies when destroying a StructType.
Benjamin Kramer [Tue, 12 Jul 2011 18:22:07 +0000 (18:22 +0000)]
Delete StructType bodies when destroying a StructType.

Leak found by valgrind.

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

13 years agoAdd check for predicate w/o S bit.
Jim Grosbach [Tue, 12 Jul 2011 16:25:04 +0000 (16:25 +0000)]
Add check for predicate w/o S bit.

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

13 years agoImprove test cases from r134746.
Jim Grosbach [Tue, 12 Jul 2011 16:06:01 +0000 (16:06 +0000)]
Improve test cases from r134746.

Use memory barriers to force if-conversion off for these tests instead of
the internal llc command line option ifcvt-limit.

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

13 years agoReverted 134901 because of 134959. Did not use svn merge -r but rather:
Garrison Venn [Tue, 12 Jul 2011 15:34:42 +0000 (15:34 +0000)]
Reverted 134901 because of 134959. Did not use svn merge -r but rather:

1,$s/llvm::Type::getInt\(..\)Ty(builder.getContext())/builder.getInt\1Ty()/g
1,$s/builder.getInt\(..*\)Ty()->getPointerTo()/builder.getInt\1PtrTy()/g

vi sub commands (second one was not a reversion but requested by
Tobias Grosser.

Mod was tested, but other examples have failed to build as they are currently
being thrashed with the const qualifier removal change.

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

13 years agoSecond attempt at de-constifying LLVM Types in FunctionType::get(),
Jay Foad [Tue, 12 Jul 2011 14:06:48 +0000 (14:06 +0000)]
Second attempt at de-constifying LLVM Types in FunctionType::get(),
StructType::get() and TargetData::getIntPtrType().

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

13 years agoVectorType is also a SequentialType
Tobias Grosser [Tue, 12 Jul 2011 11:37:02 +0000 (11:37 +0000)]
VectorType is also a SequentialType

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

13 years agoRemove IntegerType constness from TargetData
Tobias Grosser [Tue, 12 Jul 2011 11:36:58 +0000 (11:36 +0000)]
Remove IntegerType constness from TargetData

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

13 years agoFix the BrainF build.
Francois Pichet [Tue, 12 Jul 2011 08:43:36 +0000 (08:43 +0000)]
Fix the BrainF build.

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

13 years agosimplify assertions to not be completely redundant.
Chris Lattner [Tue, 12 Jul 2011 05:26:21 +0000 (05:26 +0000)]
simplify assertions to not be completely redundant.

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

13 years agomake the IRBuilder type methods return non-const types.
Chris Lattner [Tue, 12 Jul 2011 04:14:22 +0000 (04:14 +0000)]
make the IRBuilder type methods return non-const types.

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

13 years agoComment correction.
Andrew Trick [Tue, 12 Jul 2011 03:39:22 +0000 (03:39 +0000)]
Comment correction.

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

13 years agoRevert r134893 and r134888 (and related patches in other trees). It was causing
Bill Wendling [Tue, 12 Jul 2011 01:15:52 +0000 (01:15 +0000)]
Revert r134893 and r134888 (and related patches in other trees). It was causing
an assert on Darwin llvm-gcc builds.

Assertion failed: (castIsValid(op, S, Ty) && "Invalid cast!"), function Create, file /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.llvm-gcc-i386-darwin9-RA/llvm.src/lib/VMCore/Instructions.cpp, li\
ne 2067.
etc.

http://smooshlab.apple.com:8013/builders/llvm-gcc-i386-darwin9-RA/builds/2354

--- Reverse-merging r134893 into '.':
U    include/llvm/Target/TargetData.h
U    include/llvm/DerivedTypes.h
U    tools/bugpoint/ExtractFunction.cpp
U    unittests/Support/TypeBuilderTest.cpp
U    lib/Target/ARM/ARMGlobalMerge.cpp
U    lib/Target/TargetData.cpp
U    lib/VMCore/Constants.cpp
U    lib/VMCore/Type.cpp
U    lib/VMCore/Core.cpp
U    lib/Transforms/Utils/CodeExtractor.cpp
U    lib/Transforms/Instrumentation/ProfilingUtils.cpp
U    lib/Transforms/IPO/DeadArgumentElimination.cpp
U    lib/CodeGen/SjLjEHPrepare.cpp
--- Reverse-merging r134888 into '.':
G    include/llvm/DerivedTypes.h
U    include/llvm/Support/TypeBuilder.h
U    include/llvm/Intrinsics.h
U    unittests/Analysis/ScalarEvolutionTest.cpp
U    unittests/ExecutionEngine/JIT/JITTest.cpp
U    unittests/ExecutionEngine/JIT/JITMemoryManagerTest.cpp
U    unittests/VMCore/PassManagerTest.cpp
G    unittests/Support/TypeBuilderTest.cpp
U    lib/Target/MBlaze/MBlazeIntrinsicInfo.cpp
U    lib/Target/Blackfin/BlackfinIntrinsicInfo.cpp
U    lib/VMCore/IRBuilder.cpp
G    lib/VMCore/Type.cpp
U    lib/VMCore/Function.cpp
G    lib/VMCore/Core.cpp
U    lib/VMCore/Module.cpp
U    lib/AsmParser/LLParser.cpp
U    lib/Transforms/Utils/CloneFunction.cpp
G    lib/Transforms/Utils/CodeExtractor.cpp
U    lib/Transforms/Utils/InlineFunction.cpp
U    lib/Transforms/Instrumentation/GCOVProfiling.cpp
U    lib/Transforms/Scalar/ObjCARC.cpp
U    lib/Transforms/Scalar/SimplifyLibCalls.cpp
U    lib/Transforms/Scalar/MemCpyOptimizer.cpp
G    lib/Transforms/IPO/DeadArgumentElimination.cpp
U    lib/Transforms/IPO/ArgumentPromotion.cpp
U    lib/Transforms/InstCombine/InstCombineCompares.cpp
U    lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
U    lib/Transforms/InstCombine/InstCombineCalls.cpp
U    lib/CodeGen/DwarfEHPrepare.cpp
U    lib/CodeGen/IntrinsicLowering.cpp
U    lib/Bitcode/Reader/BitcodeReader.cpp

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

13 years agoTypeMap had a destructor that destroyed the types it held. DenseMap did not, so
Nick Lewycky [Tue, 12 Jul 2011 00:26:08 +0000 (00:26 +0000)]
TypeMap had a destructor that destroyed the types it held. DenseMap did not, so
destroy those types in ~LLVMContext.

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

13 years agoindvars: Code reorganization in preparation for
Andrew Trick [Tue, 12 Jul 2011 00:08:50 +0000 (00:08 +0000)]
indvars: Code reorganization in preparation for
LinearFunctionTestReplace rewrite. No functionality.

I've been wanting to group the indvar subphases into sections and
order them by their logical sequence. My next checkin adds functions
related to LFTR, and doing the reorg now should help reviewers. Since,
most of the code in IndVarSimplify.cpp has recently been replaced or
will be replaced soon, obscuring blame should not be an issue. This
seems like an ideal time to shuffle the code around.

I'm happy to take more suggestions for cleaning up the code. Or if
you've been wanting to cleanup anything in this file yourself, now is
a good time.

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

13 years agoRevert r134921, 134917, 134908 and 134907. They're causing failures
Eric Christopher [Mon, 11 Jul 2011 23:06:52 +0000 (23:06 +0000)]
Revert r134921, 134917, 134908 and 134907. They're causing failures
in multiple buildbots.

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

13 years agofix some examples
John Wiegley [Mon, 11 Jul 2011 22:39:46 +0000 (22:39 +0000)]
fix some examples

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

13 years agoFix LTO after the recent MC subtarget refactoring.
Cameron Zwarich [Mon, 11 Jul 2011 22:19:51 +0000 (22:19 +0000)]
Fix LTO after the recent MC subtarget refactoring.

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

13 years agoMost MCCodeEmitter's don't meed MCContext.
Evan Cheng [Mon, 11 Jul 2011 21:24:15 +0000 (21:24 +0000)]
Most MCCodeEmitter's don't meed MCContext.

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

13 years agoUse get(0 Instead of Create()
David Greene [Mon, 11 Jul 2011 20:55:22 +0000 (20:55 +0000)]
Use get(0 Instead of Create()

Respond to some feedback asking for a name change.

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

13 years agoDisassembler doesn't need TargetMachine anymore.
Evan Cheng [Mon, 11 Jul 2011 20:40:56 +0000 (20:40 +0000)]
Disassembler doesn't need TargetMachine anymore.

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

13 years agostruct Init -> class Init.
Evan Cheng [Mon, 11 Jul 2011 20:23:13 +0000 (20:23 +0000)]
struct Init -> class Init.

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

13 years agoFix Build
David Greene [Mon, 11 Jul 2011 18:59:29 +0000 (18:59 +0000)]
Fix Build

Update the tag for Init to match how it's defined.

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

13 years ago[AVX] Make Inits Foldable
David Greene [Mon, 11 Jul 2011 18:25:51 +0000 (18:25 +0000)]
[AVX] Make Inits Foldable

Manage Inits in a FoldingSet.  This provides several benefits:

- Memory for Inits is properly managed

- Duplicate Inits are folded into Flyweights, saving memory

- It enforces const-correctness, protecting against certain classes
  of bugs

The above benefits allow Inits to be used in more contexts, which in
turn provides more dynamism to TableGen.  This enhanced capability
will be used by the AVX code generator to a fold common patterns
together.

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

13 years agoResynchronize EDInfo.h and EDEmitter.cpp.
Shantonu Sen [Mon, 11 Jul 2011 17:57:30 +0000 (17:57 +0000)]
Resynchronize EDInfo.h and EDEmitter.cpp.
The enum names as well as order (i.e. value)
had skewed, which means that consumers of the
tablegen-ed table would see different values than
intended. Make both files have a superset of enums,
and add classification as needed for numMCOperands.

Reviewed by Owen Anderson

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

13 years agoFix recognition of ARM 'adcs' mnemonic.
Jim Grosbach [Mon, 11 Jul 2011 17:09:57 +0000 (17:09 +0000)]
Fix recognition of ARM 'adcs' mnemonic.

The 'CS' is not a predication suffix in this case.

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

13 years agoSimplify printing of ARM shifted immediates.
Jim Grosbach [Mon, 11 Jul 2011 16:48:36 +0000 (16:48 +0000)]
Simplify printing of ARM shifted immediates.

Print shifted immediate values directly rather than as a payload+shifter
value pair. This makes for more readable output assembly code, simplifies
the instruction printer, and is consistent with how Thumb immediates are
 displayed.

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