summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
* Add a proper implementation of EXTRACT_SUBVECTOR legalization that Eli Friedman2009-05-231-19/+42
| | | | | | | | doesn't split legal vector operands. This is necessary because the type legalization (and therefore, vector splitting) code will be going away soon. llvm-svn: 72349
* Fix PR4254.Torok Edwin2009-05-231-2/+2
| | | | | | | | | | | The DAGCombiner created a negative shiftamount, stored in an unsigned variable. Later the optimizer eliminated the shift entirely as being undefined. Example: (srl (shl X, 56) 48). ShiftAmt is 4294967288. Fix it by checking that the shiftamount is positive, and storing in a signed variable. llvm-svn: 72331
* Add a new step to legalization to legalize vector math operations. This Eli Friedman2009-05-232-0/+362
| | | | | | | | | | | will allow simplifying LegalizeDAG to eliminate type legalization. (I have a patch to do that, but it's not quite finished; I'll commit it once it's finished and I've fixed any review comments for this patch.) See the comment at the beginning of lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp for more details on the motivation for this patch. llvm-svn: 72325
* Add a new codegen pass that normalizes dwarf exception handlingDuncan Sands2009-05-226-12/+407
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | code in preparation for code generation. The main thing it does is handle the case when eh.exception calls (and, in a future patch, eh.selector calls) are far away from landing pads. Right now in practice you only find eh.exception calls close to landing pads: either in a landing pad (the common case) or in a landing pad successor, due to loop passes shifting them about. However future exception handling improvements will result in calls far from landing pads: (1) Inlining of rewinds. Consider the following case: In function @f: ... invoke @g to label %normal unwind label %unwinds ... unwinds: %ex = call i8* @llvm.eh.exception() ... In function @g: ... invoke @something to label %continue unwind label %handler ... handler: %ex = call i8* @llvm.eh.exception() ... perform cleanups ... "rethrow exception" Now inline @g into @f. Currently this is turned into: In function @f: ... invoke @something to label %continue unwind label %handler ... handler: %ex = call i8* @llvm.eh.exception() ... perform cleanups ... invoke "rethrow exception" to label %normal unwind label %unwinds unwinds: %ex = call i8* @llvm.eh.exception() ... However we would like to simplify invoke of "rethrow exception" into a branch to the %unwinds label. Then %unwinds is no longer a landing pad, and the eh.exception call there is then far away from any landing pads. (2) Using the unwind instruction for cleanups. It would be nice to have codegen handle the following case: invoke @something to label %continue unwind label %run_cleanups ... handler: ... perform cleanups ... unwind This requires turning "unwind" into a library call, which necessarily takes a pointer to the exception as an argument (this patch also does this unwind lowering). But that means you are using eh.exception again far from a landing pad. (3) Bugpoint simplifications. When bugpoint is simplifying exception handling code it often generates eh.exception calls far from a landing pad, which then causes codegen to assert. Bugpoint then latches on to this assertion and loses sight of the original problem. Note that it is currently rare for this pass to actually do anything. And in fact it normally shouldn't do anything at all given the code coming out of llvm-gcc! But it does fire a few times in the testsuite. As far as I can see this is almost always due to the LoopStrengthReduce codegen pass introducing pointless loop preheader blocks which are landing pads and only contain a branch to another block. This other block contains an eh.exception call. So probably by tweaking LoopStrengthReduce a bit this can be avoided. llvm-svn: 72276
* Use v.data() instead of &v[0] when SmallVector v might be empty.Jay Foad2009-05-211-1/+1
| | | | llvm-svn: 72210
* Temporarily revert r72191. It was causing an assert during llvm-gccBill Wendling2009-05-216-124/+27
| | | | | | bootstrapping. llvm-svn: 72200
* Minor code cleanup. No functionality change.Bill Wendling2009-05-201-18/+7
| | | | llvm-svn: 72198
* Merge 'ConstructFunctionDbgScope' and 'ConstructAbstractDbgScope'.Bill Wendling2009-05-202-41/+14
| | | | llvm-svn: 72197
* Rename 'New*' methods to 'Create*' to be consistent. 'NewString' isn't used.Bill Wendling2009-05-202-20/+13
| | | | llvm-svn: 72196
* Add comment for emit section.Bill Wendling2009-05-201-0/+4
| | | | llvm-svn: 72195
* Move 'Emit' methods down to their own place.Bill Wendling2009-05-201-720/+720
| | | | llvm-svn: 72194
* Revert r72192. It was causing a build failure.Bill Wendling2009-05-202-779/+807
| | | | llvm-svn: 72193
* Do some mechanical changes. Combine the 'construct abastract dbg thingy' in withBill Wendling2009-05-202-807/+779
| | | | | | | the 'constract function dbg thingy'. Rename some methods to make them consistent with the rest of the methods. Move the 'Emit' methods to the end of the file. llvm-svn: 72192
* Introduce DebugScope which gets embedded into the machine instructions' ↵Argyrios Kyrtzidis2009-05-206-27/+124
| | | | | | | | DebugLoc. DebugScope refers to a debug region, function or block. llvm-svn: 72191
* Fix for PR4235: to build a floating-point value from integer parts, Eli Friedman2009-05-201-5/+19
| | | | | | | | | | | | build an integer and cast that to a float. This fixes a crash caused by trying to split an f32 into two f16's. This changes the behavior in test/CodeGen/XCore/fneg.ll because that testcase now triggers a DAGCombine which converts the fneg into an integer operation. If someone is interested, it's probably possible to tweak the test to generate an actual fneg. llvm-svn: 72162
* Forward decls.Bill Wendling2009-05-191-0/+3
| | | | llvm-svn: 72114
* Remove 'class' specifier.Bill Wendling2009-05-191-3/+3
| | | | llvm-svn: 72113
* Fix to compile on VS2008.Bill Wendling2009-05-191-1/+2
| | | | llvm-svn: 72112
* Remove the #ifndef NDEBUG from the FastISel debugging options. ThisDan Gohman2009-05-191-5/+0
| | | | | | fixes dejagnu tests that use these options. llvm-svn: 72094
* Fix cmake builds.Mike Stump2009-05-192-0/+6
| | | | llvm-svn: 72078
* Don't set the "location" information for inlined functions' variables.Bill Wendling2009-05-181-7/+16
| | | | llvm-svn: 72064
* Small code cleanup.Bill Wendling2009-05-181-9/+4
| | | | llvm-svn: 72057
* RecordVariable is called each time a DECLARE node is encountered. For an inlinedBill Wendling2009-05-182-9/+39
| | | | | | | | function, this could be many, many times. We don't want to re-add variables to that DIE for each time. We just want to add them once. Check to make sure that we haven't added them already. llvm-svn: 72047
* Fix CodePlacementOpt::OptimizeIntraLoopEdges so that its return valueBob Wilson2009-05-181-0/+2
| | | | | | correctly indicates whether it changed the code. llvm-svn: 72038
* New Spiller interface and trivial implementation.Lang Hames2009-05-183-2/+262
| | | | llvm-svn: 72030
* Revert last commit. It was wrong.Bill Wendling2009-05-181-2/+1
| | | | llvm-svn: 72026
* Don't call RegionInlinedFnEnd if our optimization level isn't -O0.Bill Wendling2009-05-181-1/+2
| | | | llvm-svn: 72024
* Silence Release-Asserts warnings.Daniel Dunbar2009-05-182-6/+10
| | | | llvm-svn: 72011
* Prevented reg0 from being added to MBB live-in set, which was causing issuesLang Hames2009-05-171-0/+5
| | | | | | for PostRAScheduler. llvm-svn: 71991
* Rename MachineVerifier pass to avoid command line collision.Jakob Stoklund Olesen2009-05-171-1/+1
| | | | llvm-svn: 71987
* Verify that explicit definitions in the TargetInstrDesc are matched byJakob Stoklund Olesen2009-05-161-1/+12
| | | | | | explicit register define operands. llvm-svn: 71933
* Allow redefinition of reserved registers.Jakob Stoklund Olesen2009-05-161-2/+3
| | | | llvm-svn: 71932
* Put back a bit of expensive checking logic thatDuncan Sands2009-05-161-1/+1
| | | | | | was overenthusiastically deleted in r70234. llvm-svn: 71926
* Pacify gcc-4.3, which suggests explicit braces hereDuncan Sands2009-05-161-1/+2
| | | | | | to avoid an ambiguous else. llvm-svn: 71924
* Pass to verify generated machine code.Jakob Stoklund Olesen2009-05-163-27/+704
| | | | | | | | | | | | | | | | | | | The following is checked: * Operand counts: All explicit operands must be present. * Register classes: All physical and virtual register operands must be compatible with the register class required by the instruction descriptor. * Register live intervals: Registers must be defined only once, and must be defined before use. The machine code verifier is enabled with the command-line option '-verify-machineinstrs', or by defining the environment variable LLVM_VERIFY_MACHINEINSTRS to the name of a file that will receive all the verifier errors. llvm-svn: 71918
* Split out the DwarfDebug module from the DwarfWriter module.Bill Wendling2009-05-157-2804/+3188
| | | | | | Again, no intendtional functionality change. llvm-svn: 71854
* Mark class as hidden.Bill Wendling2009-05-151-1/+1
| | | | llvm-svn: 71850
* Fix PR4210. Rewritter should track and update kills of sub-registers as well.Evan Cheng2009-05-151-42/+63
| | | | llvm-svn: 71848
* Move c'tor/d'tor to top of file.Bill Wendling2009-05-151-17/+14
| | | | llvm-svn: 71828
* Split out the DwarfException class into its own file. No functionality change,Bill Wendling2009-05-153-769/+894
| | | | | | though the classes have been marked with "VISIBILITY_HIDDEN". llvm-svn: 71827
* Split out the Dwarf writer stuff into separate files. This is a much moreBill Wendling2009-05-157-1278/+1584
| | | | | | | | | logical/sane approach to organizing all of the stuff that goes into writing out DWARF information. Honestly? even this is too complex for what it's supposed to be doing. Trivia: It *looks* like there would be functionality changes, however there aren't! llvm-svn: 71821
* Down with static variables!Owen Anderson2009-05-141-4/+8
| | | | | | Part one of many. llvm-svn: 71785
* Tag blocks with DW_AT_APPLE_block.Mike Stump2009-05-141-0/+7
| | | | llvm-svn: 71784
* Revert r71744. I must not have understood this correctly, because theBob Wilson2009-05-141-4/+9
| | | | | | assertion is failing for some tests. llvm-svn: 71779
* Fix for PR4124. Make TwoAddressFormPass::FindLastUseInMBB return the real ↵Lang Hames2009-05-141-2/+5
| | | | | | last use. llvm-svn: 71769
* Add an assert to turn a segfault on an unsupported inlineDan Gohman2009-05-141-0/+2
| | | | | | asm construct into an assertion failure. llvm-svn: 71757
* There's yet more ugliness (surprise!) in DebugInfo. This needs major reworking.Bill Wendling2009-05-131-21/+30
| | | | | | | Basically, there was a situation where it was getting an empty vector and doing a .back() on that. Which isn't cool. llvm-svn: 71746
* The IfConverter::MergeBlocks method appears to be used only to merge a basicBob Wilson2009-05-131-9/+4
| | | | | | | | block with its unique predecessor. Change the code to assert if that is not the case, instead of trying to handle situations where the block has multiple predecessors. llvm-svn: 71744
* Removing the HasBuiltinSetjmp flag and associated bits. Flagging the presenceJim Grosbach2009-05-133-8/+1
| | | | | | | | | of exception handling builtin sjlj targets in functions turns out not to be necessary. Marking the intrinsic implementation in the .td file as defining all registers is sufficient to get the context saved properly by the containing function. llvm-svn: 71743
* Revert a portion of Dan's change r71018 that I'm convinced is wrong.Bob Wilson2009-05-131-1/+1
| | | | | | | | | | | | | | | | | | | Dan was trying to catch the case where a basic block ends with a conditional branch to the fall-through block. In this case, all the instructions have been moved out of FromBBI, leaving it empty. It cannot end with a conditional branch. As the existing comment indicates, it will always fall through to the next block. If the block already had the next block (NBB) listed as a successor, the preceding loop has a check for that and does not remove it. Thus, we need to check and add the successor only when it is not already listed. With Dan's change, the empty block often ends up with the fall-through successor listed twice. This exposed the problem in pr4195, where CodePlacementOpt did not handle the same predecessor listed more than once. It is also at least partially responsible for pr4202 and probably a similar issue with Thumb branches being out of range. llvm-svn: 71742
OpenPOWER on IntegriCloud