This emits a remark when LoopDeletion deletes a dead loop, using the source location of the loop's header. There are currently two reasons for removing the loop: invariant loop or loop that never executes.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
LGTM, thanks! I've added a few suggestions with respect to tests.
llvm/test/Transforms/LoopDeletion/basic-remark.ll | ||
---|---|---|
2 | Does this need -mtriple? If so, the test would probably need ; REQUIRES: x86-registered-target or may fail on builds without the x86 target enabled. | |
llvm/test/Transforms/LoopDeletion/unreachable-loops.ll | ||
1–2 | I think it would probably be better to just add a second test function with a loop that never executes to basic-remark.ll and not check for remarks in this file. Without checking for the location/containing function of the remarks, it is hard to verify what the check lines check precisely. |
llvm/test/Transforms/LoopDeletion/basic-remark.ll | ||
---|---|---|
2 | Nope, it doesn't, I removed it. | |
llvm/test/Transforms/LoopDeletion/unreachable-loops.ll | ||
1–2 | I agree. I decided to change the test to check the YAML output and use CHECK-LABEL to find the function name. Thanks for pointing this out, turns out 2 checks were in the wrong function :) |
Does this need -mtriple? If so, the test would probably need ; REQUIRES: x86-registered-target or may fail on builds without the x86 target enabled.