Bill Wendling
ca087a1582
Change the "PreferredEHDataFormat" from "absptr" if we're on a Darwin system >
...
Leopard.
llvm-svn: 77414
2009-07-29 00:59:34 +00:00
Bill Wendling
63e2e5f961
Move comment to above method.
...
llvm-svn: 77412
2009-07-29 00:50:05 +00:00
Devang Patel
127ab37209
Parse named metadata.
...
llvm-svn: 77410
2009-07-29 00:34:02 +00:00
Devang Patel
8ed4662148
Add NamedMDNode.
...
llvm-svn: 77409
2009-07-29 00:33:07 +00:00
Bill Wendling
067f40533e
- Temporarily unbreak the build by forcing the TType "absptr", which isn't
...
correct. But what are you going to do? I'll fix this in the future.
- Move another large loop into its own method.
llvm-svn: 77408
2009-07-29 00:31:35 +00:00
Eric Christopher
c7b97d1f03
Add support for gcc __builtin_ia32_ptest{z,c,nzc} intrinsics. Lower
...
to ptest instruction plus setcc. Revamp ptest instruction. Add test.
llvm-svn: 77407
2009-07-29 00:28:05 +00:00
Dan Gohman
454f9dc117
Remove another F_OK.
...
llvm-svn: 77405
2009-07-29 00:02:58 +00:00
Daniel Dunbar
a364079155
Match X86 register names to number.
...
llvm-svn: 77404
2009-07-29 00:02:19 +00:00
David Goodwin
65028e2427
Thumb-2: fix typo that caused incorrect stack elimination for VFP operations and very large stack frames.
...
llvm-svn: 77401
2009-07-28 23:52:33 +00:00
Bill Wendling
542faaa8f1
Cleanup code to use iterators instead of ".size()".
...
Does any one else hate the name "const_reverse_iterator" as much as I do?
llvm-svn: 77399
2009-07-28 23:44:43 +00:00
David Greene
6c6f368805
Improve performance of PadToColumn by eliminating flushes.
...
llvm-svn: 77397
2009-07-28 23:26:34 +00:00
Dan Gohman
94bc13beac
On "Unix", if Program::FindProgramByName is given a name containing
...
slashes, just go with it, regardless of whether it looks like it will
be executable. This follows the behavior of sh(1) more closely.
llvm-svn: 77396
2009-07-28 23:25:18 +00:00
Bill Wendling
3c423d6937
Doxygenify comments.
...
llvm-svn: 77394
2009-07-28 23:23:00 +00:00
Bill Wendling
4aca242899
Split out large loop into it's very own method. No intended functionality change.
...
llvm-svn: 77393
2009-07-28 23:22:13 +00:00
Dan Gohman
3341edff8b
It isn't necessary to use F_OK when using R_OK or similar.
...
llvm-svn: 77392
2009-07-28 23:22:01 +00:00
Daniel Dunbar
4ed0e9b76c
Move X86 instruction parsing into X86/AsmParser.
...
llvm-svn: 77384
2009-07-28 22:40:46 +00:00
Bill Wendling
e3f9b54a39
Output the EH TType format and base offset only if there are types that we're
...
going to emit.
llvm-svn: 77382
2009-07-28 22:23:45 +00:00
Benjamin Kramer
c5d38b51da
Fix a fixme; don't take binaries from the working directory.
...
This fixes clang on non-darwin platforms if a file called 'ld' or 'as'
is in the working directory. Based on patch by Pawel Worach!
llvm-svn: 77379
2009-07-28 22:08:15 +00:00
Devang Patel
b784b514a3
Remove unused method.
...
llvm-svn: 77378
2009-07-28 22:04:55 +00:00
Bill Wendling
41139f3ed4
Output the correct format for Darwin.
...
llvm-svn: 77376
2009-07-28 22:03:50 +00:00
Bill Wendling
2c464b4a80
Use the preferred EH data format for the preferred EH data format.
...
llvm-svn: 77373
2009-07-28 21:54:03 +00:00
Bill Wendling
c041a73806
Darwin outputs (DW_EH_PE_pcrel | DW_EH_PE_indirect | DW_EH_PE_sdata4) when we're
...
dealing with Data.
llvm-svn: 77372
2009-07-28 21:53:17 +00:00
Devang Patel
cb23671431
Rename MDNode.h header. It defines MDnode and other metadata classes.
...
New name is Metadata.h.
llvm-svn: 77370
2009-07-28 21:49:47 +00:00
Evan Cheng
67f68983fe
Fix a typo.
...
llvm-svn: 77369
2009-07-28 21:49:18 +00:00
Owen Anderson
390e9778d4
Return ConstantVector to 2.5 API.
...
llvm-svn: 77366
2009-07-28 21:19:26 +00:00
Evan Cheng
cf483eb0c0
In thumb2 mode, add pc is unpredictable. Use add + mov pc instead (that is until more optimization goes in).
...
llvm-svn: 77364
2009-07-28 20:53:24 +00:00
David Goodwin
0c9e96bf09
Remove support for ORN to workaround <rdar://problem/7096522>.
...
llvm-svn: 77363
2009-07-28 20:51:25 +00:00
Daniel Dunbar
d0d6b26e87
Provide generic MCAsmParser when constructing target specific parsers.
...
llvm-svn: 77362
2009-07-28 20:47:52 +00:00
Devang Patel
5aba07663b
Add DebugInfoEnumerator to collect debug info.
...
llvm-svn: 77360
2009-07-28 19:55:13 +00:00
Andreas Bolka
415bdb47a8
Simplify LDA-internal interface.
...
llvm-svn: 77359
2009-07-28 19:50:13 +00:00
Andreas Bolka
a9b0af9da7
Add LDA statistics.
...
llvm-svn: 77358
2009-07-28 19:49:49 +00:00
Andreas Bolka
aa84e1d9d3
Minor factoring, naming and formatting cleanups.
...
llvm-svn: 77357
2009-07-28 19:49:25 +00:00
Bruno Cardoso Lopes
9bfa0c1c3d
Handle null and file symbol on doInitialization
...
llvm-svn: 77354
2009-07-28 19:25:33 +00:00
Chris Lattner
8972d46576
more simplifications and cleanup. :)
...
llvm-svn: 77350
2009-07-28 18:48:43 +00:00
Owen Anderson
aa8c94b051
Change ConstantArray to 2.5 API.
...
llvm-svn: 77347
2009-07-28 18:32:17 +00:00
David Goodwin
dbc23ece04
Add workaround for <rdar://problem/7098328>.
...
llvm-svn: 77340
2009-07-28 18:15:38 +00:00
Daniel Dunbar
6e2f7db6b6
Expose Tokens to target specific assembly parsers.
...
llvm-svn: 77337
2009-07-28 17:58:44 +00:00
Chris Lattner
986bd2bd0a
Fix PR4639, a ELF-TLS regression from some of my refactoring.
...
llvm-svn: 77336
2009-07-28 17:57:51 +00:00
Chris Lattner
c74586940a
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.
llvm-svn: 77334
2009-07-28 17:50:28 +00:00
David Goodwin
e94d490b89
Add Thumb-2 patterns for ARMsrl_flag and ARMsra_flag.
...
llvm-svn: 77329
2009-07-28 17:06:49 +00:00
David Greene
b224a9f38c
Add reload and remat backscheduling. This is disabled by default. Use
...
-schedule-spills=true to enable.
llvm-svn: 77327
2009-07-28 16:49:24 +00:00
Chris Lattner
dde77ff48b
fix unused variable warning
...
llvm-svn: 77326
2009-07-28 16:49:19 +00:00
Evan Cheng
05555a7d31
tADDrSPI doesn't have a predicate operand, but tADDhirr and tADDi3 have.
...
llvm-svn: 77305
2009-07-28 07:38:35 +00:00
Evan Cheng
93c1b56fe9
Code clean up. No functionality changes.
...
llvm-svn: 77301
2009-07-28 06:24:12 +00:00
Evan Cheng
b740190d2e
- 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.
llvm-svn: 77300
2009-07-28 05:48:47 +00:00
Chris Lattner
ec951ca82f
fix a casting problem on the llvm-x86_64-linux tester
...
llvm-svn: 77295
2009-07-28 03:20:34 +00:00
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
2aed301c12
don't copy TargetLowering.
...
llvm-svn: 77293
2009-07-28 03:05:40 +00:00
Dan Gohman
0d0dd7b732
Teach instcombine to respect and preserve inbounds. Add inbounds
...
to a few tests where it is required for the expected transformation.
llvm-svn: 77290
2009-07-28 01:40:03 +00:00
Mike Stump
8902846c69
Fix a small little typo.
...
llvm-svn: 77289
2009-07-28 01:35:34 +00:00
Dan Gohman
11eb2ee32c
Replace dyn_castGetElementPtr with dyn_cast<GEPOperator>.
...
llvm-svn: 77286
2009-07-28 00:37:50 +00:00
Dan Gohman
361e911b89
Grab the LLVMContext and parent Module of SI ahead of the
...
point where SI can get deleted. This fixes a use of free'd memory.
This fixes Externals/Povray.
llvm-svn: 77285
2009-07-28 00:37:06 +00:00
David Goodwin
0bcb94eeff
ORN does not require (and can not have) the ".w" suffix. "Orthogonality" is a dirty word at ARM.
...
llvm-svn: 77275
2009-07-27 23:34:12 +00:00
Mike Stump
6cc3ea28df
Fix a release-asserts warning. Debug functions should be marked used,
...
if there are no other uses. If people don't need this routine
anymore, if should be deleted.
llvm-svn: 77274
2009-07-27 23:33:34 +00:00
Daniel Dunbar
3edfc4bb16
llvm-mc: Implement .abort fully in the front end
...
llvm-svn: 77272
2009-07-27 23:20:52 +00:00
Mike Stump
be4029ff76
Avoid build warnings.
...
llvm-svn: 77271
2009-07-27 23:14:11 +00:00
Owen Anderson
d729f993b8
Move ConstantStruct back to 2.5 API.
...
llvm-svn: 77266
2009-07-27 22:29:26 +00:00
Dan Gohman
1e723730cb
Add a comment about the "getelementptr null" trick.
...
llvm-svn: 77262
2009-07-27 21:59:50 +00:00
Dan Gohman
490eb36e1d
Add a new keyword 'inbounds' for use with getelementptr. See the
...
LangRef.html changes for details.
llvm-svn: 77259
2009-07-27 21:53:46 +00:00
Daniel Dunbar
5f73e9d3f8
llvm-mc: Move AsmLexer::getCurStrVal to StringRef based API.
...
- My DFS traversal of LLVM is, at least for now, nearly complete! :)
llvm-svn: 77258
2009-07-27 21:49:56 +00:00
Daniel Dunbar
89c8a88449
Unbreak build.
...
llvm-svn: 77256
2009-07-27 21:47:07 +00:00
Dan Gohman
40bd748448
Make raw_null_ostream flush its buffer in its destructor, so that
...
it conforms to the assertion added in r77245. This fixes a failure
in qa_override.c in clang's testsuite.
llvm-svn: 77255
2009-07-27 21:46:02 +00:00
Chris Lattner
d519223908
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.
llvm-svn: 77252
2009-07-27 21:28:04 +00:00
Daniel Dunbar
6de68a2544
Move MCContext and friends to StringRef based APIs.
...
llvm-svn: 77251
2009-07-27 21:22:30 +00:00
Owen Anderson
256c2c250e
Move ConstantFP construction back to the 2.5-ish API.
...
llvm-svn: 77247
2009-07-27 20:59:43 +00:00
Dan Gohman
982c2fe893
Add an assertion check to raw_ostream's destructor to verify
...
that the subclass hasn't left any pending data in the buffer.
llvm-svn: 77245
2009-07-27 20:49:44 +00:00
David Goodwin
6ff3fd8021
Remove TPat. No patterns depend on just isThumb(). Must use either T1Pat (isThumb1Only()) or T2Pat (is Thumb2).
...
llvm-svn: 77242
2009-07-27 19:59:26 +00:00
Bruno Cardoso Lopes
acb73d4897
fix comment
...
llvm-svn: 77239
2009-07-27 19:38:38 +00:00
Bruno Cardoso Lopes
f6ea9fb8c2
add module identifier to the elf object file
...
llvm-svn: 77238
2009-07-27 19:32:57 +00:00
Chris Lattner
674e5fa434
Sink getSectionPrefixForUniqueGlobal down into the TAI
...
implementations that need it, rearrange ELFTAI.
llvm-svn: 77236
2009-07-27 19:14:14 +00:00
Chris Lattner
4ff7e1300f
remove dead code.
...
llvm-svn: 77233
2009-07-27 19:00:33 +00:00
Bruno Cardoso Lopes
a536302ed5
Handle external symbols for ELF and add some static methods to ELFSym
...
llvm-svn: 77232
2009-07-27 18:54:47 +00:00
Evan Cheng
718ab76a04
More DCE.
...
llvm-svn: 77231
2009-07-27 18:48:45 +00:00
Evan Cheng
a702481089
convertToThreeAddress can't handle Thumb2 instructions (which don't have same address mode as ARM instructions).
...
llvm-svn: 77230
2009-07-27 18:44:00 +00:00
Devang Patel
579ccbe163
Initialize mdnNext.
...
llvm-svn: 77229
2009-07-27 18:42:56 +00:00
Evan Cheng
fa630cca3f
Get rid of more dead code.
...
llvm-svn: 77227
2009-07-27 18:38:54 +00:00
Evan Cheng
55e369a447
Cosmetic change.
...
llvm-svn: 77222
2009-07-27 18:31:40 +00:00
Evan Cheng
03307125f5
Clean up.
...
llvm-svn: 77221
2009-07-27 18:25:24 +00:00
Evan Cheng
a773ae7a39
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.
llvm-svn: 77218
2009-07-27 18:20:05 +00:00
Mike Stump
ddec2c6c95
Fix build.
...
llvm-svn: 77217
2009-07-27 18:18:30 +00:00
Sanjiv Gupta
aec8e8ce73
Remove duplicate entries while printing decls for external symbols.
...
Some libcall names are same, so they were getting printed twice.
llvm-svn: 77215
2009-07-27 18:04:34 +00:00
Douglas Gregor
a16477fe59
CMake: make sure that the *.inc files for libSystem show up in the resulting
...
project.
llvm-svn: 77213
2009-07-27 17:55:55 +00:00
Chris Lattner
60c53ef86b
add an explanatory comment about why we drop these in readonly and
...
not in mergable
llvm-svn: 77210
2009-07-27 17:39:40 +00:00
Devang Patel
dfa0528df7
Do not seed mstadata into the value map.
...
llvm-svn: 77208
2009-07-27 17:17:04 +00:00
Chris Lattner
12c25bacbd
make COFF work like ELF and macho, by splitting out into its own
...
header even though there is only one COFF target.
llvm-svn: 77204
2009-07-27 16:45:59 +00:00
Chris Lattner
90a2885055
don't create default text/data sections for all targets.
...
llvm-svn: 77203
2009-07-27 16:44:04 +00:00
Chris Lattner
3677ab7082
Apparently alpha doesn't use ElfTargetAsmInfo (?)
...
llvm-svn: 77202
2009-07-27 16:42:14 +00:00
David Goodwin
bbab77cdda
Thumb-2 does not have RSC.
...
llvm-svn: 77201
2009-07-27 16:39:05 +00:00
David Goodwin
471e9f5b8d
Add ".w" suffix for wide thumb-2 instructions.
...
llvm-svn: 77199
2009-07-27 16:31:55 +00:00
Chris Lattner
062cc18e39
inline a method.
...
llvm-svn: 77198
2009-07-27 16:27:32 +00:00
Chris Lattner
d44632b8ad
apparently we have "windows" and "coff", which are different(?)
...
llvm-svn: 77197
2009-07-27 16:22:39 +00:00
Chris Lattner
793cbcd529
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.
llvm-svn: 77196
2009-07-27 16:20:58 +00:00
Dan Gohman
39c0d3b10a
Change the assembly syntax for nsw, nuw, and exact, putting them
...
after their associated opcodes rather than before. This makes them
a little easier to read.
llvm-svn: 77194
2009-07-27 16:11:46 +00:00
Dan Gohman
e999569f50
Fix wording in comments.
...
llvm-svn: 77193
2009-07-27 16:09:48 +00:00
Chris Lattner
255675d8b2
32-bit darwin targets support .literal16 too.
...
llvm-svn: 77191
2009-07-27 15:44:04 +00:00
Benjamin Kramer
706c0b2b97
Test commit: fix typo
...
llvm-svn: 77187
2009-07-27 09:06:52 +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
Evan Cheng
657ef082f0
If CPSR is modified but the def is dead, then it's ok to fold the load / store.
...
llvm-svn: 77182
2009-07-27 04:18:04 +00:00
Evan Cheng
674c4d47b9
Use t2LDRi12 and t2STRi12 to load / store to / from stack frames. Eliminate more getOpcode calls.
...
llvm-svn: 77181
2009-07-27 03:14:20 +00:00
Sanjiv Gupta
efd89b69e1
Generate a libcall for i8 multiply.
...
llvm-svn: 77179
2009-07-27 02:44:46 +00:00
Sanjiv Gupta
c1b29cb551
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.
llvm-svn: 77178
2009-07-27 02:26:06 +00:00
Evan Cheng
0cdbde1adf
Use the right instructions to copy between GPR and the more strictive tGPR classes. t2MOV does not match the RC requirements.
...
llvm-svn: 77175
2009-07-27 00:33:08 +00:00
Evan Cheng
61765ac517
Merge isLoadFromStackSlot into one since it behaves the same regardless of sub-target.
...
llvm-svn: 77174
2009-07-27 00:24:36 +00:00
Evan Cheng
b1ab426733
Just use a single isMoveInstr to catch all the cases.
...
llvm-svn: 77173
2009-07-27 00:05:15 +00:00
Evan Cheng
a6737e21cf
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.
...
llvm-svn: 77172
2009-07-26 23:59:01 +00:00
Eli Friedman
8008283cf9
Reorganize code a bit to reduce indentation. No visible functionality
...
change.
llvm-svn: 77171
2009-07-26 23:47:17 +00:00
Daniel Dunbar
dda1b60b4b
Don't use llvm_report_error in libSystem, this is a layering violation.
...
llvm-svn: 77169
2009-07-26 21:16:42 +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
Evan Cheng
d555fec28c
Refactor. Get rid of a few more getOpcode() calls.
...
llvm-svn: 77164
2009-07-26 18:55:14 +00:00
Chris Lattner
12e2f1ca42
reduce indentation
...
llvm-svn: 77161
2009-07-26 18:08:15 +00:00
Sanjiv Gupta
cc8eb579b9
Fix the breakage caused by 76950.
...
PIC16 has special naming conventions for variables having section names specified via section attribute.
llvm-svn: 77153
2009-07-26 10:25:01 +00:00
Daniel Dunbar
4a36d5dcfd
Remove Value::getName{Start,End}, the last of the old Name APIs.
...
llvm-svn: 77152
2009-07-26 09:48:23 +00:00
Daniel Dunbar
d0f5c0b334
Make sure getName().data() is always null terminated.
...
llvm-svn: 77149
2009-07-26 09:22:02 +00:00
Daniel Dunbar
64abfd0337
Remove Value::getNameLen
...
llvm-svn: 77148
2009-07-26 08:34:35 +00:00
Nick Lewycky
c130e8eae9
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.
llvm-svn: 77146
2009-07-26 08:16:51 +00:00
Daniel Dunbar
75a66c519b
Eliminate some uses of DOUT, cerr, and getNameStart().
...
llvm-svn: 77145
2009-07-26 07:49:05 +00:00
Chris Lattner
9104e8d808
remove a densemap from TargetAsmInfo that was uniquing the targetflags strings,
...
just use a smallstring instead.
llvm-svn: 77144
2009-07-26 07:33:58 +00:00
Chris Lattner
090aa4b8f4
simplify SectionFlagsForGlobal, even though I want to kill it.
...
llvm-svn: 77143
2009-07-26 07:17:39 +00:00
Chris Lattner
b508741de0
make SectionKind keep track of whether a global had an explicit
...
section specified for it or not.
llvm-svn: 77142
2009-07-26 07:14:28 +00:00
Chris Lattner
dfd1014214
simplify this code now that SectionKind knows if a global is weak or not.
...
llvm-svn: 77141
2009-07-26 07:07:01 +00:00
Chris Lattner
41570cf306
make SectionKind know whether a symbol is weak or not in addition
...
to its classification.
llvm-svn: 77140
2009-07-26 07:00:12 +00:00
Chris Lattner
61e4445f5a
rename Mergable -> Mergeable and Writable -> Writeable
...
llvm-svn: 77138
2009-07-26 06:48:26 +00:00
Chris Lattner
950bd8ba10
two files I missed in the last commit.
...
llvm-svn: 77137
2009-07-26 06:36:20 +00:00
Chris Lattner
e2a16438a6
remove a bunch of helper functions, just use SectionKind::get instead.
...
llvm-svn: 77135
2009-07-26 06:34:33 +00:00
Chris Lattner
1f709a74f6
simplify getSectionForMergableConstant to take a SectionKind.
...
llvm-svn: 77134
2009-07-26 06:26:55 +00:00
Chris Lattner
d44b68fbeb
precreate 4/8/16 byte mergable sections to simplify code.
...
llvm-svn: 77133
2009-07-26 06:16:11 +00:00
Chris Lattner
e8b2f94ce2
introduce specialized mergable const sectionkinds for elements of size 4/8/16 to
...
simplify targets.
llvm-svn: 77132
2009-07-26 06:11:33 +00:00
Chris Lattner
736f3d6eb5
improve the default impl of getSectionForMergableConstant by
...
putting readonly constants in the readonly section if we have one.
llvm-svn: 77131
2009-07-26 05:57:07 +00:00
Chris Lattner
e795c027fd
make elf targets correctly handle constant pool entries that require relocations.
...
llvm-svn: 77130
2009-07-26 05:55:20 +00:00
Chris Lattner
b3d6d59c10
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.
llvm-svn: 77129
2009-07-26 05:44:20 +00:00
Daniel Dunbar
fe859a94dc
Sort list of targets in --version.
...
llvm-svn: 77127
2009-07-26 05:09:50 +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
1c59fa86e2
Oops, forgot XCore. Sorry XCore!
...
llvm-svn: 77125
2009-07-26 04:52:45 +00:00
Daniel Dunbar
6b705e3a64
Update for API change.
...
llvm-svn: 77124
2009-07-26 04:23:03 +00:00
Daniel Dunbar
5a9d56ab90
Update Triple to use StringRef/Twine based APIs.
...
- This is now shorter, simpler, safer, and more efficient, what a deal.
llvm-svn: 77119
2009-07-26 03:31:47 +00:00
Chris Lattner
5547fd80ad
put normal data into .data instead of .data.rel on elf systems.
...
llvm-svn: 77116
2009-07-26 03:06:11 +00:00
Daniel Dunbar
7917e05213
Remove unused header
...
llvm-svn: 77115
2009-07-26 02:23:52 +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
62e74f03c7
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.
llvm-svn: 77111
2009-07-26 02:12:58 +00:00
Chris Lattner
32fefa61d9
eliminate a pointless switch stmt.
...
llvm-svn: 77110
2009-07-26 01:44:55 +00:00
Chris Lattner
9cd489c7f1
finish simplifying DarwinTargetAsmInfo::SelectSectionForGlobal
...
for now. Make the section switching directives more consistent
by not including \n and including \t for them all.
llvm-svn: 77107
2009-07-26 01:24:18 +00:00
Daniel Dunbar
518cd20f61
Rewrite getName{Start,End,Len} in terms of getName(), instead of vice-versa.
...
llvm-svn: 77105
2009-07-26 00:51:56 +00:00
Chris Lattner
b95150b65a
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.
llvm-svn: 77104
2009-07-26 00:51:36 +00:00
Daniel Dunbar
ddf2470263
Simplify.
...
llvm-svn: 77102
2009-07-26 00:42:33 +00:00
Bob Wilson
ec256c8938
Add support for ARM Neon VREV instructions.
...
Patch by Anton Korzh, with some modifications from me.
llvm-svn: 77101
2009-07-26 00:39:34 +00:00
Daniel Dunbar
3e85b410ab
Remove Value::setName(const char*, unsigned).
...
llvm-svn: 77100
2009-07-26 00:34:27 +00:00
Daniel Dunbar
c1ab70760a
Remove Value::setName(const char*).
...
- Split into a separate patch because there is a slight functionality change,
it is no longer valid to call setName(0), which was equivalent to
setName(""). I'm hoping no one depends on this...
llvm-svn: 77099
2009-07-26 00:17:14 +00:00
Daniel Dunbar
038a7f0d35
Remove Value::{isName, getNameRef}.
...
Also, change MDString to use a StringRef.
llvm-svn: 77098
2009-07-25 23:55:21 +00:00
Chris Lattner
fda0ca90c1
make SectionKind be a first-class pod struct instead of just
...
an enum.
llvm-svn: 77096
2009-07-25 23:21:55 +00:00
Reid Kleckner
b159a2bad6
Added a test and fixed a bug in BumpPtrAllocator relating to large alignment
...
values. Hopefully this fixes PR4622.
llvm-svn: 77088
2009-07-25 21:26:02 +00:00
Chris Lattner
15b3d2039f
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.
llvm-svn: 77085
2009-07-25 18:57:34 +00:00
Chris Lattner
edbf2e64cb
document some invariants.
...
llvm-svn: 77084
2009-07-25 18:11:58 +00:00
Chris Lattner
cf7cc0ed7d
add the most expedient hack to fix PR4619, along with a testcase.
...
Thanks to Rafael for the great example.
llvm-svn: 77083
2009-07-25 17:57:37 +00:00
Dan Gohman
0781059503
SCEV objects are no longer reference-counted.
...
llvm-svn: 77080
2009-07-25 16:18:07 +00:00
Dan Gohman
c126330ef1
When attempting to sign-extend an addrec by interpreting
...
the step value as unsigned, the start value and the addrec
itself still need to be treated as signed.
llvm-svn: 77078
2009-07-25 16:03:30 +00:00
Andreas Bolka
72c14efff0
Convert DOUT to DEBUG.
...
llvm-svn: 77065
2009-07-25 12:19: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
Sanjiv Gupta
b09f01d842
Mark attributes of return insn correctly. It was being assumed safe to delete in isSafeToDelete (a thing checked-in 76281).
...
llvm-svn: 77056
2009-07-25 07:48:53 +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
Daniel Dunbar
9f50ab3c49
Finish migrating VMCore to StringRef/Twine based APIs.
...
llvm-svn: 77051
2009-07-25 06:02:13 +00:00
Daniel Dunbar
251177c96e
Initial update to VMCore to use Twines for string arguments.
...
- The only meat here is in Value.{h,cpp} the rest is essential 'const
std::string &' -> 'const Twine &'.
llvm-svn: 77048
2009-07-25 04:41:11 +00:00
Eric Christopher
b5f8390b6c
Fix 80-col violations.
...
llvm-svn: 77045
2009-07-25 02:45:27 +00:00
Eric Christopher
df9c86fc26
Move ExtractElementInst to ::Create instead of new. Update all uses.
...
llvm-svn: 77044
2009-07-25 02:28:41 +00:00
Evan Cheng
0f605005c5
80 col violation.
...
llvm-svn: 77041
2009-07-25 01:55:25 +00:00
Dan Gohman
9a7deba67e
Convert a few more things to use raw_ostream.
...
llvm-svn: 77039
2009-07-25 01:43:01 +00:00
Evan Cheng
5468ef5230
Get rid of a couple of unnecessary getOpcode calls.
...
llvm-svn: 77035
2009-07-25 01:25:08 +00:00
Dan Gohman
13aabe2ba4
Teach ScalarEvolution to make use of no-overflow flags when
...
analyzing add recurrences.
llvm-svn: 77034
2009-07-25 01:22:26 +00:00
Dan Gohman
fdf1a11a27
Convert a few more uses of llvm/Support/Streams.h to raw_ostream.
...
llvm-svn: 77033
2009-07-25 01:13:51 +00:00
Dan Gohman
a823846bd1
Instead of eagerly creating new SCEVs to replace all SCEVs that are
...
affected after a PHI node has been analyzed, just remove affected
SCEVs from the Scalars map, so that they'll be (lazily) recreated as
needed. This avoids creating SCEV objects that aren't actually needed.
Also, rewrite the associated def-use walking code to be non-recursive
and to continue traversing past Instructions that don't have an
entry in the Scalars map.
llvm-svn: 77032
2009-07-25 01:13:03 +00:00
Dan Gohman
acc5d6eaae
Make AliasAnalysis and related classes use
...
getAnalysisIfAvailable<TargetData>().
llvm-svn: 77028
2009-07-25 00:48:42 +00:00
Evan Cheng
e3a37c42fb
Another TODO.
...
llvm-svn: 77026
2009-07-25 00:39:37 +00:00
Evan Cheng
d615e606c4
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.
llvm-svn: 77024
2009-07-25 00:33:29 +00:00
Daniel Dunbar
8496064116
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.
llvm-svn: 77019
2009-07-25 00:23:56 +00:00
Evan Cheng
cb63bf2810
ARM code emitter can't handle Thumb2 instructions yet. So don't even try.
...
llvm-svn: 77018
2009-07-25 00:13:11 +00:00
Daniel Dunbar
5bf752cc30
Fix build for GCC 4.0?
...
llvm-svn: 77016
2009-07-24 23:42:33 +00:00
Daniel Dunbar
8fe4f99da4
Fix compile with 4.4 (I hope?); PR4617.
...
llvm-svn: 77015
2009-07-24 23:23:46 +00:00
Andreas Bolka
4e68450b70
Forward-declare raw_ostream.
...
llvm-svn: 77014
2009-07-24 23:19:28 +00:00
Owen Anderson
cc33e89571
Revert the ConstantInt constructors back to their 2.5 forms where possible, thanks to contexts-on-types. More to come.
...
llvm-svn: 77011
2009-07-24 23:12:02 +00:00
Dan Gohman
b895f668cc
AliasAnalysis wants sizes in address-units, not bits.
...
llvm-svn: 77009
2009-07-24 23:01:30 +00:00
Eli Friedman
11e86150c4
Fix assert assembling zero-argument constant GEP.
...
There's still a strict-aliasing violation here, but I don't feel like
dealing with that right now...
llvm-svn: 77005
2009-07-24 21:56:17 +00:00
Evan Cheng
84cf748468
Uh. It would be useful to actually print the operand.
...
llvm-svn: 77004
2009-07-24 20:47:38 +00:00
Chris Lattner
50d9b68935
fix some predicates
...
llvm-svn: 76999
2009-07-24 20:27:11 +00:00
Chris Lattner
89b6f54999
change SectionKindForGlobal from being a public (and
...
previously virtual) function to being a static function
in the .cpp file.
llvm-svn: 76997
2009-07-24 20:14:10 +00:00
Evan Cheng
597bf41097
Disable my constant island pass optimization (to make use soimm more effectively). It caused infinite looping on lencod.
...
llvm-svn: 76995
2009-07-24 19:31:03 +00:00
Chris Lattner
3d63455016
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.
llvm-svn: 76993
2009-07-24 19:15:47 +00:00
Evan Cheng
92376f5a32
Add a workaround for Darwin assembler bug where it's not setting the thumb bit in Thumb2 jumptable entries. We now pass Olden.
...
llvm-svn: 76991
2009-07-24 18:54:23 +00:00
Chris Lattner
5af94066ee
we already know the sectionkind when invoking SelectSectionForGlobal,
...
pass it in instead of recomputing it.
llvm-svn: 76990
2009-07-24 18:42:53 +00:00
Chris Lattner
cc951ce3cb
make SectionForGlobal non-virtual, add a hook for pic16 to do its "address=" hack.
...
llvm-svn: 76989
2009-07-24 18:34:27 +00:00
Dan Gohman
58619d5ad2
Fix this condition I accidentally inverted.
...
llvm-svn: 76988
2009-07-24 18:31:07 +00:00
Jakob Stoklund Olesen
5ca1bdc613
Add support for promoting SETCC operations.
...
llvm-svn: 76987
2009-07-24 18:22:59 +00:00
Evan Cheng
e01fec5446
Make sure thumb2 jumptable entries are aligned.
...
llvm-svn: 76986
2009-07-24 18:20:44 +00:00
Evan Cheng
c4221e9b04
Clean up.
...
llvm-svn: 76984
2009-07-24 18:20:16 +00:00
Evan Cheng
5bab9444f9
Replace use of std::set with SmallPtrSet.
...
llvm-svn: 76983
2009-07-24 18:19:46 +00:00
Dan Gohman
f1a01b8cc0
Convert several more passes to use getAnalysisIfAvailable<TargetData>()
...
instead of getAnalysis<TargetData>().
llvm-svn: 76982
2009-07-24 18:13:53 +00:00
Chris Lattner
a9c1641014
start refactoring pic16 section selection logic.
...
llvm-svn: 76977
2009-07-24 17:13:27 +00:00
Chris Lattner
37abb9f4ba
move ELF-specific code into ELFTargetAsmInfo.
...
llvm-svn: 76976
2009-07-24 17:02:17 +00:00
Chris Lattner
ad0925f556
tidy up
...
llvm-svn: 76975
2009-07-24 16:53:52 +00:00
Chris Lattner
bd89cc24bb
split the ELF-specific section flag inference-from-name code out
...
into its own helper function.
llvm-svn: 76974
2009-07-24 16:50:24 +00:00
Chris Lattner
6e4d35f825
make SectionFlagsForGlobal a private static function instead of a public
...
virtual one.
llvm-svn: 76973
2009-07-24 16:46:50 +00:00