[PATCH] D140647: Handle simple diamond CFG hoisting in DivRemPairs.
Owen Anderson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 23 20:26:22 PST 2022
resistor created this revision.
resistor added a reviewer: nikic.
Herald added subscribers: atanasyan, jrtc27, hiraditya, nemanjai, sdardis.
Herald added a project: All.
resistor requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Previous we only handled triangle CFGs. This patch expands that
to support diamonds, where the div and rem appear in the then/else
sides of a condition. In that case, we can hoist the div into the
shared predecessor.
This could be generalized further to use nearest common ancestors,
but some of the conditions for hoisting would then require
post-dominator information.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D140647
Files:
llvm/lib/Transforms/Scalar/DivRemPairs.cpp
llvm/test/Transforms/DivRemPairs/Mips/div-rem-pairs.ll
llvm/test/Transforms/DivRemPairs/PowerPC/div-rem-pairs.ll
llvm/test/Transforms/DivRemPairs/X86/div-expanded-rem-pair.ll
llvm/test/Transforms/DivRemPairs/X86/div-rem-pairs.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D140647.485184.patch
Type: text/x-patch
Size: 6365 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221224/9afc960b/attachment.bin>
More information about the llvm-commits
mailing list