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

Francis Visoiu Mistrih via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 3 15:39:12 PDT 2020


thegameg added inline comments.


================
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
+
----------------
fhahn wrote:
> 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.
Nope, it doesn't, I removed it.


================
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
----------------
fhahn wrote:
> 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.
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 :)


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

https://reviews.llvm.org/D83113





More information about the llvm-commits mailing list