Skip to content

Conversation

mingmingl-llvm
Copy link
Contributor

@mingmingl-llvm mingmingl-llvm commented Aug 22, 2024

The ICP pass compares the vtable pointer with vtable address point for more efficient comparison sequence. The baseline is to compare the function pointer (loaded from vtable) with function address. The current cost-benefit analysis allows at most one vtable for each function candidate (to not insert instructions on hot paths).

icmp vtable-from-obj, getelementptr inbounds (i8, ptr @Derived2, i32 <constant-offset>) compares vtable loaded from object with a vtable address point offset. After lowering, its size cost depends on whether getelementptr inbounds (i8, ptr @Derived2, i32 <constant-offset> can be folded into the icmp instruction.

@mingmingl-llvm mingmingl-llvm changed the title [TypeProf][IndirectCallProm]Tweak max number of vtables by considering vtable address point materialization cost [TypeProf][IndirectCallProm]Tweak max number of vtables in cost-benefit analysis Aug 22, 2024
@mingmingl-llvm mingmingl-llvm changed the title [TypeProf][IndirectCallProm]Tweak max number of vtables in cost-benefit analysis [TypeProf][ICP]Tweak max number of vtables in cost-benefit analysis Aug 22, 2024
@mingmingl-llvm
Copy link
Contributor Author

This tuning doesn't make a difference practically. Close this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant