From 3597588493192c58e2d455de3a024c398488f6e9 Mon Sep 17 00:00:00 2001 From: Sanjay Patel Date: Wed, 20 Jun 2018 19:02:17 +0000 Subject: [IR] add/use isIntDivRem convenience function There are more existing potential users of this, but I've limited this patch to the first couple that I found to minimize typo risk. llvm-svn: 335157 --- llvm/lib/Transforms/InstCombine/InstructionCombining.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'llvm/lib/Transforms/InstCombine') diff --git a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp index 2b9db4baafa..1281c99f8dd 100644 --- a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp +++ b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp @@ -1423,9 +1423,7 @@ Instruction *InstCombiner::foldShuffledBinop(BinaryOperator &Inst) { // undefined behavior. All other binop opcodes are always safe to // speculate, and therefore, it is fine to include undef elements for // unused lanes (and using undefs may help optimization). - BinaryOperator::BinaryOps Opcode = Inst.getOpcode(); - if (Opcode == Instruction::UDiv || Opcode == Instruction::URem || - Opcode == Instruction::SDiv || Opcode == Instruction::SRem) { + if (Inst.isIntDivRem()) { assert(C->getType()->getScalarType()->isIntegerTy() && "Not expecting FP opcodes/operands/constants here"); for (unsigned i = 0; i < VWidth; ++i) -- cgit v1.2.3