[PATCH] D126644: [llvm/CodeGen] Add ExpandLargeDivRem pass

Matthias Gehre via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 19 02:57:48 PDT 2022


mgehre-amd marked 2 inline comments as done.
mgehre-amd added inline comments.


================
Comment at: llvm/lib/CodeGen/TargetPassConfig.cpp:1115
   addPass(createPreISelIntrinsicLoweringPass());
+  addPass(createExpandLargeDivRemPass());
   PM->add(createTargetTransformInfoWrapperPass(TM->getTargetIRAnalysis()));
----------------
arsenm wrote:
> This doesn't belong in this patch. Currently this is lacking in legality checks for the expansion. I would prefer to see a separate patch which adds the pass and checks the legality per target, rather than relying on the arbitrary command line threshold
Ok, I'll make a follow-up PR to add the pass and configure a per-target threshold.
I'm thinking about adding an `int MaxLegalDivRemBitSize` member to TargetTransformInfo.


================
Comment at: llvm/test/Transforms/ExpandLargeDivRem/sdiv129.ll:11
+
+; CHECK-LABEL: @sdiv129(
+; CHECK-NEXT:  _udiv-special-cases:
----------------
arsenm wrote:
> The positioning of the checks looks weird. Usually update_test_checks put these comments inside the function?
I guess the position is still from the time where this was an extra function. I regenerated the check-lines, but update_test_checks.py doesn't move them around. I will re-generate them from scratch to get the typical position.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D126644



More information about the llvm-commits mailing list