summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore
Commit message (Collapse)AuthorAgeFilesLines
* Remove casts between Value** and Constant**, which won't work if aJay Foad2011-01-144-31/+67
| | | | | | | static_cast from Constant* to Value* has to adjust the "this" pointer. This is groundwork for PR889. llvm-svn: 123435
* Move some shift transforms out of instcombine and into InstructionSimplify.Duncan Sands2011-01-141-2/+2
| | | | | | | | | | | | While there, I noticed that the transform "undef >>a X -> undef" was wrong. For example if X is 2 then the top two bits must be equal, so the result can not be anything. I fixed this in the constant folder as well. Also, I made the transform for "X << undef" stronger: it now folds to undef always, even though X might be zero. This is in accordance with the LangRef, but I must admit that it is fairly aggressive. Also, I added "i32 X << 32 -> undef" following the LangRef and the constant folder, likewise fairly aggressive. llvm-svn: 123417
* Reject uses of unnamed_addr in declarations.Rafael Espindola2011-01-131-0/+3
| | | | llvm-svn: 123358
* FixedNumOperandTraits and VariadicOperandTraits assumed that, given aJay Foad2011-01-111-10/+20
| | | | | | | | | | | "this" pointer for any subclass of User, you could static_cast it to User* and then reinterpret_cast that to Use* to get the end of the operand list. This isn't a safe assumption in general, because the static_cast might adjust the "this" pointer. Fixed by having these OperandTraits classes take an extra template parameter, which is the subclass of User. This is groundwork for PR889. llvm-svn: 123235
* make domtree verification print something useful on failure.Chris Lattner2011-01-081-1/+8
| | | | llvm-svn: 123078
* First step in fixing PR8927:Rafael Espindola2011-01-082-0/+4
| | | | | | | | | | | | | | | | | | | Add a unnamed_addr bit to global variables and functions. This will be used to indicate that the address is not significant and therefore the constant or function can be merged with others. If an optimization pass can show that an address is not used, it can set this. Examples of things that can have this set by the FE are globals created to hold string literals and C++ constructors. Adding unnamed_addr to a non-const global should have no effect unless an optimization can transform that global into a constant. Aliases are not allowed to have unnamed_addr since I couldn't figure out any use for it. llvm-svn: 123063
* Simplify the allocation and freeing of Users' operand lists, now thatJay Foad2011-01-072-60/+1
| | | | | | every BranchInst has a fixed number of operands. llvm-svn: 123027
* Silence a warning from non-standard warning avoidance code.Jakob Stoklund Olesen2011-01-051-1/+2
| | | | llvm-svn: 122911
* These methods should be "const"; make them so.Duncan Sands2011-01-041-4/+4
| | | | llvm-svn: 122809
* split dom frontier handling stuff out to its own DominanceFrontier header,Chris Lattner2011-01-021-1/+2
| | | | | | so that Dominators.h is *just* domtree. Also prune #includes a bit. llvm-svn: 122714
* fix PR8867: a crash handling fp128. Thanks to Nick for the testcase.Chris Lattner2010-12-291-1/+1
| | | | llvm-svn: 122613
* add methods to IRBuilder to create memcpy/memset/memmove.Chris Lattner2010-12-261-0/+81
| | | | llvm-svn: 122571
* Change all self assignments X=X to (void)X, so that we can turn on aJeffrey Yasskin2010-12-234-10/+10
| | | | | | | new gcc warning that complains on self-assignments and self-initializations. llvm-svn: 122458
* rename MVT::Flag to MVT::Glue. "Flag" is a terrible name forChris Lattner2010-12-211-1/+1
| | | | | | | something that just glues two nodes together, even if it is sometimes used for flags. llvm-svn: 122310
* Revert r122114 (CallbackVH observing use-list changes) because it caused ↵Owen Anderson2010-12-201-38/+0
| | | | | | severe slowdowns on the Linux self-host configuration. llvm-svn: 122279
* There is no need for isAssociative to take the type as an argument anymore.Duncan Sands2010-12-202-3/+2
| | | | llvm-svn: 122242
* Add missing standard headers. Patch by Joerg Sonnenberger!Nick Lewycky2010-12-191-0/+1
| | | | llvm-svn: 122193
* Add missing std:: prefixes to some calls. C++ doesn't require that <cfoo>Nick Lewycky2010-12-191-2/+2
| | | | | | | headers provide symbols outside namespace std and the LLVM coding standards state that we should prefix all of them. llvm-svn: 122192
* Add support to CallbackVH to receive notification when a Value's use-list ↵Owen Anderson2010-12-181-0/+38
| | | | | | changes. llvm-svn: 122114
* Remove trailing whitespace.Bob Wilson2010-12-171-7/+6
| | | | llvm-svn: 122099
* MemoryBuffer now return an error_code and returns a OwningPtr<MemoryBuffer> ↵Michael J. Spencer2010-12-161-4/+6
| | | | | | via an out parm. llvm-svn: 121958
* Move Value::getUnderlyingObject to be a standaloneDan Gohman2010-12-151-21/+0
| | | | | | | function so that it can live in Analysis instead of VMCore. llvm-svn: 121885
* Support/MemoryBuffer: Replace all uses of std::string *ErrMsg with ↵Michael J. Spencer2010-12-091-7/+8
| | | | | | error_code &ec. And fix clients. llvm-svn: 121379
* Remove the code from Function::dropAllReferences which replacedDan Gohman2010-12-071-13/+4
| | | | | | | | | uses of the function's blocks with undef. This code isn't needed, because BasicBlock's destructor handles such uses. Also, undef isn't correct, since blockaddresses may still be used for comparisons with null. llvm-svn: 121170
* PR5207: Change APInt methods trunc(), sext(), zext(), sextOrTrunc() andJay Foad2010-12-071-10/+7
| | | | | | | | 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
* Fix PR 4170 by having ExtractValueInst::getIndexedType() reject ↵Frits van Bommel2010-12-051-7/+24
| | | | | | | | out-of-bounds indexing. Also add asserts that the indices are valid in InsertValueInst::init(). ExtractValueInst already asserts when constructed with invalid indices. llvm-svn: 120956
* Remove unneeded zero arrays.Benjamin Kramer2010-12-041-3/+1
| | | | llvm-svn: 120910
* Apparently APFloat::getZero doesn't like PPCDoubleDoubles.Benjamin Kramer2010-12-041-1/+1
| | | | llvm-svn: 120909
* Simplify code. No functionality change.Benjamin Kramer2010-12-041-6/+9
| | | | llvm-svn: 120907
* Merge System into Support.Michael J. Spencer2010-11-296-9/+9
| | | | llvm-svn: 120298
* add a function to the C api to get the context out of a module, patchChris Lattner2010-11-281-0/+6
| | | | | | by Eric Dobson! llvm-svn: 120259
* add a 'LLVMConstIntOfArbitraryPrecision' api to the C api,Chris Lattner2010-11-231-0/+8
| | | | | | patch by Greg Pfeil! llvm-svn: 119989
* Simplify code. No change in functionality.Benjamin Kramer2010-11-201-10/+6
| | | | llvm-svn: 119908
* Fix an order-of-deallocation issue where the AttrListImpl could be ↵Owen Anderson2010-11-181-2/+7
| | | | | | | | deallocated before the global LLVMContext, causing memory errors. Patch by Peter Collingbourne. llvm-svn: 119721
* Now that hasConstantValue has been made simpler, it may return theDuncan Sands2010-11-171-4/+5
| | | | | | | phi node itself if it occurs in an unreachable basic block. Protect against this. Hopefully this will fix some more buildbots. llvm-svn: 119493
* now that AsmPrinter::EmitInlineAsm is factored right, we can eliminate theChris Lattner2010-11-172-6/+8
| | | | | | | | cookie argument to the SourceMgr diagnostic stuff. This cleanly separates LLVMContext's inlineasm handler from the sourcemgr error handling definition, increasing type safety and cleaning things up. llvm-svn: 119486
* fix PR8613 - Copy constructor of SwitchInst does not call SwitchInst::initChris Lattner2010-11-171-8/+9
| | | | llvm-svn: 119463
* Fix a layering violation: hasConstantValue, which is part of the PHINodeDuncan Sands2010-11-171-56/+7
| | | | | | | | | | | | | | class, uses DominatorTree which is an analysis. This change moves all of the tricky hasConstantValue logic to SimplifyInstruction, and replaces it with a very simple literal implementation. I already taught users of hasConstantValue that need tricky stuff to use SimplifyInstruction instead. I didn't update InlineFunction because the IR looks like it might be in a funky state at the point it calls hasConstantValue, which makes calling SimplifyInstruction dangerous since it can in theory do a lot of tricky reasoning. This may be a pessimization, for example in the case where all phi node operands are either undef or a fixed constant. llvm-svn: 119459
* If dom tree information is available, make it possible to passDuncan Sands2010-11-141-1/+1
| | | | | | it to get better phi node simplification. llvm-svn: 119055
* DoxygenifyNick Lewycky2010-11-111-1/+1
| | | | llvm-svn: 118846
* Factor out Instruction::isSafeToSpeculativelyExecute's code forDan Gohman2010-11-112-18/+58
| | | | | | | | | | | | testing for dereferenceable pointers into a helper function, isDereferenceablePointer. Teach it how to reason about GEPs with simple non-zero indices. Also eliminate ArgumentPromtion's IsAlwaysValidPointer, which didn't check for weak externals or out of range gep indices. llvm-svn: 118840
* Include ImmutablePass passes in -debug-pass=Arguments.Dan Gohman2010-11-111-0/+6
| | | | llvm-svn: 118790
* Last try to get this reference counting right, I swear.Owen Anderson2010-11-091-1/+1
| | | | llvm-svn: 118589
* Really fix the leak in the attributes list. Thanks to Benjamin Kramer for ↵Owen Anderson2010-11-091-2/+2
| | | | | | pointing out how I was being stupid. llvm-svn: 118588
* Fix leak in my recent fix for PR8442.Owen Anderson2010-11-091-1/+1
| | | | llvm-svn: 118490
* Fix PR8441, a race condition in the static attributes list. While the ↵Owen Anderson2010-11-091-5/+12
| | | | | | | | reference counting was itself threadsafe, the implicit removal of each object from the global list was not. Make this operation atomic. llvm-svn: 118461
* Apply patch for use-after-free in InlineAsm constant handling,Dale Johannesen2010-11-021-0/+1
| | | | | | | | PR 8522 / 8616046. Test reduction, analysis and patch by Tim Deegan! (However, review by someone who understands the classes here better is welcome. John Krum will return!) llvm-svn: 118030
* Inline asm multiple alternative constraints development phase 2 - improved ↵John Thompson2010-10-291-5/+5
| | | | | | basic logic, added initial platform support. llvm-svn: 117667
* Add a new 'hotpatch' attribute. This attribute will insert a two-byte no-opCharles Davis2010-10-251-0/+2
| | | | | | | instruction at the beginning of each function that has the attribute, allowing the function to be easily hooked and/or patched. llvm-svn: 117264
* Make some symbols static, move classes into anonymous namespaces.Benjamin Kramer2010-10-222-1/+3
| | | | llvm-svn: 117111
OpenPOWER on IntegriCloud