Chris Lattner
55461787cc
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.
llvm-svn: 77294
2009-07-28 03:13:23 +00:00
Chris Lattner
cd7d963b75
Eliminate getNamed/getUnnamedSection, adding a new and unified getOrCreateSection
...
instead.
llvm-svn: 77186
2009-07-27 06:17:14 +00:00
Chris Lattner
a2b00bdd7a
Eliminate SectionFlags, just embed a SectionKind into Section
...
instead and drive things based off of that.
llvm-svn: 77184
2009-07-27 05:32:16 +00:00
Chris Lattner
0f4d60ca90
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.
llvm-svn: 77165
2009-07-26 19:23:28 +00:00
Daniel Dunbar
75a66c519b
Eliminate some uses of DOUT, cerr, and getNameStart().
...
llvm-svn: 77145
2009-07-26 07:49:05 +00:00
Daniel Dunbar
a7a01acc7c
Factor commonality in triple match routines into helper template for registering
...
classes, and migrate existing targets over.
llvm-svn: 77126
2009-07-26 05:03:33 +00:00
Daniel Dunbar
49987490c2
Kill Target specific ModuleMatchQuality stuff.
...
- This was overkill and inconsistently implemented.
llvm-svn: 77114
2009-07-26 02:22:58 +00:00
Daniel Dunbar
d699ffc2ac
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.
llvm-svn: 77060
2009-07-25 10:09:50 +00:00
Daniel Dunbar
284fe09fe4
Add new helpers for registering targets.
...
- Less boilerplate == good.
llvm-svn: 77052
2009-07-25 06:49:55 +00:00
Owen Anderson
cc287b28c9
Get rid of the Pass+Context magic.
...
llvm-svn: 76702
2009-07-22 00:24:57 +00:00
Eli Friedman
a78b44069b
Missed a piece of the commit to remove the shift flavor.
...
llvm-svn: 76635
2009-07-21 20:15:24 +00:00
Chris Lattner
3d4ab7a231
make AsmPrinter::doFinalization iterate over the global variables
...
and call PrintGlobalVariable, allowing elimination and simplification
of various targets.
llvm-svn: 76604
2009-07-21 18:38:57 +00:00
Chris Lattner
433fbf959a
fix Sparc, SystemZ, and MSP430 to not override AsmPrinter::doInitialization.
...
This eliminates redundancy setting up the mangler and adds support to them
for module-level inline asm and a .file directive.
llvm-svn: 76592
2009-07-21 17:37:35 +00:00
Chris Lattner
0f65fbf095
Rename LessPrivateGlobalPrefix -> LinkerPrivateGlobalPrefix to match the
...
LLVM IR concept.
llvm-svn: 76590
2009-07-21 17:30:51 +00:00
Bill Wendling
16a69eeaeb
Pass in the unfortunately named "LessPrivatePrefix" for the
...
"LinkerPrivatePrefix". It seems to have been used in only one place before I
started this "linker_private" business. I'm thinking that a rename is in
order...
llvm-svn: 76479
2009-07-20 21:30:28 +00:00
Bill Wendling
1a10a060cb
Add plumbing for the `linker_private' linkage type. This type is meant for
...
"private" symbols which the assember shouldn't strip, but which the linker may
remove after evaluation. This is mostly useful for Objective-C metadata.
This is plumbing, so we don't have a use of it yet. More to come, etc.
llvm-svn: 76385
2009-07-20 01:03:30 +00:00
Daniel Dunbar
e1a18819f7
CMake support for SystemZ.
...
llvm-svn: 76384
2009-07-20 00:24:17 +00:00
Daniel Dunbar
e52f9f19ff
SystemZ *does* have a CodeGen/AsmPrinter split.
...
- What it doesn't have is the rest of its cmake files...
llvm-svn: 76352
2009-07-19 00:46:44 +00:00
Daniel Dunbar
f5a95d9e81
Tweak cmake files for the four targets that don't split CodeGen out.
...
- We should canonicalize this and get rid of the cmake and llvm-config hacks to
support both variants.
llvm-svn: 76350
2009-07-19 00:26:46 +00:00
Daniel Dunbar
aca95eac72
Add dependencies from TargetInfo onto .td generation.
...
- Shouldn't really be necessary, but currently .inc files get included into
some main target headers.
llvm-svn: 76349
2009-07-19 00:21:12 +00:00
Daniel Dunbar
960ef321ca
Put Target definitions inside Target specific header, and llvm namespace.
...
llvm-svn: 76344
2009-07-18 23:03:22 +00:00
Anton Korobeynikov
d8faa95b25
Add carry producing / using versions of add / sub
...
llvm-svn: 76316
2009-07-18 14:16:06 +00:00
Anton Korobeynikov
89f45fb02c
Expand frem
...
llvm-svn: 76315
2009-07-18 13:44:25 +00:00
Anton Korobeynikov
a806bf16c4
Turn abort() into unreachable
...
llvm-svn: 76314
2009-07-18 13:34:59 +00:00
Anton Korobeynikov
b3e0446dbb
Turn few asserts into errors / unreachable's
...
llvm-svn: 76313
2009-07-18 13:33:17 +00:00
Anton Korobeynikov
a7b22f8483
Handle vector returns
...
llvm-svn: 76312
2009-07-18 12:51:06 +00:00
Anton Korobeynikov
ff561b2308
Provide expansion for ct* intrinsics
...
llvm-svn: 76311
2009-07-18 12:26:13 +00:00
Anton Korobeynikov
f31ebc380b
Expand sext_inreg for i1
...
llvm-svn: 76310
2009-07-18 12:20:36 +00:00
Anton Korobeynikov
fbac44c040
Add missed return
...
llvm-svn: 76209
2009-07-17 18:28:59 +00:00
Duncan Sands
d1b273609e
Avoid a compiler warning when assertions are turned off.
...
llvm-svn: 76176
2009-07-17 12:25:14 +00:00
Daniel Dunbar
fd7e588f92
Fix 'may be used uninitialized' warning.
...
- Anton, please review.
llvm-svn: 76144
2009-07-17 02:19:26 +00:00
Anton Korobeynikov
c66cf22284
Unbreak
...
llvm-svn: 76064
2009-07-16 14:36:52 +00:00
Anton Korobeynikov
3e8bb65ec8
Temporary disable 16 bit bswap
...
llvm-svn: 76063
2009-07-16 14:35:57 +00:00
Anton Korobeynikov
94e21c8740
Add instruction formats and few opcodes
...
llvm-svn: 76062
2009-07-16 14:35:20 +00:00
Anton Korobeynikov
e11a89ba74
Add bswap patterns
...
llvm-svn: 76061
2009-07-16 14:34:52 +00:00
Anton Korobeynikov
6c622a4547
Provide crazy pseudos for regpairs spills / reloads
...
llvm-svn: 76060
2009-07-16 14:34:15 +00:00
Anton Korobeynikov
c5e948c021
Handle long-disp stuff more consistently
...
llvm-svn: 76059
2009-07-16 14:33:52 +00:00
Anton Korobeynikov
d9c48cfd00
All FP instructions have 12 bit memory displacement field
...
llvm-svn: 76058
2009-07-16 14:33:27 +00:00
Anton Korobeynikov
e1bf81893d
Another predicate routine
...
llvm-svn: 76057
2009-07-16 14:33:01 +00:00
Anton Korobeynikov
605ebc2c3c
More helpers
...
llvm-svn: 76056
2009-07-16 14:32:41 +00:00
Anton Korobeynikov
014ce79e73
Add bunch of branch folding stuff
...
llvm-svn: 76055
2009-07-16 14:32:19 +00:00
Anton Korobeynikov
918a93419c
Add missed opcodes to short => long displacement conversion
...
llvm-svn: 76054
2009-07-16 14:31:52 +00:00
Anton Korobeynikov
08d9f6b882
Cleanup
...
llvm-svn: 76053
2009-07-16 14:31:32 +00:00
Anton Korobeynikov
94f250ff30
Fix logic inversion for RI-mode address selection
...
llvm-svn: 76052
2009-07-16 14:31:14 +00:00
Anton Korobeynikov
373515d99e
Expand 32-bit bitconverts via memory
...
llvm-svn: 76050
2009-07-16 14:30:29 +00:00
Anton Korobeynikov
080bdae588
Fix incomin arg stack frame offset in case we need to generate stack frame
...
llvm-svn: 76049
2009-07-16 14:29:57 +00:00
Anton Korobeynikov
c84e2bb30e
Fix instruction mnemonics for some fp_to_sint operations
...
llvm-svn: 76048
2009-07-16 14:29:26 +00:00
Anton Korobeynikov
74497b2190
i32 values are passed extended also on stack. Handle this in generic way
...
llvm-svn: 76047
2009-07-16 14:29:05 +00:00
Anton Korobeynikov
319dc4e8d3
We definitely have 1-0 bools
...
llvm-svn: 76046
2009-07-16 14:28:46 +00:00
Anton Korobeynikov
2e8f54d16d
Revert the commit, it just hides the real bug
...
llvm-svn: 76045
2009-07-16 14:28:26 +00:00
Anton Korobeynikov
0276bc9176
Out GR128 regclass is not a 'real' i128 one.
...
llvm-svn: 76044
2009-07-16 14:27:53 +00:00
Anton Korobeynikov
690fef7849
Add missed condbranch opcodes
...
llvm-svn: 76043
2009-07-16 14:27:26 +00:00
Anton Korobeynikov
4181716247
Handle bitconverts
...
llvm-svn: 76042
2009-07-16 14:27:01 +00:00
Anton Korobeynikov
60427c0b64
Unbreak mvi and friends - emit only 'significant' part of the operand
...
llvm-svn: 76041
2009-07-16 14:26:38 +00:00
Anton Korobeynikov
ff6d84fd85
Expand fp_to_uint too
...
llvm-svn: 76040
2009-07-16 14:26:06 +00:00
Anton Korobeynikov
da480ca78d
We don't have FP truncstores
...
llvm-svn: 76039
2009-07-16 14:25:46 +00:00
Anton Korobeynikov
7ea47e70b3
Expand uint_to_fp
...
llvm-svn: 76038
2009-07-16 14:25:30 +00:00
Anton Korobeynikov
117e7a7179
Emit proper rounding mode for fp_to_sint
...
llvm-svn: 76037
2009-07-16 14:25:12 +00:00
Anton Korobeynikov
61bf5c13c4
f32/f64 regs are stored on stack if we're short in FP regs
...
llvm-svn: 76036
2009-07-16 14:24:57 +00:00
Anton Korobeynikov
bbf0fe2a76
Lower anyext to zext, 32-bit stuff does not have any implicit zero-extension side effects
...
llvm-svn: 76035
2009-07-16 14:24:41 +00:00
Anton Korobeynikov
886e977c69
Make FP zero to be legal FP immediate via LOAD ZERO
...
llvm-svn: 76034
2009-07-16 14:24:16 +00:00
Anton Korobeynikov
2474b40557
Loads are not two-address in any way
...
llvm-svn: 76033
2009-07-16 14:24:01 +00:00
Anton Korobeynikov
e45c7cb554
Add LOAD NEGATIVE instruction
...
llvm-svn: 76032
2009-07-16 14:23:44 +00:00
Anton Korobeynikov
d12e7875c9
LOAD COMPLEMENT instruction is not really two-addr
...
llvm-svn: 76031
2009-07-16 14:23:30 +00:00
Anton Korobeynikov
f8ac41d531
Add multiple add/sub instructions
...
llvm-svn: 76030
2009-07-16 14:23:16 +00:00
Anton Korobeynikov
df2f045667
Handle FP callee-saved regs
...
llvm-svn: 76029
2009-07-16 14:23:01 +00:00
Anton Korobeynikov
b90a38d00d
Proper FP extloads
...
llvm-svn: 76028
2009-07-16 14:22:46 +00:00
Anton Korobeynikov
940ec5955b
Add proper PWS impdef's
...
llvm-svn: 76027
2009-07-16 14:22:30 +00:00
Anton Korobeynikov
3f37f337be
Propagate FP select_cc to dag inserters
...
llvm-svn: 76026
2009-07-16 14:22:15 +00:00
Anton Korobeynikov
dc167c2eec
Implement fp_to_sint
...
llvm-svn: 76025
2009-07-16 14:21:57 +00:00
Anton Korobeynikov
e372330133
Implement FP regs spills / restores
...
llvm-svn: 76024
2009-07-16 14:21:41 +00:00
Anton Korobeynikov
0c3534b070
Add fabs
...
llvm-svn: 76023
2009-07-16 14:21:27 +00:00
Anton Korobeynikov
fc1f449073
Add fneg
...
llvm-svn: 76022
2009-07-16 14:21:12 +00:00
Anton Korobeynikov
a73f3ffb1f
We don't have native sine / cosine instructions
...
llvm-svn: 76021
2009-07-16 14:20:56 +00:00
Anton Korobeynikov
d2feb0d2e4
More sint_to_fp stuff
...
llvm-svn: 76020
2009-07-16 14:20:39 +00:00
Anton Korobeynikov
23615e0340
Add bunch of FP instructions
...
llvm-svn: 76019
2009-07-16 14:20:24 +00:00
Anton Korobeynikov
32c9954322
We don't have any FP extloads
...
llvm-svn: 76018
2009-07-16 14:20:08 +00:00
Anton Korobeynikov
643215b0d7
Implement all comparisons
...
llvm-svn: 76017
2009-07-16 14:19:54 +00:00
Anton Korobeynikov
488f8c2fd1
Add constpool lowering / printing
...
llvm-svn: 76016
2009-07-16 14:19:35 +00:00
Anton Korobeynikov
4dbabbe3cf
Allow FP arguments pass / return
...
llvm-svn: 76015
2009-07-16 14:19:16 +00:00
Anton Korobeynikov
d4e7c7a373
Register FP regclasses
...
llvm-svn: 76014
2009-07-16 14:19:02 +00:00
Anton Korobeynikov
2ccdd0fd2b
Add FP regs
...
llvm-svn: 76013
2009-07-16 14:18:48 +00:00
Anton Korobeynikov
d8ced10967
Fix fallout from prev. patch
...
llvm-svn: 76012
2009-07-16 14:18:31 +00:00
Anton Korobeynikov
3e670f38f9
Provide consistent subreg idx scheme. This (hopefully) fixes remaining divide problems
...
llvm-svn: 76011
2009-07-16 14:18:17 +00:00
Anton Korobeynikov
bf722c6946
Use divide single for 32 bit signed divides
...
llvm-svn: 76010
2009-07-16 14:17:52 +00:00
Anton Korobeynikov
785f486b30
Add missed operands types
...
llvm-svn: 76009
2009-07-16 14:17:07 +00:00
Anton Korobeynikov
41d3ac1720
Missed part of prev. patch
...
llvm-svn: 76008
2009-07-16 14:16:45 +00:00
Anton Korobeynikov
7cf7a634df
Another attempt to fix prologue emission
...
llvm-svn: 76007
2009-07-16 14:16:26 +00:00
Anton Korobeynikov
b3af53a626
Implement 'large' PIC model
...
llvm-svn: 76006
2009-07-16 14:16:05 +00:00
Anton Korobeynikov
2889a28adb
Implement shifts properly (hopefilly - finally!)
...
llvm-svn: 76005
2009-07-16 14:15:24 +00:00
Anton Korobeynikov
6ff1411adf
Remove redundand register move
...
llvm-svn: 76004
2009-07-16 14:14:54 +00:00
Anton Korobeynikov
f48e88136e
Properly handle divides. As a bonus - implement memory versions of them.
...
llvm-svn: 76003
2009-07-16 14:14:33 +00:00
Anton Korobeynikov
3434b05a2c
Fix epic fail: full-width muls are not commutable. This unbreaks bunch of stuff from SingleSource/Benchmarks/Stanford
...
llvm-svn: 76002
2009-07-16 14:14:01 +00:00
Anton Korobeynikov
ca4d4129c6
32 bit rotate is not twoaddr instruction
...
llvm-svn: 76001
2009-07-16 14:13:43 +00:00
Anton Korobeynikov
e6b7c15a63
32 bit shifts have only 12 bit displacements
...
llvm-svn: 76000
2009-07-16 14:13:24 +00:00
Anton Korobeynikov
cffc479110
Add proper register aliases
...
llvm-svn: 75999
2009-07-16 14:12:54 +00:00
Anton Korobeynikov
2954802d28
Properly generate stack frame
...
llvm-svn: 75998
2009-07-16 14:12:36 +00:00
Anton Korobeynikov
0e3d764cc1
Unbreak indirect branches
...
llvm-svn: 75997
2009-07-16 14:12:18 +00:00
Anton Korobeynikov
07380f3ab0
Unbreak
...
llvm-svn: 75996
2009-07-16 14:12:00 +00:00
Anton Korobeynikov
1764c55d85
Do not forget to save R15 when we allocate stack frame
...
llvm-svn: 75995
2009-07-16 14:11:40 +00:00