Commit Graph

48343 Commits

Author SHA1 Message Date
Chris Lattner
d91aa14075 add C api for hte new type system rewrite API. Patch by Vitaly Lugovskiy!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135132 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-14 05:53:17 +00:00
Evan Cheng
672b93a332 Unfortunately several files in MC are badly violating layering rule by using
TargetAsmInfo, which in turn pulls in TargetRegisterInfo, etc. :-( There are
other cases of violations, but this is probably the worst.

This patch is but one small step towards fixing this. 500 more steps to go. :-(


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135131 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-14 05:43:07 +00:00
Jakob Stoklund Olesen
f1c709837b Reapply r135121 with a fixed copy constructor.
Original commit message:

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@135130 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-14 05:35:11 +00:00
Devang Patel
49c19f778b Simplify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135127 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-14 01:52:45 +00:00
Benjamin Kramer
3ff25514ce 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
2011-07-14 01:38:42 +00:00
Devang Patel
d77ec6208c 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
2011-07-14 01:14:57 +00:00
Eric Christopher
7332e6ee25 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
2011-07-14 01:12:15 +00:00
Jakob Stoklund Olesen
4fcfcf4984 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
2011-07-14 00:58:38 +00:00
Jakob Stoklund Olesen
6a9feaac93 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
2011-07-14 00:31:14 +00:00
Eli Friedman
7e94501071 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
2011-07-14 00:22:31 +00:00
Devang Patel
0cd0c248cc 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
2011-07-14 00:20:24 +00:00
Jim Grosbach
e77494e3e3 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
2011-07-14 00:18:13 +00:00
Jakob Stoklund Olesen
c66a37df73 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
2011-07-14 00:17:10 +00:00
Jim Grosbach
77f379e2a1 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
2011-07-14 00:10:26 +00:00
Devang Patel
0f16a4eecc Fix typo in DEBUG message.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135111 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-14 00:04:53 +00:00
Devang Patel
5fc0d886da Add DEBUG messages.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135110 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-14 00:03:58 +00:00
Jim Grosbach
032434d622 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
2011-07-13 23:40:38 +00:00
Jim Grosbach
20fcaffaf7 Update comments. These are for assembler, too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135107 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-13 23:33:10 +00:00
Owen Anderson
16884415db 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
2011-07-13 23:22:26 +00:00
Bill Wendling
efe2a6557d 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
2011-07-13 23:03:31 +00:00
Jim Grosbach
6f9f884502 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
2011-07-13 22:59:38 +00:00
Jakob Stoklund Olesen
54c74e906a Revert r135074 and r135080. They broke clamscan.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135096 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-13 22:20:09 +00:00
Jim Grosbach
1cbb0c16a1 Revert 135093. Think-o.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135094 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-13 22:06:11 +00:00
Jim Grosbach
91eb0aa5de Correct range for thumb co-processor immediate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135093 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-13 22:03:11 +00:00
Jim Grosbach
83ab070fc1 Range checking for CDP[2] immediates.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135092 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-13 22:01:08 +00:00
Bruno Cardoso Lopes
466b022c99 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
2011-07-13 21:36:51 +00:00
Bruno Cardoso Lopes
c1af4772f1 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
2011-07-13 21:36:47 +00:00
Jim Grosbach
e35c5e06fe 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
2011-07-13 21:35:10 +00:00
Eli Friedman
2a01946de4 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
2011-07-13 21:29:53 +00:00
Jim Grosbach
0d8dae292a Parameterize away the ARM T1Cop class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135082 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-13 21:17:59 +00:00
Jim Grosbach
9bb098ad3a 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
2011-07-13 21:14:23 +00:00
Jakob Stoklund Olesen
3bae1bf62e 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
2011-07-13 20:49:46 +00:00
Eli Friedman
4977eb5eb5 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
2011-07-13 20:44:23 +00:00
Jim Grosbach
898e7e26a5 Fix encoding for ARM BXJ instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135077 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-13 20:25:01 +00:00
Jim Grosbach
d447ac6c8c 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
2011-07-13 20:21:31 +00:00
Jakob Stoklund Olesen
1337e2b75a 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
2011-07-13 20:14:52 +00:00
Jim Grosbach
fff76ee7ef 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
2011-07-13 20:10:10 +00:00
Jay Foad
d1863560cb 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
2011-07-13 20:05:31 +00:00
Evan Cheng
9bc402c8d4 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
2011-07-13 19:54:59 +00:00
Jim Grosbach
619e0d6d95 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
2011-07-13 19:24:09 +00:00
Jim Grosbach
21101d60ce 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
2011-07-13 19:17:36 +00:00
Evan Cheng
93a635c82c 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
2011-07-13 19:08:16 +00:00
Jim Grosbach
19906729a4 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
2011-07-13 18:49:30 +00:00
Jim Grosbach
37ee464ea9 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
2011-07-13 17:57:17 +00:00
Jim Grosbach
e8606dc7c8 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
2011-07-13 17:50:29 +00:00
Jim Grosbach
aa4cc1a6d7 80 columns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135047 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-13 17:25:55 +00:00
Jim Grosbach
b7f689bab9 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
2011-07-13 15:34:57 +00:00
Jay Foad
75f67e0d8d 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
2011-07-13 10:39:49 +00:00
Jay Foad
fc6d3a4986 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
2011-07-13 10:26:04 +00:00
Danil Malyshev
cf852dc49b Add to RuntimeDyld support different object formats
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135037 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-13 07:57:58 +00:00
Chris Lattner
c09ef37171 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
2011-07-13 04:22:39 +00:00
Evan Cheng
3b737081e4 Add an entry.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135024 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-13 01:33:00 +00:00
Bruno Cardoso Lopes
61905f0139 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
2011-07-13 01:15:33 +00:00
Bill Wendling
8440fe2166 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
2011-07-13 00:49:09 +00:00
Eli Friedman
5cf2ee1f80 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
2011-07-13 00:44:29 +00:00
Evan Cheng
e721f5c8d3 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
2011-07-13 00:42:17 +00:00
Bill Wendling
3641e81172 Assign variable before we test it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135015 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-13 00:23:39 +00:00
Bill Wendling
f4f53f08f5 Fix obvious think-o.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135014 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-13 00:20:09 +00:00
Bill Wendling
595d745f5f 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
2011-07-13 00:16:14 +00:00
Bill Wendling
d5efb1eee6 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
2011-07-12 22:35:01 +00:00
Jay Foad
5fdd6c8793 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
2011-07-12 14:06:48 +00:00
Tobias Grosser
e3f5ae7b9e Remove IntegerType constness from TargetData
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134978 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-12 11:36:58 +00:00
Chris Lattner
4e47aadd96 simplify assertions to not be completely redundant.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134968 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-12 05:26:21 +00:00
Chris Lattner
a17ce80a1e 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
2011-07-12 04:14:22 +00:00
Bill Wendling
2280ebd614 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
2011-07-12 01:15:52 +00:00
Nick Lewycky
1852e21701 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
2011-07-12 00:26:08 +00:00
Andrew Trick
1a54bb28c7 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
2011-07-12 00:08:50 +00:00
Evan Cheng
af0a2e6730 Most MCCodeEmitter's don't meed MCContext.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134922 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-11 21:24:15 +00:00
Shantonu Sen
7ae0df4142 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
2011-07-11 17:57:30 +00:00
Jim Grosbach
3f00e31706 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
2011-07-11 17:09:57 +00:00
Jim Grosbach
589130fac1 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
2011-07-11 16:48:36 +00:00
Jay Foad
eeb64ae6e5 De-constify Types in StructType::get() and TargetData::getIntPtrType().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134893 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-11 09:56:20 +00:00
Jay Foad
f362affa3a De-constify Types in FunctionType::get().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134888 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-11 07:56:41 +00:00
Jay Foad
7f0ce34918 Remove mentions of type planes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134887 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-11 07:28:49 +00:00
Evan Cheng
59ee62d241 - Eliminate MCCodeEmitter's dependency on TargetMachine. It now uses MCInstrInfo
and MCSubtargetInfo.
- Added methods to update subtarget features (used when targets automatically
  detect subtarget features or switch modes).
- Teach X86Subtarget to update MCSubtargetInfo features bits since the
  MCSubtargetInfo layer can be shared with other modules.
- These fixes .code 16 / .code 32 support since mode switch is updated in
  MCSubtargetInfo so MC code emitter can do the right thing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134884 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-11 03:57:24 +00:00
Rafael Espindola
b5a12dd12f Don't duplicate the work done by a gep into a "bitcast" if the gep has
more than one use.

Fixes PR10322.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134883 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-11 03:43:47 +00:00
Cameron Zwarich
f75ae4c977 Fix <rdar://problem/9751331>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134882 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-11 01:29:42 +00:00
Chandler Carruth
dc770fcb2c Silence -Wunused-variable in release builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134868 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-10 09:45:35 +00:00
Jakub Staszak
f81b7f6069 Use BranchProbability instead of floating points in IfConverter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134858 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-10 02:58:07 +00:00
Jakub Staszak
2b33f4cbad Don't analyze block if it's not considered for ifcvt anymore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134856 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-10 02:00:16 +00:00
Chris Lattner
eaf79809e8 the various ConstantExpr::get*Ty methods existed to work with issues around
type refinement.  Zap them now that type refinement is toast.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134837 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-09 18:23:52 +00:00
Chris Lattner
bda20650d2 don't load element before checking to see if it is valid.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134836 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-09 18:23:26 +00:00
Chris Lattner
145ab10711 Eliminate the WriteTypeSymbolic function. Now that types know
their names, we don't need a module around to print them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134835 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-09 18:03:13 +00:00
Chris Lattner
368381e9ab stop using WriteTypeSymbolic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134833 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-09 18:02:13 +00:00
Chris Lattner
aca50a94b8 remove the DerivedType which isn't adding value anymore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134832 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-09 17:59:15 +00:00
Chris Lattner
1afcace3a3 Land the long talked about "type system rewrite" patch. This
patch brings numerous advantages to LLVM.  One way to look at it
is through diffstat:
 109 files changed, 3005 insertions(+), 5906 deletions(-)

Removing almost 3K lines of code is a good thing.  Other advantages
include:

1. Value::getType() is a simple load that can be CSE'd, not a mutating
   union-find operation.
2. Types a uniqued and never move once created, defining away PATypeHolder.
3. Structs can be "named" now, and their name is part of the identity that
   uniques them.  This means that the compiler doesn't merge them structurally
   which makes the IR much less confusing.
4. Now that there is no way to get a cycle in a type graph without a named
   struct type, "upreferences" go away.
5. Type refinement is completely gone, which should make LTO much MUCH faster
   in some common cases with C++ code.
6. Types are now generally immutable, so we can use "Type *" instead 
   "const Type *" everywhere.

Downsides of this patch are that it removes some functions from the C API,
so people using those will have to upgrade to (not yet added) new API.  
"LLVM 3.0" is the right time to do this.

There are still some cleanups pending after this, this patch is large enough
as-is.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134829 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-09 17:41:24 +00:00
NAKAMURA Takumi
71c10666cc Windows/DynamicLibrary.inc: Fix trivial warnings. Thanks to John Myers!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134812 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-09 08:41:20 +00:00
Evan Cheng
1fe156f987 Revert accidental commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134800 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-09 06:26:27 +00:00
Evan Cheng
ffc0e73046 Change createAsmParser to take a MCSubtargetInfo instead of triple,
CPU, and feature string. Parsing some asm directives can change
subtarget state (e.g. .code 16) and it must be reflected in other
modules (e.g. MCCodeEmitter). That is, the MCSubtargetInfo instance
must be shared.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134795 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-09 05:47:46 +00:00
Jakob Stoklund Olesen
4f4a6fcd16 Oops, didn't mean to commit that.
Spills should be hoisted out of loops, but we don't want to hoist them
to dominating blocks at the same loop depth. That could cause the spills
to be executed more often.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134782 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-09 01:02:44 +00:00
Lang Hames
bd1828c6ed Added recognition for signed add/sub/mul with overflow intrinsics to GVN as per Chris and Frits suggestion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134777 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-09 00:25:11 +00:00
Jakob Stoklund Olesen
56573cc1ae Hoist spills within a basic block.
Try to move spills as early as possible in their basic block. This can
help eliminate interferences by shortening the live range being
spilled.

This fixes PR10221.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134776 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-09 00:25:03 +00:00
Eli Friedman
439d05d587 Really force on 64bit for 64-bit targets. Should fix remaining failures on unknown x86/non-x86 targets.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134773 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-08 23:43:01 +00:00
Eli Friedman
6dfef6605f Revert earlier unnecessary hack. Make sure we correctly force on 64bit and cmov for 64-bit targets.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134768 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-08 23:07:42 +00:00
Evan Cheng
eb0caa1154 Fix indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134764 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-08 22:49:55 +00:00
Evan Cheng
5c2eef6aed Fix comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134763 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-08 22:49:42 +00:00
Evan Cheng
3286920505 Add support for ARM / Thumb mode switching with .code 16 and .code 32.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134760 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-08 22:36:29 +00:00
Bob Wilson
7c3a5cac02 Update comments for SandyBridge CPU identifiers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134759 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-08 22:33:59 +00:00
Jim Grosbach
7e61a3120d Mark tBRIND as predicable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134758 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-08 22:33:49 +00:00
Evan Cheng
4d1a8dde2d Restore old behavior. Always auto-detect features unless cpu or features are specified.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134757 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-08 22:30:25 +00:00