summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG
Commit message (Collapse)AuthorAgeFilesLines
* Simplify LowerCallTo by using a callsite.Duncan Sands2007-12-191-41/+27
| | | | llvm-svn: 45198
* The C++ exception handling personality function wantsDuncan Sands2007-12-191-2/+6
| | | | | | | | | | | | | | | | | | | | | | | to know about calls that cannot throw ('nounwind'): if such a call does throw for some reason then the personality will terminate the program. The distinction between an ordinary call and a nounwind call is that an ordinary call gets an entry in the exception table but a nounwind call does not. This patch sets up the exception table appropriately. One oddity is that I've chosen to bracket nounwind calls with labels (like invokes) - the other choice would have been to bracket ordinary calls with labels. While bracketing ordinary calls is more natural (because bracketing by labels would then correspond exactly to getting an entry in the exception table), I didn't do it because introducing labels impedes some optimizations and I'm guessing that ordinary calls occur more often than nounwind calls. This fixes the gcc filter2 eh test, at least at -O0 (the inliner needs some tweaking at higher optimization levels). llvm-svn: 45197
* Don't leave newly created nodes around if it turns out they are not needed.Evan Cheng2007-12-191-2/+4
| | | | llvm-svn: 45186
* Fix PR1872: SrcValue and SrcValueOffset should not be used to compute load / ↵Evan Cheng2007-12-181-20/+0
| | | | | | store node id. llvm-svn: 45167
* Also print alignment and volatileness.Evan Cheng2007-12-181-13/+19
| | | | llvm-svn: 45164
* FIX for PR1799: When a load is unfolded from an instruction, check if it is ↵Evan Cheng2007-12-181-26/+36
| | | | | | a new node. If not, do not create a new SUnit. llvm-svn: 45157
* SelectionDAG::dump() should print SrcValue of LoadSDNode and StoreSDNode.Evan Cheng2007-12-181-0/+18
| | | | llvm-svn: 45151
* Make invokes of inline asm legal. Teach codegenDuncan Sands2007-12-171-17/+20
| | | | | | | | how to lower them (with no attempt made to be efficient, since they should only occur for unoptimized code). llvm-svn: 45108
* Bug fix. Must also match ResNo when matching an operand with a user.Evan Cheng2007-12-141-1/+1
| | | | llvm-svn: 45028
* Allow vector integer constants to be created withDan Gohman2007-12-121-9/+22
| | | | | | | | SelectionDAG::getConstant, in the same way as vector floating-point constants. This allows the legalize expansion code for @llvm.ctpop and friends to be usable with vector types. llvm-svn: 44954
* Pretty print shuffle mask operand.Evan Cheng2007-12-111-0/+13
| | | | llvm-svn: 44837
* Duncan points out that the subtraction is unneeded since hte codeChris Lattner2007-12-091-1/+1
| | | | | | knows the vector is not pow2 llvm-svn: 44740
* Add support for splitting the operand of a return instruction.Chris Lattner2007-12-093-53/+21
| | | | llvm-svn: 44728
* add many new cases to SplitResult. SplitResult now handles all the cases ↵Chris Lattner2007-12-082-3/+178
| | | | | | that LegalizeDAG does. llvm-svn: 44726
* Implement splitting support for store, allowing us to compile:Chris Lattner2007-12-082-3/+27
| | | | | | | | | | | | | | | | | | | | | | | | | %f8 = type <8 x float> define void @test_f8(%f8* %P, %f8* %Q, %f8* %S) { %p = load %f8* %P ; <%f8> [#uses=1] %q = load %f8* %Q ; <%f8> [#uses=1] %R = add %f8 %p, %q ; <%f8> [#uses=1] store %f8 %R, %f8* %S ret void } into: _test_f8: movaps 16(%rdi), %xmm0 addps 16(%rsi), %xmm0 movaps (%rdi), %xmm1 addps (%rsi), %xmm1 movaps %xmm0, 16(%rdx) movaps %xmm1, (%rdx) ret llvm-svn: 44725
* implement vector splitting of load, undef, and binops.Chris Lattner2007-12-082-4/+88
| | | | llvm-svn: 44724
* implement some methods.Chris Lattner2007-12-082-2/+29
| | | | llvm-svn: 44723
* add scaffolding for splitting of vectors.Chris Lattner2007-12-083-4/+138
| | | | llvm-svn: 44722
* reorganize header to separate into functional blocks.Chris Lattner2007-12-081-47/+59
| | | | llvm-svn: 44719
* split scalarization out to its own file.Chris Lattner2007-12-082-183/+202
| | | | llvm-svn: 44718
* Split expansion out into its own file.Chris Lattner2007-12-082-1144/+1166
| | | | llvm-svn: 44717
* Split promotion support out to its own file.Chris Lattner2007-12-082-472/+490
| | | | llvm-svn: 44716
* Rename LegalizeDAGTypes.cpp -> LegalizeTypes.cppChris Lattner2007-12-081-1/+0
| | | | llvm-svn: 44715
* Split the class definition of DAGTypeLegalizer out into a header.Chris Lattner2007-12-082-234/+256
| | | | | | Leave it visibility hidden, but not in an anon namespace. llvm-svn: 44714
* Redo previous patch so optimization only done for i1.Dale Johannesen2007-12-061-16/+4
| | | | | | Simpler and safer. llvm-svn: 44663
* third time around: instead of disabling this completely,Chris Lattner2007-12-061-6/+13
| | | | | | | only disable it if we don't know it will be obviously profitable. Still fixme, but less so. :) llvm-svn: 44658
* Actually, disable this code for now. More analysis and improvements toChris Lattner2007-12-061-0/+6
| | | | | | the X86 backend are needed before this should be enabled by default. llvm-svn: 44657
* implement a readme entry, compiling the code into:Chris Lattner2007-12-061-19/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | _foo: movl $12, %eax andl 4(%esp), %eax movl _array(%eax), %eax ret instead of: _foo: movl 4(%esp), %eax shrl $2, %eax andl $3, %eax movl _array(,%eax,4), %eax ret As it turns out, this triggers all the time, in a wide variety of situations, for example, I see diffs like this in various programs: - movl 8(%eax), %eax - shll $2, %eax - andl $1020, %eax - movl (%esi,%eax), %eax + movzbl 8(%eax), %eax + movl (%esi,%eax,4), %eax - shll $2, %edx - andl $1020, %edx - movl (%edi,%edx), %edx + andl $255, %edx + movl (%edi,%edx,4), %edx Unfortunately, I also see stuff like this, which can be fixed in the X86 backend: - andl $85, %ebx - addl _bit_count(,%ebx,4), %ebp + shll $2, %ebx + andl $340, %ebx + addl _bit_count(%ebx), %ebp llvm-svn: 44656
* implement the rest of the functionality from ↵Chris Lattner2007-12-061-10/+24
| | | | | | SelectionDAGLegalize::ScalarizeVectorOp llvm-svn: 44654
* Fix PR1842.Dale Johannesen2007-12-061-4/+16
| | | | llvm-svn: 44649
* more scalarizationChris Lattner2007-12-051-0/+30
| | | | llvm-svn: 44608
* scalarize vector binopsChris Lattner2007-12-051-1/+24
| | | | llvm-svn: 44607
* Implement framework for scalarizing node results. This is sufficient Chris Lattner2007-12-041-11/+80
| | | | | | | | | | | | to codegen this: define float @test_extract_elt(<1 x float> * %P) { %p = load <1 x float>* %P %R = extractelement <1 x float> %p, i32 0 ret float %R } llvm-svn: 44570
* start providing framework for scalarizing vectors.Chris Lattner2007-12-041-4/+106
| | | | llvm-svn: 44569
* Rather than having special rules like "intrinsics cannotDuncan Sands2007-12-031-21/+3
| | | | | | | | | throw exceptions", just mark intrinsics with the nounwind attribute. Likewise, mark intrinsics as readnone/readonly and get rid of special aliasing logic (which didn't use anything more than this anyway). llvm-svn: 44544
* Add some convenience methods for querying attributes, andDuncan Sands2007-11-281-12/+11
| | | | | | use them. llvm-svn: 44403
* Support returning non-power-of-2 vectors to unblock some workNate Begeman2007-11-271-0/+7
| | | | llvm-svn: 44371
* Fix PR1146: parameter attributes are longer part ofDuncan Sands2007-11-271-12/+10
| | | | | | | | | | | | the function type, instead they belong to functions and function calls. This is an updated and slightly corrected version of Reid Spencer's original patch. The only known problem is that auto-upgrading of bitcode files doesn't seem to work properly (see test/Bitcode/AutoUpgradeIntrinsics.ll). Hopefully a bitcode guru (who might that be? :) ) will fix it. llvm-svn: 44359
* err, no really.Chris Lattner2007-11-271-1/+1
| | | | llvm-svn: 44352
* don't depend on ADL.Chris Lattner2007-11-271-1/+1
| | | | llvm-svn: 44351
* Don't lower srem/urem X%C to X-X/C*C unless the division is actuallyDan Gohman2007-11-261-14/+18
| | | | | | | | | optimized. This avoids creating illegal divisions when the combiner is running after legalize; this fixes PR1815. Also, it produces better code in the included testcase by avoiding the subtract and multiply when the division isn't optimized. llvm-svn: 44341
* Implement expand support for MERGE_VALUEs that only produces one result.Chris Lattner2007-11-241-0/+4
| | | | llvm-svn: 44304
* Implement support for custom legalization in DAGTypeLegalizer::ExpandOperand.Chris Lattner2007-11-241-30/+43
| | | | | | | | Improve a comment. Unbreak Duncan's carefully written path compression where I didn't realize what was happening! llvm-svn: 44301
* Several changes:Chris Lattner2007-11-243-45/+118
| | | | | | | | | | | | | | | | | | | | | 1) Change the interface to TargetLowering::ExpandOperationResult to take and return entire NODES that need a result expanded, not just the value. This allows us to handle things like READCYCLECOUNTER, which returns two values. 2) Implement (extremely limited) support in LegalizeDAG::ExpandOp for MERGE_VALUES. 3) Reimplement custom lowering in LegalizeDAGTypes in terms of the new ExpandOperationResult. This makes the result simpler and fully general. 4) Implement (fully general) expand support for MERGE_VALUES in LegalizeDAGTypes. 5) Implement ExpandOperationResult support for ARM f64->i64 bitconvert and ARM i64 shifts, allowing them to work with LegalizeDAGTypes. 6) Implement ExpandOperationResult support for X86 READCYCLECOUNTER and FP_TO_SINT, allowing them to work with LegalizeDAGTypes. LegalizeDAGTypes now passes several more X86 codegen tests when enabled and when type legalization in LegalizeDAG is ifdef'd out. llvm-svn: 44300
* Fix a bug in which node A is replaced by node B, but laterDuncan Sands2007-11-211-7/+30
| | | | | | | | node A gets back into the DAG again because it was hiding in one of the node maps: make sure that node replacement happens in those maps too. llvm-svn: 44263
* ExpandUnalignedLoad doesn't handle vectors right at all apparently.Chris Lattner2007-11-191-8/+22
| | | | | | | | | | | | | | | Fix a couple of problems: 1. Don't assume the VT-1 is a VT that is half the size. 2. Treat vectors of FP in the vector path, not the FP path. This has a couple of remaining problems before it will work with the code in PR1811: the code below this change assumes that it can use extload/shift/or to construct the result, which isn't right for vectors. This also doesn't handle vectors of 1 or vectors that aren't pow-2. llvm-svn: 44243
* Implement vector expand support for shuffle_vector. This fixes PR1811.Chris Lattner2007-11-191-0/+35
| | | | llvm-svn: 44242
* Implement splitting of UNDEF nodes. This is the first step towards fixing PR1811Chris Lattner2007-11-191-0/+4
| | | | llvm-svn: 44239
* Add support in SplitVectorOp for remainder operators.Dan Gohman2007-11-191-1/+4
| | | | llvm-svn: 44233
* Add support for vectors to int <-> float casts.Nate Begeman2007-11-171-1/+5
| | | | llvm-svn: 44204
OpenPOWER on IntegriCloud