[PATCH] D87555: [DivRemPairs] Add an initial case for hoisting to a common predecessor.
Roman Lebedev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Sep 13 01:16:25 PDT 2020
lebedev.ri added inline comments.
================
Comment at: llvm/lib/Transforms/Scalar/DivRemPairs.cpp:260-261
+ // FIXME: We could handle more cases hoisting cases?
+ if (RemInst->getParent()->getFirstNonPHIOrDbg() == RemInst &&
+ DivInst->getParent()->getFirstNonPHIOrDbg() == DivInst &&
+ RemInst->getParent()->getSingleSuccessor() == DivInst->getParent())
----------------
This is too fragile.
You want to check that every instruction between the place you hoist to,
and each div/rem instruction is `isGuaranteedToTransferExecutionToSuccessor()`
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D87555/new/
https://reviews.llvm.org/D87555
More information about the llvm-commits
mailing list