[PATCH] D89665: [LSR] ignore profitable chain optimization when instruction number is the major cost
ChenZheng via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 20 20:37:31 PDT 2020
shchenz added inline comments.
================
Comment at: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:3097
}
// Remove any unprofitable chains.
unsigned ChainIdx = 0;
----------------
steven.zhang wrote:
> I am not familiar with the code logic. But it makes more sense to bail out here when the instruction is the major cost.
agree with your concern here. return early always good for compiling time. But the logic here should be specific for `isProfitableChain`, it would make more sense to keep it inside `isProfitableChain`. For example what if we have more than one caller of `isProfitableChain` function?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D89665/new/
https://reviews.llvm.org/D89665
More information about the llvm-commits
mailing list