Commit Graph

10336 Commits

Author SHA1 Message Date
Evan Cheng 6ea7ad0351 Add thumb2 add sp.
llvm-svn: 74156
2009-06-25 01:21:30 +00:00
Chris Lattner ea7422e7bf fix comments to be correct.
llvm-svn: 74154
2009-06-25 01:15:47 +00:00
Evan Cheng b566ab7b97 Some reorg and additional comments.
llvm-svn: 74152
2009-06-25 01:05:06 +00:00
Devang Patel 9d68302e48 No need to code gen MDNodes
llvm-svn: 74150
2009-06-25 00:47:42 +00:00
Evan Cheng 83f979a48b Add Thumb2 pc relative add.
llvm-svn: 74141
2009-06-24 23:47:58 +00:00
Evan Cheng 4c048fe5ad 80 col violation.
llvm-svn: 74138
2009-06-24 23:14:45 +00:00
Chris Lattner 6544289af3 move some functions, add a FIXME, use PrintPICBaseSymbol to print the
picbase instead of inlining it.

llvm-svn: 74111
2009-06-24 19:44:36 +00:00
Chris Lattner 9b4aaef9d4 reimplement getPICLabelString as PrintPICBaseSymbol to eliminate std::string heap thrashing.
llvm-svn: 74105
2009-06-24 19:19:16 +00:00
Chris Lattner 1fd5888294 sink management of DwarfWriter & MachineModuleInfo into the AsmPrinter base class.
llvm-svn: 74101
2009-06-24 19:09:55 +00:00
Chris Lattner 70413126b6 sink dwarf finalization out of each target into AsmPrinter::doFinalization
llvm-svn: 74097
2009-06-24 18:54:37 +00:00
Chris Lattner 2981dc1742 eliminate the ExtWeakSymbols set from AsmPrinter. This eliminates
a bunch of code from all the targets, and eliminates nondeterministic
ordering of directives being emitted in the output.

llvm-svn: 74096
2009-06-24 18:52:01 +00:00
Chris Lattner a297e0c9b1 only emit one .align for all the hidden gv stubs instead of one for each.
llvm-svn: 74094
2009-06-24 18:24:42 +00:00
Chris Lattner f094f09b76 inline print*Stub and rearrange function stub printing to more closely match
gv and hiddengv stub printing.

llvm-svn: 74093
2009-06-24 18:24:09 +00:00
Chris Lattner 13fb0bef1c remove dead code now that personality functions don't print stubs directly.
llvm-svn: 74092
2009-06-24 18:19:01 +00:00
Chris Lattner e8ad3f13fa remove now-dead argument.
llvm-svn: 74091
2009-06-24 18:17:56 +00:00
Chris Lattner cc5104dcc4 simplify personality function stub printing to use the mangler and
decorateName like other stuff instead of special casing _.  Also, stick
it into GVStubs and let the normal stub printer print the stub instead 
of doing it manually.

llvm-svn: 74090
2009-06-24 18:17:00 +00:00
Chris Lattner 63aab8a84c remove dead argument
llvm-svn: 74089
2009-06-24 18:00:11 +00:00
Chris Lattner 9db5fbac05 factor some code better.
llvm-svn: 74067
2009-06-24 05:47:59 +00:00
Chris Lattner 9f40bc2f79 wire up support for MCContext/MCStreamer in -experimental-asm-printer mode.
llvm-svn: 74066
2009-06-24 05:46:28 +00:00
Nick Lewycky 443af01b1a Unbreak build on Linux by removing Darwinism.
llvm-svn: 74046
2009-06-24 01:08:42 +00:00
Dan Gohman a3d375845e Revert this accidental commit.
llvm-svn: 74042
2009-06-24 00:55:55 +00:00
Dan Gohman f436bacb6b Move the special cases for constants out of getUnknown and into
createSCEV. Also, recognize UndefValue in createSCEV.

Change getIntegerSCEV's comment to avoid mentioning FP types,
and re-implement it in terms of getConstant instead of getUnknown.

llvm-svn: 74041
2009-06-24 00:54:57 +00:00
Bob Wilson 5a495fea07 Provide InitializeAllTargets and InitializeNativeTarget functions in the
C bindings.  Change all the backend "Initialize" functions to have C linkage.
Change the "llvm/Config/Targets.def" header to use C-style comments to avoid
compile warnings.

llvm-svn: 74026
2009-06-23 23:59:40 +00:00
Sean Callanan 9c14bce0f9 Test commit: fixed spacing.
llvm-svn: 74022
2009-06-23 23:25:37 +00:00
Evan Cheng 7d80d29187 Test instructions operands were printed in the wrong order.
llvm-svn: 73990
2009-06-23 19:56:37 +00:00
Bill Wendling f6e8f6b0f4 "The MMX_MASKMOVQ and MMX_MASKMOVQ64 instructions are labeled as MRMDestMem
instructions, which implies that there is an explicit memory operand.  There is
(however) no explicit memory operand; although this is a store, the only memory
operand is implicit, indicated by DS:EDI.  This causes the table-generation code
for the disassembler to report an error."

Patch by Sean Callanan!

llvm-svn: 73989
2009-06-23 19:52:59 +00:00
Evan Cheng 4983e4550e Proper patterns for thumb2 shift and rotate instructions.
llvm-svn: 73987
2009-06-23 19:39:13 +00:00
Evan Cheng 8d21e9c4e6 Code clean up.
llvm-svn: 73986
2009-06-23 19:38:34 +00:00
Evan Cheng bec1dba896 Add IsThumb1Only to most 16-bit thumb instructions since we want to isel 32-bit instructions when they are available.
llvm-svn: 73985
2009-06-23 19:38:13 +00:00
Evan Cheng e379107cdc Rename SelectShifterOperand to SelectThumb2ShifterOperandReg.
llvm-svn: 73975
2009-06-23 18:14:38 +00:00
Douglas Gregor 85fedbe081 Eliminate object-relinking support from CMake. Fixes PR 4429 and
cleans up the CMake-based build system a bit. Started by a patch from
Xerxes Rånby.

llvm-svn: 73969
2009-06-23 17:57:35 +00:00
Evan Cheng b45cebabc9 Obvious typo.
llvm-svn: 73967
2009-06-23 17:54:26 +00:00
Evan Cheng 431cf567de Initial Thumb2 support. Majority of the work is done by David Goodwin. There are
also some contribution from Jim Grosbach, Bob Wilson, and Evan Cheng.

I've done my best to consolidate the patches with those that were done by
Viktor Kutuzov and Anton Korzh from Access Softek, Inc. Let me know if missed
anything. I've completely reorganized the thumb2 td file, made more extensive
uses of multiclass, etc.

Test cases will be contributed later after I re-organize what's in svn first.

llvm-svn: 73965
2009-06-23 17:48:47 +00:00
Sanjiv Gupta 84b581a4bd Fold the add (ptr, offset) into ptr[offset] only if the offset is small enough. movwi and moviw allow value of 5-bits only (i.e. 32).
llvm-svn: 73953
2009-06-23 07:10:19 +00:00
Evan Cheng 6a42ec3e70 Minor reorg.
llvm-svn: 73948
2009-06-23 05:25:29 +00:00
Evan Cheng 022a726a25 Replace isTwoAddress with operand constraint.
llvm-svn: 73947
2009-06-23 05:23:49 +00:00
Owen Anderson e3c1aca0d9 Guard the layout info object.
llvm-svn: 73928
2009-06-23 00:21:15 +00:00
Bob Wilson 2e076c4e02 Add support for ARM's Advanced SIMD (NEON) instruction set.
This is still a work in progress but most of the NEON instruction set
is supported.

llvm-svn: 73919
2009-06-22 23:27:02 +00:00
Bob Wilson e67b77028e Add explicit types for shift count constants. This is in preparation for
another change that makes the types ambiguous (at least as far as tablegen
is concerned).

llvm-svn: 73909
2009-06-22 22:08:29 +00:00
Bob Wilson 482495695e Use thumb2 for ARM architectures V6T2 and later. Fix a bug in checking
for "thumb" and add a check for V6T2.

llvm-svn: 73905
2009-06-22 21:28:22 +00:00
Bob Wilson 4582530a2c For Darwin on ARMv6 and newer, make register r9 available for use as a
caller-saved register.

llvm-svn: 73901
2009-06-22 21:01:46 +00:00
Bruno Cardoso Lopes a040566fec Add more methods to gather target specific elf stuff
Support for .text relocations, implementing TargetELFWriter overloaded methods for x86/x86_64.
Use a map to track global values to their symbol table indexes
Code cleanup and small fixes

llvm-svn: 73894
2009-06-22 19:16:16 +00:00
Evan Cheng 3d75d6af57 hasFP should return true if frame address is taken.
llvm-svn: 73893
2009-06-22 18:38:48 +00:00
Bob Wilson 360eef0782 Fix llvm-gcc build for armv6t2 and later architectures. The hasV6T2Ops
predicate does not check if Thumb mode is enabled, and when in ARM mode
there are still some checks for constant-pool use that need to run.

llvm-svn: 73887
2009-06-22 17:29:13 +00:00
Rafael Espindola 6ead59f8ed Fix PR4185.
Handle FpSET_ST0_80 being used when ST0 is still alive.

llvm-svn: 73850
2009-06-21 12:02:51 +00:00
Chris Lattner 7719d0184a simplify closing paren and (rip) printing.
llvm-svn: 73841
2009-06-21 02:22:53 +00:00
Chris Lattner a3da048c82 indentation fix
llvm-svn: 73840
2009-06-21 02:22:34 +00:00
Chris Lattner e80442452e remove #if 0 code
llvm-svn: 73837
2009-06-21 01:48:49 +00:00
Chris Lattner cfad3f3807 cosmetic changes.
llvm-svn: 73836
2009-06-21 01:27:55 +00:00
Chris Lattner 7d2b049404 change TLS_ADDR lowering to lower to a real mem operand, instead of matching as
a global with that gets printed with the :mem modifier.  All operands to lea's 
should be handled with the lea32mem operand kind, and this allows the TLS stuff
to do this.  There are several better ways to do this, but I went for the minimal
change since I can't really test this (beyond make check).

This also makes the use of EBX explicit in the operand list in the 32-bit, 
instead of implicit in the instruction.

llvm-svn: 73834
2009-06-20 20:38:48 +00:00
Chris Lattner 40f560d433 remove dead code, the main codepath never has to deal
with MBB's.

llvm-svn: 73830
2009-06-20 19:34:47 +00:00
Chris Lattner 9c2119616f eliminate the "call" operand modifier from the asm descriptions, modeling
it as a pcrel immediate instead.  This gets pc-rel weirdness out of the
main printoperand codepath.

llvm-svn: 73829
2009-06-20 19:34:09 +00:00
Chris Lattner b4b5c10477 fix edit-o
llvm-svn: 73824
2009-06-20 08:13:12 +00:00
Chris Lattner 9fc4db5615 some comments and cleanup
llvm-svn: 73818
2009-06-20 07:59:10 +00:00
Chris Lattner a0022a772b implement support for lowering subregs when preparing to print
LEA64_32r, eliminating a bunch of modifier logic stuff on addr modes.

Implement support for printing mbb labels as operands.

llvm-svn: 73817
2009-06-20 07:03:18 +00:00
Devang Patel 79ef65a271 Remove unused field.
llvm-svn: 73815
2009-06-20 01:07:54 +00:00
Devang Patel 1b61c2a1ce Initialize MMI
llvm-svn: 73813
2009-06-20 01:00:07 +00:00
Chris Lattner 1f8d968687 hook up printMemReference.
llvm-svn: 73811
2009-06-20 00:50:32 +00:00
Chris Lattner 4682015e61 Start implementing translation of MachineInstr to MCInst. Next
step is to make tblgen generate something more appropriate for MCInst,
and generate calls to operand translation routines where needed.
This includes a bunch of #if 0 code which will slowly be refactored into
something sensible.

llvm-svn: 73810
2009-06-20 00:49:26 +00:00
Chris Lattner 8d284c7683 stub out some hacky code for wiring up the new asmprinter interfaces
on X86.  Not useful yet.

llvm-svn: 73799
2009-06-19 23:59:57 +00:00
Devang Patel 88be5cf01f DwarfWriter is used to emit EH info also.
llvm-svn: 73792
2009-06-19 23:21:20 +00:00
Evan Cheng b4b20bbb7d Enable arm pre-allocation load / store multiple optimization pass.
llvm-svn: 73791
2009-06-19 23:17:27 +00:00
Devang Patel da10358c84 mv CodeGen/DebugLoc.h Support/DebugLoc.h
llvm-svn: 73786
2009-06-19 22:08:58 +00:00
Devang Patel 33f4eb462f Move up dwarf writer initialization in common AsmPrinter class.
llvm-svn: 73784
2009-06-19 21:54:26 +00:00
Anton Korobeynikov 2028e25325 Unbreak cyclic deps
llvm-svn: 73781
2009-06-19 19:36:55 +00:00
Chris Lattner 3773afe931 fix the sparc codegen to not depend on the sparc asmprinter.
llvm-svn: 73767
2009-06-19 15:48:10 +00:00
Evan Cheng d305869ca2 Add comments.
llvm-svn: 73761
2009-06-19 07:06:07 +00:00
Eli Friedman 2fc939c809 Fix for PR2484: add an SSE1 pattern for a shuffle we normally prefer to
handle with an SSE2 instruction.

llvm-svn: 73760
2009-06-19 07:00:55 +00:00
Evan Cheng 1592035e67 Should be using Bcc (average) latency to determine if-conversion threshold, not BL.
llvm-svn: 73759
2009-06-19 06:56:26 +00:00
Eli Friedman 707cbc4126 Misc tweaks to Intel asm printing to make it more compatible with MASM.
Patch by Benedict Gaster.

llvm-svn: 73753
2009-06-19 04:48:38 +00:00
Evan Cheng 5d8df7ff34 Transfer dead markers when a ldrd is changed into a ldm or a pair of ldr.
llvm-svn: 73749
2009-06-19 01:59:04 +00:00
Evan Cheng 4e712de541 Latency information for ARM v6. It's rough and not yet hooked up. Right now we are only using branch latency to determine if-conversion limits.
llvm-svn: 73747
2009-06-19 01:51:50 +00:00
Eli Friedman d984158320 Mark a few Thumb instructions commutable; just happened to spot this
while experimenting.  I'm reasonably sure this is correct, but please 
tell me if these instructions have some strange property which makes this
change unsafe.

llvm-svn: 73746
2009-06-19 01:43:08 +00:00
Chris Lattner a08186aabc add a file I missed, this goes with r73743
llvm-svn: 73744
2009-06-19 00:47:59 +00:00
Chris Lattner 3235c38dbb Add some scaffolding for a new experimental asmprinter
implementation.  The idea is that we want asmprinting to
work by converting MachineInstrs into a new MCInst class,
then the per-instruction asmprinter works on MCInst.  MCInst
and the new asmprinters will not depend on most of the 
llvm code generators.  This allows building diassemblers
that don't link in the whole llvm code generator.  This is
step #1 of many.

llvm-svn: 73743
2009-06-19 00:47:33 +00:00
Chris Lattner 8284b66264 merge the common darwin settings from the X86/PPC/ARM targets
into DarwinTargetAsmInfo.cpp.  The remaining differences should
be evaluated.  It seems strange that x86/arm has .zerofill but ppc
doesn't, etc.

llvm-svn: 73742
2009-06-19 00:08:39 +00:00
Chris Lattner b84764516d move mangler quote handling from asm printers to TargetAsmInfo.
llvm-svn: 73738
2009-06-18 23:41:35 +00:00
Chris Lattner 4df8e5c800 minor cleanup
llvm-svn: 73737
2009-06-18 23:33:13 +00:00
Chris Lattner 09081b25a5 simplify macro debug info directive handling.
llvm-svn: 73736
2009-06-18 23:31:37 +00:00
Evan Cheng a0ca298f8a Remove UseThumbBacktraces. Just check if subtarget is darwin.
llvm-svn: 73734
2009-06-18 23:14:30 +00:00
Evan Cheng de9e36a74e On Darwin, ams printer should output a second label before a jump table so the linker knows it's a new atom. But this is only needed if the jump table is put in a separate section from the function body.
llvm-svn: 73720
2009-06-18 20:37:15 +00:00
Evan Cheng 0e79603588 - Update register allocation hint after coalescing. This is done by the target since the hint is target dependent. This is important for ARM register pair hints.
- Register allocator should resolve the second part of the hint (register number) before passing it to the target since it knows virtual register to physical register mapping.
- More fixes to get ARM load / store double word working.

llvm-svn: 73671
2009-06-18 02:04:01 +00:00
Dale Johannesen 9d9acb065a It looks like nobody is working on PR 4158, so I'm
adding a check to catch this case at compile time
instead of quietly generating incorrect code.
That will at least let us identify CBE failures
that are not due to this problem.

llvm-svn: 73668
2009-06-18 01:07:23 +00:00
Bob Wilson 86c12d7bc4 ARM unified syntax is not specific to ELF; use it for Darwin, too.
llvm-svn: 73665
2009-06-18 00:36:17 +00:00
Anton Korobeynikov 5658086052 Fix asm string from MOVi16
llvm-svn: 73661
2009-06-17 23:43:36 +00:00
Anton Korobeynikov f687a828b2 Thumb2 instructions are enabled only in unified assembler mode.
Emit switch directive for it. I have no idea whether this is
requirement for Darwin or not.

llvm-svn: 73660
2009-06-17 23:43:18 +00:00
Anton Korobeynikov 02bb33c58d Initial support for some Thumb2 instructions.
Patch by Viktor Kutuzov and Anton Korzh from Access Softek, Inc.

llvm-svn: 73622
2009-06-17 18:13:58 +00:00
Devang Patel 722848dc01 Do not use first actual instruction's location for prologue. The debug wants to skip prologue while setting a breakpoint for the function.
llvm-svn: 73592
2009-06-17 00:48:26 +00:00
Chris Lattner ca52e86346 fix a circular dependency between the mips code generator
and its asmprinter.

llvm-svn: 73573
2009-06-16 22:38:04 +00:00
Douglas Gregor 1b731d5dbe Introduce new headers whose inclusion forces linking and
initialization of all targets (InitializeAllTargets.h) or assembler
printers (InitializeAllAsmPrinters.h). This is a step toward the
elimination of relinked object files, so that we can build normal
archives.

llvm-svn: 73543
2009-06-16 20:12:29 +00:00
Evan Cheng 0d9730f39f CALL64pcrel32 immediate field is 32-bit. Patch by Abhinav Duggal.
llvm-svn: 73536
2009-06-16 19:44:27 +00:00
Anton Korobeynikov a8fd40b50a Address review comments: add 3 ARM calling conventions.
Dispatch C calling conv. to one of these conventions based on
target triple and subtarget features.

llvm-svn: 73530
2009-06-16 18:50:49 +00:00
Anton Korobeynikov 5d28cb204f GNU as refuses to assemble "pop {}" instruction. Do not emit such
(this is the case when we have thumb vararg function with single
callee-saved register, which is handled separately).

llvm-svn: 73529
2009-06-16 18:49:08 +00:00
Sanjiv Gupta 05a7dba3bd Added missing libcalls for floating point to int conversions.
llvm-svn: 73491
2009-06-16 16:17:35 +00:00
Sanjiv Gupta 5372d4a568 Code Restructuring. No functionality change.
llvm-svn: 73481
2009-06-16 09:45:18 +00:00
Eli Friedman 48021d15d6 Misc accumulated tweaks to legalization logic for various targets.
llvm-svn: 73476
2009-06-16 06:40:59 +00:00
Chris Lattner 0101f45785 another xform that is target-independent (should be done in instcombine).
llvm-svn: 73472
2009-06-16 06:15:56 +00:00
Chris Lattner aba55a69b1 I think instcombine should unconditionally do this xform.
llvm-svn: 73471
2009-06-16 06:11:35 +00:00
Bill Wendling 92b17b550e There doesn't seem to be a reason to move the save FP stuff.
llvm-svn: 73468
2009-06-16 04:12:45 +00:00
Bill Wendling f6c6a7f1b7 The DWARF to compact encoding converter assumes that the DW_CFA_def_cfa_offset
comes after the DW_CFA_def_cfa_register, because the CFA is really ESP from the
start of the function and only gets an offset when the "subl $xxx,%esp"
instruction happens, not the other way around.

And reapply r72898:

The DWARF unwind info was incorrect. While compiling with
`-fomit-frame-pointer', we would lack the DW_CFA_advance_loc information for a
lot of function, and then they would be `0'. The linker (at least on Darwin)
needs to encode the stack size. In some cases, the stack size is too large to
directly encode. So the linker checks to see if there is a "subl $xxx,%esp"
instruction at the point where the `DW_CFA_def_cfa_offset' says the pc was. If
so, the compact encoding records the offset in the function to where the stack
size is embedded. But because the `DW_CFA_advance_loc' instructions are missing,
it looks before the function and dies.

So, instead of emitting the EH debug label before the stack adjustment
operations, emit it afterwards, right before the frame move stuff.

llvm-svn: 73465
2009-06-16 04:06:15 +00:00
Evan Cheng f691b829ab On Darwin, frame pointer r7 is never available.
llvm-svn: 73434
2009-06-15 22:32:01 +00:00
Anton Korobeynikov 409105fc95 Rename methods for the sake of consistency.
llvm-svn: 73428
2009-06-15 21:46:20 +00:00
Evan Cheng ad0dba582f Typo.
llvm-svn: 73422
2009-06-15 21:18:20 +00:00
Bill Wendling 2dadb42dd0 The Ls and Qs were mixed up. Patch by Sean.
llvm-svn: 73417
2009-06-15 20:59:31 +00:00
Evan Cheng eba57e41b3 Do not form ldrd / strd if the two dests / srcs are the same. Code clean up.
llvm-svn: 73413
2009-06-15 20:54:56 +00:00
Bill Wendling e790614fa5 "The Intel instruction tables should include the 64-bit and 32-bit instructions
that push immediate operands of 1, 2, and 4 bytes (extended to the native
register size in each case).  The assembly mnemonics are "pushl" and "pushq."
One such instruction appears at the beginning of the "start" function , so this
is essential for accurate disassembly when unwinding."

Patch by Sean Callanan!

llvm-svn: 73407
2009-06-15 19:39:04 +00:00
Evan Cheng 1cf0f193b0 Silence a warning.
llvm-svn: 73406
2009-06-15 19:36:32 +00:00
Evan Cheng 1283c6a066 Part 1.
- Change register allocation hint to a pair of unsigned integers. The hint type is zero (which means prefer the register specified as second part of the pair) or entirely target dependent.
- Allow targets to specify alternative register allocation orders based on allocation hint.

Part 2.
- Use the register allocation hint system to implement more aggressive load / store multiple formation.
- Aggressively form LDRD / STRD. These are formed *before* register allocation. It has to be done this way to shorten live interval of base and offset registers. e.g.
v1025 = LDR v1024, 0
v1026 = LDR v1024, 0
=>
v1025,v1026 = LDRD v1024, 0

If this transformation isn't done before allocation, v1024 will overlap v1025 which means it more difficult to allocate a register pair.

- Even with the register allocation hint, it may not be possible to get the desired allocation. In that case, the post-allocation load / store multiple pass must fix the ldrd / strd instructions. They can either become ldm / stm instructions or back to a pair of ldr / str instructions.

This is work in progress, not yet enabled.

llvm-svn: 73381
2009-06-15 08:28:29 +00:00
Chris Lattner 8565c4bed4 remove extraneous const qualifier
llvm-svn: 73373
2009-06-15 04:42:32 +00:00
Chris Lattner c68a564cdd I got J and K backward, many thanks to Eli for spotting this!
llvm-svn: 73372
2009-06-15 04:39:05 +00:00
Chris Lattner ea3621a6b1 implement support for the 'K' asm constraint, PR4347
llvm-svn: 73366
2009-06-15 04:01:39 +00:00
Dan Gohman 4fe64deb7b Fix old-style type names in comments.
llvm-svn: 73362
2009-06-14 23:30:43 +00:00
Bruno Cardoso Lopes 2f55027012 Introduce new BinaryObject (blob) class, ELF Writer modified to use it. BinaryObject.h by Aaron Gray
llvm-svn: 73333
2009-06-14 07:53:21 +00:00
Sanjiv Gupta c16c947071 The subprogram descriptor for a function may be missing (llvm-ld linking two static functions with same name), so pick up the compilation unit for the function from the first valid debug loc of its instructions.
This patch also emits debug info for structure (aggregate types in 
general) types.

llvm-svn: 73295
2009-06-13 17:35:54 +00:00
Evan Cheng 185c9ef0a2 Add a ARM specific pre-allocation pass that re-schedule loads / stores from
consecutive addresses togther. This makes it easier for the post-allocation pass
to form ldm / stm.

This is step 1. We are still missing a lot of ldm / stm opportunities because
of register allocation are not done in the desired order. More enhancements
coming.

llvm-svn: 73291
2009-06-13 09:12:55 +00:00
Evan Cheng d93b5b672f Mark some pattern-less instructions as neverHasSideEffects.
llvm-svn: 73252
2009-06-12 20:46:18 +00:00
Arnold Schwaighofer e3a018d707 Fix Bug 4278: X86-64 with -tailcallopt calling convention
out of sync with regular cc.

The only difference between the tail call cc and the normal
cc was that one parameter register - R9 - was reserved for
calling functions through a function pointer. After time the
tail call cc has gotten out of sync with the regular cc. 

We can use R11 which is also caller saved but not used as
parameter register for potential function pointers and
remove the special tail call cc on x86-64.

llvm-svn: 73233
2009-06-12 16:26:57 +00:00
Eli Friedman 32ad5e9c08 Misc x86 README updates: remove a couple of already-fixed issues,
add a few suggestions from looking at some assembly code.

llvm-svn: 73210
2009-06-11 23:07:04 +00:00
Bruno Cardoso Lopes 66189503ef Use forward declarations and move TargetELFWriterInfo impl to a new file.
llvm-svn: 73209
2009-06-11 22:13:00 +00:00
Bruno Cardoso Lopes 1656366e4d Support for ELF Visibility
Emission for globals, using the correct data sections
Function alignment can be computed for each target using TargetELFWriterInfo
Some small fixes

llvm-svn: 73201
2009-06-11 19:16:03 +00:00
Sanjiv Gupta 5dce37298f Generate libcalls for floating point arithmetic and casting operations.
llvm-svn: 73194
2009-06-11 16:50:48 +00:00
Sanjiv Gupta c8df02487e More formatting.
llvm-svn: 73185
2009-06-11 06:55:48 +00:00
Sanjiv Gupta 8f03663a09 Fixed source comments. No functionality change.
llvm-svn: 73184
2009-06-11 06:49:55 +00:00
Anton Korobeynikov 06039d1190 Silence a warning
llvm-svn: 73152
2009-06-09 23:00:39 +00:00
Bill Wendling 0422f4ca0c Simplified logic of this if-then statement to reduce nesting. No functionality
change.

llvm-svn: 73143
2009-06-09 20:08:51 +00:00
Sanjiv Gupta 7607eba036 PIC16 emits auto variables as globals. When optimizer removes a function entierly by estimating its side effects on globals, those globals(autos) without a function were not being printed by the Asm printer.
llvm-svn: 73135
2009-06-09 15:31:19 +00:00
Anton Korobeynikov 5b1b5b2a8a Typo
llvm-svn: 73098
2009-06-08 22:59:50 +00:00
Anton Korobeynikov 3708883bfe Revert hunk commited by accident
llvm-svn: 73097
2009-06-08 22:57:18 +00:00
Anton Korobeynikov 77d1943637 The attached patches implement most of the ARM AAPCS-VFP hard float
ABI. The missing piece is support for putting "homogeneous aggregates"
into registers.

Patch by Sandeep Patel!

llvm-svn: 73095
2009-06-08 22:53:56 +00:00
Anton Korobeynikov c82b282b34 Separate V6 from V6T2 since the latter has some extra nice instructions
llvm-svn: 73085
2009-06-08 21:20:36 +00:00
Anton Korobeynikov cd41a9019e Add helper for checking of Thumb1 mode
llvm-svn: 73080
2009-06-08 20:31:02 +00:00
Bill Wendling d9173b83db Revert r72898. It does not solve the problem I want it to solve.
llvm-svn: 73075
2009-06-08 18:18:28 +00:00
Eli Friedman 0d4234416f Get rid of some unnecessary code.
llvm-svn: 73017
2009-06-07 07:28:45 +00:00
Eli Friedman 3234587213 Slightly generalize the code that handles shuffles of consecutive loads
on x86 to handle more cases.  Fix a bug in said code that would cause it 
to read past the end of an object.  Rewrite the code in 
SelectionDAGLegalize::ExpandBUILD_VECTOR to be a bit more general. 
Remove PerformBuildVectorCombine, which is no longer necessary with 
these changes.  In addition to simplifying the code, with this change, 
we can now catch a few more cases of consecutive loads.

llvm-svn: 73012
2009-06-07 06:52:44 +00:00
Eli Friedman be1bb0f8b1 PR3628: Add patterns to match SHL/SRL/SRA to the corresponding Altivec
instructions.

llvm-svn: 73009
2009-06-07 01:07:55 +00:00
Eli Friedman 75c496f920 Avoid crashing on a variable-index insertelement with element type i16.
llvm-svn: 72991
2009-06-06 06:32:50 +00:00
Eli Friedman 1b1844ad1f Get rid of some bogus patterns for X86vzmovl. Don't create VZEXT_MOVL
nodes for vectors with an i16 element type.  Add an optimization for 
building a vector which is all zeros/undef except for the bottom 
element, where the bottom element is an i8 or i16.

llvm-svn: 72988
2009-06-06 06:05:10 +00:00
Eli Friedman 868bd6ab52 Fix an obvious typo.
llvm-svn: 72987
2009-06-06 05:55:37 +00:00
Bruno Cardoso Lopes 7531e92333 x86_64 now uses the correct ELF e_machine type
llvm-svn: 72986
2009-06-06 04:29:16 +00:00
Eli Friedman 6c101ebfa8 Get rid of a bogus pattern that interferes with optimization.
llvm-svn: 72985
2009-06-06 04:17:04 +00:00
Eli Friedman b45e8ce69a PR2598: make sure to expand illegal forms of integer/floating-point
conversions for x86, like <2 x i32> -> <2 x float> and <4 x i16> -> 
<4 x float>.

llvm-svn: 72983
2009-06-06 03:57:58 +00:00
Dan Gohman d185a7a629 Add explicit keywords.
llvm-svn: 72969
2009-06-05 23:05:51 +00:00
Devang Patel d1c7d34924 Add new function attribute - noimplicitfloat
Update code generator to use this attribute and remove NoImplicitFloat target option.
Update llc to set this attribute when -no-implicit-float command line option is used.

llvm-svn: 72959
2009-06-05 21:57:13 +00:00
Nate Begeman 624690c6b2 Adapt the x86 build_vector dagcombine to the current state of the legalizer.
build vectors with i64 elements will only appear on 32b x86 before legalize.
Since vector widening occurs during legalize, and produces i64 build_vector 
elements, the dag combiner is never run on these before legalize splits them
into 32b elements.

Teach the build_vector dag combine in x86 back end to recognize consecutive 
loads producing the low part of the vector.

Convert the two uses of TLI's consecutive load recognizer to pass LoadSDNodes
since that was required implicitly.

Add a testcase for the transform.

Old:
	subl	$28, %esp
	movl	32(%esp), %eax
	movl	4(%eax), %ecx
	movl	%ecx, 4(%esp)
	movl	(%eax), %eax
	movl	%eax, (%esp)
	movaps	(%esp), %xmm0
	pmovzxwd	%xmm0, %xmm0
	movl	36(%esp), %eax
	movaps	%xmm0, (%eax)
	addl	$28, %esp
	ret

New:
	movl	4(%esp), %eax
	pmovzxwd	(%eax), %xmm0
	movl	8(%esp), %eax
	movaps	%xmm0, (%eax)
	ret

llvm-svn: 72957
2009-06-05 21:37:30 +00:00
Evan Cheng 3158790e32 Changing allocation ordering from r3 ... r0 back to r0 ... r3. The order change no longer make sense after the coalescing changes we have made since then.
llvm-svn: 72955
2009-06-05 19:08:58 +00:00
Devang Patel 54707b420a Evan thinks NoImplicitFloat check is not required here.
llvm-svn: 72954
2009-06-05 18:48:29 +00:00
Evan Cheng 7fce2cf0ba When merging multiple load / store instructions. Use the DebugLoc of the first one.
llvm-svn: 72952
2009-06-05 18:19:23 +00:00
Evan Cheng c154c1185c Code clean up: return vector by reference rather than by value. No functionality changes.
llvm-svn: 72950
2009-06-05 17:56:14 +00:00
Dan Gohman d9ef48a73e Remove some unnecessary #includes.
llvm-svn: 72948
2009-06-05 16:32:58 +00:00
Sanjiv Gupta b794c12c7e Lower i16/i32 sdiv/udiv/srem/urem using libcalls.
llvm-svn: 72942
2009-06-05 14:43:12 +00:00