We'd need to identify the EF.Compile API at AOT time and do the necessary things. Note that compiled queries still make sense in AOT mode, since they pass parameter extraction and the cache lookup.