summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
* Optimize some common usage patterns of atomic built-ins ↵Evan Cheng2009-07-301-0/+1
| | | | | | | | | | | | __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. llvm-svn: 77582
* Move types back to the 2.5 API.Owen Anderson2009-07-299-49/+34
| | | | llvm-svn: 77516
* inline the global 'getInstrOperandRegClass' function into its callersChris Lattner2009-07-294-14/+18
| | | | | | now that TargetOperandInfo does the heavy lifting. llvm-svn: 77508
* Forgot to output the base offset.Bill Wendling2009-07-291-4/+8
| | | | llvm-svn: 77505
* 1. Introduce a new TargetOperandInfo::getRegClass() helper methodChris Lattner2009-07-291-4/+2
| | | | | | | | | | | | | 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. llvm-svn: 77504
* Remove now unused Context variables.Benjamin Kramer2009-07-291-1/+0
| | | | llvm-svn: 77495
* Move ConstantExpr to 2.5 API.Owen Anderson2009-07-292-2/+2
| | | | llvm-svn: 77494
* pass the mangler down into the various SectionForGlobal methods.Chris Lattner2009-07-292-3/+4
| | | | | | No functionality change. llvm-svn: 77432
* Move comment to above method.Bill Wendling2009-07-291-21/+21
| | | | llvm-svn: 77412
* - Temporarily unbreak the build by forcing the TType "absptr", which isn'tBill Wendling2009-07-292-50/+75
| | | | | | | 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
* Cleanup code to use iterators instead of ".size()".Bill Wendling2009-07-281-21/+25
| | | | | | Does any one else hate the name "const_reverse_iterator" as much as I do? llvm-svn: 77399
* Doxygenify comments.Bill Wendling2009-07-282-2/+4
| | | | llvm-svn: 77394
* Split out large loop into it's very own method. No intended functionality ↵Bill Wendling2009-07-282-42/+62
| | | | | | change. llvm-svn: 77393
* Output the EH TType format and base offset only if there are types that we'reBill Wendling2009-07-281-6/+15
| | | | | | going to emit. llvm-svn: 77382
* Use the preferred EH data format for the preferred EH data format.Bill Wendling2009-07-281-2/+2
| | | | llvm-svn: 77373
* Fix a typo.Evan Cheng2009-07-281-1/+1
| | | | llvm-svn: 77369
* Return ConstantVector to 2.5 API.Owen Anderson2009-07-282-2/+2
| | | | llvm-svn: 77366
* Handle null and file symbol on doInitializationBruno Cardoso Lopes2009-07-282-9/+8
| | | | llvm-svn: 77354
* Change ConstantArray to 2.5 API.Owen Anderson2009-07-282-2/+2
| | | | llvm-svn: 77347
* Add reload and remat backscheduling. This is disabled by default. UseDavid Greene2009-07-281-26/+150
| | | | | | -schedule-spills=true to enable. llvm-svn: 77327
* Rip all of the global variable lowering logic out of TargetAsmInfo. SinceChris Lattner2009-07-285-25/+43
| | | | | | | | | | | | | | | | | | | | 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
* Avoid build warnings.Mike Stump2009-07-271-0/+1
| | | | llvm-svn: 77271
* Move ConstantStruct back to 2.5 API.Owen Anderson2009-07-271-2/+2
| | | | llvm-svn: 77266
* hoist MCContext/MCStreamer up to AsmPrinter since we're going to start creatingChris Lattner2009-07-271-0/+11
| | | | | | | MCSections soon instead of Section for all targets, and we need something to own them. llvm-svn: 77252
* Move ConstantFP construction back to the 2.5-ish API.Owen Anderson2009-07-272-5/+3
| | | | llvm-svn: 77247
* fix commentBruno Cardoso Lopes2009-07-271-1/+1
| | | | llvm-svn: 77239
* add module identifier to the elf object fileBruno Cardoso Lopes2009-07-273-9/+26
| | | | llvm-svn: 77238
* Handle external symbols for ELF and add some static methods to ELFSymBruno Cardoso Lopes2009-07-274-46/+155
| | | | llvm-svn: 77232
* Eliminate SectionFlags, just embed a SectionKind into SectionChris Lattner2009-07-273-18/+19
| | | | | | instead and drive things based off of that. llvm-svn: 77184
* Reorganize code a bit to reduce indentation. No visible functionality Eli Friedman2009-07-261-287/+287
| | | | | | change. llvm-svn: 77171
* Remove Value::getName{Start,End}, the last of the old Name APIs.Daniel Dunbar2009-07-264-8/+7
| | | | llvm-svn: 77152
* Remove Value::getNameLenDaniel Dunbar2009-07-261-18/+6
| | | | llvm-svn: 77148
* remove a densemap from TargetAsmInfo that was uniquing the targetflags strings,Chris Lattner2009-07-261-4/+8
| | | | | | just use a smallstring instead. llvm-svn: 77144
* make SectionKind know whether a symbol is weak or not in additionChris Lattner2009-07-262-14/+18
| | | | | | to its classification. llvm-svn: 77140
* rename Mergable -> Mergeable and Writable -> WriteableChris Lattner2009-07-262-11/+10
| | | | llvm-svn: 77138
* two files I missed in the last commit.Chris Lattner2009-07-262-12/+12
| | | | llvm-svn: 77137
* simplify getSectionForMergableConstant to take a SectionKind.Chris Lattner2009-07-262-9/+30
| | | | llvm-svn: 77134
* Remove Value::{isName, getNameRef}.Daniel Dunbar2009-07-251-1/+1
| | | | | | Also, change MDString to use a StringRef. llvm-svn: 77098
* this is (unfortunately) several changes mixed together:Chris Lattner2009-07-251-1/+1
| | | | | | | | | | | | | | 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
* Convert a few more things to use raw_ostream.Dan Gohman2009-07-252-26/+27
| | | | llvm-svn: 77039
* More migration to raw_ostream, the water has dried up around the iostream hole.Daniel Dunbar2009-07-2516-86/+101
| | | | | | | | | | - 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
* Revert the ConstantInt constructors back to their 2.5 forms where possible, ↵Owen Anderson2009-07-246-44/+44
| | | | | | thanks to contexts-on-types. More to come. llvm-svn: 77011
* Add support for promoting SETCC operations.Jakob Stoklund Olesen2009-07-244-13/+20
| | | | llvm-svn: 76987
* remove a use of SectionFlagsForGlobal.Chris Lattner2009-07-241-3/+4
| | | | llvm-svn: 76970
* More move to raw_ostream.Daniel Dunbar2009-07-241-4/+3
| | | | llvm-svn: 76966
* Move more to raw_ostream, provide support for writing MachineBasicBlock,Daniel Dunbar2009-07-245-5/+45
| | | | | | LiveInterval, etc to raw_ostream. llvm-svn: 76965
* Move to raw_ostream.Daniel Dunbar2009-07-242-38/+39
| | | | llvm-svn: 76963
* Switch to getNameStr().Daniel Dunbar2009-07-244-13/+13
| | | | llvm-svn: 76962
* document SectionFlags::Named better and make it more easily greppable byChris Lattner2009-07-241-1/+1
| | | | | | eliminating isNamed. llvm-svn: 76946
* "fix" PR4612, which is a crash on:Chris Lattner2009-07-231-1/+5
| | | | | | | | | | %0 = malloc [3758096384 x i32] The "malloc" instruction doesn't support 64-bits correctly (see PR715), and should be removed. Victor is actively working on fixing this, in the meantime just don't crash. llvm-svn: 76899
OpenPOWER on IntegriCloud