diff options
author | Craig Topper <craig.topper@intel.com> | 2018-05-03 05:00:18 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@intel.com> | 2018-05-03 05:00:18 +0000 |
commit | 8ef2abdbc4018e898b097df3a9b0aad0fc1a185d (patch) | |
tree | 8712c8d9d1e1660b5ea9489e01b98015a4a86b70 /llvm/lib/Transforms | |
parent | cc2da59f6920c8b4893713d768ea23242f796ad5 (diff) | |
download | bcm5719-llvm-8ef2abdbc4018e898b097df3a9b0aad0fc1a185d.tar.gz bcm5719-llvm-8ef2abdbc4018e898b097df3a9b0aad0fc1a185d.zip |
[LoopIdiomRecognize] Remove unnecessary cast from BinaryOperator to Instruction. NFC
BinaryOperator is a sub class of Instruction. We don't need an explicit cast back to Instruction.
llvm-svn: 331432
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp b/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp index 6be22e20ef4..fc64058fd4a 100644 --- a/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp +++ b/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp @@ -1199,11 +1199,10 @@ static bool detectPopcountIdiom(Loop *CurLoop, BasicBlock *PreCondBB, if (!SubOneOp) return false; - Instruction *SubInst = cast<Instruction>(SubOneOp); - ConstantInt *Dec = dyn_cast<ConstantInt>(SubInst->getOperand(1)); + ConstantInt *Dec = dyn_cast<ConstantInt>(SubOneOp->getOperand(1)); if (!Dec || - !((SubInst->getOpcode() == Instruction::Sub && Dec->isOne()) || - (SubInst->getOpcode() == Instruction::Add && + !((SubOneOp->getOpcode() == Instruction::Sub && Dec->isOne()) || + (SubOneOp->getOpcode() == Instruction::Add && Dec->isMinusOne()))) { return false; } |