http://llvm.org/bugs/show_bug.cgi?id=15770
Bug ID: 15770
Summary: mergefunc could improve in face of virtual methods?
Product: new-bugs
Version: 3.2
Hardware: PC
OS: All
Status: NEW
Severity: normal
Priority: P
Component: new bugs
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Classification: Unclassified
Created attachment 10360
--> http://llvm.org/bugs/attachment.cgi?id=10360&action=edit
Example C++ file
With emscripten, we'd like to be able to use the mergefunc optimization pass
and in looking at the results of using it, a lot of thunks are created for
virtual methods, presumably due to vtable references.
I've attached an example C++ file that demonstrates a very basic case of this.
Why do we need the thunk in this situation? Do we really need the bitcast?
I compiled the attached file as follows:
/usr/local/bin/clang++ -emit-llvm -S -o test.ll -c test.cpp
And then ran opt:
/usr/local/bin/opt -debug -mergefunc test.ll -o opt-test.bc
And that told me:
Args: /usr/local/bin/opt -debug -mergefunc test.ll -o opt-test.bc
size of module: 11
size of worklist: 8
Inserting as unique: main
Inserting as unique: _ZN1BC1Ev
Inserting as unique: _ZN1CC1Ev
Inserting as unique: _ZN1CC2Ev
Inserting as unique: _ZN1AC2Ev
Inserting as unique: _ZN1C3fooEi
Inserting as unique: _ZN1BC2Ev
_ZN1C3fooEi == _ZN1B3fooEi
writeThunk: _ZN1B3fooEi
size of FnSet: 7
Any chance this could be better?
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs