[PATCH] D83113: [LoopDeletion] Emit a remark when a dead loop is deleted

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 3 02:07:45 PDT 2020


fhahn accepted this revision.
fhahn added a comment.
This revision is now accepted and ready to land.

LGTM, thanks! I've added a few suggestions with respect to tests.



================
Comment at: llvm/test/Transforms/LoopDeletion/basic-remark.ll:1
+; RUN: opt -mtriple=x86_64-- -loop-deletion -pass-remarks=loop-delete %s -o /dev/null 2>&1 | FileCheck %s
+
----------------
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.


================
Comment at: llvm/test/Transforms/LoopDeletion/unreachable-loops.ll:1
-; RUN: opt < %s -loop-deletion -verify-dom-info -S | FileCheck %s
+; RUN: opt < %s -loop-deletion -verify-dom-info -pass-remarks=loop-delete -S 2>%t | FileCheck %s
+; RUN: cat %t | FileCheck %s --check-prefix=REMARKS
----------------
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.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83113/new/

https://reviews.llvm.org/D83113





More information about the llvm-commits mailing list