[PATCH] D92754: [LoopIdiom] 'left-shift until bittest' idiom: support rewriting loop as countable, allow extra cruft

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 7 04:40:13 PST 2020


lebedev.ri created this revision.
lebedev.ri added reviewers: craig.topper, fhahn, jdoerfert.
lebedev.ri added a project: LLVM.
Herald added a subscriber: hiraditya.
lebedev.ri requested review of this revision.

The current state of the transform is still not enough to support
my motivational pattern, because it has one more "induction variable".

I have delayed posting this patch, because originally even just rewriting
the loop as countable wasn't enough to nicely transform my motivational pattern,
because i expected that extra IV to be rewritten afterwards,
but it wasn't happening until i fixed that in D91800 <https://reviews.llvm.org/D91800>.

So, this patch allows the  'left-shift until bittest' loop idiom
as long as the inserted ops are cheap,
and lifts any and all extra use checks on the instructions.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D92754

Files:
  llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
  llvm/test/Transforms/LoopIdiom/X86/left-shift-until-bittest.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D92754.309877.patch
Type: text/x-patch
Size: 59846 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201207/2955fbd5/attachment.bin>


More information about the llvm-commits mailing list