[PATCH] D38725: [LoopUnroll] Clean up remarks for unroll remainder

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 17 12:32:03 PDT 2017


dmgreen added a comment.

Hello again. Thanks for taking a look.



================
Comment at: lib/Transforms/Utils/LoopUnroll.cpp:504
+        ORE->emit(
+            [&]() { return DiagBuilder() << " with run-time trip count"; });
     }
----------------
fhahn wrote:
> Do I understand correctly that we want to only display this remark in case the following condition is true, so if we successfully unrolled the loop with a run-time trip count (condition at line 428)?
> 
> ``` RuntimeTripCount && TripMultiple % Count != 0 && 
>       UnrollRuntimeLoopRemainder(....) ```
> 
> I am probably missing something, but it seems like this code path does not consider the `TripMultiple % Count != 0` from the condition. 
Currently with -unroll-runtime=true -unroll-remainder (like we have for cortex-m cores), the remainder loop is unrolled. It does this by calling UnrollLoop() from inside UnrollRuntimeLoopRemainder(). When that happens we get two remarks, one from the "outer" UnrollLoop for the original loop, one from the inner UnrollLoop() for the remainder loop. I'm trying to remove that second one for the remainder loop.

Clang-format moved things around a bit here, but I've just made it so that the ORE is optional, and not passed through to the inner UnrollRuntimeLoopRemainder/UnrollLoop.


https://reviews.llvm.org/D38725





More information about the llvm-commits mailing list