Skip to content

Commit f1b15d3

Browse files
committed
Re-arrange getPartialReductionExtendKind
1 parent f809c68 commit f1b15d3

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

llvm/lib/Analysis/TargetTransformInfo.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -986,10 +986,9 @@ InstructionCost TargetTransformInfo::getShuffleCost(
986986

987987
TargetTransformInfo::PartialReductionExtendKind
988988
TargetTransformInfo::getPartialReductionExtendKind(Instruction *I) {
989-
auto *Cast = dyn_cast<CastInst>(I);
990-
if (!Cast)
991-
return PR_None;
992-
return getPartialReductionExtendKind(Cast->getOpcode());
989+
if (auto *Cast = dyn_cast<CastInst>(I))
990+
return getPartialReductionExtendKind(Cast->getOpcode());
991+
return PR_None;
993992
}
994993

995994
TargetTransformInfo::PartialReductionExtendKind
@@ -1001,7 +1000,7 @@ TargetTransformInfo::getPartialReductionExtendKind(
10011000
case Instruction::CastOps::SExt:
10021001
return PR_SignExtend;
10031002
default:
1004-
return PR_None;
1003+
llvm_unreachable("Unexpected cast opcode");
10051004
}
10061005
}
10071006

0 commit comments

Comments
 (0)