PR #198138 makes a significant change that will surely be pervasive in the LLVM development experience. I believe it strictly improves FileCheck’s output by addressing some readability issues that have been discussed for years.
The main purpose of this RFC is to announce the change so that its sudden appearance does not confuse people. However, if it turns out people feel the change will introduce new problems for their use cases, then this RFC is also an opportunity to iterate further or object before the PR lands.
The examples below are based on main at c2047f919e7549c2853b609b4cbef9d0adb9c3af.
Example: Reducing Verbosity from X~~
For this example, I introduced a mistake into the second FileCheck directive of llvm/test/Transforms/LoopUnroll/epilog_const_phi.ll. Without this PR, FileCheck then produces this input dump:
With this PR, FileCheck instead produces this input dump:
In general, this PR changes FileCheck to never emit X~~~~, which is a verbose way to depict the search range for an unmatched pattern. Instead, FileCheck emits annotations depicting just the start and end of that search range. The PR’s initial comment discusses details like the rationale for using exclusive bounds to depict the search range.
The most recent observation of this verbosity that I recall appears in issue #77257. Thanks to @Shivam, @MaskRay, and others who drove that discussion.
Example: Adding search ranges for all errors
For this example, I introduced a mistake into the third FileCheck directive of llvm/test/Transforms/LoopUnroll/expensive-tripcount.ll. With this PR, FileCheck then produces this input dump:
Without this PR, input lines 1-9 and 92-97 are not shown. However, lines 1-9 are highly relevant to the actual problem because that is where the CHECK-NEXT directive was expected to match but did not.
In general, this PR adds annotations depicting the search range for any failed FileCheck pattern. The PR initial comment discusses why that is useful generally and points to additional examples.
Conclusion
I hope people agree that PR #198138 is strictly an improvement to FileCheck’s input dumps. If so, we can land it quickly. The PR has already been accepted (thanks go to @MaskRay for all the reviews). I plan to wait 1 week for replies to this RFC before landing, but I can wait longer if people need more time.
In the past, people have proposed entirely new formats for FileCheck’s output, as in the issue cited above. Such ideas can be valuable, and I do not wish to discourage their investigation. However, to avoid confusion, I respectfully ask that this RFC’s discussion stay focused on whether PR #198138 is a helpful incremental improvement for FileCheck’s current output format.


