summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore
Commit message (Collapse)AuthorAgeFilesLines
* Make MDNode use CallbackVH. Also change MDNode to store Value* instead ofNick Lewycky2009-05-102-26/+31
| | | | | | | Constant* in preperation of a future change to support holding non-Constants in an MDNode. llvm-svn: 71407
* OCaml parameter attribute bindings from PR2752.Duncan Sands2009-05-061-0/+14
| | | | | | Incomplete, but better than nothing. llvm-svn: 71081
* Allow readonly functions to unwind exceptions. TeachDuncan Sands2009-05-061-0/+8
| | | | | | | | the optimizers about this. For example, a readonly function with no uses cannot be removed unless it is also marked nounwind. llvm-svn: 71071
* Quotes should be printed before private prefix; some code clean up.Evan Cheng2009-05-051-50/+68
| | | | llvm-svn: 71032
* Use true instead of 1 for a boolean value. And fix a copy+pastoDan Gohman2009-05-041-3/+3
| | | | | | in a comment. llvm-svn: 70882
* Apply Jeffrey Yasskin's CallbackVH patch, with minor tweaks from meDan Gohman2009-05-021-2/+10
| | | | | | | to make the copy constructor and destructor protected, and corresponding adjustments to the unittests. llvm-svn: 70644
* Any size of integral indices are allowed in gep for indexing into sequential ↵Sanjiv Gupta2009-04-261-3/+2
| | | | | | types. Also adding a test case to check the indices type allowed into struct. llvm-svn: 70134
* Allow aliasee to be a GEP or bitcast instead of just a bitcast.Chris Lattner2009-04-252-7/+9
| | | | | | | | | | | The real fix for this whole mess is to require the operand of the alias to be a *GlobalValue* (not a general constant, including constant exprs) but allow the operand and the alias type to be unrelated. This fixes PR4066 llvm-svn: 70079
* Allow i16 type indices to gep.Sanjiv Gupta2009-04-241-1/+2
| | | | llvm-svn: 69946
* It's not necessary for PrintModulePass to flush the output streamsDan Gohman2009-04-201-2/+0
| | | | | | now that errs() is properly non-buffered. llvm-svn: 69602
* Don't discard an AssemblyAnnotationWriter when writing GlobalValues,Dan Gohman2009-04-201-1/+1
| | | | | | | which include Functions, where it can be quite useful to use an AssemblyAnnotationWriter. llvm-svn: 69598
* Implement operator<<(raw_ostream &OS, const Type &T).Dan Gohman2009-04-201-0/+5
| | | | llvm-svn: 69596
* Limit the number of times we're willing to chase pointers. Removes an O(n^2)Nick Lewycky2009-04-151-1/+3
| | | | | | problem from instcombine. llvm-svn: 69151
* Add a new "available_externally" linkage type. This is intendedChris Lattner2009-04-131-0/+3
| | | | | | | | to support C99 inline, GNU extern inline, etc. Related bugzilla's include PR3517, PR3100, & PR2933. Nothing uses this yet, but it appears to work. llvm-svn: 68940
* Add a new Type::getPointerTo method, which is shorthand forChris Lattner2009-04-101-0/+4
| | | | | | llvm::PointerType::get(). Patch by Anders Johnsen! llvm-svn: 68772
* disable this code for now, re-breaking PR2975, but fixingChris Lattner2009-04-081-3/+3
| | | | | | a testcase I'm about to attach to that pr. llvm-svn: 68592
* fix style.Torok Edwin2009-04-071-3/+3
| | | | llvm-svn: 68542
* Another attempt at fixing PR2975.Torok Edwin2009-04-071-0/+25
| | | | | | Types can have references to eachother, so we can't just call destroy on them. llvm-svn: 68523
* revert r68457, its crashing in make check.Torok Edwin2009-04-061-16/+0
| | | | llvm-svn: 68459
* fix (part of) memory leak on shutdown. See PR2975.Torok Edwin2009-04-061-0/+16
| | | | llvm-svn: 68457
* Remove bogus include.Nick Lewycky2009-04-041-1/+0
| | | | llvm-svn: 68421
* Add support for embedded metadata to LLVM. This introduces two new types ofNick Lewycky2009-04-044-3/+155
| | | | | | | | Constant, MDString and MDNode which can only be used by globals with a name that starts with "llvm." or as arguments to a function with the same naming restriction. llvm-svn: 68420
* Clean up pass manager cache after each run.Devang Patel2009-04-011-0/+14
| | | | llvm-svn: 68254
* Add two new classes: WeakVH and AssertingVH. These are both "ValueHandles", Chris Lattner2009-03-311-2/+165
| | | | | | | | | | | | | | | | | | which are effectively smart pointers to Value*'s. They are both very light weight and simple, and react to values being destroyed or being RAUW'd. WeakVN does a best effort to follow a value around, including through RAUW operations and will get nulled out of the value is destroyed. This is useful for the eventual "metadata that references a value" work, because it is a reference to a value that does not show up on its use_* list. AssertingVH is a pointer that compiles down to a dumb raw pointer when assertions are disabled. When enabled, it emits an assertion if the pointed-to value is destroyed while it is still being referenced. This is very useful for Maps and other things, and should have caught the recent bugs in CallGraph and Reassociate, for example. llvm-svn: 68149
* Fix infinite loopingAnton Korobeynikov2009-03-301-0/+2
| | | | llvm-svn: 68034
* Properly propagate Kind.Anton Korobeynikov2009-03-301-1/+1
| | | | llvm-svn: 68033
* Extend the relocation tracker handler, so we can filter on different 'kinds' ↵Anton Korobeynikov2009-03-291-5/+20
| | | | | | of relocations required. llvm-svn: 68004
* "ghostify" the ilist<Function> sentinelGabor Greif2009-03-271-8/+0
| | | | llvm-svn: 67872
* Fix internal representation of fp80 to be theDale Johannesen2009-03-231-2/+22
| | | | | | | | | | same as a normal i80 {low64, high16} rather than its own {high64, low16}. A depressing number of places know about this; I think I got them all. Bitcode readers and writers convert back to the old form to avoid breaking compatibility. llvm-svn: 67562
* Now that errs() is properly non-buffered, there's no need toDan Gohman2009-03-231-3/+2
| | | | | | explicitly flush it. llvm-svn: 67526
* add a fastpath to ConstantExpr::getBitCast to handle the case when an obviouslyChris Lattner2009-03-211-0/+5
| | | | | | | | | unneeded bitcast is requested. This is common for frontends who just unconditionally cast even if the target is often the right type already. THis prevents going into getFoldedCast which switches on the opcode and does a bunch of other stuff before doing the same opzn. llvm-svn: 67435
* Fix a couple glaring whitespace issues. This file isn't internally consistentNick Lewycky2009-03-191-2/+2
| | | | | | either. llvm-svn: 67288
* typoGabor Greif2009-03-171-1/+1
| | | | llvm-svn: 67080
* Simplify. "Broken" is always true here.Nick Lewycky2009-03-151-1/+1
| | | | llvm-svn: 67025
* Remove obviously redundant call.Nick Lewycky2009-03-151-1/+1
| | | | llvm-svn: 67023
* Apply a patch by Micah Villmow to fix AsmParser to accept vectorDan Gohman2009-03-142-1/+7
| | | | | | | shift constant expressions, and add support for folding vector shift constant expressions. This fixes PR3802. llvm-svn: 67010
* Revert r66920. It was causing failures in the self-hosting buildbot (in releaseBill Wendling2009-03-133-17/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mode). Running /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/dg.exp ... FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/crash-narrowfunctiontest.ll Failed with signal(SIGBUS) at line 1 while running: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/crash-narrowfunctiontest.ll -bugpoint-crashcalls -silence-passes > /dev/null 0 bugpoint 0x0035dd25 llvm::sys::SetInterruptFunction(void (*)()) + 85 1 bugpoint 0x0035e382 llvm::sys::RemoveFileOnSignal(llvm::sys::Path const&, std::string*) + 706 2 libSystem.B.dylib 0x92f112bb _sigtramp + 43 3 libSystem.B.dylib 0xffffffff _sigtramp + 1829694831 4 bugpoint 0x00021d1c main + 92 5 bugpoint 0x00002106 start + 54 6 bugpoint 0x00000004 start + 18446744073709543220 Stack dump: 0. Program arguments: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/crash-narrowfunctiontest.ll -bugpoint-crashcalls -silence-passes FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/misopt-basictest.ll Failed with signal(SIGBUS) at line 1 while running: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/misopt-basictest.ll -dce -bugpoint-deletecalls -simplifycfg -silence-passes 0 bugpoint 0x0035dd25 llvm::sys::SetInterruptFunction(void (*)()) + 85 1 bugpoint 0x0035e382 llvm::sys::RemoveFileOnSignal(llvm::sys::Path const&, std::string*) + 706 2 libSystem.B.dylib 0x92f112bb _sigtramp + 43 3 libSystem.B.dylib 0xffffffff _sigtramp + 1829694831 4 bugpoint 0x00021d1c main + 92 5 bugpoint 0x00002106 start + 54 6 bugpoint 0x00000006 start + 18446744073709543222 Stack dump: 0. Program arguments: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/misopt-basictest.ll -dce -bugpoint-deletecalls -simplifycfg -silence-passes FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/remove_arguments_test.ll Failed with signal(SIGBUS) at line 1 while running: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/remove_arguments_test.ll -bugpoint-crashcalls -silence-passes 0 bugpoint 0x0035dd25 llvm::sys::SetInterruptFunction(void (*)()) + 85 1 bugpoint 0x0035e382 llvm::sys::RemoveFileOnSignal(llvm::sys::Path const&, std::string*) + 706 2 libSystem.B.dylib 0x92f112bb _sigtramp + 43 3 libSystem.B.dylib 0xffffffff _sigtramp + 1829694831 4 bugpoint 0x00021d1c main + 92 5 bugpoint 0x00002106 start + 54 Stack dump: 0. Program arguments: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/remove_arguments_test.ll -bugpoint-crashcalls -silence-passes --- Reverse-merging (from foreign repository) r66920 into '.': U include/llvm/Support/CallSite.h U include/llvm/Instructions.h U lib/Analysis/IPA/GlobalsModRef.cpp U lib/Analysis/IPA/Andersens.cpp U lib/Bitcode/Writer/BitcodeWriter.cpp U lib/VMCore/Instructions.cpp U lib/VMCore/Verifier.cpp U lib/VMCore/AsmWriter.cpp U lib/Transforms/Utils/LowerInvoke.cpp U lib/Transforms/Scalar/SimplifyCFGPass.cpp U lib/Transforms/IPO/PruneEH.cpp U lib/Transforms/IPO/DeadArgumentElimination.cpp llvm-svn: 66953
* Second installment of "BasicBlock operands to the back"Gabor Greif2009-03-133-9/+17
| | | | | | | | | | | | | | | | | | changes. For InvokeInst now all arguments begin at op_begin(). The Callee, Cont and Fail are now faster to get by access relative to op_end(). This patch introduces some temporary uglyness in CallSite. Next I'll bring CallInst up to a similar scheme and then the uglyness will magically vanish. This patch also exposes all the reliance of the libraries on InvokeInst's operand ordering. I am thinking of taking care of that too. llvm-svn: 66920
* Rearrange operands of the BranchInst, to be able toGabor Greif2009-03-123-30/+105
| | | | | | | | | | | | | | | | | | | | | | | | | access each with a fixed negative index from op_end(). This has two important implications: - getUser() will work faster, because there are less iterations for the waymarking algorithm to perform. This is important when running various analyses that want to determine callers of basic blocks. - getSuccessor() now runs faster, because the indirection via OperandList is not necessary: Uses corresponding to the successors are at fixed offset to "this". The price we pay is the slightly more complicated logic in the operator User::delete, as it has to pick up the information whether it has to free the memory of an original unconditional BranchInst or a BranchInst that was originally conditional, but has been shortened to unconditional. I was not able to come up with a nicer solution to this problem. (And rest assured, I tried *a lot*). Similar reorderings will follow for InvokeInst and CallInst. After that some optimizations to pred_iterator and CallSite will fall out naturally. llvm-svn: 66815
* It makes no sense to have a ODR version of commonDuncan Sands2009-03-111-2/+1
| | | | | | linkage, so remove it. llvm-svn: 66690
* Remove the one-definition-rule version of extern_weakDuncan Sands2009-03-111-2/+1
| | | | | | | linkage: this linkage type only applies to declarations, but ODR is only relevant to globals with definitions. llvm-svn: 66650
* Use WriteAsOperand instead of manually decorating the name for thisDan Gohman2009-03-101-11/+8
| | | | | | debug output. This improves the printing of anonymous values. llvm-svn: 66561
* make GlobalValue::removeDeadConstantUsers() const.Chris Lattner2009-03-091-7/+7
| | | | llvm-svn: 66403
* fix Analysis/BasicAA/2004-12-08-BasicAACrash.ll by allowing opaque types.Chris Lattner2009-03-091-2/+4
| | | | llvm-svn: 66395
* Fix PR3746 - Crash in isel with GEP of function pointerChris Lattner2009-03-091-13/+17
| | | | | | | | | | | by checking that the top-level type of a gep is sized. This causes us to reject the example with: llvm-as: t2.ll:2:16: invalid getelementptr indices getelementptr i32()* null, i32 1 ^ llvm-svn: 66393
* fix typoChris Lattner2009-03-081-1/+1
| | | | llvm-svn: 66367
* Introduce new linkage types linkonce_odr, weak_odr, common_odrDuncan Sands2009-03-071-10/+14
| | | | | | | | | | | | | | | | | | | | | and extern_weak_odr. These are the same as the non-odr versions, except that they indicate that the global will only be overridden by an *equivalent* global. In C, a function with weak linkage can be overridden by a function which behaves completely differently. This means that IP passes have to skip weak functions, since any deductions made from the function definition might be wrong, since the definition could be replaced by something completely different at link time. This is not allowed in C++, thanks to the ODR (One-Definition-Rule): if a function is replaced by another at link-time, then the new function must be the same as the original function. If a language knows that a function or other global can only be overridden by an equivalent global, it can give it the weak_odr linkage type, and the optimizers will understand that it is alright to make deductions based on the function body. The code generators on the other hand map weak and weak_odr linkage to the same thing. llvm-svn: 66339
* simplify the way how traits get hold of the symbol tableGabor Greif2009-03-071-5/+3
| | | | llvm-svn: 66336
* further simplifications arising from peruse of the more declarative interfaceGabor Greif2009-03-073-21/+0
| | | | llvm-svn: 66333
* Add Module::getNamedValue; use to normalize access to Module symbolDaniel Dunbar2009-03-061-19/+21
| | | | | | | table. - No functionality change. llvm-svn: 66289
OpenPOWER on IntegriCloud