Commit Graph

41954 Commits

Author SHA1 Message Date
Daniel Dunbar
a7e3b56477 Add an explicit initialization to work around what appears to be a valgrind
false positive, at least on Darwin. I haven't filed this, but you can feel free.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115242 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 23:56:49 +00:00
Owen Anderson
b3c04ec956 Temporarily add a flag to make it easier to compare the new-style ARM if
conversion heuristics to the old-style ones.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115239 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 23:48:38 +00:00
Jim Grosbach
ddcf859851 Clean up asm writer usage for x86 and msp430 to flag that the writer should
use MC instructions in the printInstruction() method via the tablegen flag
for it rather than a #define prior to including the autogenerated bits.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115238 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 23:40:25 +00:00
Eric Christopher
086378597d Movement and cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115225 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 22:34:19 +00:00
Nick Lewycky
c6877b4ee1 Pacify a noisy compiler, and sink this variable declaration closer to its uses.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115206 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 21:04:13 +00:00
Owen Anderson
722cc1f414 We do want to allow LoadPRE to perform LICM-like transformations: we already consider PHI nodes to be negligible for
code size (making this transform code size neutral), and it allows us to hoist values out of loops, which is always
a good thing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115205 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 20:53:04 +00:00
Jakob Stoklund Olesen
7eb589d3f9 Try again to disable critical edge splitting in CodeGenPrepare.
The bug that broke i386 linux has been fixed in r115191.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115204 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 20:51:52 +00:00
Eric Christopher
f9764fa14f Start of generalized call support for ARM fast isel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115203 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 20:49:44 +00:00
Talin
c87cfb6a81 Allow llvm.gcroot to work with non-pointer allocas.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115198 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 20:23:47 +00:00
Rafael Espindola
7eae36b38b Factor some logic into ShouldRelocOnSymbol. This simplifies the code and
fixes some cases where we were producing relocations with at symbol that
should use a section instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115194 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 20:18:35 +00:00
Jim Grosbach
a3fbadfcd8 Nuke a few more unused asm strings
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115193 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 19:53:58 +00:00
Jakob Stoklund Olesen
2622f4622c When isel is emitting instructions for an x86 target without CMOV, the CFG is
edited during emission.

If the basic block ends in a switch that gets lowered to a jump table, any
phis at the default edge were getting updated wrong. The jump table data
structure keeps a pointer to the header blocks that wasn't getting updated
after the MBB is split.

This bug was exposed on 32-bit Linux when disabling critical edge splitting in
codegen prepare.

The fix is to uipdate stale MBB pointers whenever a block is split during
emission.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115191 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 19:44:31 +00:00
Jim Grosbach
3787a40e03 Move getPointerSize() to the base class since it's not dependent on MachO
vs. ELF

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115180 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 17:45:51 +00:00
Jim Grosbach
af2a8b21f1 Remove extraneous ';'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115176 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 17:19:17 +00:00
Chris Lattner
905f2e0669 preemptively add the rest of the non-n fpstack instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115168 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 17:11:29 +00:00
Jim Grosbach
71d933a49e The asm strings are never used at all, so just nuke 'em entirely.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115160 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 16:56:53 +00:00
Kevin Enderby
c095793b4a This is the last major patch to implement support for the .loc directive
and output the dwarf line number tables.  This contains the code to emit and
encode the dwarf line tables from the previously gathered information in the
MCLineSection objects.  This contains all the details to encode the line and
address deltas into the dwarf line table.

To do this an MCDwarfLineAddrFragment has been added.

Also this moves the interface code out of Mach-O streamer into
MCDwarf so it should be useable by other object file formats.

There is now one call to be made from an MCObjectStreamer
EmitInstruction() method:
   MCLineEntry::Make(this, getCurrentSection());
to create a line entry after each instruction is assembled.

And one call call to be made from an MCObjectStreamer Finish() method:
   MCDwarfFileTable::Emit(this, DwarfLineSection);
when getContext().hasDwarfFiles() is true and is passed a object file specific
MCSection where to emit the dwarf file and the line tables.

This appears to now be correct for 32-bit targets, at least x86.  But the
relocation entries for 64-bit Darwin needs some further work which is next
up to work on.  So for now the 64-bit Mach-O target does not output the
dwarf file and line tables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115157 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 16:52:03 +00:00
Chris Lattner
9ee4aed3b6 implement support for finit, PR8258
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115156 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 16:42:53 +00:00
Kevin Enderby
b5a3ec17a4 Changes EvaluateAsAbsolute() to return the "current value" of the expression
if we are given a Layout object, even in cases when the value is not fixed.
This will be needed by the final patch for the dwarf .loc support to size a
new MCDwarf fragment needed to build and emit dwarf line number tables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115155 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 16:42:21 +00:00
Chris Lattner
0bb83a84d4 add support for fstcw, PR8259
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115154 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 16:39:29 +00:00
Kevin Enderby
8ebf66236e Adds getPointerSize() to the AsmBackend which will be needed by the final patch
for the dwarf .loc support to emit dwarf line number tables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115153 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 16:38:07 +00:00
Benjamin Kramer
82d96cccbc Grow BumpPtrAllocator's slab size dynamically if we allocated many slabs. This
reduces the amount of malloc calls and may reduce memory overhead.

Some numbers:
ASTContext stats, clang -cc1 -disable-free -fsyntax-only Cocoa_h.m
without dynamic growth                          |  with dynamic growth
Number of memory regions: 3158                  |  Number of memory regions: 432
Bytes used: 12333185                            |  Bytes used: 12333185
Bytes allocated: 12935168                       |  Bytes allocated: 12800000
Bytes wasted: 601983 (includes alignment, etc)  |  Bytes wasted: 466815 (includes alignment, etc)

ASTContext stats, clang -cc1 -disable-free -fsyntax-only on clang's ASTReader.cpp
without dynamic growth                          |  with dynamic growth
Number of memory regions: 10987                 |  Number of memory regions: 551
Bytes used: 42910356                            |  Bytes used: 42910356
Bytes allocated: 45002752                       |  Bytes allocated: 44711936
Bytes wasted: 2092396 (includes alignment, etc) |  Bytes wasted: 1801580 (includes alignment, etc)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115151 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 16:18:28 +00:00
Jim Grosbach
2f24c4ece0 80 column fix
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115149 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 15:25:22 +00:00
Jason W Kim
a4c27248b5 Fix two tiny issues (ARM does not need COFF) and comment sanity.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115147 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 14:58:19 +00:00
Benjamin Kramer
4c75679b1c Tighten up prototype verification of strchr and strrchr to avoid a crash in the very unlikely case that someone passes an integer > i64 to strchr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115144 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 11:21:59 +00:00
Chandler Carruth
5c0d472b6e Silence a GCC warning about not handling all flags in this switch, we
specifically assert on unexpected flags.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115143 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 10:59:51 +00:00
Jan Wen Voung
186e7a0fb1 Move logic of determining ELF entsize from the .s printer to initialization
time. That way, the EntrySize field is initialized for other code paths, 
namely, the .ll -> .o code path.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115141 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 05:59:22 +00:00
Jim Grosbach
f73fd7278f trailing whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115136 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 03:21:00 +00:00
Jim Grosbach
87dc3aa2d8 Remove misplaced ';'. Make buildbots happy, hopefully.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115135 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 03:20:34 +00:00
Rafael Espindola
a8c02c3bdd Correctly produce R_X86_64_32 or R_X86_64_32S.
With this patch in

movq    $foo, foo(%rip)
foo:
.long   foo

We produce a R_X86_64_32S for the first relocation and R_X86_64_32 for the
second one.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115134 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 03:11:42 +00:00
Jason W Kim
afd1cc2578 Tiny patch for proof-of-concept cleanup of ARMAsmPrinter::EmitStartOfAsmFile()
Small test for sanity check of resulting ARM .s file.
Tested against -r115129.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115133 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 02:45:56 +00:00
Jan Wen Voung
12ad94e03c Have ELFAsmParser.cpp use the already parsed "Size" (entry size) when
constructing a section. Test for a few cases also included.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115132 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 02:41:46 +00:00
Rafael Espindola
7070387f08 Make it possible for the MCObjectWriter to decide if a given fixup is fully
resolved or not. Different object files have different restrictions and
different native assemblers have different idiosyncrasies we want to emulate
for now.

Move the existing MachO logic to the new place and implement an ELF one that
gets fixups to globals right.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115131 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 02:22:20 +00:00
Jim Grosbach
7ebc863c15 Go ahead and jump!
Now that the MC lowering handles the expansion of the pseudos, kill the horrible
blobs of text.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115130 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 02:18:06 +00:00
Jason W Kim
d4d4f4f488 I added a new file ARMAsmBackend which stubs out in similar ways to
the eqv X86 class.
For now, I split the ELFARMAsmBackend from the DarwinARMAsmBackend
(also mimicking X86)

Tested against -r115126



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115129 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 02:17:26 +00:00
Jim Grosbach
a4e97de71d Now that the pseudos that needed this are all custom lowered, we can go back
to an empty PrintSpecial()

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115128 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 02:02:22 +00:00
Jim Grosbach
2317e40539 Nuke it from orbit. It's the only way to be sure.
(Kill the dead non-MC asm printer for the ARM target.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115127 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 01:57:53 +00:00
Jan Wen Voung
a854a4bbc8 Test commit - Deleted some whitespace at the end of a line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115122 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 01:09:20 +00:00
Evan Cheng
0e55fd61ae ARM instruction itinerary fixes:
1. Cortex-a9 8-bit and 16-bit loads / stores AGU cycles are 1 cycle longer than 32-bit ones.
2. Cortex-a9 is out-of-order so model all read cycles as cycle 1.
3. Lots of other random fixes for A8 and A9.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115121 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 01:08:25 +00:00
Benjamin Kramer
9510a2538b Add constant folding for strspn and strcspn to SimplifyLibCalls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115116 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 00:58:35 +00:00
Francois Pichet
3eddd98be3 Revert r114320(move file = copy + delete on Win32). r115040 is a better solution for the Win32 ACCESS_DENIED lit error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115114 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 00:44:58 +00:00
Benjamin Kramer
05f585e28b Add strpbrk folding to SimplifyLibCalls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115111 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29 23:52:12 +00:00
Nick Lewycky
28815c4b64 Silence compiler warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115107 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29 23:32:20 +00:00
Eric Christopher
a9a7a1a9a5 Refactor arm fast isel libcall handling so that pieces can be used
for generic call handling.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115105 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29 23:11:09 +00:00
Devang Patel
3cf763dc7a Let FE mark a variable as artificial variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115102 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29 23:07:21 +00:00
Eric Christopher
e487b017e9 Noticed by inspection when looking for other cmov bits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115100 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29 23:00:29 +00:00
Evan Cheng
3881cb7a5d Model Cortex-a9 load to SUB, RSB, ADD, ADC, SBC, RSC, CMN, MVN, or CMP
pipeline forwarding path.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115098 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29 22:42:35 +00:00
Benjamin Kramer
6406d004c9 Silence msvc warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115097 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29 22:38:50 +00:00
Benjamin Kramer
e260990fa1 Simplify the loop in StrChrOptimizer. FileCheckize test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115095 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29 22:29:12 +00:00
Eric Christopher
8cf6c60710 Add a convenience variable so I'm not chasing all over looking for
a context.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115094 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29 22:24:45 +00:00