[PATCH] D59374: [InstCombine] canonicalize funnel shift constant shift amount to be modulo bitwidth

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 14 11:15:49 PDT 2019


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

Hmm, this looks good, but i have a nit.



================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp:2000
+    Constant *ShAmtC;
+    if (match(II->getArgOperand(2), m_Constant(ShAmtC))) {
+      Constant *WidthC = ConstantInt::get(II->getType(), BitWidth);
----------------
Will `m_Constant()` also math constant expressions?
Maybe add some test that we don't do anything stupid with them?


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

https://reviews.llvm.org/D59374





More information about the llvm-commits mailing list