[PATCH] D79893: [SCEV] Constant fold MultExpr before applying depth limit.
Max Kazantsev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed May 20 21:29:38 PDT 2020
mkazantsev added a comment.
Please add a test which clearly shows the impact (e.g. running `-analyze scalar-evolution` on single mul instruction with zero depth).
================
Comment at: llvm/lib/Analysis/ScalarEvolution.cpp:2937
+ bool AllConst =
+ llvm::all_of(Ops, [](const SCEV *S) { return isa<SCEVConstant>(S); });
+ if (!AllConst)
----------------
This is too expensive. Provided that ops are sorted by type, it's enough to check the last one.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D79893/new/
https://reviews.llvm.org/D79893
More information about the llvm-commits
mailing list