This is an archive of the discontinued LLVM Phabricator instance.

[TTI] Reduction costs only need to include a single extract element cost
ClosedPublic

Authored by RKSimon on Nov 15 2018, 9:10 AM.

Details

Summary

We were adding the entire scalarization extraction cost for reductions, which returns the total cost of extracting every element of a vector type.

For reductions we don't need to do this - we just need to extract the 0'th element after the reduction pattern has completed.

Fixes PR37731

Diff Detail

Repository
rL LLVM

Event Timeline

RKSimon created this revision.Nov 15 2018, 9:10 AM
This revision is now accepted and ready to land.Nov 15 2018, 9:21 AM
This revision was automatically updated to reflect the committed changes.

This fix appears to cause bugs.llvm.org/show_bug.cgi?id=39774

fedor.sergeev reopened this revision.Nov 26 2018, 2:25 AM

Reverted by rL347541 due to P39774 mentioned above.
It is very likely that this change is not a direct cause of the crash,
but I dont know any other ways to get rid of that crash.

This revision is now accepted and ready to land.Nov 26 2018, 2:25 AM

D54955 proposes a fix for the root cause of the bug. I think the test case there shows that we can still crash even with this patch reverted.

D54955 proposes a fix for the root cause of the bug. I think the test case there shows that we can still crash even with this patch reverted.

Committed here:
rL347759

After that has baked for a while, we should be able to re-apply this patch, confirm that:
https://bugs.llvm.org/show_bug.cgi?id=39774
is no longer a problem, and re-close:
https://bugs.llvm.org/show_bug.cgi?id=37731

This revision was automatically updated to reflect the committed changes.