[PATCH] Added InstCombine transform for pattern " ((X % Y) % Y) -> (X % Y) ".

David Majnemer david.majnemer at gmail.com
Mon Sep 15 21:14:37 PDT 2014


================
Comment at: lib/Analysis/InstructionSimplify.cpp:1174
@@ +1173,3 @@
+  Value *X, *Y;
+  if (match(Op1, m_Value(Y)) && match(Op0, m_SRem(m_Value(X), m_Specific(Y)))) {
+    return Op0;
----------------
This can just be:
`if (match(Op0, m_SRem(m_Value(), m_Specific(Op1)))) {`

http://reviews.llvm.org/D5350






More information about the llvm-commits mailing list