area-CodeGen-coreclrhelp wanted
Métricas do repositório
- Stars
- (17.886 stars)
- Métricas de merge de PR
- (Mesclagem média 12d 11h) (661 fundiu PRs em 30d)
Description
Run-time simd checks can be beneficial in long-running cases (SpanHelpers.SequenceEqual for example)
Run-time simd checks can hurt performance because of redundant checks...
Could it be fixed? Eg;
void Method(){
if(Avx2.IsSupported) avx2path();
else softwarepath();
}
Method();
Method();
Method();
Can be transformed into:
if(Avx2.IsSupported){
Method_avx2path();
Method_avx2path();
Method_avx2path();
} else {
Method_softwarepath();
Method_softwarepath();
Method_softwarepath();
}
This could be done by inlining, but it won't work for the most part...
Compiler somehow should produce an unique codegen for every simd for every subsequent method:
void Start(){
if(Avx2.IsSupported) ...;
else ...;
Continue();
}
void Continue(){
End()
}
void End(){
if(Avx2.IsSupported) ...;
else ...;
}
Will produce
Start_Avx2
Start
Continue_Avx2
Continue
End_Avx2
End
But this unbiased codegeneration will cause dramatic size increase.
Could PGO be possibly used to know where checks are actually useful?
category:cq theme:ready-to-run skill-level:expert cost:medium impact:small