Commit Graph

12141 Commits

Author SHA1 Message Date
David Goodwin
ce3c1f2a0e Disable NEON single-precision FP support for Cortex-A8, for now...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78209 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 16:40:57 +00:00
Devang Patel
bccdcb1857 Remove dead code. MDNode and MDString are not Constant anymore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78207 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 16:40:02 +00:00
Anton Korobeynikov
93e21f7b6f Add memory versions of some instructions.
Patch by Neale Ferguson!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78203 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 16:16:11 +00:00
David Goodwin
1f0e404c87 By default, for cortex-a8 use NEON for single-precision FP.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78200 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 16:01:19 +00:00
Anton Korobeynikov
1e0039d6cf Special constants as destinations does not work as expected - drop the patterns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78191 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 14:42:00 +00:00
Andrew Lenharth
1ad11a896c Alpha: Get section directives right
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78189 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 13:59:57 +00:00
Anton Korobeynikov
0802a1e1e8 Cleanup in dbg_stoppoint handling in CBE. Patch by Sandeep Patel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78182 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 09:31:40 +00:00
Anton Korobeynikov
e392c8336f Minor arm CBE fixes. Patch by Sandeep.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78181 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 09:31:07 +00:00
Anton Korobeynikov
e641b527e8 Emit module-level inline asm for CBE.
Patch by Sandeep Patel

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78180 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 09:29:56 +00:00
Bruno Cardoso Lopes
52d0851446 - Remove custom handling of jumptables by the elf writter (this was
a dirty hack and isn't need anymore since the last x86 code emitter patch)
- Add a target-dependent modifier to addend calculation
- Use R_X86_64_32S relocation for X86::reloc_absolute_word_sext
- Use getELFSectionFlags whenever possible
- fix getTextSection to use TLOF and emit the right text section 
- Handle global emission for static ctors, dtors and Type::PointerTyID
- Some minor fixes



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78176 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 06:57:03 +00:00
Evan Cheng
61f4b721b2 80 col violations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78175 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 06:41:25 +00:00
Dan Gohman
c3c9c486e4 Teach X86FastISel how to handle CCValAssign::BCvt, which is used for
MMX arguments. This fixes PR4684.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78163 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 05:33:42 +00:00
Chris Lattner
26d054d903 Clarify common linkage and the requirements on it. Enforce
them in the verifier.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78160 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 05:21:07 +00:00
Chris Lattner
58bed8fc29 expose SectionKindForGlobal to curious clients, named as
getKindForGlobal.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78156 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 04:25:40 +00:00
Bob Wilson
aa289d5e7f Oops. I didn't mean to commit this piece yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78146 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 02:47:13 +00:00
Dan Gohman
98ca4f2a32 Major calling convention code refactoring.
Instead of awkwardly encoding calling-convention information with ISD::CALL,
ISD::FORMAL_ARGUMENTS, ISD::RET, and ISD::ARG_FLAGS nodes, TargetLowering
provides three virtual functions for targets to override:
LowerFormalArguments, LowerCall, and LowerRet, which replace the custom
lowering done on the special nodes. They provide the same information, but
in a more immediately usable format.

This also reworks much of the target-independent tail call logic. The
decision of whether or not to perform a tail call is now cleanly split
between target-independent portions, and the target dependent portion
in IsEligibleForTailCallOptimization.

This also synchronizes all in-tree targets, to help enable future
refactoring and feature work.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78142 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 01:29:28 +00:00
Dan Gohman
5b0d72e850 Remove an unnecessary flush in the CppBackend's output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78138 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 01:06:38 +00:00
Dan Gohman
1c55fab534 Don't flush the raw_ostream between each MachineFunction. These flush
calls were originally put in place because errs() at one time was
not unbuffered, and these print routines are commonly used with errs()
for debugging. However, errs() is now properly unbuffered, so the
flush calls are no longer needed. This significantly reduces the
number of write(2) calls for regular asm printing when there are many
small functions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78137 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 00:49:25 +00:00
Bob Wilson
4a3d35abef Change DAG nodes for Neon VLD2/3/4 operations to return multiple results.
Get rid of yesterday's code to fix the register usage during isel.
Select the new DAG nodes to machine instructions.  The new pre-alloc pass
to choose adjacent registers for these results is not done, so the
results of this will generally not assemble yet.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78136 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 00:49:09 +00:00
Bruno Cardoso Lopes
e55fef36a9 1) Proper emit displacements for x86, using absolute relocations where necessary
for ELF to work.  
2) RIP addressing: Use SIB bytes for absolute relocations where RegBase=0, 
IndexReg=0.
3) The JIT can get the real address of cstpools and jmptables during
code emission, fix that for object code emission


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78129 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 00:11:21 +00:00
Evan Cheng
35d6c41fde Fix part 1 of pr4682. PICADD is a 16-bit instruction even in thumb2 mode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78126 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-04 23:47:55 +00:00
Bob Wilson
c00479253b Replace dregsingle operand modifier with explicit escaped curly brackets.
For other VLDn and VSTn operations, we need to list the multiple registers
explicitly anyway, so there's no point in special-casing this one usage.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78109 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-04 21:39:33 +00:00
Mike Stump
4dcff6db72 Restlyize to match other targets, fixes cmake build to boot.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78105 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-04 21:27:06 +00:00
Evan Cheng
9e7a312391 Enable load / store multiple pass for Thumb2. It's not using ldrd / strd yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78104 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-04 21:12:13 +00:00
Chris Lattner
275bb1bd12 remove a random reference to subtarget. Even without this, we
still get "intel syntax" instructions from llc with  
-x86-asm-syntax=intel




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78103 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-04 21:12:08 +00:00
David Goodwin
53e4471adc Add NEON single-precision FP support for fabs and fneg.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78101 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-04 20:39:05 +00:00
Chris Lattner
f9c1ccf280 rip out SectionEndDirectiveSuffix support, only uses by
the masm backend.  If anyone cares about masm in the future,
we'll have semantic sections it can hang off of.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78096 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-04 20:09:41 +00:00
Jakob Stoklund Olesen
71d342e854 Most flags are reserved registers on Blackfin.
The only exception is CC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78089 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-04 19:16:55 +00:00
Evan Cheng
3425df44b5 In thumb mode, r7 is used as frame register. This fixes pr4681.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78086 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-04 18:46:17 +00:00
David Goodwin
b84f3d427c Match common pattern for FNMAC. Add NEON SP support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78085 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-04 18:44:29 +00:00
Sanjiv Gupta
ada097a853 Legalize i64 store operations generated by inst-combine.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78082 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-04 17:59:16 +00:00
David Goodwin
42a83f2d15 Initial support for single-precision FP using NEON. Added "neonfp" attribute to enable. Added patterns for some binary FP operations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78081 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-04 17:53:06 +00:00
Daniel Dunbar
7145e9be64 Avoid compiler warning (in -Asserts mode)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78070 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-04 16:46:12 +00:00
Chris Lattner
ec409759e9 enhance codegen to put 16-bit character strings into the
__TEXT,__ustring section on darwin.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78068 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-04 16:27:13 +00:00
Chris Lattner
7e88a50428 fix a fixme: don't create an explicit "CStringSection" for ELF,
it is just being used as a prefix, so forward substitute it directly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78067 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-04 16:19:50 +00:00
Chris Lattner
1850e5add1 Add support emiting for 2/4 byte mergable strings to the ".rodata.str*"
section on ELF targets.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78066 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-04 16:13:09 +00:00
Anton Korobeynikov
939ba32747 Ooops, I was too fast to commit the wrong fix :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78060 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-04 11:18:31 +00:00
Anton Korobeynikov
20e037a8c5 Fix a typo - this unbreaks llvm-gcc build on arm
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78059 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-04 11:12:51 +00:00
Evan Cheng
eb084d1671 Thumb2 does not have ib (increment before) and da (decrement after) forms of ldm / stm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78057 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-04 08:34:18 +00:00
Chris Lattner
3b24c01720 make MergeableCString be a SectionKind "abstract class", and
add new concrete versions for 1/2/4-byte mergable strings.

These are not actually created yet.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78055 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-04 05:35:56 +00:00
Daniel Dunbar
4b3d57228c No really, it's unused.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78047 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-04 04:08:40 +00:00
Daniel Dunbar
214e22396f Remove now unused Module argument to createTargetMachine.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78043 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-04 04:02:45 +00:00
Evan Cheng
f0409ea488 Remove ARM specific getInlineAsmLength. We'll rely on the simpler (and faster) generic algorithm for now. If more accurate computation is needed, we'll rely on the disassembler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78032 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-04 01:56:09 +00:00
Evan Cheng
27934da97b Load / store multiple pass fixes for Thumb2. Not enabled yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78031 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-04 01:43:45 +00:00
Evan Cheng
fa2ea1a8cf Emit sub r, #c instead of transforming it to add r, #-c if c fits in 8-bit. This is a bit of pre-mature optimization. 8-bit variant makes it likely it will be narrowed to a 16-bit instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78030 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-04 01:41:15 +00:00
Bob Wilson
a599bff101 Lower Neon VLD* intrinsics to custom DAG nodes, and manually allocate the
results to fixed registers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78025 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-04 00:36:16 +00:00
Bob Wilson
916afdbc2d Minor cleanup. No functional changes intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78024 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-04 00:25:01 +00:00
Ted Kremenek
f6e75c3435 Update CMake files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78020 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 23:44:01 +00:00
Chris Lattner
7b59e2493d remove an unneeded section switch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78014 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 23:02:45 +00:00
Chris Lattner
2dfddee396 switch ppc to using SwitchToSection instead of textual section stuff.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78013 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 22:52:21 +00:00
Chris Lattner
5e44e472d6 use TLOF to compute the section for a function instead of
replicating the logic manually.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78011 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 22:32:50 +00:00
Chris Lattner
f61159b574 convert macho stub emission to use SwitchToSection instead of
textual sections.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78007 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 22:18:15 +00:00
Chris Lattner
865aaf00ad hoist some common code out of a switch
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78006 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 22:16:57 +00:00
Chris Lattner
c8bfb7a49d this really shouldn't switch sections without telling the asmprinter, but
hey it uses .previous, so it should work :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78004 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 21:57:00 +00:00
Chris Lattner
11e9657eeb Eliminate textual section switching from the x86 backend, one
more step towards "semantics sections"


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78002 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 21:53:27 +00:00
Bob Wilson
a6d658620f Lower CONCAT_VECTOR during legalization instead of matching it during isel.
Add a testcase.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77992 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 20:36:38 +00:00
Jakob Stoklund Olesen
ea1c9b7bac Minor stylistic cleanups in the Blackfin target.
Thanks Chris.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77987 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 19:32:30 +00:00
Chris Lattner
9a7a4d2a60 remove a dead switch directive, replace it with some
code that I will be using shortly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77983 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 19:10:44 +00:00
Evan Cheng
d2aee8ce89 Remove neverHasSideEffects on MMX_MOVD64rrv164 since it has a matching pattern.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77978 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 18:07:19 +00:00
Chris Lattner
1763766a57 eliminate textual section switching from intel asm printer.
This will cause it to enter the ".text" section instead of "_text"
but masm is already broken.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77977 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 18:06:07 +00:00
Daniel Dunbar
d1a919e139 Change C, CBE, MSIL to not provide target data via getTargetData().
- The theory is these should never actually be called, since these boil down to
   passes which can access the target data via the standard mechanism.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77975 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 17:40:25 +00:00
Benjamin Kramer
d5fe92efbc llvm_report_error already prints "LLVM ERROR:". So stop reporting errors like "LLVM ERROR: llvm: error:" or "LLVM ERROR: ERROR:".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77971 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 13:33:33 +00:00
Anton Korobeynikov
0144280cfb Unbreak win64 compilation callback.
Since we're generating stubs by hands we don't follow the ABI and don't
create a register spill area.
Don't use this area in compilation callback!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77968 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 08:43:36 +00:00
Anton Korobeynikov
dd93f5eb71 Create proper frame index for FP
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77966 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 08:14:30 +00:00
Anton Korobeynikov
6dde14bc25 Perform bitconvert to proper type
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77965 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 08:14:14 +00:00
Anton Korobeynikov
4ab15535e7 Add 'Indirect' LocInfo class and use to pass __m128 on win64. Also minore fixes here and there (mostly __m64).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77964 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 08:13:56 +00:00
Anton Korobeynikov
80cb8aa862 Cleanup Darwin MMX calling conv stuff - make the stuff more generic. This also fixes a subtle bug, when 6th v1i64 argument passed wrongly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77963 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 08:13:24 +00:00
Anton Korobeynikov
cf6b739d3d Unbreak Win64 CC. Step one: honour register save area, fix some alignment and provide a different set of call-clobberred registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77962 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 08:12:53 +00:00
Rafael Espindola
8d632c1e98 Use movd instead of movq
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77956 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 05:21:05 +00:00
Daniel Dunbar
4bd03abe59 Remove now unused arguments from TargetRegistry::lookupTarget.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77950 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 04:20:57 +00:00
Evan Cheng
9072c8198d These are done.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77949 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 04:08:36 +00:00
Daniel Dunbar
3c2d4bf97f Pass target triple string in to TargetMachine constructor.
This is not just a matter of passing in the target triple from the module;
currently backends are making decisions based on the build and host
architecture. The goal is to migrate to making these decisions based off of the
triple (in conjunction with the feature string). Thus most clients pass in the
target triple, or the host triple if that is empty.

This has one important change in the way behavior of the JIT and llc.

For the JIT, it was previously selecting the Target based on the host
(naturally), but it was setting the target machine features based on the triple
from the module. Now it is setting the target machine features based on the
triple of the host.

For LLC, -march was previously only used to select the target, the target
machine features were initialized from the module's triple (which may have been
empty). Now the target triple is taken from the module, or the host's triple is
used if that is empty. Then the triple is adjusted to match -march.

The take away is that -march for llc is now used in conjunction with the host
triple to initialize the subtarget. If users want more deterministic behavior
from llc, they should use -mtriple, or set the triple in the input module.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77946 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 04:03:51 +00:00
Rafael Espindola
0c794b8725 Fix the instruction encoding.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77944 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 03:27:05 +00:00
Rafael Espindola
cc2b67af91 Remove a bitcast that was a no-op.
Thanks to Eli Friedman for noticing it.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77942 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 03:00:05 +00:00
Rafael Espindola
def390a30a Use movq to move 64 bits in and out of mmx registers.
Fixes PR4669



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77940 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 02:45:34 +00:00
Evan Cheng
a8e8984ee4 Use the i12 variant of load / store opcodes if offset is zero. Now we pass all of multisource as well.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77939 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 02:38:06 +00:00
Eli Friedman
e2c7408199 Remove -disable-mips-abicall and -enable-mips-absolute-call command-line
options, which don't appear to be useful.  -enable-mips-absolute-call is
completely unused (and unless I'm mistaken, is supposed to have the 
same effect that -relocation-model=dynamic-no-pic should have), 
and -disable-mips-abicall appears to be effectively a 
synonym for -relocation-model=static. Adjust the few users of hasABICall
to checks which seem more appropriate.  Update MipsSubtarget, 
MipsTargetMachine, and MipselTargetMachine to synchronize with recent 
changes.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77938 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 02:22:28 +00:00
Bill Wendling
0ea8bf3590 - s/DOUT/DEBUG(errs()/g
- Tidy up some headers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77929 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 00:11:34 +00:00
Daniel Dunbar
e28039cfd1 Move most targets TargetMachine constructor to only taking a target triple.
- The C, C++, MSIL, and Mips backends still need the module.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77927 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 23:37:13 +00:00
Richard Osborne
d558ea5e0a Add extra SEXT pattern.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77920 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 22:45:24 +00:00
Bill Wendling
3bb9b9a1ab The x86 jit doesn't generate a def_cfa_offset unwind instruction after the
pushes in the function prolog if the function doesn't have any stack space,
i.e. for a prolog like:

0x40011870:     push %r15
0x40011872:     push %r14
0x40011874:     push %rbx

Patch by Zoltan!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77919 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 22:25:37 +00:00
Daniel Dunbar
3be03406c9 Normalize Subtarget constructors to take a target triple string instead of
Module*.

Also, dropped uses of TargetMachine where unnecessary. The only target which
still takes a TargetMachine& is Mips, I would appreciate it if someone would
normalize this to match other targets.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77918 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 22:11:08 +00:00
Jakob Stoklund Olesen
1391cc19d0 Remove unneeded intrinsics from Blackfin backend.
__builtin_bfin_ones does the same as ctpop, so it can be implemented in the front-end.

__builtin_bfin_loadbytes loads from an unaligned pointer with the disalignexcpt instruction. It does the same as loading from a pointer with the low bits masked. It is better if the front-end creates a masked load. We can always instruction select the masked to disalignexcpt+load.

We keep csync/ssync/idle. These intrinsics represent instructions that need workarounds for some silicon revisions. We may even want to convert inline assembler to intrinsics to enable the workarounds.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77917 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 21:49:05 +00:00
Jakob Stoklund Olesen
6b30f5c867 Add some basic blackfin intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77903 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 18:28:11 +00:00
Jakob Stoklund Olesen
26a84d4f3c Add support for CPU features (i.e., bugs) and workarounds.
This is just the framework to identify the needed workarounds. They are not actually implemented.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77902 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 18:27:36 +00:00
Jakob Stoklund Olesen
63cc527fbc Inline assembly support for Blackfin.
We use the same constraints as GCC, including those that are slightly insane for inline assembler.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77899 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 17:39:17 +00:00
Jakob Stoklund Olesen
d950941e13 Analog Devices Blackfin back-end.
Generate code for the Blackfin family of DSPs from Analog Devices:

  http://www.analog.com/en/embedded-processing-dsp/blackfin/processors/index.html
  
We aim to be compatible with the exsisting GNU toolchain found at:

  http://blackfin.uclinux.org/gf/project/toolchain
  
The back-end is experimental.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77897 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 17:32:10 +00:00
Dan Gohman
7267734c39 Fix indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77895 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 16:10:52 +00:00
Dan Gohman
cadb226a3f Add a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77894 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 16:10:01 +00:00
Dan Gohman
a98634ba14 Resync lea32addr and lea64addr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77893 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 16:09:17 +00:00
Chris Lattner
18a4c16726 move dwarf debug info section selection stuff from TAI to
TLOF, unifying all the dwarf targets at the same time.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77889 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 07:24:22 +00:00
Chris Lattner
35039ac241 convert EHFrameSection to be managed by TLOF instead of TAI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77888 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 06:52:36 +00:00
Chris Lattner
21e1e81aa6 I need Triple information, 10.6 shouldn't set this, it bloats
object files.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77887 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 06:51:58 +00:00
Chris Lattner
24def37c85 ARM TAI no longer needs a TM, but createTargetAsmInfo() still does.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77878 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 05:23:52 +00:00
Chris Lattner
d90183d25d Move the getInlineAsmLength virtual method from TAI to TII, where
the only real caller (GetFunctionSizeInBytes) uses it.

The custom ARM implementation of this is basically reimplementing
an assembler poorly for negligible gain.  It should be removed 
IMNSHO, but I'll leave that to ARMish folks to decide.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77877 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 05:20:37 +00:00
Chris Lattner
b6bbfebdc6 move a virtual method body to its .cpp file to avoid a #include
in a header.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77874 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 04:58:19 +00:00
Chris Lattner
7bbd178d4b turn some templated inline functions into static functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77873 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 04:52:00 +00:00
Chris Lattner
f67de7a69e alpha TAI doesn't need TM.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77872 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 04:46:05 +00:00
Chris Lattner
68f2b2cdd5 MSP430 TAI doesn't need TM.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77871 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 04:45:22 +00:00
Chris Lattner
09e820b07c simplify SPULinuxTargetAsmInfo, remove use of TM.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77869 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 04:44:33 +00:00
Chris Lattner
71a56d75b4 xcore TAI doesn't need TM.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77868 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 04:42:09 +00:00
Chris Lattner
3878bff390 PIC16 TAI doesn't need TM
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77867 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 04:41:14 +00:00
Chris Lattner
9ba8c6872d remove the dead ELFTargetAsmInfo.h/cpp file. TargetAsmInfo
defaults to being ELF.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77866 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 04:33:09 +00:00
Chris Lattner
e6483e3097 eliminate the TM argument to the TAI class, remove comment about supporting
solaris :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77865 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 04:32:07 +00:00
Chris Lattner
ba8e7401fb eliminate TargetMAchine argument to sparc TAI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77864 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 04:30:59 +00:00
Chris Lattner
8d4a0a328a remove TargetAsmInfo::TM, which is now dead. The basic TAI class now
no longer depends on TM!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77863 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 04:27:24 +00:00
Chris Lattner
83f08a2efd remove the x86/ppc impls of getEHGlobalPrefix, which is already dead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77861 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 04:13:22 +00:00
Chris Lattner
5e62147e07 clean up #includes of TargetAsmInfo.cpp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77858 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 04:09:22 +00:00
Chris Lattner
b6d667403f remove the dead PreferredEHDataFormat TAI hook: its now dead
even considering #if 0 code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77856 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 04:02:52 +00:00
Chris Lattner
d5bbb07ec8 move getDwarfExceptionSection from TAI to TLOF and rename it to
getLSDASection() to be more specific.  This makes it pretty obvious
that the ELF LSDA section is being specified wrong in PIC mode.  We're
probably getting a lot of startup-time relocations to a readonly page,
which is expensive and bad.

Someone who cares about ELF C++ should investigate this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77847 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 01:34:32 +00:00
Daniel Dunbar
967ce7f5e1 Fix a possible crash on delete of an uninitialized variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77846 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 01:25:15 +00:00
Dan Gohman
18f54c07e1 Don't call SectionForGlobal for hasAvailableExternallyLinkage()
variables either.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77844 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 01:18:44 +00:00
Chris Lattner
6f411dfad9 don't call SectionForGlobal on declarations, you can't tell the section a
declaration will end up in.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77843 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 01:02:43 +00:00
Chris Lattner
80ec2792b2 convert ctors/dtors section to be in TLOF instead of
TAI.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77842 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 00:34:36 +00:00
Chris Lattner
73e789fd37 don't override the default of this, the only difference is \t instead of ' '.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77838 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 00:12:20 +00:00
Daniel Dunbar
cdcb388a58 Change MCOperand to use Create style instead of Make style for constructing
operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77837 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 00:09:22 +00:00
Chris Lattner
1ef9be2883 Make SectionKind::get() private.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77835 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 00:02:44 +00:00
Chris Lattner
2798119ab4 (re)introduce new simpler apis for creation sectionkinds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77834 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-01 23:57:16 +00:00
Chris Lattner
83d77faf6e Remove "JumpTableDataSection" from TAI, instead, have AsmPrinter
compute it based on what it knows.  As part of this, rename getSectionForMergeableConstant
to getSectionForConstant because it works for non-mergable constants also.

The only functionality change from this is that Xcore will start dropping
its jump tables into readonly section instead of data section in -static mode.
This should be fine as the linker resolves the relocations.  If this is a
problem, let me know and we'll come up with another solution.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77833 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-01 23:46:12 +00:00
Chris Lattner
0da3f4f742 give alpha its readonly section. This optimizes alpha, and prevents a
testsuite regression with a coming patch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77832 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-01 23:44:04 +00:00
Chris Lattner
528c0d26a5 .rdata == .rodata on mips.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77827 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-01 23:07:29 +00:00
Chris Lattner
566d1c426b no need to override the default with the default.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77826 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-01 23:05:25 +00:00
Chris Lattner
b80610cd13 REmove dead fields of TAI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77820 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-01 22:40:22 +00:00
Chris Lattner
cea01bfe7d update for rename
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77817 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-01 22:06:53 +00:00
Chris Lattner
824583844a fix a fixme by sinking various target-specific directives down into
the appropriate subclasses.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77815 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-01 21:56:13 +00:00
Chris Lattner
94dab1e57a coff also doesn't have a ReadOnlySection yet, (!)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77814 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-01 21:49:24 +00:00
Chris Lattner
56fe93c5d3 coff doesn't set a .bss seciton, so this is dead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77813 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-01 21:48:25 +00:00
Chris Lattner
f9650c061e it turns out that isWeak() was basically dead anyway. Kill off SectionInfo :-/
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77812 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-01 21:46:23 +00:00
Chris Lattner
27602b82c2 don't use isWeak anymore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77810 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-01 21:42:58 +00:00
Dan Gohman
a9c1dd7820 Fix typos in comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77806 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-01 21:25:00 +00:00
Chris Lattner
968ff11967 Change SectionKind to be a property that is true of a *section*, it
should have no state that is specific to particular globals in the
section.  In this case, it means the removal of the "isWeak" and
"ExplicitSection" bits.  MCSection uses the new form of SectionKind.

To handle isWeak, I introduced a new SectionInfo class, which is
SectionKind + isWeak, and it is used by the part of the code generator
that does classification of a specific global.

The ExplicitSection disappears.  It is moved onto MCSection as a new
"IsDirective" bit.  Since the Name of a section is either a section
or directive, it makes sense to keep this bit in MCSection.  Ultimately
the creator of MCSection should canonicalize (e.g.) .text to whatever
the actual section is.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77803 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-01 21:11:14 +00:00
Dan Gohman
7e77b0fcb0 Minor code cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77795 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-01 19:14:37 +00:00
Nick Lewycky
1102afb8c5 Add newline at end of file to remove gcc warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77791 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-01 19:09:44 +00:00
Chris Lattner
4a7bc1e5aa All MCSections are now required to have a SectionKind.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77787 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-01 18:25:49 +00:00
Evan Cheng
25f7cfc3cc Workaround a couple of Darwin assembler bugs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77781 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-01 06:13:52 +00:00
Dan Gohman
7571eb5015 Minor code simplifications.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77768 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-01 03:42:59 +00:00
Evan Cheng
13f8b36205 Split t2MOVCCs since some assemblers do not recognize mov shifted register alias with predicate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77764 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-01 01:43:45 +00:00
Dan Gohman
92aa4045d2 The X86 maximal stack alignment calculator preserves the CFG. Also,
be more careful about the return value of runOnMachineFunction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77758 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-01 00:31:02 +00:00
Dan Gohman
df09055cdb X86 floating-point passes don't modify the CFG.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77757 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-01 00:26:16 +00:00
Evan Cheng
b620724e61 Fix Thumb2 function call isel. Thumb1 and Thumb2 should share the same
instructions for calls since BL and BLX are always 32-bit long and BX is always
16-bit long.

Also, we should be using BLX to call external function stubs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77756 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-01 00:16:10 +00:00
Dan Gohman
675fb65bf4 Use setPreservesAll in X86CodeEmitter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77755 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 23:44:16 +00:00
Daniel Dunbar
c09e411102 llvm-mc: A few more parsing / match tweaks.
- Operands which are just a label should be parsed as immediates, not memory
   operands (from the assembler perspective).

 - Match a few more flavors of immediates.

 - Distinguish match functions for memory operands which don't take a segment
   register.

 - We match the .s for "hello world" now!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77745 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 22:22:54 +00:00
Evan Cheng
a0ee862f2e t2BR_JT is mov pc, it's 2 byte long, not 4.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77744 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 22:22:22 +00:00
Evan Cheng
1119776b19 Thumb2 movcc need .w suffix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77743 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 22:21:55 +00:00
Chris Lattner
7a01e95915 PreferredEHDataFormat is always call with data and global, but this whole
thing is #if0'd out anyway.  Just simplify the code by reducing the interface.
Not deleting this is essential for Bill's continuing happiness.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77736 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 21:39:55 +00:00
Daniel Dunbar
022e2a84a8 llvm-mc/X86: Sketch match functions for immediates and memory operands.
Also, change scale value to always be 1 when unspecified to machine MachineInst
encoding.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77728 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 20:53:16 +00:00
Chris Lattner
26630c1180 move emitUsedDirectiveFor to TargetLoweringObjectFile and rename it to
indicate that it is a predicate, not an emitter.  This eliminates TAI
dependencies on Mangler and GlobalValue.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77726 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 20:52:39 +00:00
Chris Lattner
1db511cc91 remove the PPCLinuxTargetAsmInfo implementation of PreferredEHDataFormat,
because it just calls the default impl.

Remove the PPCDarwinTargetAsmInfo version of PreferredEHDataFormat because
it just returns DW_EH_PE_absptr unless on 10.6.  However, 10.6 doesn't support
PPC, so the default impl is just fine.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77724 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 20:43:26 +00:00
Chris Lattner
78a0e1bd53 remove a pointless override.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77723 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 20:36:15 +00:00
Owen Anderson
a7235ea724 Move a few more APIs back to 2.5 forms. The only remaining ones left to change back are
metadata related, which I'm waiting on to avoid conflicting with Devang.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77721 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 20:28:14 +00:00
Eric Christopher
44b93ff9ad Whitespace and 80-col cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77718 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 20:07:27 +00:00
Chris Lattner
a87dea4f8c switch off of 'Section' onto MCSection. We're not properly using
MCSection subclasses yet, but this is a step in the right direction.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77708 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 18:48:30 +00:00
Evan Cheng
ff6ab17619 Until we have a "ALIGN" pseudo instruction, have asm printer emitted a .align
to ensure the instruction that follows a TBB (when the number of table entries
is odd) is 2-byte aligned.
Patch by Sandeep Patel.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77705 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 18:35:56 +00:00
Evan Cheng
d26b14c34c - Teach TBB / TBH offset limits are 510 and 131070 respectively since the offset
is scaled by two.
- Teach GetInstSizeInBytes about TBB and TBH.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77701 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 18:28:05 +00:00
Daniel Dunbar
d5f02f65af Normalize target registration code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77692 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 18:16:53 +00:00
Dan Gohman
ad2afc2a42 Reapply r77654 with a fix: MachineFunctionPass's getAnalysisUsage
shouldn't do AU.setPreservesCFG(), because even though CodeGen passes
don't modify the LLVM IR CFG, they may modify the MachineFunction CFG,
and passes like MachineLoop are registered with isCFGOnly set to true.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77691 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 18:16:33 +00:00
Chris Lattner
f26e03bc7e refactor section construction in TLOF to be through an explicit
initialize method, which can be called when an MCContext is available.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77687 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 17:42:42 +00:00
Chris Lattner
82987bfe9b fix PR4650: we only track sizes for certain objects, so only put something
into the mergable section if it is one of our special cases.  This could
obviously be improved, but this is the minimal fix and restores us to the
previous behavior.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77679 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 16:17:13 +00:00
Benjamin Kramer
c6b79ac88e Fix a struct/class mismatch, to silence a MSVC warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77673 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 11:35:26 +00:00
Sanjiv Gupta
aa93917a5e define target names for std libcalls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77667 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 07:35:57 +00:00
Daniel Dunbar
c5b19b21d8 Revert r77654, it appears to be causing llvm-gcc bootstrap failures, and many
failures when building assorted projects with clang.

--- Reverse-merging r77654 into '.':
U    include/llvm/CodeGen/Passes.h
U    include/llvm/CodeGen/MachineFunctionPass.h
U    include/llvm/CodeGen/MachineFunction.h
U    include/llvm/CodeGen/LazyLiveness.h
U    include/llvm/CodeGen/SelectionDAGISel.h
D    include/llvm/CodeGen/MachineFunctionAnalysis.h
U    include/llvm/Function.h
U    lib/Target/CellSPU/SPUISelDAGToDAG.cpp
U    lib/Target/PowerPC/PPCISelDAGToDAG.cpp
U    lib/CodeGen/LLVMTargetMachine.cpp
U    lib/CodeGen/MachineVerifier.cpp
U    lib/CodeGen/MachineFunction.cpp
U    lib/CodeGen/PrologEpilogInserter.cpp
U    lib/CodeGen/MachineLoopInfo.cpp
U    lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
D    lib/CodeGen/MachineFunctionAnalysis.cpp
D    lib/CodeGen/MachineFunctionPass.cpp
U    lib/CodeGen/LiveVariables.cpp


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77661 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 03:02:41 +00:00
Daniel Dunbar
a027d222e1 llvm-mc: Match a few X86 instructions.
- This is "experimental" code, I am feeling my way around and working out the
   best way to do things (and learning tblgen in the process). Comments welcome,
   but keep in mind this stuff will change radically.

 - This is enough to match "subb" and friends, but not much else. The next step is to
   automatically generate the matchers for individual operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77657 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 02:32:59 +00:00
Dan Gohman
933c762371 Manage MachineFunctions with an analysis Pass instead of the Annotable
mechanism. To support this, make MachineFunctionPass a little more
complete.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77654 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 01:52:50 +00:00
Evan Cheng
ee42fd309e When fp is not eliminated, instructions with T2_i12 modes will be changed to T2_i8 ones. Take that into consideration when determining stack size limit for reserving register scavenging slot.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77642 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-30 23:29:25 +00:00
David Goodwin
07337c0fcf Remove redundant match for frame index from imm8 addrmode, it is handled by the imm12 addrmode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77632 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-30 22:45:52 +00:00
David Goodwin
8f65253236 Darwin assembler now recognizes "orn", so remove workaround.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77627 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-30 21:51:41 +00:00
David Goodwin
7c92f3ac99 Darwin assembler now supports "rrx", so remove workaround.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77625 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-30 21:38:40 +00:00
David Goodwin
d8c95b5ac2 Cleanup and include code selection for some frame index cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77622 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-30 18:56:48 +00:00
David Goodwin
3e4b22d983 Add missing D* register clobbers for Thumb-2 call.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77611 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-30 18:01:09 +00:00
Dan Gohman
524dab14f4 Minor whitespace tidiness.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77602 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-30 17:04:07 +00:00
Dan Gohman
68a31c2583 Rename GRAD to GR32_AD, to follow the naming convention of other
classes. And define its SubRegClassList.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77601 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-30 17:02:08 +00:00
Chris Lattner
513503961d add a random codegen deficiency.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77598 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-30 16:08:58 +00:00
Evan Cheng
7216920791 Add a note.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77584 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-30 08:56:19 +00:00
Evan Cheng
37b7387da9 Optimize some common usage patterns of atomic built-ins __sync_add_and_fetch() and __sync_sub_and_fetch.
When the return value is not used (i.e. only care about the value in the memory), x86 does not have to use add to implement these. Instead, it can use add, sub, inc, dec instructions with the "lock" prefix.

This is currently implemented using a bit of instruction selection trick. The issue is the target independent pattern produces one output and a chain and we want to map it into one that just output a chain. The current trick is to select it into a merge_values with the first definition being an implicit_def. The proper solution is to add new ISD opcodes for the no-output variant. DAG combiner can then transform the node before it gets to target node selection.

Problem #2 is we are adding a whole bunch of x86 atomic instructions when in fact these instructions are identical to the non-lock versions. We need a way to add target specific information to target nodes and have this information carried over to machine instructions. Asm printer (or JIT) can use this information to add the "lock" prefix.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77582 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-30 08:33:02 +00:00
Daniel Dunbar
7f93dc8345 Switch obvious clients to Twine instead of utostr (when they were already using
a Twine, e.g., for names).
 - I am a little ambivalent about this; we don't want the string conversion of
   utostr, but using overload '+' mixed with string and integer arguments is
   sketchy. On the other hand, this particular usage is something of an idiom.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77579 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-30 04:20:37 +00:00
Sanjiv Gupta
e409f0a779 Keep track of references to mem(cpy,move,set) and then print only one extern
declaration for them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77578 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-30 04:15:15 +00:00
Dan Gohman
a4714e025d Add a new register class to describe operands that can't be SP,
due to x86 encoding restrictions. This is currently off by default
because it may cause code quality regressions. This is for PR4572.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77565 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-30 01:56:29 +00:00
Dan Gohman
084d1ba5ad Eliminate a bunch of redundant tables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77558 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-30 00:40:42 +00:00
Bob Wilson
cf661e2c56 Lower a 128-bit BUILD_VECTOR with 2 elements to a pair of INSERT_VECTOR_ELTs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77557 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-30 00:31:25 +00:00
Dan Gohman
7c5f0c5ce9 Use array_endof instead of doing it manually.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77553 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-30 00:10:18 +00:00
Evan Cheng
8770f747a9 tbb / tbh instructions only branch forward, not backwards.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77522 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29 23:20:20 +00:00
Evan Cheng
d600522608 Add VFP3 D registers to the DPR register class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77521 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29 23:03:41 +00:00
Owen Anderson
debcb01b0f Move types back to the 2.5 API.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77516 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29 22:17:13 +00:00
Chris Lattner
2a38688494 inline the global 'getInstrOperandRegClass' function into its callers
now that TargetOperandInfo does the heavy lifting.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77508 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29 21:36:49 +00:00
Evan Cheng
20a2a0aff3 Make sure Thumb2 uses the right call instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77507 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29 21:26:42 +00:00
Chris Lattner
cb778a8634 1. Introduce a new TargetOperandInfo::getRegClass() helper method
and convert code to using it, instead of having lots of things
   poke the isLookupPtrRegClass() method directly.

2. Make PointerLikeRegClass contain a 'kind' int, and store it in
   the existing regclass field of TargetOperandInfo when the
   isLookupPtrRegClass() predicate is set.  Make getRegClass pass
   this into TargetRegisterInfo::getPointerRegClass(), allowing
   targets to have multiple ptr_rc things.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77504 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29 21:10:12 +00:00
Chris Lattner
2cfd52c507 Give getPointerRegClass() a "kind" value so that targets can
support multiple different pointer register classes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77501 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29 20:31:52 +00:00
Evan Cheng
0531d04d00 - Fix an obvious copy and paste error.
- Darwin Thumb2 call clobbers r9.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77500 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29 20:10:36 +00:00
Eric Christopher
978dae35e2 Add llvm_unreachable for ... unreachable code!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77480 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29 18:14:04 +00:00
Bob Wilson
b7d0c90c44 Change Neon VLDn intrinsics to return multiple values instead of really
wide vectors.  Likewise, change VSTn intrinsics to take separate arguments
for each vector in a multi-vector struct.  Adjust tests accordingly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77468 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29 16:39:22 +00:00
Chris Lattner
37dfdecafd more syntactic cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77442 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29 06:33:53 +00:00
Chris Lattner
c3c35b1721 minor smallvector cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77441 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29 06:29:53 +00:00
Chris Lattner
31dcfe6121 whitespace cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77438 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29 05:48:09 +00:00
Chris Lattner
83d1c3db39 mingw uses .data and .text, not _data and _text.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77435 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29 05:25:42 +00:00
Chris Lattner
b8f396bdbb fix PR4584 with a trivial patch now that the pieces are in place.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77434 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29 05:20:33 +00:00
Chris Lattner
e53a600f06 pass the mangler down into the various SectionForGlobal methods.
No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77432 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29 05:09:30 +00:00
Chris Lattner
a679207d58 constant prop a utostr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77430 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29 04:55:08 +00:00
Chris Lattner
067fe1ae54 remove some completely wrong code. 1 is never < 16. It turns out that GCC appears to put strings of any length into the ELF cstring equivalent, so just rip out the code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77429 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29 04:54:38 +00:00
Evan Cheng
5657c01949 Optimize Thumb2 jumptable to use tbb / tbh when all the offsets fit in byte / halfword.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77422 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29 02:18:14 +00:00
Eric Christopher
794bfed25d Fix comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77415 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29 01:01:19 +00:00
Bill Wendling
859cc77963 Change the "PreferredEHDataFormat" from "absptr" if we're on a Darwin system >
Leopard.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77414 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29 00:59:34 +00:00
Eric Christopher
71c6753d03 Add support for gcc __builtin_ia32_ptest{z,c,nzc} intrinsics. Lower
to ptest instruction plus setcc. Revamp ptest instruction. Add test.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77407 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29 00:28:05 +00:00
Daniel Dunbar
0e2771f4c4 Match X86 register names to number.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77404 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29 00:02:19 +00:00
David Goodwin
d9453784fb Thumb-2: fix typo that caused incorrect stack elimination for VFP operations and very large stack frames.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77401 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-28 23:52:33 +00:00
Daniel Dunbar
16cdcb38b2 Move X86 instruction parsing into X86/AsmParser.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77384 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-28 22:40:46 +00:00
Bill Wendling
1711a7c8cf Output the correct format for Darwin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77376 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-28 22:03:50 +00:00
Bill Wendling
ac3126ebdd Darwin outputs (DW_EH_PE_pcrel | DW_EH_PE_indirect | DW_EH_PE_sdata4) when we're
dealing with Data.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77372 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-28 21:53:17 +00:00
Devang Patel
0a9f7b9c3e Rename MDNode.h header. It defines MDnode and other metadata classes.
New name is Metadata.h.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77370 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-28 21:49:47 +00:00
Owen Anderson
af7ec97587 Return ConstantVector to 2.5 API.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77366 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-28 21:19:26 +00:00
Evan Cheng
e7c329bf4b In thumb2 mode, add pc is unpredictable. Use add + mov pc instead (that is until more optimization goes in).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77364 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-28 20:53:24 +00:00
David Goodwin
6340632d3b Remove support for ORN to workaround <rdar://problem/7096522>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77363 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-28 20:51:25 +00:00
Daniel Dunbar
a2edbabcb8 Provide generic MCAsmParser when constructing target specific parsers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77362 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-28 20:47:52 +00:00
Chris Lattner
b180d992d8 more simplifications and cleanup. :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77350 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-28 18:48:43 +00:00
Owen Anderson
1fd7096407 Change ConstantArray to 2.5 API.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77347 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-28 18:32:17 +00:00
David Goodwin
5743854f47 Add workaround for <rdar://problem/7098328>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77340 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-28 18:15:38 +00:00
Chris Lattner
bf15e433b9 Fix PR4639, a ELF-TLS regression from some of my refactoring.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77336 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-28 17:57:51 +00:00
Chris Lattner
4bb253c60f the apple "ld_classic" linker doesn't support .literal16 in 32-bit
mode, and "ld64" (the default linker) falls back to it in -static
mode.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77334 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-28 17:50:28 +00:00
David Goodwin
3583df7676 Add Thumb-2 patterns for ARMsrl_flag and ARMsra_flag.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77329 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-28 17:06:49 +00:00
Chris Lattner
8fb0039ea6 fix unused variable warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77326 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-28 16:49:19 +00:00
Evan Cheng
bae20a6353 tADDrSPI doesn't have a predicate operand, but tADDhirr and tADDi3 have.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77305 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-28 07:38:35 +00:00
Evan Cheng
542383d93b Code clean up. No functionality changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77301 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-28 06:24:12 +00:00
Evan Cheng
6495f63945 - More refactoring. This gets rid of all of the getOpcode calls.
- This change also makes it possible to switch between ARM / Thumb on a
  per-function basis.
- Fixed thumb2 routine which expand reg + arbitrary immediate. It was using
  using ARM so_imm logic.
- Use movw and movt to do reg + imm when profitable.
- Other code clean ups and minor optimizations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77300 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-28 05:48:47 +00:00
Chris Lattner
f4b64f67b6 fix a casting problem on the llvm-x86_64-linux tester
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77295 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-28 03:20:34 +00:00
Chris Lattner
f0144127b9 Rip all of the global variable lowering logic out of TargetAsmInfo. Since
it is highly specific to the object file that will be generated in the end,
this introduces a new TargetLoweringObjectFile interface that is implemented
for each of ELF/MachO/COFF/Alpha/PIC16 and XCore.

Though still is still a brutal and ugly refactoring, this is a major step
towards goodness.

This patch also:
1. fixes a bunch of dangling pointer problems in the PIC16 backend.
2. disables the TargetLowering copy ctor which PIC16 was accidentally using.
3. gets us closer to xcore having its own crazy target section flags and
   pic16 not having to shadow sections with its own objects.
4. fixes wierdness where ELF targets would set CStringSection but not
   CStringSection_.  Factor the code better.
5. fixes some bugs in string lowering on ELF targets.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77294 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-28 03:13:23 +00:00
Chris Lattner
7988aff079 don't copy TargetLowering.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77293 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-28 03:05:40 +00:00
David Goodwin
1f0962756d ORN does not require (and can not have) the ".w" suffix. "Orthogonality" is a dirty word at ARM.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77275 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-27 23:34:12 +00:00
Daniel Dunbar
9a7e2ccf57 llvm-mc: Move AsmLexer::getCurStrVal to StringRef based API.
- My DFS traversal of LLVM is, at least for now, nearly complete! :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77258 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-27 21:49:56 +00:00
Chris Lattner
2b2954f00b hoist MCContext/MCStreamer up to AsmPrinter since we're going to start creating
MCSections soon instead of Section for all targets, and we need something to
own them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77252 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-27 21:28:04 +00:00
Owen Anderson
6f83c9c6ef Move ConstantFP construction back to the 2.5-ish API.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77247 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-27 20:59:43 +00:00
David Goodwin
c9d138f505 Remove TPat. No patterns depend on just isThumb(). Must use either T1Pat (isThumb1Only()) or T2Pat (is Thumb2).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77242 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-27 19:59:26 +00:00
Chris Lattner
3b07b5214c Sink getSectionPrefixForUniqueGlobal down into the TAI
implementations that need it, rearrange ELFTAI.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77236 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-27 19:14:14 +00:00
Chris Lattner
fa199f3c16 remove dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77233 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-27 19:00:33 +00:00
Evan Cheng
e0f21bd47f More DCE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77231 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-27 18:48:45 +00:00
Evan Cheng
78703ddafe convertToThreeAddress can't handle Thumb2 instructions (which don't have same address mode as ARM instructions).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77230 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-27 18:44:00 +00:00
Evan Cheng
fc17fb0aee Get rid of more dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77227 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-27 18:38:54 +00:00
Evan Cheng
293f8d9b88 Cosmetic change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77222 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-27 18:31:40 +00:00
Evan Cheng
83e0e36be8 Clean up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77221 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-27 18:25:24 +00:00
Evan Cheng
5ca53a7ad8 Get rid of some more getOpcode calls.
This also fixes potential problems in ARMBaseInstrInfo routines not recognizing thumb1 instructions when 32-bit and 16-bit instructions mix.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77218 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-27 18:20:05 +00:00
Mike Stump
487cdc1bdc Fix build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77217 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-27 18:18:30 +00:00
Sanjiv Gupta
be7b97b773 Remove duplicate entries while printing decls for external symbols.
Some libcall names are same, so they were getting printed twice.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77215 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-27 18:04:34 +00:00
Chris Lattner
a7defb7150 add an explanatory comment about why we drop these in readonly and
not in mergable


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77210 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-27 17:39:40 +00:00
Chris Lattner
40412e7e90 make COFF work like ELF and macho, by splitting out into its own
header even though there is only one COFF target.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77204 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-27 16:45:59 +00:00
Chris Lattner
afcb70bc73 don't create default text/data sections for all targets.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77203 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-27 16:44:04 +00:00
Chris Lattner
6470177588 Apparently alpha doesn't use ElfTargetAsmInfo (?)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77202 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-27 16:42:14 +00:00
David Goodwin
752aa7d2fe Thumb-2 does not have RSC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77201 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-27 16:39:05 +00:00
David Goodwin
af0d08d55c Add ".w" suffix for wide thumb-2 instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77199 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-27 16:31:55 +00:00
Chris Lattner
33ae7a453b inline a method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77198 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-27 16:27:32 +00:00
Chris Lattner
20886cf91c apparently we have "windows" and "coff", which are different(?)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77197 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-27 16:22:39 +00:00
Chris Lattner
92ef3f66c1 sink text/data section creation down into the target-specific places that
should know about them.  PECoff doesn't share these, and I want all sections
to be created by object-file-specific code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77196 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-27 16:20:58 +00:00
Chris Lattner
de3a1078ab 32-bit darwin targets support .literal16 too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77191 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-27 15:44:04 +00:00
Chris Lattner
e346694a81 Eliminate getNamed/getUnnamedSection, adding a new and unified getOrCreateSection
instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77186 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-27 06:17:14 +00:00
Chris Lattner
5fe575ff4f Eliminate SectionFlags, just embed a SectionKind into Section
instead and drive things based off of that.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77184 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-27 05:32:16 +00:00
Evan Cheng
1f5c988754 If CPSR is modified but the def is dead, then it's ok to fold the load / store.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77182 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-27 04:18:04 +00:00
Evan Cheng
5732ca084a Use t2LDRi12 and t2STRi12 to load / store to / from stack frames. Eliminate more getOpcode calls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77181 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-27 03:14:20 +00:00
Sanjiv Gupta
8e14eab07e Generate a libcall for i8 multiply.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77179 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-27 02:44:46 +00:00
Sanjiv Gupta
bf36cafb8c fixed incorrect lowering of ISD::SUB node. SUB has only one result value.
It wasn't caught during tests because we never got a sub generated, (i8 was always getting promoted to int, which in turn was broken into subc/sube). Though the optimizer leaves an i8 sub now. 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77178 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-27 02:26:06 +00:00
Evan Cheng
08b93c6a70 Use the right instructions to copy between GPR and the more strictive tGPR classes. t2MOV does not match the RC requirements.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77175 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-27 00:33:08 +00:00
Evan Cheng
dced03fc84 Merge isLoadFromStackSlot into one since it behaves the same regardless of sub-target.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77174 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-27 00:24:36 +00:00
Evan Cheng
68e3c6ae49 Just use a single isMoveInstr to catch all the cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77173 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-27 00:05:15 +00:00
Evan Cheng
d83360694a Rename tMOVhi2lor to tMOVgpr2tgpr. It's not moving from a high register to a low register. It's moving from a GPR register class to a more restrictive tGPR class. Also change tMOVlor2hir, and tMOVhir2hir.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77172 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-26 23:59:01 +00:00
Chris Lattner
0fcf4dc6d3 untangle a TargetAsmInfo hack where ELFTargetAsmInfo would create a
'unnamed' bss section, but some impls would want a named one.  Since
they don't have consistent behavior, just make each target do their
own thing, instead of doing something "sortof common" then having
targets change immutable objects later.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77165 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-26 19:23:28 +00:00
Evan Cheng
30b2bdfa73 Refactor. Get rid of a few more getOpcode() calls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77164 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-26 18:55:14 +00:00
Chris Lattner
74fb545163 reduce indentation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77161 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-26 18:08:15 +00:00
Sanjiv Gupta
f9474ca928 Fix the breakage caused by 76950.
PIC16 has special naming conventions for variables having section names specified via section attribute.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77153 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-26 10:25:01 +00:00
Nick Lewycky
92fbbc7588 Move MSILModule and MSILWriter into the 'llvm' namespace, instead of the 'MSIL'
namespace which could very well conflict with non-LLVM code.

Also clean up some spacing, remove an extra header.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77146 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-26 08:16:51 +00:00
Daniel Dunbar
93b67e40de Eliminate some uses of DOUT, cerr, and getNameStart().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77145 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-26 07:49:05 +00:00
Chris Lattner
f40761d522 remove a densemap from TargetAsmInfo that was uniquing the targetflags strings,
just use a smallstring instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77144 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-26 07:33:58 +00:00
Chris Lattner
6468b44d3a simplify SectionFlagsForGlobal, even though I want to kill it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77143 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-26 07:17:39 +00:00
Chris Lattner
37088b3f82 make SectionKind keep track of whether a global had an explicit
section specified for it or not.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77142 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-26 07:14:28 +00:00
Chris Lattner
2b421dad78 simplify this code now that SectionKind knows if a global is weak or not.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77141 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-26 07:07:01 +00:00
Chris Lattner
4c50922f6b make SectionKind know whether a symbol is weak or not in addition
to its classification.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77140 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-26 07:00:12 +00:00
Chris Lattner
2ceb60a677 rename Mergable -> Mergeable and Writable -> Writeable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77138 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-26 06:48:26 +00:00
Chris Lattner
2c5815d090 remove a bunch of helper functions, just use SectionKind::get instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77135 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-26 06:34:33 +00:00
Chris Lattner
5c2f789952 simplify getSectionForMergableConstant to take a SectionKind.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77134 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-26 06:26:55 +00:00
Chris Lattner
f15327290e precreate 4/8/16 byte mergable sections to simplify code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77133 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-26 06:16:11 +00:00
Chris Lattner
8ca520944e introduce specialized mergable const sectionkinds for elements of size 4/8/16 to
simplify targets.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77132 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-26 06:11:33 +00:00
Chris Lattner
7f88a20f67 improve the default impl of getSectionForMergableConstant by
putting readonly constants in the readonly section if we have one.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77131 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-26 05:57:07 +00:00
Chris Lattner
af89a96c6b make elf targets correctly handle constant pool entries that require relocations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77130 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-26 05:55:20 +00:00
Chris Lattner
e346e180f3 Rearrange all the SectionKinds and structure them into a hierarchical
group instead of a bunch of random unrelated ideas.  Provide predicates
to categorize a SectionKind into a group, and use them instead of 
getKind() throughout the code.

This also renames a ton of SectionKinds to be more consistent and
evocative, and adds a huge number of comments on the enums so that
I will hopefully be able to remember how this stuff works long from
now.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77129 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-26 05:44:20 +00:00
Daniel Dunbar
8977d087c6 Factor commonality in triple match routines into helper template for registering
classes, and migrate existing targets over.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77126 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-26 05:03:33 +00:00
Chris Lattner
abb477f663 put normal data into .data instead of .data.rel on elf systems.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77116 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-26 03:06:11 +00:00
Daniel Dunbar
fa27ff296d Kill Target specific ModuleMatchQuality stuff.
- This was overkill and inconsistently implemented.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77114 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-26 02:22:58 +00:00
Daniel Dunbar
a5881e3060 Add TargetRegistry::lookupTarget.
- This is a simplified mechanism which just looks up a target based on the
   target triple, with a few additional flags.

 - Remove getClosestStaticTargetForModule, the moral equivalent is now:
     lookupTarget(Mod->getTargetTriple, true, false, ...);

 - This no longer does the fuzzy matching with target data (based on endianness
   and pointer width) that getClosestStaticTargetForModule was doing, but this
   was deemed unnecessary.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77111 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-26 02:12:58 +00:00
Chris Lattner
13b9251eb1 eliminate a pointless switch stmt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77110 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-26 01:44:55 +00:00
Chris Lattner
30c4a3b9a8 finish simplifying DarwinTargetAsmInfo::SelectSectionForGlobal
for now.  Make the section switching directives more consistent
by not including \n and including \t for them all.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77107 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-26 01:24:18 +00:00
Chris Lattner
e3577da6d9 simplify DarwinTargetAsmInfo::SelectSectionForGlobal a bit
and make it more aggressive, we now put:

const int G2 __attribute__((weak)) = 42;

into the text (readonly) segment like gcc, previously we put
it into the data (readwrite) segment.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77104 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-26 00:51:36 +00:00
Bob Wilson
8bb9e48752 Add support for ARM Neon VREV instructions.
Patch by Anton Korzh, with some modifications from me.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77101 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-26 00:39:34 +00:00
Daniel Dunbar
03d7651c36 Remove Value::{isName, getNameRef}.
Also, change MDString to use a StringRef.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77098 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-25 23:55:21 +00:00
Chris Lattner
460d51e0c0 make SectionKind be a first-class pod struct instead of just
an enum.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77096 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-25 23:21:55 +00:00
Chris Lattner
b4fc419d83 this is (unfortunately) several changes mixed together:
1. Spell SectionFlags::Writeable as "Writable".
2. Add predicates for deriving SectionFlags from SectionKinds.
3. Sink ELF-specific getSectionPrefixForUniqueGlobal impl into
   ELFTargetAsmInfo.
4. Fix SectionFlagsForGlobal to know that BSS/ThreadBSS has the
   BSS bit set (the real fix for PR4619).
5. Fix isSuitableForBSS to not put globals with explicit sections
   set in BSS (which was the reason #4 wasn't fixed earlier).
6. Remove my previous hack for PR4619.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77085 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-25 18:57:34 +00:00
Chris Lattner
4f05591e61 document some invariants.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77084 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-25 18:11:58 +00:00
Chris Lattner
10cf6a6a4b add the most expedient hack to fix PR4619, along with a testcase.
Thanks to Rafael for the great example.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77083 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-25 17:57:37 +00:00
Daniel Dunbar
d6fd377f33 Simplify JIT target selection.
- Instead of requiring targets to define a JIT quality match function, we just
   have them specify if they support a JIT.

 - Target selection for the JIT just gets the host triple and looks for the best
   target which matches the triple and has a JIT.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77060 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-25 10:09:50 +00:00
Sanjiv Gupta
e0d12d5f7b Mark attributes of return insn correctly. It was being assumed safe to delete in isSafeToDelete (a thing checked-in 76281).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77056 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-25 07:48:53 +00:00
Daniel Dunbar
0c795d6187 Add new helpers for registering targets.
- Less boilerplate == good.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77052 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-25 06:49:55 +00:00
Evan Cheng
c7423aff68 80 col violation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77041 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-25 01:55:25 +00:00
Evan Cheng
c6b54d5a33 Get rid of a couple of unnecessary getOpcode calls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77035 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-25 01:25:08 +00:00
Evan Cheng
3c91f36a45 Another TODO.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77026 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-25 00:39:37 +00:00
Evan Cheng
66ac53165e Change Thumb2 jumptable codegen to one that uses two level jumps:
Before:
      adr r12, #LJTI3_0_0
      ldr pc, [r12, +r0, lsl #2]
LJTI3_0_0:
      .long    LBB3_24
      .long    LBB3_30
      .long    LBB3_31
      .long    LBB3_32

After:
      adr r12, #LJTI3_0_0
      add pc, r12, +r0, lsl #2
LJTI3_0_0:
      b.w    LBB3_24
      b.w    LBB3_30
      b.w    LBB3_31
      b.w    LBB3_32

This has several advantages.
1. This will make it easier to optimize this to a TBB / TBH instruction +
   (smaller) table.
2. This eliminate the need for ugly asm printer hack to force the address
   into thumb addresses (bit 0 is one).
3. Same codegen for pic and non-pic.
4. This eliminate the need to align the table so constantpool island pass
   won't have to over-estimate the size.

Based on my calculation, the later is probably slightly faster as well since
ldr pc with shifter address is very slow. That is, it should be a win as long
as the HW implementation can do a reasonable job of branch predict the second
branch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77024 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-25 00:33:29 +00:00
Daniel Dunbar
ce63ffb52f More migration to raw_ostream, the water has dried up around the iostream hole.
- Some clients which used DOUT have moved to DEBUG. We are deprecating the
   "magic" DOUT behavior which avoided calling printing functions when the
   statement was disabled. In addition to being unnecessary magic, it had the
   downside of leaving code in -Asserts builds, and of hiding potentially
   unnecessary computations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77019 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-25 00:23:56 +00:00
Evan Cheng
90daf4d035 ARM code emitter can't handle Thumb2 instructions yet. So don't even try.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77018 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-25 00:13:11 +00:00
Daniel Dunbar
961f5852ca Fix build for GCC 4.0?
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77016 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24 23:42:33 +00:00
Daniel Dunbar
7cdf01d6c5 Fix compile with 4.4 (I hope?); PR4617.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77015 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24 23:23:46 +00:00
Owen Anderson
eed707b1e6 Revert the ConstantInt constructors back to their 2.5 forms where possible, thanks to contexts-on-types. More to come.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77011 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24 23:12:02 +00:00
Evan Cheng
0b6afa8c71 Uh. It would be useful to actually print the operand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77004 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24 20:47:38 +00:00
Chris Lattner
fbd3d4a5c3 fix some predicates
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76999 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24 20:27:11 +00:00
Chris Lattner
0d4960c3ca change SectionKindForGlobal from being a public (and
previously virtual) function to being a static function
in the .cpp file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76997 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24 20:14:10 +00:00
Evan Cheng
40efc251cd Disable my constant island pass optimization (to make use soimm more effectively). It caused infinite looping on lencod.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76995 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24 19:31:03 +00:00
Chris Lattner
b303504a56 make SectionKindForGlobal target independent, and therefore non-virtual.
It's classifications now include elf-specific discriminators.  Targets
that don't have these features (like darwin and pecoff) simply treat
data.rel like data, etc.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76993 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24 19:15:47 +00:00
Evan Cheng
49f846805e Add a workaround for Darwin assembler bug where it's not setting the thumb bit in Thumb2 jumptable entries. We now pass Olden.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76991 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24 18:54:23 +00:00
Chris Lattner
f20f250b6f we already know the sectionkind when invoking SelectSectionForGlobal,
pass it in instead of recomputing it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76990 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24 18:42:53 +00:00
Chris Lattner
7420ab2191 make SectionForGlobal non-virtual, add a hook for pic16 to do its "address=" hack.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76989 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24 18:34:27 +00:00
Evan Cheng
789476240d Make sure thumb2 jumptable entries are aligned.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76986 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24 18:20:44 +00:00
Evan Cheng
23606e35ab Clean up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76984 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24 18:20:16 +00:00
Evan Cheng
c324ecb7bc Replace use of std::set with SmallPtrSet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76983 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24 18:19:46 +00:00
Chris Lattner
7c023d6759 start refactoring pic16 section selection logic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76977 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24 17:13:27 +00:00
Chris Lattner
2dcafe4b8f move ELF-specific code into ELFTargetAsmInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76976 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24 17:02:17 +00:00
Chris Lattner
e5ca0ac36b tidy up
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76975 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24 16:53:52 +00:00
Chris Lattner
27f3065cf3 split the ELF-specific section flag inference-from-name code out
into its own helper function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76974 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24 16:50:24 +00:00
Chris Lattner
8adc547a91 make SectionFlagsForGlobal a private static function instead of a public
virtual one.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76973 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24 16:46:50 +00:00
Chris Lattner
104bbd10e4 move a method up in the file, GV is always non-null, so remove a check.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76972 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24 16:44:01 +00:00
Chris Lattner
3df6d5d83b There is no need to pass the name into lib/Target/TargetAsmInfo.cpp
when we have a global with no section explicitly specified.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76971 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24 16:40:45 +00:00
Daniel Dunbar
895c9ede1f Another getName -> getNameStr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76967 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24 12:21:08 +00:00
Daniel Dunbar
f6ccee5a9d Switch to getNameStr().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76962 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24 08:24:36 +00:00
Eli Friedman
23ed52752b Remove unused member functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76960 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24 07:43:59 +00:00
Chris Lattner
eed05b8042 hoist section name uniquing logic up to the top-level SectionForGlobal
implementation, eliminating a dupe.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76953 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24 05:10:25 +00:00
Chris Lattner
57743effb8 reduce indentation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76951 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24 05:01:55 +00:00
Chris Lattner
796131ee35 simplify code by making special case more obvious
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76950 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24 04:59:43 +00:00
Chris Lattner
f76280de82 the 'isWeakForLinker' code is common between functions and globals, hoist it
and simplify some other code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76949 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24 04:52:38 +00:00
Chris Lattner
55acc6807f Replace UniqueSectionForGlobal with getSectionPrefixForUniqueGlobal.
The later doesn't depend on any crazy LLVM IR stuff, and this
pulls the concatenation of prefix with GV name (the root problem behind
PR4584) out one level.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76948 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24 04:49:34 +00:00
Chris Lattner
686177dae7 fix indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76945 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24 04:11:40 +00:00
Chris Lattner
c440cc7f2c use section flags more correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76944 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24 04:08:17 +00:00
Chris Lattner
e2663d076c fix a mysterious and scary failure on test/CodeGen/X86/cstring.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76942 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24 03:55:48 +00:00
Chris Lattner
fb3431aec5 reduce api exposure: clients shouldn't call SectionKindForGlobal directly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76941 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24 03:49:17 +00:00
Chris Lattner
083a1e0597 make Constant::getRelocationInfo return an enum, as suggested by Duncan.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76938 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24 03:27:21 +00:00
Chris Lattner
ad733cd851 remove more bits of small section support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76937 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24 03:16:53 +00:00
Chris Lattner
d94061f123 remove more remnants of small section support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76936 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24 03:14:35 +00:00
Chris Lattner
013e6b6309 Remove SectionKind::Small*. This was only used on mips, and is apparently
a sad mistake that is regretted. :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76935 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24 03:11:51 +00:00
Evan Cheng
865763bf80 Thumb2 should use the register scavenger.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76930 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24 01:05:51 +00:00
Evan Cheng
b74bb1a7a4 FLDD, FLDS, FCPYD, FCPYS, FSTD, FSTS, VMOVD, VMOVQ maps to the same instructions on all sub-targets.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76925 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24 00:53:56 +00:00
Eric Christopher
fbd6687cf1 Update insertps handling based on feedback. Move to a v4f32 style
to support vector arguments and scalar arguments correctly. Update
lowering and fix comment to refer to pinsr* instead of insertps.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76921 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24 00:33:09 +00:00
Dan Gohman
d2cb3d2c32 Remove the IA-64 backend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76920 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24 00:30:09 +00:00
David Goodwin
5ff58b5c3a Correctly handle the Thumb-2 imm8 addrmode. Specialize frame index elimination more exactly for Thumb-2 to get better code gen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76919 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24 00:16:18 +00:00
Sean Callanan
74e5210809 Added a 2+-byte NOP instruction to the Intel tables,
for the assembler/disassembler to use.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76914 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-23 23:39:34 +00:00
Evan Cheng
eee839dd3c Thumb2 does not allow the use of "pc" register as part of the load / store address.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76909 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-23 23:09:51 +00:00
Duncan Sands
daf2212e83 Revert r75581: it causes massive breakage in the Ada
testsuite, due to exception handling not working
correctly.  Maybe because the libgcc unwinder is
miscompiled - not sure, and I won't have time to
look into it before leaving on holiday.  Note that
miscompilations of libgcc are not picked up by the
nightly testers, because they dynamically link with
libgcc, so pick up the system version rather than
the version built as part of llvm-gcc.  This is a
nasty flaw in the nightly testers.  (On the other
hand the Ada testsuite links with the just built
libgcc).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76895 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-23 19:00:02 +00:00
Evan Cheng
d3d9d66dd2 Fix up ARM constant island pass for Thumb2.
Also fixed up code to fully use the SoImm field for ADR on ARM mode.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76890 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-23 18:27:47 +00:00
Evan Cheng
81c102ba66 Since we have moved unified assembly, switch to ADR instruction instead of a the difficult-to-read .set + add syntax to materialize pc-relative address.
Turns out this also fixed a poor code selection on Thumb1. I have no idea why we were using a mov + add to do the same thing as ADR before.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76889 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-23 18:26:03 +00:00
David Goodwin
b53cc014d0 Fix frame index elimination to correctly handle thumb-2 addressing modes that don't allow negative offsets. During frame elimination convert *i12 opcode to a *i8 when necessary due to a negative offset.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76883 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-23 17:06:46 +00:00
Evan Cheng
697712c7d4 80 col violation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76872 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-23 07:58:08 +00:00