summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [AVX] Add INSERT_SUBVECTOR and support it on x86. This provides aDavid Greene2011-01-261-0/+25
| | | | | | | | default implementation for x86, going through the stack in a similr fashion to how the codegen implements BUILD_VECTOR. Eventually this will get matched to VINSERTF128 if AVX is available. llvm-svn: 124307
* [AVX] Support EXTRACT_SUBVECTOR on x86. This provides a defaultDavid Greene2011-01-261-3/+22
| | | | | | | | implementation of EXTRACT_SUBVECTOR for x86, going through the stack in a similr fashion to how the codegen implements BUILD_VECTOR. Eventually this will get matched to VEXTRACTF128 if AVX is available. llvm-svn: 124292
* Provide an interface to transfer SDDbgValue from one SDNode to another.Devang Patel2011-01-251-0/+17
| | | | llvm-svn: 124245
* Null initialize a few variables flagged byTed Kremenek2011-01-231-1/+1
| | | | | | | | | | clang's -Wuninitialized-experimental warning. While these don't look like real bugs, clang's -Wuninitialized-experimental analysis is stricter than GCC's, and these fixes have the benefit of being general nice cleanups. llvm-svn: 124073
* Rename TargetFrameInfo into TargetFrameLowering. Also, put couple of FIXMEs ↵Anton Korobeynikov2011-01-101-1/+0
| | | | | | and fixes here and there. llvm-svn: 123170
* Replace TargetRegisterInfo::printReg with a PrintReg class that also works ↵Jakob Stoklund Olesen2011-01-091-6/+1
| | | | | | | | | | without a TRI instance. Print virtual registers numbered from 0 instead of the arbitrary FirstVirtualRegister. The first virtual register is printed as %vreg0. TRI::NoRegister is printed as %noreg. llvm-svn: 123107
* Re-implement r122936 with proper target hooks. Now getMaxStoresPerMemcpyEvan Cheng2011-01-061-15/+12
| | | | | | | etc. takes an option OptSize. If OptSize is true, it would return the inline limit for functions with attribute OptSize. llvm-svn: 122952
* Revert r122936. I'll re-implement the change.Evan Cheng2011-01-061-9/+2
| | | | llvm-svn: 122949
* r105228 reduced the memcpy / memset inline limit to 4 with -Os to avoid blowingEvan Cheng2011-01-061-2/+9
| | | | | | | | up freebsd bootloader. However, this doesn't make much sense for Darwin, whose -Os is meant to optimize for size only if it doesn't hurt performance. rdar://8821501 llvm-svn: 122936
* Try to reuse the value when lowering memset.Benjamin Kramer2011-01-021-3/+21
| | | | | | | | | | This allows us to compile: void test(char *s, int a) { __builtin_memset(s, a, 15); } into 1 mul + 3 stores instead of 3 muls + 3 stores. llvm-svn: 122710
* Lower the i8 extension in memset to a multiply instead of a potentially long ↵Benjamin Kramer2011-01-021-15/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | series of shifts and ors. We could implement a DAGCombine to turn x * 0x0101 back into logic operations on targets that doesn't support the multiply or it is slow (p4) if someone cares enough. Example code: void test(char *s, int a) { __builtin_memset(s, a, 4); } before: _test: ## @test movzbl 8(%esp), %eax movl %eax, %ecx shll $8, %ecx orl %eax, %ecx movl %ecx, %eax shll $16, %eax orl %ecx, %eax movl 4(%esp), %ecx movl %eax, 4(%ecx) movl %eax, (%ecx) ret after: _test: ## @test movzbl 8(%esp), %eax imull $16843009, %eax, %eax ## imm = 0x1010101 movl 4(%esp), %ecx movl %eax, 4(%ecx) movl %eax, (%ecx) ret llvm-svn: 122707
* rename MVT::Flag to MVT::Glue. "Flag" is a terrible name forChris Lattner2010-12-211-12/+12
| | | | | | | something that just glues two nodes together, even if it is sometimes used for flags. llvm-svn: 122310
* teach MaskedValueIsZero how to analyze ADDE. This isChris Lattner2010-12-191-2/+13
| | | | | | | enough to teach it that ADDE(0,0) is known 0 except the low bit, for example. llvm-svn: 122191
* Catch attempts to remove a deleted node from the CSE maps. Better toDuncan Sands2010-12-121-3/+2
| | | | | | | catch this here rather than later after accessing uninitialized memory etc. Fires when compiling the testcase in PR8237. llvm-svn: 121635
* PR5207: Change APInt methods trunc(), sext(), zext(), sextOrTrunc() andJay Foad2010-12-071-34/+29
| | | | | | | | zextOrTrunc(), and APSInt methods extend(), extOrTrunc() and new method trunc(), to be const and to return a new value instead of modifying the object in place. llvm-svn: 121120
* Remove unneeded zero arrays.Benjamin Kramer2010-12-041-2/+1
| | | | llvm-svn: 120910
* PR5207: Rename overloaded APInt methods set(), clear(), flip() toJay Foad2010-12-011-5/+5
| | | | | | setAllBits(), setBit(unsigned), etc. llvm-svn: 120564
* Merge System into Support.Michael J. Spencer2010-11-291-1/+1
| | | | llvm-svn: 120298
* Renaming ISD::BIT_CONVERT to ISD::BITCAST to better reflect the LLVM IR concept.Wesley Peck2010-11-231-38/+38
| | | | llvm-svn: 119990
* Silence Release build warnings about unused functions.Benjamin Kramer2010-11-201-0/+2
| | | | llvm-svn: 119903
* On X86, MEMBARRIER, MFENCE, SFENCE, LFENCE are not target memory intrinsics,Duncan Sands2010-11-201-9/+46
| | | | | | | | | | | so don't claim they are. They are allocated using DAG.getNode, so attempts to access MemSDNode fields results in reading off the end of the allocated memory. This fixes crashes with "llc -debug" due to debug code trying to print MemSDNode fields for these barrier nodes (since the crashes are not deterministic, use valgrind to see this). Add some nasty checking to try to catch this kind of thing in the future. llvm-svn: 119901
* Make isScalarToVector to return false if the node is a scalar. This will preventMon P Wang2010-11-191-0/+2
| | | | | | | DAGCombine from making an illegal transformation of bitcast of a scalar to a vector into a scalar_to_vector. llvm-svn: 119819
* Do not throw away alignment when generating the DAG forDale Johannesen2010-11-181-1/+1
| | | | | | | | memset; we may need it to decide between MOVAPS and MOVUPS later. Adjust a test that was looking for wrong code. PR 3866 / 8675131. llvm-svn: 119605
* When passing a parameter using the 'byval' mechanism, inline code needs to ↵Duncan Sands2010-11-051-0/+2
| | | | | | | | | | | | | be used to perform the copy, which may be of lots of memory [*]. It would be good if the fall-back code generated something reasonable, i.e. did the copy in a loop, rather than vast numbers of loads and stores. Add a note about this. Currently target specific code seems to always kick in so this is more of a theoretical issue rather than a practical one now that X86 has been fixed. [*] It's amazing how often people pass mega-byte long arrays by copy... llvm-svn: 118275
* Simplify uses of MVT and EVT. An MVT can be compared directlyDuncan Sands2010-11-031-3/+2
| | | | | | | with a SimpleValueType, while an EVT supports equality and inequality comparisons with SimpleValueType. llvm-svn: 118169
* Use a MemIntrinsicSDNode for ISD::PREFETCH, which touchesDale Johannesen2010-10-261-0/+1
| | | | | | | | memory, so a MachineMemOperand is useful (not propagated into the MachineInstr yet). No functional change except for dump output. llvm-svn: 117413
* Make CodeGen TBAA-aware.Dan Gohman2010-10-201-10/+15
| | | | llvm-svn: 116890
* Add a pre-dispatch SjLj EH hook on the unwind edge for targets to do anyJim Grosbach2010-10-191-0/+1
| | | | | | | setup they require. Use this for ARM/Darwin to rematerialize the base pointer from the frame pointer when required. rdar://8564268 llvm-svn: 116879
* finish pushing MachinePointerInfo through selectiondags. At this point,Chris Lattner2010-09-211-10/+0
| | | | | | | I think I've audited all uses, so it should be dependable for address spaces, and the pointer+offset info should also be accurate when there. llvm-svn: 114464
* eliminate an old SelectionDAG::getTruncStore method, propagatingChris Lattner2010-09-211-10/+0
| | | | | | MachinePointerInfo around more. llvm-svn: 114452
* eliminate last SelectionDAG::getLoad old entrypoint, on to stores.Chris Lattner2010-09-211-13/+0
| | | | llvm-svn: 114450
* fix the code that infers SV info to be correct when dealingChris Lattner2010-09-211-28/+53
| | | | | | with an indexed load/store that has an offset in the index. llvm-svn: 114449
* propagate MachinePointerInfo through various uses of the oldChris Lattner2010-09-211-10/+0
| | | | | | SelectionDAG::getExtLoad overload, and eliminate it. llvm-svn: 114446
* continue MachinePointerInfo'izing, eliminating use of one of the oldChris Lattner2010-09-211-10/+0
| | | | | | getLoad overloads. llvm-svn: 114443
* reimplement memcpy/memmove/memset lowering to use MachinePointerInfoChris Lattner2010-09-211-24/+47
| | | | | | | instead of srcvalue/offset pairs. This corrects SV info for mem operations whose size is > 32-bits. llvm-svn: 114401
* add overloads for SelectionDAG::getLoad, getStore, getTruncStore that take aChris Lattner2010-09-211-18/+47
| | | | | | | MachinePointerInfo. Among other virtues, this doesn't silently truncate the svoffset to 32-bits. llvm-svn: 114399
* simplify interface to SelectionDAG::getMemIntrinsicNode, making it take a ↵Chris Lattner2010-09-211-5/+4
| | | | | | MachinePointerInfo llvm-svn: 114397
* chagne interface to SelectionDAG::getAtomic to take a MachinePointerInfo,Chris Lattner2010-09-211-11/+3
| | | | | | eliminating some weird "infer a frame address" logic which was dead. llvm-svn: 114396
* force clients of MachineFunction::getMachineMemOperand to provide aChris Lattner2010-09-211-7/+8
| | | | | | | MachinePointerInfo, propagating the type out a level of API. Remove the old MachineFunction::getMachineMemOperand impl. llvm-svn: 114393
* Invert the logic of reachesChainWithoutSideEffects(). What we want to check ↵Owen Anderson2010-09-181-7/+7
| | | | | | | | | | is that there is NO path to the destination containing side effects, not that SOME path contains no side effects. In practice, this only manifests with CombinerAA enabled, because otherwise the chain has little to no branching, so "any" is effectively equivalent to "all". llvm-svn: 114268
* zap unused method. x86 is the only user and already has a more powerfull versionBruno Cardoso Lopes2010-08-311-29/+0
| | | | llvm-svn: 112571
* Prefix `next' iterator operation with `llvm::'.Oscar Fuentes2010-08-021-1/+1
| | | | | | | | Fixes potential ambiguity problems on VS 2010. Patch by nobled! llvm-svn: 110029
* Make SDNode::dump() print a newline at the end.Dan Gohman2010-07-231-0/+1
| | | | llvm-svn: 109234
* keep in 80 colsGabor Greif2010-07-221-2/+4
| | | | llvm-svn: 109122
* Split -enable-finite-only-fp-math to two options:Evan Cheng2010-07-151-1/+1
| | | | | | -enable-no-nans-fp-math and -enable-no-infs-fp-math. All of the current codegen fp math optimizations only care whether the fp arithmetics arguments and results can never be NaN. llvm-svn: 108465
* Move getExtLoad() and (some) getLoad() DebugLoc argument after EVT argument ↵Evan Cheng2010-07-071-10/+10
| | | | | | for consistency sake. llvm-svn: 107820
* Propagate debug loc.Devang Patel2010-07-061-4/+5
| | | | llvm-svn: 107710
* Infer alignments of fixed frame objects when they are constructed. This ↵Evan Cheng2010-07-041-17/+0
| | | | | | ensures remat'ed loads from fixed slots have the right alignments. llvm-svn: 107591
* When splitting a VAARG, remember its alignment.Rafael Espindola2010-06-261-3/+4
| | | | | | This produces terrible but correct code. llvm-svn: 106952
* Remove variables which are assigned to but for which the valueDuncan Sands2010-06-251-1/+0
| | | | | | is not used. Spotted by gcc-4.6. llvm-svn: 106854
OpenPOWER on IntegriCloud