summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Add NumFixedArgs attribute to CallSDNode which indicates the number of fixed ↵Tilmann Scheller2009-07-031-2/+2
| | | | | | | | | | | arguments in a vararg call. With the SVR4 ABI on PowerPC, vector arguments for vararg calls are passed differently depending on whether they are a fixed or a variable argument. Variable vector arguments always go into memory, fixed vector arguments are put into vector registers. If there are no free vector registers available, fixed vector arguments are put on the stack. The NumFixedArgs attribute allows to decide for an argument in a vararg call whether it belongs to the fixed or variable portion of the parameter list. llvm-svn: 74764
* This increases the maximum for MVT::LAST_VALUETYPEDavid Greene2009-06-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | This change doubles the allowable value for MVT::LAST_VALUETYPE. It does this by doing several things. 1. Introduces MVT::MAX_ALLOWED_LAST_VALUETYPE which in this change has a value of 64. This value contains the current maximum for the MVT::LAST_VALUETYPE. 2. Instead of checking "MVT::LAST_VALUETYPE <= 32", all of those uses now become "MVT::LAST_VALUETYPE <= MVT::MAX_ALLOWED_LAST_VALUETYPE" 3. Changes the dimension of the ValueTypeActions from 2 elements to four elements and adds comments ahead of the declaration indicating the it is "(MVT::MAX_ALLOWED_LAST_VALUETYPE/32) * 2". This at least lets us find what is affected if and when MVT::MAX_ALLOWED_LAST_VALUETYPE gets changed. 4. Adds initializers for the new elements of ValueTypeActions. This does NOT add any types in MVT. That would be done separately. This doubles the size of ValueTypeActions from 64 bits to 128 bits and gives us the freedom to add more types for AVX. llvm-svn: 74110
* Add some generic expansion logic for SMULO and UMULO. Fixes UMULO Eli Friedman2009-06-161-0/+47
| | | | | | | | support for x86, and UMULO/SMULO for many architectures, including PPC (PR4201), ARM, and Cell. The resulting expansion isn't perfect, but it's not bad. llvm-svn: 73477
* Slightly generalize the code that handles shuffles of consecutive loads Eli Friedman2009-06-071-78/+37
| | | | | | | | | | | on x86 to handle more cases. Fix a bug in said code that would cause it to read past the end of an object. Rewrite the code in SelectionDAGLegalize::ExpandBUILD_VECTOR to be a bit more general. Remove PerformBuildVectorCombine, which is no longer necessary with these changes. In addition to simplifying the code, with this change, we can now catch a few more cases of consecutive loads. llvm-svn: 73012
* Fix the expansion for CONCAT_VECTORS so that it doesn't create illegal Eli Friedman2009-06-061-17/+1
| | | | | | types. llvm-svn: 72993
* Factor out a couple of helpers.Eli Friedman2009-06-061-78/+101
| | | | llvm-svn: 72992
* 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. llvm-svn: 72536
* 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. llvm-svn: 72530
* Remove a couple of useless functions.Eli Friedman2009-05-281-34/+6
| | | | llvm-svn: 72516
* 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. llvm-svn: 72514
* Remove special case for SETCC opcode; add some comments explaining why Eli Friedman2009-05-281-73/+63
| | | | | | some special cases are necessary. llvm-svn: 72511
* Some minor cleanups.Eli Friedman2009-05-281-54/+30
| | | | llvm-svn: 72509
* Minor cleanups; add a better explanation for the issue with Eli Friedman2009-05-271-23/+10
| | | | | | BUILD_VECTOR. llvm-svn: 72469
* Remove more special cases for opcodes.Eli Friedman2009-05-271-310/+201
| | | | llvm-svn: 72468
* Remove special cases for more opcodes.Eli Friedman2009-05-271-205/+120
| | | | llvm-svn: 72467
* Removing more special cases from LegalizeDAG.Eli Friedman2009-05-271-191/+78
| | | | llvm-svn: 72465
* Eliminate more special cases for opcodes.Eli Friedman2009-05-271-192/+105
| | | | llvm-svn: 72464
* Remove more special cases from LegalizeDAG.Eli Friedman2009-05-271-210/+145
| | | | llvm-svn: 72456
* Remove unused argument.Eli Friedman2009-05-271-11/+6
| | | | llvm-svn: 72455
* Remove more opcode special cases.Eli Friedman2009-05-271-159/+70
| | | | llvm-svn: 72454
* Start of refactoring LegalizeDAG so that we don't need specialized Eli Friedman2009-05-271-1185/+363
| | | | | | handling for every single opcode. llvm-svn: 72447
* Delete a bunch of dead code from LegalizeDAG.Eli Friedman2009-05-261-3667/+29
| | | | llvm-svn: 72414
* Minor improvement to FCOPYSIGN to use BIT_CONVERT in cases where the Eli Friedman2009-05-241-10/+24
| | | | | | corresponding integer type is legal. llvm-svn: 72373
* 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. llvm-svn: 72363
* 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. llvm-svn: 72359
* 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. llvm-svn: 72358
* Fix a bug in the expansion of EXTRACT_SUBVECTOR in Eli Friedman2009-05-231-1/+2
| | | | | | ExpandExtractFromVectorThroughStack. llvm-svn: 72351
* 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
* Use v.data() instead of &v[0] when SmallVector v might be empty.Jay Foad2009-05-211-1/+1
| | | | llvm-svn: 72210
* 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
* Rename PaddedSize to AllocSize, in the hope that thisDuncan Sands2009-05-091-1/+1
| | | | | | | will make it more obvious what it represents, and stop it being confused with the StoreSize. llvm-svn: 71349
* Properly expand libcalls for urem / srem. Also make code more straightforward.Anton Korobeynikov2009-05-081-29/+40
| | | | llvm-svn: 71238
* Add generic expansion of SUB when ADD and XORDuncan Sands2009-05-061-8/+12
| | | | | | are legal. Based on a patch by Micah Villmow. llvm-svn: 71078
* Properly handle sdiv / udiv / srem / urem libcallsAnton Korobeynikov2009-05-031-7/+11
| | | | llvm-svn: 70764
* Add libcall expansion for 16 and 128 bit mulsAnton Korobeynikov2009-05-031-0/+4
| | | | llvm-svn: 70749
* Allow CONCAT_VECTORS nodes to be legal or have custom lowering for some targets.Bob Wilson2009-05-011-14/+37
| | | | | | Changes to take advantage of this will come later. llvm-svn: 70560
* Make DebugLoc independent of DwarfWriter.Argyrios Kyrtzidis2009-04-301-5/+2
| | | | | | | | -Replace DebugLocTuple's Source ID with CompileUnit's GlobalVariable* -Remove DwarfWriter::getOrCreateSourceID -Make necessary changes for the above (fix callsites, etc.) llvm-svn: 70520
* Instead of passing in an unsigned value for the optimization level, use an enum,Bill Wendling2009-04-291-5/+6
| | | | | | | which better identifies what the optimization is doing. And is more flexible for future uses. llvm-svn: 70440
* Fix infinite recursion in the C++ code which handles movddup by making it ↵Nate Begeman2009-04-291-2/+2
| | | | | | unnecessary. llvm-svn: 70425
* Implement review feedback for vector shuffle work.Nate Begeman2009-04-291-17/+22
| | | | llvm-svn: 70372
* Second attempt:Bill Wendling2009-04-291-8/+8
| | | | | | | | | | | | Massive check in. This changes the "-fast" flag to "-O#" in llc. If you want to use the old behavior, the flag is -O0. This change allows for finer-grained control over which optimizations are run at different -O levels. Most of this work was pretty mechanical. The majority of the fixes came from verifying that a "fast" variable wasn't used anymore. The JIT still uses a "Fast" flag. I'll change the JIT with a follow-up patch. llvm-svn: 70343
* r70270 isn't ready yet. Back this out. Sorry for the noise.Bill Wendling2009-04-281-8/+8
| | | | llvm-svn: 70275
* Massive check in. This changes the "-fast" flag to "-O#" in llc. If you want toBill Wendling2009-04-281-8/+8
| | | | | | | | | | | use the old behavior, the flag is -O0. This change allows for finer-grained control over which optimizations are run at different -O levels. Most of this work was pretty mechanical. The majority of the fixes came from verifying that a "fast" variable wasn't used anymore. The JIT still uses a "Fast" flag. I'm not 100% sure if it's necessary to change it there... llvm-svn: 70270
* Now that PR2957 is resolved, remove a bunch ofDuncan Sands2009-04-271-3/+1
| | | | | | no-longer needed workarounds. llvm-svn: 70234
* 2nd attempt, fixing SSE4.1 issues and implementing feedback from duncan.Nate Begeman2009-04-271-143/+80
| | | | | | | | | | | | | | PR2957 ISD::VECTOR_SHUFFLE now stores an array of integers representing the shuffle mask internal to the node, rather than taking a BUILD_VECTOR of ConstantSDNodes as the shuffle mask. A value of -1 represents UNDEF. In addition to eliminating the creation of illegal BUILD_VECTORS just to represent shuffle masks, we are better about canonicalizing the shuffle mask, resulting in substantially better code for some classes of shuffles. llvm-svn: 70225
* Revert 69952. Causes testsuite failures on linux x86-64.Rafael Espindola2009-04-241-75/+138
| | | | llvm-svn: 69967
* PR2957Nate Begeman2009-04-241-138/+75
| | | | | | | | | | | | | | ISD::VECTOR_SHUFFLE now stores an array of integers representing the shuffle mask internal to the node, rather than taking a BUILD_VECTOR of ConstantSDNodes as the shuffle mask. A value of -1 represents UNDEF. In addition to eliminating the creation of illegal BUILD_VECTORS just to represent shuffle masks, we are better about canonicalizing the shuffle mask, resulting in substantially better code for some classes of shuffles. A clean up of x86 shuffle code, and some canonicalizing in DAGCombiner is next. llvm-svn: 69952
* Don't try to make BUILD_VECTOR operands have the sameDuncan Sands2009-04-181-41/+9
| | | | | | | | | | | | | | | | | type as the vector element type: allow them to be of a wider integer type than the element type all the way through the system, and not just as far as LegalizeDAG. This should be safe because it used to be this way (the old type legalizer would produce such nodes), so backends should be able to handle it. In fact only targets which have legal vector types with an illegal promoted element type will ever see this (eg: <4 x i16> on ppc). This fixes a regression with the new type legalizer (vec_splat.ll). Also, treat SCALAR_TO_VECTOR the same as BUILD_VECTOR. After all, it is just a special case of BUILD_VECTOR. llvm-svn: 69467
* Generalize one of the SelectionDAG::ReplaceAllUsesWith overloadsDan Gohman2009-04-151-4/+2
| | | | | | | | to support replacing a node with another that has a superset of the result types. Use this instead of calling ReplaceAllUsesOfValueWith for each value. llvm-svn: 69209
* Change SelectionDAG type legalization to allow BUILD_VECTOR operands to beBob Wilson2009-04-131-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | promoted to legal types without changing the type of the vector. This is following a suggestion from Duncan (http://lists.cs.uiuc.edu/pipermail/llvmdev/2009-February/019923.html). The transformation that used to be done during type legalization is now postponed to DAG legalization. This allows the BUILD_VECTORs to be optimized and potentially handled specially by target-specific code. It turns out that this is also consistent with an optimization done by the DAG combiner: a BUILD_VECTOR and INSERT_VECTOR_ELT may be combined by replacing one of the BUILD_VECTOR operands with the newly inserted element; but INSERT_VECTOR_ELT allows its scalar operand to be larger than the element type, with any extra high bits being implicitly truncated. The result is a BUILD_VECTOR where one of the operands has a type larger the the vector element type. Any code that operates on BUILD_VECTORs may now need to be aware of the potential type discrepancy between the vector element type and the BUILD_VECTOR operands. This patch updates all of the places that I could find to handle that case. llvm-svn: 68996
OpenPOWER on IntegriCloud