[PATCH] D91481: [LoopUnroll] Discount uniform instructions in cost models
    Philip Reames via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Tue Dec  1 13:35:19 PST 2020
    
    
  
reames added inline comments.
================
Comment at: llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp:785
+        if (SE.isLoopInvariant(SE.getSCEV(&I), &TheLoop))
+          Count++;
+      }
----------------
Whitney wrote:
> Given that `unsigned LoopSize = Metrics.NumInsts;`, and `NumInsts += TTI.getUserCost(&I, TargetTransformInfo::TCK_CodeSize);`, should we increment `Count` by `TTI.getUserCost(&I, TargetTransformInfo::TCK_CodeSize);` instead of 1?
Yes, yes we should.  Thank you for catching this!
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91481/new/
https://reviews.llvm.org/D91481
    
    
More information about the llvm-commits
mailing list