NarrowSearchSpaceByPickingWinnerRegs has an aggressive filtering method to reduce the complexity of the search space down by picking a best formula with the highest number of reuses and assuming it will yield profitable reuse. In certain cases we can find a "best" formula like {X+30,+,1} and later check a formula like {X,+,1} with the same number of Uses. On certain architectures it can be better to pick {X,+,1}, especially if an offset of 30 can be used as a legal addressing mode, but -30 cannot. That happens under Thumb1 code, which has fairly limited addressing modes. This patch adds a check to see if it can pick the simpler formula, if it looks more profitable.
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
LGTM. Does this unblock the inliner change?
llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp | ||
---|---|---|
4985–4986 |
Comment Actions
Thanks. This is hopefully fixing the second of the issues, there is still the problems in arm_mult_q15.ll. I haven't looked to see if there are any other issues beyond those two, but hopefully these are the largest parts.