Skip to content

Commit

Permalink
[VectorCombine] scalarizeLoadExtract - add debug message for match + …
Browse files Browse the repository at this point in the history
…cost-comparison

Helps with debugging to show to that the fold found the match, and shows the old + new costs to indicate whether the fold was/wasn't profitable.
  • Loading branch information
RKSimon committed Mar 1, 2025
1 parent f611e95 commit 8f4d2e0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions llvm/lib/Transforms/Vectorize/VectorCombine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1612,6 +1612,10 @@ bool VectorCombine::scalarizeLoadExtract(Instruction &I) {
ScalarizedCost += TTI.getAddressComputationCost(VecTy->getElementType());
}

LLVM_DEBUG(dbgs() << "Found all extractions of a vector load: " << I
<< "\n LoadExtractCost: " << OriginalCost
<< " vs ScalarizedCost: " << ScalarizedCost << "\n");

if (ScalarizedCost >= OriginalCost)
return false;

Expand Down

0 comments on commit 8f4d2e0

Please sign in to comment.