[PATCH] D111036: [GlobalISel] Combine G_UMULH x, (1 << c)) -> x >> (bitwidth - c)

Amara Emerson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 8 11:30:03 PDT 2021


aemerson added inline comments.


================
Comment at: llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp:4581
+  LLT ShiftAmtTy = getTargetLowering().getPreferredShiftAmountTy(Ty);
+  auto CstVal = isConstantOrConstantSplatVector(*MRI.getVRegDef(RHS), MRI);
+  if (!CstVal || CstVal->isOne() || !isPowerOf2_64(CstVal->getZExtValue()))
----------------
foad wrote:
> This will no longer handle the "mix of non-NPQ/NPQ paths" that D110890 can generate.
Thanks. I've fixed this by using `matchUnaryPredicate()` instead in 17b89f9daad56f80c29b46bed0b6ce94093dcfc9


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D111036



More information about the llvm-commits mailing list