The patch https://reviews.llvm.org/D63957 is to avoid empty string when scrubbing loop comments.
If the line only has loop comments the patch D63957 will replace it to a #, that's correct.
But if the line has someelse not only loop comments, we will get a extra #.
For example:
.LBB40_1: # =>This Inner Loop Header: Depth=1
The patch D63957 will get
.LBB40_1: #
The patch is to remove the extra #.
Why we want to scrub loop comment TWICE?
If the extra comments # is bothering you,
can we try to add one regex to scrub it AFTER SCRUB_LOOP_COMMENT_RE?
Something like: