[PATCH] D97578: [instcombine] Collapse trivial or/and recurrences

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 26 13:38:57 PST 2021


reames created this revision.
reames added reviewers: spatel, nikic, lebedev.ri.
Herald added subscribers: dantrushin, hiraditya, mcrosier.
Herald added a reviewer: bollu.
reames requested review of this revision.
Herald added a project: LLVM.

If we have a recurrence of the form <Start, Or, Step> or <Start, And, Step> we know that the value taken by the recurrence stabilizes on the first iteration (provided step is loop invariant).     We can exploit that fact to remove the loop carried dependence in the recurrence.

The motivation is mostly consistency and demonstrating some recently added infrastructure for identifying recurrences, but as shown in the test change, we do seem to see them outside contrived examples as well.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D97578

Files:
  llvm/include/llvm/Analysis/ValueTracking.h
  llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
  llvm/test/Transforms/IndVarSimplify/X86/pr45360.ll
  llvm/test/Transforms/InstCombine/recurrence.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D97578.326788.patch
Type: text/x-patch
Size: 7358 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210226/41e07969/attachment.bin>


More information about the llvm-commits mailing list