aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71453 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71438 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't generate redundant casts of constant values when lowering calls toJay Foad2009-05-111-38/+29
| | | | | | memcpy, memmove and memset. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71427 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71410 91177308-0d34-0410-b5e6-96231b3b80d8
* --- Reverse-merging r71370 into '.':Bill Wendling2009-05-101-34/+58
| | | | | | | | | U lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Revert r71370. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71373 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71370 91177308-0d34-0410-b5e6-96231b3b80d8
* Oops. Don't forget to align single bb loops.Evan Cheng2009-05-091-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71363 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71349 91177308-0d34-0410-b5e6-96231b3b80d8
* Enable loop bb placement optimization.Evan Cheng2009-05-081-9/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71291 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid warning in release-asserts build.Mike Stump2009-05-081-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71275 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71268 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71263 91177308-0d34-0410-b5e6-96231b3b80d8
* Minor clean ups. No functionality change.Bill Wendling2009-05-081-5/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71256 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't align loop header unless the loop back edge is below the header.Evan Cheng2009-05-081-1/+17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71242 91177308-0d34-0410-b5e6-96231b3b80d8
* Factor out cycle-finder code and make it generic.Anton Korobeynikov2009-05-081-0/+116
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71241 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not emit bit tests if target does not support natively left shiftAnton Korobeynikov2009-05-081-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71240 91177308-0d34-0410-b5e6-96231b3b80d8
* Properly expand libcalls for urem / srem. Also make code more straightforward.Anton Korobeynikov2009-05-081-29/+40
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71238 91177308-0d34-0410-b5e6-96231b3b80d8
* TypoAnton Korobeynikov2009-05-081-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71237 91177308-0d34-0410-b5e6-96231b3b80d8
* Reverse branch condition only when there is a conditional branch.Evan Cheng2009-05-081-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71214 91177308-0d34-0410-b5e6-96231b3b80d8
* Add explicit braces to disambiguate nested if/else. Removes a warning.Nick Lewycky2009-05-081-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71211 91177308-0d34-0410-b5e6-96231b3b80d8
* 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] git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71209 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71196 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a comment (again).Bob Wilson2009-05-071-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71180 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a comment.Bob Wilson2009-05-071-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71179 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert 71165. It did more than just revert 71158 and it introducedDan Gohman2009-05-073-147/+61
| | | | | | | several regressions. The problem due to 71158 is now fixed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71176 91177308-0d34-0410-b5e6-96231b3b80d8
* Temporarily revert r71158. It was causing a failure during a full bootstrap:Bill Wendling2009-05-073-61/+147
| | | | | | | | | | | | | | | | | | | | | | | checking for bcopy... no checking for getc_unlocked... Assertion failed: (0 && "Unknown SCEV kind!"), function operator(), file /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore.roots/llvmCore~obj/src/lib/Analysis/ScalarEvolution.cpp, line 511. /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmgcc42.roots/llvmgcc42~obj/src/libdecnumber/decUtility.c:360: internal compiler error: Abort trap Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://developer.apple.com/bugreporter> for instructions. make[4]: *** [decUtility.o] Error 1 make[4]: *** Waiting for unfinished jobs.... Assertion failed: (0 && "Unknown SCEV kind!"), function operator(), file /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore.roots/llvmCore~obj/src/lib/Analysis/ScalarEvolution.cpp, line 511. /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmgcc42.roots/llvmgcc42~obj/src/libdecnumber/decNumber.c:5591: internal compiler error: Abort trap Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://developer.apple.com/bugreporter> for instructions. make[4]: *** [decNumber.o] Error 1 make[3]: *** [all-stage2-libdecnumber] Error 2 make[3]: *** Waiting for unfinished jobs.... git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71165 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the tablegen-produced DebugLoc handling into a ↵Argiris Kirtzidis2009-05-071-0/+17
| | | | | | | | | AsmWriter::processDebugLoc function. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71156 91177308-0d34-0410-b5e6-96231b3b80d8
* Code refactoring.Evan Cheng2009-05-071-7/+22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71151 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename "loop aligner" pass to "code placement optimization" pass.Evan Cheng2009-05-073-12/+16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71150 91177308-0d34-0410-b5e6-96231b3b80d8
* Just turn aggressive stack coloring off at -O3.Bill Wendling2009-05-072-10/+23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71140 91177308-0d34-0410-b5e6-96231b3b80d8
* Temporarily revert r71010. It was causing massive failures during self-hosting.Bill Wendling2009-05-072-22/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71138 91177308-0d34-0410-b5e6-96231b3b80d8
* Make DwarfWriter::RecordInlinedFnStart more like the other DwarfWriter's ↵Argiris Kirtzidis2009-05-073-20/+21
| | | | | | | | | | | | methods: -Have it return a label ID -Remove the unused Instruction parameter No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71132 91177308-0d34-0410-b5e6-96231b3b80d8
* - Move some debug fields to coincide with how GCC emits them. No functionalityBill Wendling2009-05-061-24/+53
| | | | | | | | change. - Reformatting. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71118 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not use register as base ptr of pre- and post- inc/dec load / store nodes.Evan Cheng2009-05-061-1/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71098 91177308-0d34-0410-b5e6-96231b3b80d8
* CMake: Updated lib/CodeGen/CMakeLists.txt.Oscar Fuentes2009-05-061-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71085 91177308-0d34-0410-b5e6-96231b3b80d8
* Add generic expansion of SUB when ADD and XORDuncan Sands2009-05-061-8/+12
| | | | | | | are legal. Based on a patch by Micah Villmow. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71078 91177308-0d34-0410-b5e6-96231b3b80d8
* Renamed Spiller classes (plus uses and related files) to VirtRegRewriter.Lang Hames2009-05-066-2244/+2206
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71057 91177308-0d34-0410-b5e6-96231b3b80d8
* If a MachineBasicBlock has multiple ways of reaching another block,Dan Gohman2009-05-052-9/+5
| | | | | | | | | allow it to have multiple CFG edges to that block. This is needed to allow MachineBasicBlock::isOnlyReachableByFallthrough to work correctly. This fixes PR4126. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71018 91177308-0d34-0410-b5e6-96231b3b80d8
* Enable stack coloring with regs at -O3.Evan Cheng2009-05-052-10/+22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71010 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not require variable debug info nodes to have a compile unit.Chris Lattner2009-05-051-20/+24
| | | | | | | | For implicit decls like "self" and "_cmd" in ObjC, these decls should not have a location. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70964 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not substitute if the new register isn't in the register class of the ↵Evan Cheng2009-05-051-0/+14
| | | | | | operand being updated. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70953 91177308-0d34-0410-b5e6-96231b3b80d8
* Move getInstrOperandRegClass from the scheduler to TargetInstrInfo.Evan Cheng2009-05-052-26/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70950 91177308-0d34-0410-b5e6-96231b3b80d8
* Do forward and backward substitution to eliminate loads and stores when ↵Evan Cheng2009-05-041-13/+127
| | | | | | possible. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70937 91177308-0d34-0410-b5e6-96231b3b80d8
* Make DBG_STOPPOINT nodes, and therefore DBG_LABEL labels, get a DebugLoc, so ↵Chris Lattner2009-05-042-6/+8
| | | | | | | | | | | that it shows up in -print-machineinstrs. This doesn't appear to affect anything, but it was weird for some DBG_LABELs to have DebugLocs but not all of them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70921 91177308-0d34-0410-b5e6-96231b3b80d8
* Restore a comment.Argiris Kirtzidis2009-05-041-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70900 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix code emission for conditional branches.asl2009-05-043-16/+10
| | | | | | Patch by Collin Winter! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70898 91177308-0d34-0410-b5e6-96231b3b80d8
* Make sure to color with only allocatable registers for the specific register ↵Evan Cheng2009-05-042-2/+15
| | | | | | class. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70821 91177308-0d34-0410-b5e6-96231b3b80d8
* The stack slots which share the same stack slot after coloring can, but do ↵Evan Cheng2009-05-041-44/+37
| | | | | | not have to, use the same register. In fact, they each may have different register class requirements. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70815 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r70803 for now, it causes a regression.Argiris Kirtzidis2009-05-033-2/+16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70811 91177308-0d34-0410-b5e6-96231b3b80d8
* -Remove the DwarfWriter::RecordSourceLine calls from the instruction selectors.Argiris Kirtzidis2009-05-033-16/+2
| | | | | | | -Depend on DebugLocs for source line info. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70803 91177308-0d34-0410-b5e6-96231b3b80d8