Owen Anderson
a59d489162
Fix encoding of CBZ/CBNZ Thumb2 instructions with immediate offsets rather than labels.
...
llvm-svn: 138837
2011-08-30 22:15:17 +00:00
Benjamin Kramer
2ca7c2b2c7
Teach macho-dump to dump the uleb128s referred to by linkedit_data segments.
...
llvm-svn: 138836
2011-08-30 22:10:58 +00:00
Owen Anderson
9465c7fee0
Fix encoding of PC-relative Thumb1 LDR's when using immediate offsets instead of labels.
...
llvm-svn: 138835
2011-08-30 22:10:03 +00:00
Owen Anderson
309c4b7ef6
Fix encoding of Thumb1 B instructions with immediate offsets, which is necessary for round-tripping.
...
llvm-svn: 138834
2011-08-30 22:03:20 +00:00
Owen Anderson
d9dbde4a50
Clean up whitespace.
...
llvm-svn: 138833
2011-08-30 21:58:18 +00:00
Bill Wendling
1e8c335302
Fix off-by-one error Benjamin noticed.
...
llvm-svn: 138832
2011-08-30 21:23:24 +00:00
Owen Anderson
d3a9f00a58
Speculatively revert r138809 in an attempt to fix DragonEgg.
...
llvm-svn: 138829
2011-08-30 21:11:06 +00:00
Bill Wendling
569b9fee87
Enable compact unwind info by default. This only applies to Darwin when CFI is
...
disabled.
llvm-svn: 138826
2011-08-30 20:54:11 +00:00
Jeffrey Yasskin
8f36e758c2
Fix C++0x narrowing errors when char is unsigned.
...
In the case of EDInstInfo, this would actually cause a bug when -1 became 255
and was then compared >=0 in llvm-mc/Disassembler.cpp.
llvm-svn: 138825
2011-08-30 20:53:29 +00:00
Rafael Espindola
9db302e741
Adds support for variable sized allocas. For a variable sized alloca,
...
code is inserted to first check if the current stacklet has enough
space. If so, space is allocated by simply decrementing the stack
pointer. Otherwise a runtime routine (__morestack_allocate_stack_space
in libgcc) is called which allocates the required memory from the
heap.
Patch by Sanjoy Das.
llvm-svn: 138818
2011-08-30 19:47:04 +00:00
Rafael Espindola
7721c15106
Adds a SelectionDAG node X86SegAlloca which will be custom lowered
...
from DYNAMIC_STACKALLOC.
Two new pseudo instructions (SEG_ALLOCA_32 and SEG_ALLOCA_64) which
will match X86SegAlloca (based on word size) are also added. They
will be custom emitted to inject the actual stack handling code.
Patch by Sanjoy Das.
llvm-svn: 138814
2011-08-30 19:43:21 +00:00
Rafael Espindola
321e47cd0b
Emit segmented-stack specific code into function prologues for
...
X86. Modify the pass added in the previous patch to call this new
code.
This new prologues generated will call a libgcc routine (__morestack)
to allocate more stack space from the heap when required
Patch by Sanjoy Das.
llvm-svn: 138812
2011-08-30 19:39:58 +00:00
Rafael Espindola
84f69a1992
Command line option to enable support for segmented stacks:
...
-segmented-stacks.
Patch by Sanjoy Das!
llvm-svn: 138811
2011-08-30 19:29:02 +00:00
Evan Cheng
91aa81acaa
Follow up to r138791.
...
Add a instruction flag: hasPostISelHook which tells the pre-RA scheduler to
call a target hook to adjust the instruction. For ARM, this is used to
adjust instructions which may be setting the 's' flag. ADC, SBC, RSB, and RSC
instructions have implicit def of CPSR (required since it now uses CPSR physical
register dependency rather than "glue"). If the carry flag is used, then the
target hook will *fill in* the optional operand with CPSR. Otherwise, the hook
will remove the CPSR implicit def from the MachineInstr.
llvm-svn: 138810
2011-08-30 19:09:48 +00:00
Owen Anderson
3ec8beb8c8
When walking backwards to eliminate final stores to allocas at the end of a function, encountering an unrelated store should not cause us to give up like encountering a load does.
...
llvm-svn: 138809
2011-08-30 18:51:55 +00:00
Benjamin Kramer
de3a6db63c
Teach macho-dump how to dump linkedit_data load commands.
...
llvm-svn: 138807
2011-08-30 18:33:37 +00:00
Roman Divacky
7ac1bc57f7
Set CR1EQ only when lowering vararg floating arguments (not any vararg
...
arguments as before), unset CR1EQ otherwise.
llvm-svn: 138802
2011-08-30 17:04:16 +00:00
James Molloy
a7a4266f83
Fix typos in SPUMCTargetDesc.h
...
Patch supplied by Liu (projlc@gmail.com )
llvm-svn: 138799
2011-08-30 07:27:02 +00:00
James Molloy
c537f89907
Fix typo in BlackfinFrameLowering.h
...
Patch supplied by Liu (projlc@gmail.com )
llvm-svn: 138798
2011-08-30 07:26:11 +00:00
James Molloy
21b255e052
Fix typo in MSP430MCTargetDesc.h.
...
Patch supplied by Liu (projlc@gmail.com )
llvm-svn: 138797
2011-08-30 07:24:47 +00:00
James Molloy
e841c9709a
Fix typo in MipsMCTargetDesc.h; Patch supplied by Liu (proljc@gmail.com)
...
llvm-svn: 138796
2011-08-30 07:23:29 +00:00
Bob Wilson
cc7b5b71eb
Do not try to rematerialize a value from a partial definition.
...
I don't currently have a good testcase for this; will try to get one
tomorrow. <rdar://problem/10032939>
llvm-svn: 138794
2011-08-30 05:36:02 +00:00
Evan Cheng
1eacb83316
Change ARM / Thumb2 addc / adde and subc / sube modeling to use physical
...
register dependency (rather than glue them together). This is general
goodness as it gives scheduler more freedom. However it is motivated by
a nasty bug in isel.
When a i64 sub is expanded to subc + sube.
libcall #1
\
\ subc
\ / \
\ / \
\ / libcall #2
sube
If the libcalls are not serialized (i.e. both have chains which are dag
entry), legalizer can serialize them in arbitrary orders. If it's
unlucky, it can force libcall #2 before libcall #1 in the above case.
subc
|
libcall #2
|
libcall #1
|
sube
However since subc and sube are "glued" together, this ends up being a
cycle when the scheduler combine subc and sube as a single scheduling
unit.
The right solution is to fix LegalizeType too chains the libcalls together.
However, LegalizeType is not processing nodes in order so that's harder than
it should be. For now, the move to physical register dependency will do.
rdar://10019576
llvm-svn: 138791
2011-08-30 01:34:54 +00:00
Jim Grosbach
187be92001
Revert 138781. It's not playing nicely with the immediate forms for ADC.
...
llvm-svn: 138782
2011-08-29 23:24:15 +00:00
Jim Grosbach
bc2d35e0ec
Thumb2 assembler aliases for ADC/SBC w/o the .w suffix.
...
llvm-svn: 138781
2011-08-29 23:20:54 +00:00
Owen Anderson
4bd28c69c4
Add missing encoding information for some of the GPR<->FP register moves.
...
llvm-svn: 138780
2011-08-29 23:15:25 +00:00
Jim Grosbach
a1aa6a2e8b
Thumb2 parsing and encoding for IT blocks.
...
llvm-svn: 138773
2011-08-29 22:24:09 +00:00
Eli Friedman
4d90e53381
Explicitly zero out parts of a vector which are required to be zero by the algorithm in LowerUINT_TO_FP_i32. This only has a substantial effect on the generated code when the input is extracted from a vector register; other ways of loading an i32 do the appropriate zeroing implicitly. Fixes PR10802.
...
llvm-svn: 138768
2011-08-29 21:15:46 +00:00
Owen Anderson
bbb6ed8264
Apply the same fix for the change in LDR_PRE_IMM/LDRB_PRE_IMM operand encodings to the load-store optimizer that I applied to the instruction selector in r138758. Fixes ary3 from the nightly test suite.
...
llvm-svn: 138766
2011-08-29 21:14:19 +00:00
Bill Wendling
d9df43679c
Fix grammar, noticed by Duncan.
...
llvm-svn: 138764
2011-08-29 21:03:12 +00:00
Owen Anderson
518e14771a
Specify an additional fixed bit in the PLD/PLDW/PLI register-register encoding.
...
llvm-svn: 138760
2011-08-29 20:42:00 +00:00
Owen Anderson
44c24b13a3
addrmode_imm12 and addrmode2_offset encode their immediate values differently. Update the manual instruction selection code that was encoding them the addrmode2 way even though LDR_PRE_IMM/LDRB_PRE_IMM had switched to addrmode_imm12. Should fix a number of nightly test failures.
...
llvm-svn: 138758
2011-08-29 20:16:50 +00:00
Nadav Rotem
43912ff374
Fixes following the CR by Chris and Duncan:
...
Optimize chained bitcasts of the form A->B->A.
Undo r138722 and change isEliminableCastPair to allow this case.
llvm-svn: 138756
2011-08-29 19:58:36 +00:00
Owen Anderson
e14d6edccc
Improve handling of #-0 offsets for many more pre-indexed addressing modes.
...
llvm-svn: 138754
2011-08-29 19:36:44 +00:00
Bill Wendling
6d2c747e53
Initialize CompactUnwindSection so that other targets won't use an uninitialized value.
...
llvm-svn: 138752
2011-08-29 18:25:59 +00:00
Eli Friedman
6d27cb5e01
Expand ATOMIC_LOAD and ATOMIC_STORE for architectures I don't know well enough to fix properly.
...
llvm-svn: 138751
2011-08-29 18:23:02 +00:00
Benjamin Kramer
da658378b3
Dump with dbgs() instead of printf.
...
llvm-svn: 138749
2011-08-29 18:14:17 +00:00
Benjamin Kramer
442620e4c4
Make GCC happy by adding parens.
...
llvm-svn: 138748
2011-08-29 18:14:15 +00:00
Owen Anderson
3136f0a930
Update the load-store optimizer for changes to the operands on LDR_PRE_IMM and LDRB_PRE_IMM in r138653.
...
llvm-svn: 138746
2011-08-29 17:59:41 +00:00
Bruno Cardoso Lopes
3a09888a72
Move non-intruction patterns to a more appropriate place!
...
llvm-svn: 138744
2011-08-29 17:51:24 +00:00
Owen Anderson
8719e2c1c3
Add support for parsing #-0 on non-memory-operand immediate values, and add a testcase that necessitates it.
...
llvm-svn: 138739
2011-08-29 17:17:09 +00:00
Andrew Trick
026fa4da72
Reapply r138695. Fix PassManager stack depths.
...
Patch by Xiaoyi Guo!
llvm-svn: 138737
2011-08-29 17:07:00 +00:00
Tobias Grosser
c6abc36833
Add AMDIL as valid target triple to LLVM.
...
Submitted by: Villmow, Micah <Micah.Villmow@amd.com>
llvm-svn: 138734
2011-08-29 15:44:55 +00:00
Nicolas Geoffray
74b006fe71
Remove premature previous commit.
...
llvm-svn: 138725
2011-08-28 14:52:51 +00:00
Duncan Sands
1a69e0119a
Fix PR5329: pay attention to constructor/destructor priority
...
when outputting them. With this, the entire LLVM testsuite
passes when built with dragonegg.
llvm-svn: 138724
2011-08-28 13:17:22 +00:00
Nicolas Geoffray
d30e51ca07
Encoding of instructions referencing segments has changed. Do what X86MCCodeEmitter does.
...
llvm-svn: 138723
2011-08-28 13:07:57 +00:00
Nadav Rotem
6280c8eecc
Bitcasts are transitive. Bitcast-Bitcast-X becomes Bitcast-X.
...
llvm-svn: 138722
2011-08-28 11:51:08 +00:00
Nick Lewycky
a28dc138a1
Fix integer overflow bug in raw_ostream::write. This showed up as a
...
non-deterministic crash in the test suite. Fixes PR10055!
llvm-svn: 138717
2011-08-28 03:30:02 +00:00
Benjamin Kramer
6411b8f81a
Silence GCC warnings and make an array const.
...
llvm-svn: 138706
2011-08-27 17:36:14 +00:00
Benjamin Kramer
70ba1d6ab4
Report failure if there are less bytes than requested in a MemoryObject.
...
Before we just left the remaining bytes uninitialized. This is another step in making llvm valgrind-clean again.
llvm-svn: 138705
2011-08-27 07:45:46 +00:00