[PATCH] D130517: [GlobalISel] Add sdiv exact (X, constant) -> mul combine.

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 26 05:40:52 PDT 2022


arsenm added inline comments.


================
Comment at: llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp:4956-4959
+  // Don't do this for minsize because the instruction sequence is usually
+  // larger.
+  if (MF.getFunction().hasMinSize())
+    return false;
----------------
aemerson wrote:
> arsenm wrote:
> > aemerson wrote:
> > > arsenm wrote:
> > > > aemerson wrote:
> > > > > arsenm wrote:
> > > > > > This greatly depends on the target handling of division and probably should be attached to the tablegen addition
> > > > > Not sure what you mean by "tablegen addition"?
> > > > I mean GICombineRules should have predicate fields, analogous to PatFags
> > > Is there a patch to do that already?
> > No, not that I'm aware of
> Implementing the infrastructure for that seems a separate issue though? This kind of minsize check is mirroring the same check done for SelectionDAG.
Yes. I didn't notice that check; I should probably look into finding a way to disable it there too


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D130517



More information about the llvm-commits mailing list