llvm-6502/lib
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
..
Analysis constant fold ptrtoint(inttoptr) with target data when available. This allows 2007-08-11 23:49:01 +00:00
Archive finishing touches of bytecode -> bitcode changes. also unbreak Windows 2007-07-06 20:28:40 +00:00
AsmParser regenerate 2007-08-06 21:00:46 +00:00
Bitcode Patch 10 for long double. Doing constants right needs expanding ConstantFP 2007-08-09 22:51:36 +00:00
CodeGen Kill info update bugs. 2007-08-13 07:12:23 +00:00
Debugger switch this to bitcode instead of bytecode 2007-05-06 09:29:13 +00:00
ExecutionEngine Fix a comment typo noticed by Sandro Magi. 2007-08-11 15:57:56 +00:00
Linker Allow the filename "-" to be a place holder for stdin. This allows directing 2007-08-08 19:52:29 +00:00
Support Make getSTDIN return null if the standard input is empty, as the header file 2007-08-08 20:01:58 +00:00
System Fix PR1581, patch by Timo Savola 2007-07-31 06:00:51 +00:00
Target expand a note 2007-08-11 18:19:07 +00:00
Transforms Split loops and do CFG cleanup. 2007-08-12 07:02:51 +00:00
VMCore Constant fold: getelementptr (i8* inttoptr (i64 1 to i8*), i32 -1) 2007-08-13 17:09:08 +00:00
Makefile build lib/Archive instead of lib/Bytecode 2007-05-06 19:50:06 +00:00