[PATCH] D86696: [Attributor][WIP] Introduce Loop AA
Stefanos Baziotis via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 27 06:17:41 PDT 2020
baziotis added inline comments.
================
Comment at: llvm/lib/Transforms/IPO/AttributorAttributes.cpp:7943
+ if (auto *BI = dyn_cast<BranchInst>(&I)) {
+ auto *Op = BI->getOperand(0);
+ const auto &OpAA =
----------------
uenoku wrote:
> baziotis wrote:
> > For that to make sense, you have to verify that the branch `isConditional()`. Also, note that loops
> > may be [[ https://llvm.org/docs/LoopTerminology.html#rotated-loops | rotated ]]. In that case, the condition is not in the header block, but in the latch.
> >
> > Generally, loops can get quite complicated and so, as Kuter said, you probably want to use
> > SCEV (for example, backedge taken count etc.) I'll have to think that again because SCEV
> > won't benefit from Attributor, meaning, at a high-level, using constant range AA when it makes
> > sense seems reasonable.
> FWIW, AAConstantRange actually uses SCEV internally but I agree that using AAConstantRange might make things complicated as a starting point. So you can use SCEV first.
Yes, but the point is that using constant range directly makes things difficult because we have to re-deduce information and loop structure that SCEV is supposed to handle (e.g. the code above is doing something similar to backedge taken count).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D86696/new/
https://reviews.llvm.org/D86696
More information about the llvm-commits
mailing list