[llvm] [TTI] Add VectorInstrContext for context-aware insert/extract costs. (PR #175982)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 27 03:01:23 PST 2026


================
@@ -646,17 +646,35 @@ bool TargetTransformInfo::isTargetIntrinsicWithStructReturnOverloadAtField(
   return TTIImpl->isTargetIntrinsicWithStructReturnOverloadAtField(ID, RetIdx);
 }
 
+TargetTransformInfo::VectorInstrContext
+TargetTransformInfo::getVectorInstrContextHint(const Instruction *I) {
+  if (!I)
+    return VectorInstrContext::None;
+
+  // For inserts, check if the value being inserted comes from a load.
+  if (isa<InsertElementInst>(I) && isa<LoadInst>(I->getOperand(1)))
----------------
fhahn wrote:

ah yes, looks like the AArch64 implementation did not check or test this. Should be fixed now, thanks

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


More information about the llvm-commits mailing list