[PATCH] D67611: [LoopUnrollAnalyzer] Try to simplify address computation outside of loop.
Eli Friedman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 12 14:23:50 PST 2019
efriedma added a comment.
Not exactly a comment on this patch specifically, but should unrolled loop analysis have some sort of special case for the loop exit? If a compare is only used by the loop exit branch, it will be dead after full unroll, so it doesn't make sense to include its cost. (I mean, in theory, if SCEV can compute the trip count of a loop, UnrolledInstAnalyzer should be able to as well, but realistically it might not be worthwhile to reach parity.)
================
Comment at: llvm/lib/Analysis/LoopUnrollAnalyzer.cpp:76
+ // Check if the offset from the base address becomes a constant.
+ auto *Base = dyn_cast<SCEVUnknown>(SE.getPointerBase(S));
+ if (!Base)
----------------
Requiring the base to be a SCEVUnknown seems too restrictive to me... but I guess it's an existing restriction, so I guess it's okay for now.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D67611/new/
https://reviews.llvm.org/D67611
More information about the llvm-commits
mailing list