summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Merge adjacent conditional.Bob Wilson2009-05-131-2/+0
| | | | llvm-svn: 71741
* Remove an unused variable.Bob Wilson2009-05-131-3/+0
| | | | llvm-svn: 71740
* Fix some typos and spelling and grammar, mostly in comments, but also oneBob Wilson2009-05-131-21/+20
| | | | | | field name. No functional changes. llvm-svn: 71739
* Run code placement optimization for targets that want it (arm and x86 for now).Evan Cheng2009-05-132-0/+4
| | | | llvm-svn: 71726
* Change MachineInstrBuilder::addReg() to take a flag instead of a list ofBill Wendling2009-05-131-3/+3
| | | | | | | | | | | | booleans. This gives a better indication of what the "addReg()" is doing. Remembering what all of those booleans mean isn't easy, especially if you aren't spending all of your time in that code. I took Jakob's suggestion and made it illegal to pass in "true" for the flag. This should hopefully prevent any unintended misuse of this (by reverting to the old way of using addReg()). llvm-svn: 71722
* Move the bookkeeping of the debug scopes back to the place where itBill Wendling2009-05-131-20/+20
| | | | | | | | belonged. The variable declaration stuff wasn't happy with it where it was. Sorry that the testcase is so big. Bugpoint wasn't able to reduce it successfully. llvm-svn: 71714
* PEI: rename PEI.h to PrologEpilogInserter.h to adhere to file naming standardJohn Mosby2009-05-133-2/+2
| | | | llvm-svn: 71678
* add ShrinkWrapping.cppChris Lattner2009-05-131-0/+1
| | | | llvm-svn: 71645
* Fix for PR4121. If TwoAddressInstructionPass removes a dead def, and the regBLang Hames2009-05-131-0/+6
| | | | | | operand was killed, the kill needs to be removed from regB's VarInfo. llvm-svn: 71635
* Add support for GCC compatible builtin setjmp and longjmp intrinsics. This isJim Grosbach2009-05-123-1/+8
| | | | | | | a supporting preliminary patch for GCC-compatible SjLJ exception handling. Note that these intrinsics are not designed to be invoked directly by the user, but rather used by the front-end as target hooks for exception handling. llvm-svn: 71610
* If header of inner loop is aligned, do not align the outer loop header. We ↵Evan Cheng2009-05-121-6/+33
| | | | | | don't want to add nops in the outer loop for the sake of aligning the inner loop. llvm-svn: 71609
* Teach TransferDeadness to delete truly dead instructions if they do not ↵Evan Cheng2009-05-122-21/+60
| | | | | | produce side effects. llvm-svn: 71606
* Restructure PEI code:John Mosby2009-05-123-1307/+1375
| | | | | | | | | - moved shrink wrapping code from PrologEpilogInserter.cpp to new file ShrinkWrapping.cpp. - moved PEI pass definition into new shared header PEI.h. llvm-svn: 71588
* Switch to using IRBuilder throughout.Jay Foad2009-05-121-204/+195
| | | | llvm-svn: 71587
* Fixed a stack slot coloring with reg bug: do not update implicit use / def ↵Evan Cheng2009-05-122-16/+47
| | | | | | when doing forward / backward propagation. llvm-svn: 71574
* Fix pr4195: When iterating through predecessor blocks, break out of the loopBob Wilson2009-05-121-3/+3
| | | | | | | | | | | after finding the (unique) layout predecessor. Sometimes a block may be listed more than once, and processing it more than once in this loop can lead to inconsistent values for FtTBB/FtFBB, since the AnalyzeBranch method does not clear these values. There's no point in continuing the loop regardless. The testcase for this is reduced from the 2003-05-02-DependentPHI SingleSource test. llvm-svn: 71536
* - Record that the debug info is actually used so that the label folder doesn'tBill Wendling2009-05-121-10/+10
| | | | | | | blast it away. - Move InlineInfo bookkeeping to bookkeep the correct debug info object. llvm-svn: 71519
* Fixed PR4090.Lang Hames2009-05-111-1/+16
| | | | llvm-svn: 71495
* Fix PR4188. TailMerging can't tolerate inexactDale Johannesen2009-05-111-0/+15
| | | | | | sucessor info. llvm-svn: 71478
* Apply patch review feedback.Evan Cheng2009-05-111-0/+2
| | | | llvm-svn: 71472
* Unbreak non-debug build.Evan Cheng2009-05-111-0/+8
| | | | llvm-svn: 71457
* Eliminate a compiler warning.Evan Cheng2009-05-111-0/+1
| | | | llvm-svn: 71456
* When scalarizing a vector BITCAST, check whether the operand has vectorDan Gohman2009-05-111-1/+2
| | | | | | | | type, rather than assume that it does. If the operand is not vector, it shouldn't be run through ScalarizeVectorOp. This fixes one of the testcases in PR3886. llvm-svn: 71453
* Shrink wrapping in PEI:John Mosby2009-05-111-610/+1066
| | | | | | | | | | | | | | | - reduces _static_ callee saved register spills and restores similar to Chow's original algorithm. - iterative implementation with simple heuristic limits to mitigate compile time impact. - handles placing spills/restores for multi-entry, multi-exit regions in the Machine CFG without splitting edges. - passes test-suite in LLCBETA mode. Added contains() method to ADT/SparseBitVector. llvm-svn: 71438
* Don't generate redundant casts of constant values when lowering calls toJay Foad2009-05-111-38/+29
| | | | | | memcpy, memmove and memset. llvm-svn: 71427
* This is a large rewrite of how Dwarf info for inlined functions is handled.Bill Wendling2009-05-101-95/+225
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The DwarfWriter expects DbgScopes and DIEs to behave themselves according to DwarfWriter's rules. However, inlined functions violate these rules. There are two different types of DIEs associated with an inlined function: an abstract instance, which has information about the original source code for the function being inlined; and concrete instances, which are created for each place the function was inlined and point back to the abstract instance. This patch tries to stay true to this schema. It bypasses how regular DbgScopes and DIEs are created and used when necessary. It provides special handling for DIEs of abstract and concrete instances. This doesn't take care of all of the problems with debug info for inlined functions, but it's a step in the right direction. For one thing, llvm-gcc generates wrong IR (it's missing some llvm.dbg intrinsics at the point where the function's inlined) for this example: #include <stdio.h> static __inline__ __attribute__((always_inline)) int bar(int x) { return 4; } void foo() { long long b = 1; int Y = bar(4); printf("%d\n", Y); } while clang generates correct IR. llvm-svn: 71410
* --- Reverse-merging r71370 into '.':Bill Wendling2009-05-101-34/+58
| | | | | | | | U lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Revert r71370. llvm-svn: 71373
* A debug function start was not being recorded when the optimization level wasn'tBill Wendling2009-05-091-58/+34
| | | | | | | | None. However, we were always recording the region end. There's no longer a good reason for this code to be separated out between the different opt levels, as it was doing pretty much the same thing anyway. llvm-svn: 71370
* Oops. Don't forget to align single bb loops.Evan Cheng2009-05-091-1/+1
| | | | llvm-svn: 71363
* Rename PaddedSize to AllocSize, in the hope that thisDuncan Sands2009-05-0910-30/+30
| | | | | | | will make it more obvious what it represents, and stop it being confused with the StoreSize. llvm-svn: 71349
* Enable loop bb placement optimization.Evan Cheng2009-05-081-9/+0
| | | | llvm-svn: 71291
* Avoid warning in release-asserts build.Mike Stump2009-05-081-0/+1
| | | | llvm-svn: 71275
* Mirror how Fast ISel determines if a region.end intrinsic is the end of anBill Wendling2009-05-081-15/+12
| | | | | | | | | inlined function or the end of a function. Before, this was never executing the "inlined" version of the Record method. This will become important once the inlined Dwarf writer patch lands. llvm-svn: 71268
* Compute the offsets of the compile units. We need this so that when we emit aBill Wendling2009-05-081-11/+20
| | | | | | | | | concrete instance of an inlined function, we can get the actual address of the abstract instance inside of the compile unit. This isn't currently used, but will be by a future check-in. llvm-svn: 71263
* Minor clean ups. No functionality change.Bill Wendling2009-05-081-5/+4
| | | | llvm-svn: 71256
* Don't align loop header unless the loop back edge is below the header.Evan Cheng2009-05-081-1/+17
| | | | llvm-svn: 71242
* Factor out cycle-finder code and make it generic.Anton Korobeynikov2009-05-081-0/+116
| | | | llvm-svn: 71241
* Do not emit bit tests if target does not support natively left shiftAnton Korobeynikov2009-05-081-0/+4
| | | | llvm-svn: 71240
* Properly expand libcalls for urem / srem. Also make code more straightforward.Anton Korobeynikov2009-05-081-29/+40
| | | | llvm-svn: 71238
* TypoAnton Korobeynikov2009-05-081-1/+1
| | | | llvm-svn: 71237
* Reverse branch condition only when there is a conditional branch.Evan Cheng2009-05-081-1/+2
| | | | llvm-svn: 71214
* Add explicit braces to disambiguate nested if/else. Removes a warning.Nick Lewycky2009-05-081-1/+2
| | | | llvm-svn: 71211
* Optimize code placement in loop to eliminate unconditional branches or move ↵Evan Cheng2009-05-081-16/+236
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | unconditional branch to the outside of the loop. e.g. /// A: /// ... /// <fallthrough to B> /// /// B: --> loop header /// ... /// jcc <cond> C, [exit] /// /// C: /// ... /// jmp B /// /// ==> /// /// A: /// ... /// jmp B /// /// C: --> new loop header /// ... /// <fallthough to B> /// /// B: /// ... /// jcc <cond> C, [exit] llvm-svn: 71209
* Fix pr4100. Do not remove no-op copies when they are dead. The registerBob Wilson2009-05-071-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | scavenger gets confused about register liveness if it doesn't see them. I'm not thrilled with this solution, but it only comes up when there are dead copies in the code, which is something that hopefully doesn't happen much. Here is what happens in pr4100: As shown in the following excerpt from the debug output of llc, the source of a move gets reloaded from the stack, inserting a new load instruction before the move. Since that source operand is a kill, the physical register is free to be reused for the destination of the move. The move ends up being a no-op, copying R3 to R3, so it is deleted. But, it leaves behind the load to reload %reg1028 into R3, and that load is not updated to show that it's destination operand (R3) is dead. The scavenger gets confused by that load because it thinks that R3 is live. Starting RegAlloc of: %reg1025<def,dead> = MOVr %reg1028<kill>, 14, %reg0, %reg0 Regs have values: Reloading %reg1028 into R3 Last use of R3[%reg1028], removing it from live set Assigning R3 to %reg1025 Register R3 [%reg1025] is never used, removing it from live set Alternative solutions might be either marking the load as dead, or zapping the load along with the no-op copy. I couldn't see an easy way to do either of those, though. llvm-svn: 71196
OpenPOWER on IntegriCloud