[llvm] r324636 - [InstCombine] visitSRem - use m_Negative(APInt) helper. NFCI.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 8 11:00:45 PST 2018
Author: rksimon
Date: Thu Feb 8 11:00:45 2018
New Revision: 324636
URL: http://llvm.org/viewvc/llvm-project?rev=324636&view=rev
Log:
[InstCombine] visitSRem - use m_Negative(APInt) helper. NFCI.
Modified:
llvm/trunk/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp?rev=324636&r1=324635&r2=324636&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp (original)
+++ llvm/trunk/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp Thu Feb 8 11:00:45 2018
@@ -1629,7 +1629,7 @@ Instruction *InstCombiner::visitSRem(Bin
{
const APInt *Y;
// X % -Y -> X % Y
- if (match(Op1, m_APInt(Y)) && Y->isNegative() && !Y->isMinSignedValue()) {
+ if (match(Op1, m_Negative(Y)) && !Y->isMinSignedValue()) {
Worklist.AddValue(I.getOperand(1));
I.setOperand(1, ConstantInt::get(I.getType(), -*Y));
return &I;
More information about the llvm-commits
mailing list