[PATCH] D130543: [RISCV]Enable isIntDivCheap when attribute is minsize

Sergei Barannikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 27 00:23:57 PDT 2022


barannikov88 added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:12531
+  // TODO: Add vector division?
+  bool OptSize = Attr.hasFnAttr(Attribute::MinSize);
+  return OptSize && !VT.isVector();
----------------
barannikov88 wrote:
> craig.topper wrote:
> > barannikov88 wrote:
> > > There is `MF->getFunction().hasOptSize()` which also checks for `Attribute::OptimizeForSize`.
> > > Just a suggestion.
> > Every other target that does this only does it for MinSize. Are you suggesting we do this for -Os as well?
> That's right.
> According to the comment near hasOptSize, it checks for Os and Oz, one of which is "optimize for size" and the other is "optimize for minimum size". 
> Has the other attribute been introduced after other targets implemented the hook?..
Please ignore my comment, I mixed up OptimizeForSize and MinSize. Returning false only for MinSize sounds reasonable.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130543/new/

https://reviews.llvm.org/D130543



More information about the llvm-commits mailing list