dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.15k stars 4.71k forks source link

optimize delegate constructor in R2R for a virtual fp. #7839

Open sandreenko opened 7 years ago

sandreenko commented 7 years ago

ReadyToRun has this optimization for a non-virtual function pointers only for now. CoreRT supports a common case, moreover, it supports all R2R scenarios (for now the optimization is done only for GT_FTN_ADDR oper) where the constant lookup is used.

It would be nice to support fgOptimizeDelegateConstructor for all R2R and delete if (IsTargetAbi(CORINFO_CORERT_ABI))condition there.

category:cq theme:importer skill-level:intermediate cost:medium

sandreenko commented 7 years ago

@jkotas We discussed to create this issue, but I don't know who could be mentioned here.

sandreenko commented 3 years ago

The code from the description is located here: https://github.com/dotnet/runtime/blob/144cac3d0ce162444452a5dcc837b904fe149ef4/src/coreclr/jit/flowgraph.cpp#L7775-L7778