[PATCH] D46193: [LSR] Skip LSR if the cost of input is cheaper than LSR's solution

Jun Bum Lim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 27 08:39:32 PDT 2018


junbuml created this revision.
junbuml added reviewers: qcolombet, mkazantsev, kparzysz, sebpop, evstupac, atrick, sanjoy.
Herald added a subscriber: mcrosier.
Herald added a reviewer: javed.absar.

The heuristics used in LSR cannot always guarantee LSR's final solution is the best.
Based the existing LSR's cost model, this change calculate the cost of input of LSR.
If LSR's final solution is more expensive than just using input IR, then we don't
use LSR's solution.


https://reviews.llvm.org/D46193

Files:
  include/llvm/Analysis/IVUsers.h
  lib/Analysis/IVUsers.cpp
  lib/Transforms/Scalar/LoopStrengthReduce.cpp
  test/Transforms/LoopStrengthReduce/AArch64/skip-lsr-solution.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46193.144347.patch
Type: text/x-patch
Size: 23189 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180427/f892f80c/attachment.bin>


More information about the llvm-commits mailing list