[llvm] [LoopUnroll] Enable allowexpensivetripcounts when user provides pragma (PR #181267)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 3 07:07:19 PST 2026


nikic wrote:

> Option 2: Refactor the code that sets AllowExpensiveTripCounts to do it once outside the if(shouldPragmaUnroll) because setting it once will cover all cases (similar to current state of PR but with modified condition check to not include Full Unroll). However, I don't feel comfortable moving the UP.Runtime to also get set at the same place because there is a lot of complex logic between the check of shouldPragmaUnroll and the place where we set UP.Runtime, which may or may not affect the conditions in which Runtime should be set.

I prefer this option. And I'd also move the setting of UP.Runtime. I don't really see how setting it early would cause problems here, so as long as it doesn't break any tests, it should be fine.

https://github.com/llvm/llvm-project/pull/181267


More information about the llvm-commits mailing list