[llvm-commits] [llvm] r41046 - /llvm/trunk/lib/VMCore/ConstantFold.cpp

Rafael Espindola espindola at google.com
Wed Aug 15 12:46:39 PDT 2007

> 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.

Is it really required? Since S is passed by value, I think one can be
sure that method called is S::f and not one from a class that inherits
from S.

Maybe a LLVM type definition should include support for defining that
part of it is constant?

Rafael Avila de Espindola

Google Ireland Ltd.
Gordon House
Barrow Street
Dublin 4

Registered in Dublin, Ireland
Registration Number: 368047

More information about the llvm-commits mailing list