[PATCH] D146274: [LICM] Do not hoist widenable conditions

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 17 00:33:20 PDT 2023


mkazantsev created this revision.
mkazantsev added reviewers: skatkov, anna, nikic, lebedev.ri, dmakogon.
Herald added subscribers: StephenFan, asbirlea, hiraditya.
Herald added a project: All.
mkazantsev requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Despite the fact that it is legal, it is not profitable. Because of bug described at
https://github.com/llvm/llvm-project/issues/60234, now the guard widening is
only possible when condtion we want to add is available at the point of the
widenable_condition() of dominating guard. It means that, if all such calls are
hoisted out of loop, and the loop conditions depend on loop-variants, we cannot
widen. Hoisting is otherwise not helpful, because it does not introduce any
optimization opportunities.


https://reviews.llvm.org/D146274

Files:
  llvm/lib/Transforms/Scalar/LICM.cpp
  llvm/test/Transforms/GuardWidening/two_forms_behavior_consistency.ll
  llvm/test/Transforms/LICM/explicit_guards.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D146274.505992.patch
Type: text/x-patch
Size: 8804 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230317/02830fd5/attachment.bin>


More information about the llvm-commits mailing list