[llvm] [CostModel][AArch64] Make extractelement, with fmul user, free whenev… (PR #111479)

Sushant Gokhale via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 10 23:38:17 PST 2024


================
@@ -3177,10 +3178,10 @@ InstructionCost AArch64TTIImpl::getCFInstrCost(unsigned Opcode,
   return 0;
 }
 
-InstructionCost AArch64TTIImpl::getVectorInstrCostHelper(const Instruction *I,
-                                                         Type *Val,
-                                                         unsigned Index,
-                                                         bool HasRealUse) {
+InstructionCost AArch64TTIImpl::getVectorInstrCostHelper(
+    Type *Val, unsigned Index, bool HasRealUse, const Instruction *I,
+    std::optional<unsigned> Opcode, Value *Scalar,
----------------
sushgokh wrote:

>The code to call it can drop the `if (I || Opcode)`

This check needs to be done because it segfaults when `Scalar=nullptr` while doing cast<ExtractelemementInst>. So, either the check remains or needs to be pushed inside. I have kept it outside.

https://github.com/llvm/llvm-project/pull/111479


More information about the llvm-commits mailing list