[PATCH] D19870: Adding test cases showing the behavior of LoopUnrollPass according to optnone and optsize attributes

Chad Rosier via llvm-commits llvm-commits at lists.llvm.org
Tue May 3 11:47:32 PDT 2016


mcrosier added a comment.

In http://reviews.llvm.org/D19870#420185, @mamai wrote:

> - I am not sure it is possible to merge the optsize tests in one call to opt, since one of them use the -unroll-count parameter and not the other. Do you see another way to do that?


You can have multiple RUN lines in a file.  To differentiate the runs you can use the FileCheck --check-prefix command.

For example, look at the top of the loop-remarks.ll test in llvm/test/Transforms/LoopUnroll.

Something like:

  ; RUN: opt < %s -S -loop-unroll  | FileCheck %s
  ; RUN: opt < %s -S -loop-unroll -unroll-count=4 | FileCheck -check-prefix=UNROLLCOUNT4 %s

By default, FileCheck assumes the prefix is CHECK.  Therefore, unroll-optnone.ll and unroll-optsize2.ll can just use the CHECK: directive, while all the CHECK directives in the unroll-optsize1.ll file will be UNROLLCOUNT4:

Hopefully, that all makes sense.

> - According to a previous commit fixing the behavior of minsize, I think it should behave the same as with optsize. See http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20160111/323952.html.


In that case, please add a test case with minsize that shows the expected behavior.

I'm still interested to know how loop unroll behaves at -O1.


Repository:
  rL LLVM

http://reviews.llvm.org/D19870





More information about the llvm-commits mailing list