Merge change 24537

* changes:
  Add support for profiling when loop optimizations are active