summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2018-06-20 19:02:17 +0000
committerSanjay Patel <spatel@rotateright.com>2018-06-20 19:02:17 +0000
commit3597588493192c58e2d455de3a024c398488f6e9 (patch)
tree1e1f26f94a78d6db14e1b036157a5f7fc43df20f /llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
parent4da3331d3d77aaf0adb2ab3325405a72bdad1a5a (diff)
downloadbcm5719-llvm-3597588493192c58e2d455de3a024c398488f6e9.tar.gz
bcm5719-llvm-3597588493192c58e2d455de3a024c398488f6e9.zip
[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
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstructionCombining.cpp')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstructionCombining.cpp4
1 files changed, 1 insertions, 3 deletions
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)
OpenPOWER on IntegriCloud