llvm/lib/VMCore
Chris Lattner fe9d82a71b Constant fold: getelementptr (i8* inttoptr (i64 1 to i8*), i32 -1)
Into: inttoptr (i64 0 to i8*)  -> null

This occurs in the example in PR1602.  With this fixed, we now compile
the example in PR1602 into fully "devirtualized" code:

define void @_Z1g1S(%struct.S* noalias  %s) {
entry:        %tmp131415 = getelementptr %struct.S* %s, i32 0, i32 0          ; <i32 (...)***> [#uses=1]        %tmp16 = load i32 (...)*** %tmp131415, align 4          ; <i32 (...)**> [#uses=1]
        %tmp26277 = load i32 (...)** %tmp16             ; <i32 (...)*> [#uses=1]
        %tmp2829 = bitcast i32 (...)* %tmp26277 to void (%struct.S*)*           ; <void (%struct.S*)*> [#uses=1]
        tail call void %tmp2829( %struct.S* %s )
        ret void
}

This still has the vtable dispatch (as required) but does not have any pointer
to method cruft left.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41046 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-13 17:09:08 +00:00
..
AsmWriter.cpp Reinstate the patch for escaping non-printing characters and allow for 2007-05-22 19:27:35 +00:00
AutoUpgrade.cpp This is the patch to provide clean intrinsic function overloading support in LLVM. It cleans up the intrinsic definitions and generally smooths the process for more complicated intrinsic writing. It will be used by the upcoming atomic intrinsics as well as vector and float intrinsics in the future. 2007-08-04 01:51:18 +00:00
BasicBlock.cpp DummyInst's member functions don't need to be virtual. 2007-07-26 15:25:08 +00:00
ConstantFold.cpp Constant fold: getelementptr (i8* inttoptr (i64 1 to i8*), i32 -1) 2007-08-13 17:09:08 +00:00
ConstantFold.h
Constants.cpp Patch 10 for long double. Doing constants right needs expanding ConstantFP 2007-08-09 22:51:36 +00:00
Dominators.cpp Speed up updateDFSNumbers with two observations: 2007-08-08 06:24:20 +00:00
Function.cpp Support for trampolines, except for X86 codegen which is 2007-07-27 12:58:54 +00:00
Globals.cpp handle gep aliasee 2007-05-05 23:49:02 +00:00
InlineAsm.cpp represent indirect operands explicitly in inline asm strings. 2007-04-28 01:02:58 +00:00
Instruction.cpp Move the GET_SIDE_EFFECT_INFO logic from isInstructionTriviallyDead 2007-07-26 16:06:08 +00:00
Instructions.cpp New CallInst interface to address GLIBCXX_DEBUG errors caused by 2007-08-01 03:43:44 +00:00
IntrinsicInst.cpp
LeakDetector.cpp
Makefile
Mangler.cpp
Module.cpp Implement review feedback. Aliasees can be either GlobalValue's or 2007-04-28 13:45:00 +00:00
ModuleProvider.cpp
Pass.cpp Re-install patch to enable use of PassID. 2007-05-02 20:38:25 +00:00
PassManager.cpp Do not overuse std::string. Pass around char * directly. 2007-08-10 18:29:32 +00:00
SymbolTableListTraitsImpl.h The (negative) offset from a SymbolTableListTraits-using ilist to its container 2007-04-17 04:04:14 +00:00
Type.cpp Long double, part 1 of N. Support in IR. 2007-08-03 01:03:46 +00:00
TypeSymbolTable.cpp
Value.cpp add Value::getNameStart/getNameLen() accessors. 2007-08-10 15:34:35 +00:00
ValueSymbolTable.cpp
ValueTypes.cpp long double patch 3 of N. Add to MVT. 2007-08-03 20:51:37 +00:00
Verifier.cpp Fix minor doxygen nits. 2007-08-05 20:06:04 +00:00