[PATCH] D32433: Compute safety information in a much finer granularity.
Daniel Berlin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 24 12:55:28 PDT 2017
dberlin added inline comments.
================
Comment at: llvm/trunk/lib/Transforms/Utils/LoopUtils.cpp:1050
+ for (Instruction *ExitInst : SafetyInfo->EarlyExits)
+ if (!DT->dominates(&Inst, ExitInst))
+ return false;
----------------
efriedma wrote:
> This could be slow: if the two instructions are in the same basic block, dominates() will iterate over the whole block. And you don't attempt to prune the EarlyExits list, which could make LICM O(N^3) overall for a large loop with a single basic block.
>
> I guess we'll see if it matters in practice.
Two fixes, one short term we should do, one longer term
1. Let that dominates call take an OBB as an optional argument
2. Just provide global + local dominance ordering as an analysis that encapsulates both the OBB + DT solution, and remove that use of dominates in favor of the analysis.
Repository:
rL LLVM
https://reviews.llvm.org/D32433
More information about the llvm-commits
mailing list