[PATCH] D102928: [unroll] Use SCEV to evaluate branch conditions in cost model

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 21 09:15:20 PDT 2021


reames created this revision.
reames added reviewers: mkazantsev, dalegr.
Herald added subscribers: javed.absar, zzheng, bollu, hiraditya, mcrosier.
reames requested review of this revision.
Herald added a project: LLVM.

The current full unroll cost model does a symbolic evaluation of the loop up to a fixed limit.  That symbolic evaluation currently simplifies to constants, but I'm planning to extend that to using SimplifyInstruction infrastructure in the near future.  This patch uses the simplified operands (at this point constants), and asks SCEV to prove a condition.  SCEV can use a mix of induction reasoning, and (most relevantly) dominating branch conditions.

With the constant domain, this is a bit hard to exercise.  I mostly split it into it's own patch for ease of review - it becomes more useful once we have symbolic evaluation on the value domain.  (Forthcoming.)


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D102928

Files:
  llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
  llvm/test/Transforms/LoopUnroll/unroll-cost-symbolic-execute.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D102928.347053.patch
Type: text/x-patch
Size: 14301 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210521/961df56a/attachment.bin>


More information about the llvm-commits mailing list