Hi devs,
I am looking into subjected issue.
consider below testcase.
$test.cpp
class A {
public:
    virtual int value() { return 1; }
};

class  B final : public A {
public:
    int value(){ return 2; }
};
int test(A* b) {
    return b->value() + 11;
}
void foo_test(B*b)
{
test(b);
}
Here gcc is unable to devirtualize the call to value into the test, because
type information is not being propogated from foo_test to test.
So this is what i am trying to do to make devirtualization happen:

First we can inline the function test into foo_test.
And then update the type in the OBJ_TYPE_REF.
so that devirtualization can be applied.
Like to know your thought before going ahead.

./Kamlesh

Reply via email to