Sometimes a function cannot be codegen'd, even with codegen enabled, because some functionality is not implemented (e.g. we cannot codegen the Avro scanner if the file schema does not match the table schema, certain types are not implemented for aggregates). We should always print a message to the log explaining why this is the case, otherwise it's very difficult to figure out why codegen couldn't be used for a certain query. We already log in some cases but not all.
In addition, we could also put these reasons in the runtime profile. Currently we only log if codegen is enabled on an operator, but it would be also be useful to see if it was disabled and why.