llvm-project
b1698d3a - [LoopUnroll][NFC] Simplify recent block frequency tests (#177025)

Commit
104 days ago
[LoopUnroll][NFC] Simplify recent block frequency tests (#177025) Refactor a number of recent tests in `llvm/test/Transforms/LoopUnroll/branch-weights-freq` to make it easier to understand and extend them. The changes mostly resemble the refactoring I recently did in PR #165635 in response to reviewer comments: - For each case (e.g., each `-unroll-count` value in `unroll-epilog.ll`), group all FileCheck directives together. That way, while digesting a single case, the reader does not need to sift through all other cases and a complex FileCheck prefix scheme. - Reduce CFG testing. Drop many FileCheck directives that check for all basic block labels and branches, and drop the cryptic `-implicit-check-not` that excludes others. Instead, just use positive checks for every loop body (represented by `call void @f`), for relevant metadata, and for the branch instructions to which the metadata is attached, and use simple negative checks (e.g., `-implicit-check-not='!prof'`) to be sure we have not missed any. - Better document what the test intends to cover. The result is sometimes longer tests due to comments and repetition, but I believe they are easier to maintain this way.
Author
Parents
Loading