summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore
Commit message (Collapse)AuthorAgeFilesLines
* Fix an accidental inversion of the inbounds flag.Dan Gohman2009-09-151-3/+3
| | | | llvm-svn: 81862
* When a constant's type is refined, update the constant in placeDan Gohman2009-09-153-215/+157
| | | | | | | | | | | | | | | | | | | | | | | | | | instead of cloning and RAUWing it. - Make AbstractTypeUser a friend of Value so that it can offer its subclasses a way to update a Value's type in place. This is better than a universally visible setType method on Value, and it's sufficient for the immediate need. - Eliminate the constant "convert" functions. This eliminates a lot of logic duplication, and fixes a complicated bug where a constant can't actually be cloned during the type refinement process because some of the types that its folder needs are half-destroyed, being in the middle of refinement themselves. - Move the getValType functions from being static overloaded functions in Constants.cpp to be members of class template specializations in ConstantsContext.h. This means that the code ends up getting instantiated twice, however it also makes it possible to eliminate all "convert" functions, so it's not a big net code size increase. And if desired, the duplicate instantiations could be eliminated with some reorganization. llvm-svn: 81861
* Forbid arrays of function-type and structures with function-typed fields.Nick Lewycky2009-09-151-17/+13
| | | | | | | | | | While I'm there, change code that does: SomeTy == Type::getFooType(Context) into: SomeTy->getTypeID() == FooTyID to decrease the amount of useless type creation which may involve locking, etc. llvm-svn: 81846
* fix PR4963: folding insertvalue would sometimes turn a packed struct intoChris Lattner2009-09-151-20/+24
| | | | | | an unpacked one. llvm-svn: 81845
* make -debug-pass=Executions show information about what call graph nodesChris Lattner2009-09-151-4/+13
| | | | | | are in the SCC for each execution of a CGSCC pass. llvm-svn: 81838
* add some missing quotes in debug outputChris Lattner2009-09-151-2/+2
| | | | llvm-svn: 81836
* Fix a pair of comment typos.Nick Lewycky2009-09-141-2/+3
| | | | llvm-svn: 81750
* Fifth time's a charm! Remove ourselves as abstract type listeners once we'veNick Lewycky2009-09-141-3/+16
| | | | | | been told that the type is no longer abstract. llvm-svn: 81749
* Don't leak! Always remove oneself as a listener after adding oneself.Nick Lewycky2009-09-141-6/+15
| | | | llvm-svn: 81736
* Actually remove old types from the set.Nick Lewycky2009-09-131-12/+30
| | | | | | | Also break the type verification stuff into its own TypeSet to keep the Verifier pass from becoming an AbstractTypeUser. llvm-svn: 81729
* Storing a set of PATypeHolders is a bad idea because their sort order willNick Lewycky2009-09-131-2/+10
| | | | | | | | change as types are refined. Remove abstract types from CheckedTypes when they we're informed that they have been refined. The only way types get refined in the verifier is when later function passes start optimizing. Fixes PR4970. llvm-svn: 81716
* Make the MC symbol printer and llvm::Mangler exactly agree on manglingChris Lattner2009-09-131-0/+1
| | | | | | for systems that don't support quoting (PR4966). llvm-svn: 81682
* Preserve the inbounds flag, so that the constant folder doesn'tDan Gohman2009-09-121-2/+5
| | | | | | recompute it. llvm-svn: 81634
* Fix the build when DEBUG_SYMBOL_TABLE is set.Dan Gohman2009-09-121-1/+1
| | | | llvm-svn: 81633
* Fix -Asserts warning.Daniel Dunbar2009-09-111-2/+2
| | | | llvm-svn: 81580
* reject attempts to take the address of an intrinsic, PR4949.Chris Lattner2009-09-111-0/+12
| | | | llvm-svn: 81530
* fix prefix ordering, it's L_foo not _LfooChris Lattner2009-09-111-2/+1
| | | | llvm-svn: 81506
* add a new Mangler::getNameWithPrefix API which returns theChris Lattner2009-09-111-2/+48
| | | | | | | | (uniqued if unnamed) global variable name with the prefix that it is supposed to get. It doesn't do "mangling" in the sense of adding quotes and hacking on bad characters. llvm-svn: 81505
* Fix indentation.Dan Gohman2009-09-111-1/+1
| | | | llvm-svn: 81484
* Teach lib/VMCore/ConstantFold.cpp how to set the inbounds keyword andDan Gohman2009-09-113-9/+105
| | | | | | | | | | | | | how to fold notionally-out-of-bounds array getelementptr indices instead of just doing these in lib/Analysis/ConstantFolding.cpp, because it can be done in a fairly general way without TargetData, and because not all constants are visited by lib/Analysis/ConstantFolding.cpp. This enables more constant folding. Also, set the "inbounds" flag when the getelementptr indices are one-past-the-end. llvm-svn: 81483
* Factor out the code for checking that all indices in a getelementptr areDan Gohman2009-09-102-0/+34
| | | | | | | | | within the notional bounds of the static type of the getelementptr (which is not the same as "inbounds") from GlobalOpt into a utility routine, and use it in ConstantFold.cpp to check whether there are any mis-behaved indices. llvm-svn: 81478
* Fix whitespaces.Devang Patel2009-09-101-4/+4
| | | | llvm-svn: 81468
* Add some braces to make newer GCCs happy and update CMakeLists.Benjamin Kramer2009-09-101-3/+5
| | | | llvm-svn: 81443
* Add malloc call utility functions. Patch by Victor Hernandez.Evan Cheng2009-09-101-0/+111
| | | | llvm-svn: 81426
* Take lock before removing a node from MDNodeSet.Devang Patel2009-09-091-1/+5
| | | | llvm-svn: 81356
* Enable MDNode uniquing.Devang Patel2009-09-091-21/+1
| | | | llvm-svn: 81355
* Gracefully destroy MDNodes.Devang Patel2009-09-091-0/+3
| | | | llvm-svn: 81353
* Remove dead code.Devang Patel2009-09-081-2/+0
| | | | llvm-svn: 81235
* Hoist out the test+insert to CheckedTypes. This doesn't seem to affectNick Lewycky2009-09-081-10/+4
| | | | | | performance. llvm-svn: 81193
* Simplify from my last change. Assert1 is a macro that makes its caller return,Nick Lewycky2009-09-081-38/+30
| | | | | | | | | so "Assert1(isa<>); cast<>" is a valid idiom. Actually check the PHI node's odd-numbered operands for BasicBlock-ness, like the comment said. llvm-svn: 81182
* Verify types. Invalid types can be constructed when assertions are off.Nick Lewycky2009-09-081-36/+132
| | | | | | | Make the verifier more robust by avoiding unprotected cast<> calls. Notably, Assert1(isa<>); cast<> is not safe as Assert1 does not terminate the program. llvm-svn: 81179
* Reappy r80998, now that the GlobalOpt bug that it exposed on MiniSAT is fixed.Dan Gohman2009-09-073-47/+106
| | | | llvm-svn: 81172
* Express this in the canonical way.Nick Lewycky2009-09-071-2/+2
| | | | llvm-svn: 81157
* Homogenize whitespace.Nick Lewycky2009-09-071-20/+16
| | | | llvm-svn: 81156
* Disable MDNode uniquing.Daniel Dunbar2009-09-071-1/+21
| | | | | | - Hopefully this unbreaks some llvm-gcc bootstraps. llvm-svn: 81141
* Public and private corrections, warned about by icc (#304).Duncan Sands2009-09-063-12/+12
| | | | | | Patch by Erick Tryzelaar. llvm-svn: 81107
* Remove some unused variables and methods warned about byDuncan Sands2009-09-061-2/+0
| | | | | | icc (#177, partial). Patch by Erick Tryzelaar. llvm-svn: 81106
* Revert "Include optional subclass flags, such as inbounds, nsw, etc., ...", thisDaniel Dunbar2009-09-063-106/+47
| | | | | | breaks MiniSAT on x86_64. llvm-svn: 81098
* While replacing an MDNode elment, properly update MDNode's operand list. Devang Patel2009-09-042-3/+28
| | | | | | MDNode's operand list does not include all elements. llvm-svn: 81045
* Include optional subclass flags, such as inbounds, nsw, etc., in theDan Gohman2009-09-043-47/+106
| | | | | | | | | | | | | | | | | Constant uniquing tables. This allows distinct ConstantExpr objects with the same operation and different flags. Even though a ConstantExpr "a + b" is either always overflowing or never overflowing (due to being a ConstantExpr), it's still necessary to be able to represent it both with and without overflow flags at the same time within the IR, because the safety of the flag may depend on the context of the use. If the constant really does overflow, it wouldn't ever be safe to use with the flag set, however the use may be in code that is never actually executed. This also makes it possible to merge all the flags tests into a single test. llvm-svn: 80998
* Revert 80959. It isn't sufficient to solve the full problem. And itDan Gohman2009-09-033-1/+60
| | | | | | introduced regressions in the Ocaml bindings tests. llvm-svn: 80969
* Remove the API for creating ConstantExprs with the nsw, nuw, inbounds,Dan Gohman2009-09-033-60/+1
| | | | | | | | | | | | | | | and exact flags. Because ConstantExprs are uniqued, creating an expression with this flag causes all expressions with the same operands to have the same flag, which may not be safe. Add, sub, mul, and sdiv ConstantExprs are usually folded anyway, so the main interesting flag here is inbounds, and the constant folder already knows how to set the inbounds flag automatically in most cases, so there isn't an urgent need for the API support. This can be reconsidered in the future, but for now just removing these API bits eliminates a source of potential trouble with little downside. llvm-svn: 80959
* Use WeakVH to hold dead mdnodes. Check use_empty() before deleting a node.Devang Patel2009-09-031-5/+7
| | | | llvm-svn: 80928
* Change PHINode::hasConstantValue to have a DominatorTree argumentDan Gohman2009-09-031-7/+20
| | | | | | | | instead of a bool argument, and to do the dominator check itself. This makes it eaiser to use when DominatorTree information is available. llvm-svn: 80920
* back out my recent commit (r80858), it seems to break self-hosting ↵Gabor Greif2009-09-033-17/+9
| | | | | | buildbot's stage 2 configure llvm-svn: 80871
* Now Bitcode reader bug is fixed. Reapply 80839.Devang Patel2009-09-035-35/+113
| | | | | | | | Use CallbackVH, instead of WeakVH, to hold MDNode elements. Use FoldingSetNode to unique MDNodes in a context. Use CallbackVH hooks to update context's MDNodeSet appropriately. llvm-svn: 80868
* re-commit r66920 (which has been backed out in r66953) I may have more luck ↵Gabor Greif2009-09-033-9/+17
| | | | | | this time. I'll back out if needed... llvm-svn: 80858
* Revert 80839 for now. It causes test failures.Devang Patel2009-09-025-113/+35
| | | | llvm-svn: 80841
* Use CallbackVH, instead of WeakVH, to hold MDNode elements. Devang Patel2009-09-025-35/+113
| | | | | | | Use FoldingSetNode to unique MDNodes in a context. Use CallbackVH hooks to update context's MDNodeSet appropriately. llvm-svn: 80839
* Opaque types didn't work if llvm_is_multithreaded().Torok Edwin2009-09-021-1/+1
| | | | | | | AlwaysOpaqueTy is always NULL at this point, and it causes an assertion failure. Fix it by using the just constructed tmp instead. llvm-svn: 80780
OpenPOWER on IntegriCloud