This is an archive of the discontinued LLVM Phabricator instance.

[TTI] Fix default costs for interleaved accesses
ClosedPublic

Authored by sbaranga on Aug 3 2015, 5:43 AM.

Details

Summary

Modify the cost calculation function for interleaved accesses
to use the target-specific costs for insert/extract element and
memory operations.

This better models the case where the backend can't match
the interleaved group, and we are forced to use a wide load
and shuffle vectors.

Interleaved accesses are not enabled by default, so this shouldn't
cause a performance change.

Diff Detail

Event Timeline

sbaranga updated this revision to Diff 31226.Aug 3 2015, 5:43 AM
sbaranga retitled this revision from to [TTI] Fix default costs for interleaved accesses.
sbaranga updated this object.
sbaranga added a subscriber: llvm-commits.

No tests were added. It seems any tests for this would be very easy to break.

jmolloy accepted this revision.Aug 3 2015, 6:42 AM
jmolloy added a reviewer: jmolloy.
jmolloy added a subscriber: jmolloy.

This looks like a mechanical change to me. I don't like the static_casts all over the place, but it's used prolifically elsewhere in the file so I can't see an issue with it.

James

This revision is now accepted and ready to land.Aug 3 2015, 6:42 AM
sbaranga closed this revision.Aug 3 2015, 7:01 AM

Thanks! Committed in 243875.

rengolin added inline comments.
include/llvm/CodeGen/BasicTTIImpl.h
537

nitpick: can't you cache the T * to avoid re-using the ugly static_cast?

sbaranga added inline comments.Aug 3 2015, 7:05 AM
include/llvm/CodeGen/BasicTTIImpl.h
537

Perhaps, but using the static_casts seems to be the code style here.