[llvm] [LV] Fix missing MetaData for histogram instructions (PR #134241)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 10 15:25:56 PDT 2025


================
@@ -8642,6 +8642,8 @@ VPRecipeBuilder::tryToWidenHistogram(const HistogramInfo *HI,
   HGramOps.push_back(Operands[1]);
   // Increment value.
   HGramOps.push_back(getVPValueOrAddLiveIn(HI->Update->getOperand(1)));
+  // Store Instruction.
+  HGramOps.push_back(getVPValueOrAddLiveIn(HI->Store));
----------------
fhahn wrote:

Adding a live-in for the store as operand, just to get the underlying instruction to retrieve the metadata seems like a bit of a workaround.

I think it would be good to improve the existing metadata handling first and model it explicit in VPlan: https://github.com/llvm/llvm-project/pull/135272

Then it should be easy to preserve the metadata directly without needing any artificial operands

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


More information about the llvm-commits mailing list