From 7577a3d799b7fd66a9053f6059dcd5877e9d56e5 Mon Sep 17 00:00:00 2001 From: Sanjay Patel Date: Thu, 15 Sep 2016 14:15:47 +0000 Subject: [InstCombine] use m_APInt to allow icmp folds using known bits for splat constant vectors llvm-svn: 281613 --- llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'llvm/lib/Transforms/InstCombine') diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp index a55bfda320f..e744dde78d3 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp @@ -3216,9 +3216,9 @@ Instruction *InstCombiner::foldICmpUsingKnownBits(ICmpInst &I) { if (~Op1KnownZero == 0) { // If the LHS is an AND with the same constant, look through it. Value *LHS = nullptr; - ConstantInt *LHSC = nullptr; - if (!match(Op0, m_And(m_Value(LHS), m_ConstantInt(LHSC))) || - LHSC->getValue() != Op0KnownZeroInverted) + const APInt *LHSC; + if (!match(Op0, m_And(m_Value(LHS), m_APInt(LHSC))) || + *LHSC != Op0KnownZeroInverted) LHS = Op0; Value *X; -- cgit v1.2.3