-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Open
Labels
JitUntriagedCLR JIT issues needing additional triageCLR JIT issues needing additional triagearea-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMICLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIenhancementProduct code improvement that does NOT require public API changes/additionsProduct code improvement that does NOT require public API changes/additionsoptimizationtenet-performancePerformance related issuePerformance related issue
Milestone
Description
This limits the ability to reason about subtypes. For instance in the following example the jit cannot optimize away the cast:
using System;
using System.Collections.Generic;
class Program
{
static void Main() => MyMethod(new char[0]);
static void MyMethod<T>(IEnumerable<T> chars)
{
if (typeof(T) == typeof(char))
{
foreach (char c in (IEnumerable<char>)chars) { }
}
}
}One idea here is to allow assertion prop to fall back to querying known sources of type information, eg gtGetClassHandle, when assertions are lacking. One might also consider teaching assertion prop that sealed classes are particularly interesting.
Likely however, most interesting cases of this kind can be caught earlier and with better effect (since this may unblock devirt/inlining or streamline importation), so it may not be worth doing anything here, once the anticipated cast optimizations in the importer are implemented.
category:cq
theme:assertion-prop
skill-level:expert
cost:medium
Metadata
Metadata
Assignees
Labels
JitUntriagedCLR JIT issues needing additional triageCLR JIT issues needing additional triagearea-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMICLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIenhancementProduct code improvement that does NOT require public API changes/additionsProduct code improvement that does NOT require public API changes/additionsoptimizationtenet-performancePerformance related issuePerformance related issue