Instrumentation cleanup when operation was removed #3061
+124
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When some later optimizations remove an op that is instrumented, we still get the BEFORE/AFTER instrumentation back to back without anything in between.
That makes it harder to detect if a given optimization removes operations or not. For example, when
-enable-compiler-stick-unstick
succeeds or not in removing unneeded stick/unstick.This PR adds a pass just before lowering instrumentation and detects if there are 2 consecutive instrumentation call (one BEFORE and one AFTER tags) that do not also initialize the instrumentation. When the is the case, then these two instrumentation operations are removed.
Now we can directly see if an optimization add/remove operations using the
make-report.py
and get more informative profiling information as the number of calls more precisely reflect the number of actual operations executed.Measurement without compiler gen stick/unstick (1 stick/unstick only):
Measurement with compiler gen stick/unstick (3 stick/unstick):