This is an archive of the discontinued LLVM Phabricator instance.

[SLP] Make computeExtractCost() more conservative by checking for non-extract values
AbandonedPublic

Authored by vporpo on Apr 19 2023, 7:11 PM.

Details

Summary

This function will currently checks for consecutive extracts but it won't check:
a. If these extracts have the same operand, and
b. If any of the values is not an extract.
In either of these cases the cost should be higher because it would require
additional instructions to move the data into a common register.

This patch adds the checks for the non-extract value and for common operand.

Diff Detail

Event Timeline

vporpo created this revision.Apr 19 2023, 7:11 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 19 2023, 7:11 PM
vporpo requested review of this revision.Apr 19 2023, 7:11 PM

This is not correct. There are 2 reasons for the vectorization in this: 1. InsertElement cost to position 0 is 0, though it should be non-zero. 2. The cost of the node with the same values as another gather node must be 0, currently it is -1. I have a patch, will send it for review in couple hours.

vporpo abandoned this revision.Apr 20 2023, 10:46 AM