[PATCH] D99759: [LoopUnroll] avoid assumption clone explosion

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 1 11:59:16 PDT 2021


spatel created this revision.
spatel added reviewers: lebedev.ri, nikic, xbolva00, jdoerfert.
Herald added subscribers: zzheng, hiraditya, mcrosier.
spatel requested review of this revision.
Herald added a project: LLVM.

The PhaseOrdering test example is based on:
https://llvm.org/PR49785

The test goes over the complexity cliff somewhere between -O2 and -O3 (more unrolling is done at -O3).
The initial assume is created by SimplifyCFG, multiplied by the LoopVectorizer, and then copied across numerous clone blocks by LoopUnroll. LoopUnroll then calls SimplifyInstruction() which calls simplifyICmpWithDominatingAssume() and we seem to be spending all of our time in there computing known bits, etc.

It seems unlikely that we have much to gain by cloning assumes late in the opt pipeline, so I'm proposing to stub that out when called during LoopUnroll.


https://reviews.llvm.org/D99759

Files:
  llvm/include/llvm/Transforms/Utils/Cloning.h
  llvm/lib/Transforms/Utils/CloneFunction.cpp
  llvm/lib/Transforms/Utils/LoopUnroll.cpp
  llvm/test/Transforms/GVNSink/assumption.ll
  llvm/test/Transforms/PhaseOrdering/X86/assume-explosion.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D99759.334790.patch
Type: text/x-patch
Size: 13451 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210401/dad0d0d7/attachment.bin>


More information about the llvm-commits mailing list