[llvm] baebe71 - [AArch64] Address post-commit comments from D150482.
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 15 08:38:32 PDT 2023
Author: Florian Hahn
Date: 2023-06-15T16:38:09+01:00
New Revision: baebe719a52acbe0a5aaa04dcf1abcfd4035bf1f
URL: https://github.com/llvm/llvm-project/commit/baebe719a52acbe0a5aaa04dcf1abcfd4035bf1f
DIFF: https://github.com/llvm/llvm-project/commit/baebe719a52acbe0a5aaa04dcf1abcfd4035bf1f.diff
LOG: [AArch64] Address post-commit comments from D150482.
Address @v01dXYZ's comments, thanks!
Added:
Modified:
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
index d3eabd515d229..d4e390223951e 100644
--- a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+++ b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
@@ -14655,7 +14655,6 @@ bool AArch64TargetLowering::optimizeExtendOrTruncateConversion(
return false;
DstTy = TruncDstType;
- DstWidth = TruncDstType->getElementType()->getScalarSizeInBits();
}
return createTblShuffleForZExt(ZExt, DstTy, Subtarget->isLittleEndian());
diff --git a/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp b/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
index 554e17c283521..b7dd95dd69308 100644
--- a/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
+++ b/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
@@ -1898,7 +1898,7 @@ InstructionCost AArch64TTIImpl::getCastInstrCost(unsigned Opcode, Type *Dst,
continue;
// Use provided Src type for I and other casts that have the same source
// type.
- if (Op == I || Cast->getSrcTy() == Cast->getSrcTy())
+ if (Op == I || cast<CastInst>(I)->getSrcTy() == Cast->getSrcTy())
SrcTys.push_back(Src);
else
SrcTys.push_back(Cast->getSrcTy());
@@ -1913,7 +1913,8 @@ InstructionCost AArch64TTIImpl::getCastInstrCost(unsigned Opcode, Type *Dst,
// version of the widening instruction.
if (auto *Cast = dyn_cast<CastInst>(SingleUser->getOperand(1)))
if (I->getOpcode() == unsigned(Cast->getOpcode()) &&
- (Src == Cast->getSrcTy() || Cast->getSrcTy() == Cast->getSrcTy()))
+ (Src == Cast->getSrcTy() ||
+ cast<CastInst>(I)->getSrcTy() == Cast->getSrcTy()))
return 0;
}
}
More information about the llvm-commits
mailing list