This is an archive of the discontinued LLVM Phabricator instance.

[DAGCombiner] allow more store merging for non-i8 truncated ops
ClosedPublic

Authored by spatel on Sep 3 2020, 2:15 PM.

Details

Summary

This is a follow-up suggested in D86420 - if we have a pair of stores in inverted order for the target endian, we can rotate the source bits into place.
The "be_i64_to_i16_order" test shows a limitation of the current function (which might be avoided if we integrate this function with the other cases in mergeConsecutiveStores). In the earlier "be_i64_to_i16" test, we skip the first 2 stores because we do not match the full set as consecutive or rotate-able, but then we reach the last 2 stores and see that they are an inverted pair of 16-bit stores. The "be_i64_to_i16_order" test alters the program order of the stores, so we miss matching the sub-pattern.

Diff Detail

Event Timeline

spatel created this revision.Sep 3 2020, 2:15 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 3 2020, 2:15 PM
spatel requested review of this revision.Sep 3 2020, 2:15 PM
RKSimon accepted this revision.Sep 7 2020, 6:08 AM

LGTM cheers

This revision is now accepted and ready to land.Sep 7 2020, 6:08 AM