[llvm] [SystemZ] Fix Operand Retrieval for Vector Reduction Intrinsic in `shouldExpandReduction` (PR #88874)
Ulrich Weigand via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 18 07:12:22 PDT 2024
================
@@ -1322,26 +1323,30 @@ SystemZTTIImpl::getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA,
return BaseT::getIntrinsicInstrCost(ICA, CostKind);
}
+// Find the type of the vector operand indicated by index.
+// Asserts that the operand indicated is actually a vector.
+FixedVectorType *getOperandVectorType(const IntrinsicInst *II, unsigned Index) {
+ auto *T = II->getOperand(Index)->getType();
+ assert(T->isVectorTy());
+ return cast<FixedVectorType>(T);
+}
+
----------------
uweigand wrote:
I do believe this assert is redundant - it is fails, the immediately following cast would also fail, which would give us the same information. And without the assert, the function becomes so trivial that it might as well be inlined back in place?
https://github.com/llvm/llvm-project/pull/88874
More information about the llvm-commits
mailing list