[llvm] cd921ac - [NFC] InstCombineNegator: use auto where type is obvious from the cast
Roman Lebedev via llvm-commits
llvm-commits at lists.llvm.org
Fri May 22 01:15:39 PDT 2020
Author: Roman Lebedev
Date: 2020-05-22T11:14:54+03:00
New Revision: cd921accf91a21ba91580262c92eced34622ab5f
URL: https://github.com/llvm/llvm-project/commit/cd921accf91a21ba91580262c92eced34622ab5f
DIFF: https://github.com/llvm/llvm-project/commit/cd921accf91a21ba91580262c92eced34622ab5f.diff
LOG: [NFC] InstCombineNegator: use auto where type is obvious from the cast
Added:
Modified:
llvm/lib/Transforms/InstCombine/InstCombineNegator.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineNegator.cpp b/llvm/lib/Transforms/InstCombine/InstCombineNegator.cpp
index 6194396c49e6..a08d5dde812b 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineNegator.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineNegator.cpp
@@ -243,7 +243,7 @@ LLVM_NODISCARD Value *Negator::visit(Value *V, unsigned Depth) {
switch (I->getOpcode()) {
case Instruction::PHI: {
// `phi` is negatible if all the incoming values are negatible.
- PHINode *PHI = cast<PHINode>(I);
+ auto *PHI = cast<PHINode>(I);
SmallVector<Value *, 4> NegatedIncomingValues(PHI->getNumOperands());
for (auto I : zip(PHI->incoming_values(), NegatedIncomingValues)) {
if (!(std::get<1>(I) = visit(std::get<0>(I), Depth + 1))) // Early return.
@@ -285,7 +285,7 @@ LLVM_NODISCARD Value *Negator::visit(Value *V, unsigned Depth) {
}
case Instruction::ShuffleVector: {
// `shufflevector` is negatible if both operands are negatible.
- ShuffleVectorInst *Shuf = cast<ShuffleVectorInst>(I);
+ auto *Shuf = cast<ShuffleVectorInst>(I);
Value *NegOp0 = visit(I->getOperand(0), Depth + 1);
if (!NegOp0) // Early return.
return nullptr;
More information about the llvm-commits
mailing list