[llvm] [AArch64] Guard against getRegisterBitWidth returning zero in vector instr cost. (PR #117749)
David Green via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 27 05:13:08 PST 2024
================
@@ -3248,19 +3248,18 @@ InstructionCost AArch64TTIImpl::getVectorInstrCostHelper(
// Check if the extractelement user is scalar fmul.
auto IsUserFMulScalarTy = [](const Value *EEUser) {
// Check if the user is scalar fmul.
- const auto *BO = dyn_cast_if_present<BinaryOperator>(EEUser);
+ const auto *BO = dyn_cast<BinaryOperator>(EEUser);
return BO && BO->getOpcode() == BinaryOperator::FMul &&
!BO->getType()->isVectorTy();
};
// Check if the extract index is from lane 0 or lane equivalent to 0 for a
// certain scalar type and a certain vector register width.
- auto IsExtractLaneEquivalentToZero = [&](const unsigned &Idx,
- const unsigned &EltSz) {
+ auto IsExtractLaneEquivalentToZero = [&](unsigned Idx, unsigned EltSz) {
----------------
davemgreen wrote:
Yeah will do.
https://github.com/llvm/llvm-project/pull/117749
More information about the llvm-commits
mailing list