[NFC] Minimal refactor of TTI to avoid clangsa complaint

Differential Revision: https://reviews.llvm.org/D124754
This commit is contained in:
Markus Lavin 2022-05-03 10:20:09 +02:00
parent 6f81903e89
commit dd8cf372c5
1 changed files with 3 additions and 3 deletions

View File

@ -986,8 +986,6 @@ public:
}
Type *Ty = U->getType();
Type *OpTy =
U->getNumOperands() == 1 ? U->getOperand(0)->getType() : nullptr;
unsigned Opcode = Operator::getOpcode(U);
auto *I = dyn_cast<Instruction>(U);
switch (Opcode) {
@ -1059,9 +1057,11 @@ public:
case Instruction::FPExt:
case Instruction::SExt:
case Instruction::ZExt:
case Instruction::AddrSpaceCast:
case Instruction::AddrSpaceCast: {
Type *OpTy = U->getOperand(0)->getType();
return TargetTTI->getCastInstrCost(
Opcode, Ty, OpTy, TTI::getCastContextHint(I), CostKind, I);
}
case Instruction::Store: {
auto *SI = cast<StoreInst>(U);
Type *ValTy = U->getOperand(0)->getType();