This heuristic was introduced in D35888. Assuming it is correct, this
patch should make cost modeling a bit more robust.
This came about when looking at opaque pointers where a bitcast that previously appeared hid this heuristic. This actually regresses the benchmark I was looking at due to less loop unrolling (gesummv in llvm-test-suite), but I'm not sure how else to solve that besides removing this heuristic entirely.
I wonder whether this needs inverting - and we default stores to a cost of TTI::TCC_Basic * 2 UNLESS after stripping we find all indices are constant?