Skip to content
Commit ab736a27 authored by Philip Reames's avatar Philip Reames Committed by Philip Reames
Browse files

[BasicTTI] Account for vector of pointers in getMemoryOpCost

By using getPrimitiveSizeInBits, we were getting 0 for every pointer type. This code is trying to account for the cost of truncating a store or extending a load to convert from the source vector element type to the legal vector element type.

I'd originally seen this as a crash when trying to scalarize a <vscale x 1 x ptr> type coming from the vectorizer. Here's a minimum reproducer to exercise the code in question.

void e(int *argv[], int *p) {
  for (int i = 0; i < 1024; i++)
    argv[i] = p;
}

This was checked in as the splat_ptr test in 2cf320d4. After bbf3fd, this no longer crashes since we correctly return invalid if the extending load/truncating store isn't legal.

Differential Revision: https://reviews.llvm.org/D128228
parent 767ba58f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment