New Issue: Exempt non-recursive functions from instantiation limit

19948, "stonea", "Exempt non-recursive functions from instantiation limit", "2022-06-06T19:18:10Z"

In this PR: Add fn exempt instantiation limit pragma and apply it to isArrayValue by stonea · Pull Request #19899 · chapel-lang/chapel · GitHub I add an 'exempt from instantiation limit' pragma and apply it to the isArrayValue procedure.

This was necessary as I moved the proc from a module where things were implicitly exempted to a place where they're not and Arkouda (and I imagine other large Chapel programs) ends up calling isArrayValue many, many times on many different types of values.

More details can be found here: https://chapel.discourse.group/t/cron-perf-cray-cs-hdr-arkouda/12773
And here: https://github.com/Cray/chapel-private/issues/3415

The purpose for instantiation limits is to prevent the compiler from going into an infinite recursion in a case like this:

def foo(param p: int) return foo(p+1);

Or this:

proc foo(type t) {
  return foo((t, int));  // call foo with a tuple of `(t, int)`
  return foo((...t), int);  // add another int to the tuple that is t. 
}
foo((int,));

For non-recursive functions we're unnecessarily adding this check, which might from time-to-time trip up users (who likely aren't aware of the pragma that can be used to exempt them). Maybe we should detect whether or not the function is recursive and automatically exempt it from the instance check when it's not.