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

Sebastian Pop via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 9 11:48:51 PDT 2018


sebpop added inline comments.


================
Comment at: lib/Transforms/Scalar/LoopStrengthReduce.cpp:5679
+      IsInputCostCheaperThanSolutionCost(SolutionCost)) {
+    DEBUG(dbgs() << "Skip using LSR's solution.\n");
+    return;
----------------
Do you have some statistics on how many times this currently happens on a benchmark of your choice?



================
Comment at: test/Transforms/LoopStrengthReduce/AArch64/skip-lsr-solution.ll:1
+; RUN: llc <  %s  -mtriple=aarch64 -lsr-insns-cost=true -debug-only=loop-reduce  2>&1 | FileCheck %s
+
----------------
kparzysz wrote:
> This needs "REQUIRES: asserts".
I don't see any CHECK statement depending on -debug-only, so instead of requiring asserts, let's just remove that flag.

Also please remove the other flag: -lsr-insns-cost=true as I see that its default value is true:

  "lsr-insns-cost", cl::Hidden, cl::init(true),



https://reviews.llvm.org/D46193





More information about the llvm-commits mailing list