aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
* Do not try to create a MVT type of width 0.Evan Cheng2009-05-281-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72557 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-commit r72514 and r72516 with a fixed version of BR_CC lowering. Eli Friedman2009-05-281-87/+38
| | | | | | | | | This patch removes some special cases for opcodes and does a bit of cleanup. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72536 91177308-0d34-0410-b5e6-96231b3b80d8
* Incorporate patch feedbacks.Evan Cheng2009-05-281-11/+17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72533 91177308-0d34-0410-b5e6-96231b3b80d8
* Temporarily revert r72514 (and dependent patch r72516). It was causing thisBill Wendling2009-05-281-36/+87
| | | | | | | | | | | | | failure during llvm-gcc bootstrap: Assertion failed: (!Tmp2.getNode() && "Can't legalize BR_CC with legal condition!"), function ExpandNode, file /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore.roots/llvmCore~obj/src/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp, line 2923. /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmgcc42.roots/llvmgcc42~obj/src/gcc/libgcc2.c:1727: 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72530 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove a couple of useless functions.Eli Friedman2009-05-281-34/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72516 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove special cases for more opcodes.Eli Friedman2009-05-281-65/+42
| | | | | | | | | | | This is basically the end of this series of patches for LegalizeDAG; the remaining special cases can't be removed without more infrastructure work. There's a FIXME for each relevant opcode near the beginning of SelectionDAGLegalize::LegalizeOp. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72514 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove special case for SETCC opcode; add some comments explaining why Eli Friedman2009-05-281-73/+63
| | | | | | | | some special cases are necessary. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72511 91177308-0d34-0410-b5e6-96231b3b80d8
* Some minor cleanups.Eli Friedman2009-05-281-54/+30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72509 91177308-0d34-0410-b5e6-96231b3b80d8
* Added optimization that narrow load / op / store and the 'op' is a bit ↵Evan Cheng2009-05-281-1/+93
| | | | | | | | | | | | | | twiddling instruction and its second operand is an immediate. If bits that are touched by 'op' can be done with a narrower instruction, reduce the width of the load and store as well. This happens a lot with bitfield manipulation code. e.g. orl $65536, 8(%rax) => orb $1, 10(%rax) Since narrowing is not always a win, e.g. i32 -> i16 is a loss on x86, dag combiner consults with the target before performing the optimization. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72507 91177308-0d34-0410-b5e6-96231b3b80d8
* Minor cleanups; add a better explanation for the issue with Eli Friedman2009-05-271-23/+10
| | | | | | | | BUILD_VECTOR. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72469 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove more special cases for opcodes.Eli Friedman2009-05-271-310/+201
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72468 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove special cases for more opcodes.Eli Friedman2009-05-272-207/+122
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72467 91177308-0d34-0410-b5e6-96231b3b80d8
* Removing more special cases from LegalizeDAG.Eli Friedman2009-05-271-191/+78
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72465 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate more special cases for opcodes.Eli Friedman2009-05-271-192/+105
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72464 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove more special cases from LegalizeDAG.Eli Friedman2009-05-271-210/+145
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72456 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused argument.Eli Friedman2009-05-271-11/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72455 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove more opcode special cases.Eli Friedman2009-05-271-159/+70
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72454 91177308-0d34-0410-b5e6-96231b3b80d8
* Start of refactoring LegalizeDAG so that we don't need specialized Eli Friedman2009-05-271-1185/+363
| | | | | | | | handling for every single opcode. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72447 91177308-0d34-0410-b5e6-96231b3b80d8
* LiveVariables::VarInfo contains an AliveBlocks BitVector, which has as manyJeffrey Yasskin2009-05-263-18/+15
| | | | | | | | | | | entries as there are basic blocks in the function. LiveVariables::getVarInfo creates a VarInfo struct for every register in the function, leading to quadratic space use. This patch changes the BitVector to a SparseBitVector, which doesn't help the worst-case memory use but does reduce the actual use in very long functions with short-lived variables. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72426 91177308-0d34-0410-b5e6-96231b3b80d8
* Delete a bunch of dead code from LegalizeDAG.Eli Friedman2009-05-261-3667/+29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72414 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate VarInfo::UsedBlocks.Evan Cheng2009-05-263-13/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72411 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a comment which should hopefully make the purpose of this method a Eli Friedman2009-05-241-0/+3
| | | | | | | | bit clearer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72374 91177308-0d34-0410-b5e6-96231b3b80d8
* Minor improvement to FCOPYSIGN to use BIT_CONVERT in cases where the Eli Friedman2009-05-241-10/+24
| | | | | | | | corresponding integer type is legal. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72373 91177308-0d34-0410-b5e6-96231b3b80d8
* Rewrite ISD::FCOPYSIGN lowering to never use i64. Not really ideal, but Eli Friedman2009-05-241-30/+21
| | | | | | | | it's late, and I don't have any better ideas at the moment. Fixes PR4257. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72363 91177308-0d34-0410-b5e6-96231b3b80d8
* Update for CMakeLists; untested, so tell me if there are issues.Eli Friedman2009-05-241-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72360 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove checks of getTypeAction from LegalizeOp; we already assert that Eli Friedman2009-05-241-503/+105
| | | | | | | | | all results and all operands are legal, so this change shouldn't affect behavior at all. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72359 91177308-0d34-0410-b5e6-96231b3b80d8
* Disable type legalization in LegalizeDAG.Eli Friedman2009-05-241-94/+39
| | | | | | | | | This leaves around 4000 lines of dead code; I'll clean that up in subsequent commits. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72358 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bug in the expansion of EXTRACT_SUBVECTOR in Eli Friedman2009-05-231-1/+2
| | | | | | | | ExpandExtractFromVectorThroughStack. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72351 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72349 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR4254.Edwin Török2009-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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72331 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72325 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72276 91177308-0d34-0410-b5e6-96231b3b80d8
* Use v.data() instead of &v[0] when SmallVector v might be empty.Jay Foad2009-05-211-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72210 91177308-0d34-0410-b5e6-96231b3b80d8
* Temporarily revert r72191. It was causing an assert during llvm-gccBill Wendling2009-05-216-124/+27
| | | | | | | bootstrapping. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72200 91177308-0d34-0410-b5e6-96231b3b80d8
* Minor code cleanup. No functionality change.Bill Wendling2009-05-201-18/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72198 91177308-0d34-0410-b5e6-96231b3b80d8
* Merge 'ConstructFunctionDbgScope' and 'ConstructAbstractDbgScope'.Bill Wendling2009-05-202-41/+14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72197 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename 'New*' methods to 'Create*' to be consistent. 'NewString' isn't used.Bill Wendling2009-05-202-20/+13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72196 91177308-0d34-0410-b5e6-96231b3b80d8
* Add comment for emit section.Bill Wendling2009-05-201-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72195 91177308-0d34-0410-b5e6-96231b3b80d8
* Move 'Emit' methods down to their own place.Bill Wendling2009-05-201-720/+720
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72194 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r72192. It was causing a build failure.Bill Wendling2009-05-202-779/+807
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72193 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72192 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce DebugScope which gets embedded into the machine instructions' ↵Argiris Kirtzidis2009-05-206-27/+124
| | | | | | | | | DebugLoc. DebugScope refers to a debug region, function or block. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72191 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72162 91177308-0d34-0410-b5e6-96231b3b80d8
* Forward decls.Bill Wendling2009-05-191-0/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72114 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove 'class' specifier.Bill Wendling2009-05-191-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72113 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix to compile on VS2008.Bill Wendling2009-05-191-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72112 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the #ifndef NDEBUG from the FastISel debugging options. ThisDan Gohman2009-05-191-5/+0
| | | | | | | fixes dejagnu tests that use these options. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72094 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix cmake builds.Mike Stump2009-05-192-0/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72078 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't set the "location" information for inlined functions' variables.Bill Wendling2009-05-181-7/+16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72064 91177308-0d34-0410-b5e6-96231b3b80d8
* Small code cleanup.Bill Wendling2009-05-181-9/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72057 91177308-0d34-0410-b5e6-96231b3b80d8