Skip to content

Commit

Permalink
[NFC] Minimal refactor of TTI to avoid clangsa complaint
Browse files Browse the repository at this point in the history
Differential Revision: https://reviews.llvm.org/D124754
  • Loading branch information
markuslavin committed May 3, 2022
1 parent 6f81903 commit dd8cf37
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
Expand Up @@ -986,8 +986,6 @@ class TargetTransformInfoImplCRTPBase : public TargetTransformInfoImplBase {
}

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) {
Expand Down Expand Up @@ -1059,9 +1057,11 @@ class TargetTransformInfoImplCRTPBase : public TargetTransformInfoImplBase {
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();
Expand Down

0 comments on commit dd8cf37

Please sign in to comment.