1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 04:22:57 +02:00

[InstCombine] visitSRem - use m_Negative(APInt) helper. NFCI.

llvm-svn: 324636
This commit is contained in:
Simon Pilgrim 2018-02-08 19:00:45 +00:00
parent d445c401d9
commit 846c898f22

View File

@ -1629,7 +1629,7 @@ Instruction *InstCombiner::visitSRem(BinaryOperator &I) {
{
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;