[PATCH] D71561: [InstCombine] Refactor FoldUDivAction for future usage with multiplication. NFC

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 17 13:58:23 PST 2019


lebedev.ri accepted this revision.
lebedev.ri added a comment.
This revision is now accepted and ready to land.

LG i guess



================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp:196-197
+  Constant *C1 = getLogBase2(Op0->getType(), cast<Constant>(Op1));
+  if (!C1)
+    llvm_unreachable("Failed to constant fold udiv -> logbase2");
+  BinaryOperator *LShr = BinaryOperator::CreateLShr(Op0, C1);
----------------
I see that this is only moved, but generally it really just should be an `assert()`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71561





More information about the llvm-commits mailing list