This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] Fix ICE when truncating to vector with odd-size elements.
ClosedPublic

Authored by qiucf on Jul 24 2019, 7:49 PM.

Details

Summary

In type legalizing on PowerPC platform, when we are going to truncate normal vectors into vectors with elements whose size is not power of 2, the compiler will hit an assert complaining size-mismatch. Since such situation is rare, I add a check to prevent the trunc being optimized if the size of element is not power of 2.

Diff Detail

Repository
rL LLVM

Event Timeline

qiucf created this revision.Jul 24 2019, 7:49 PM
hfinkel accepted this revision.Aug 8 2019, 4:16 AM

LGTM

This revision is now accepted and ready to land.Aug 8 2019, 4:16 AM
MaskRay added inline comments.Aug 8 2019, 9:19 AM
llvm/test/CodeGen/PowerPC/pr25080.ll
1 ↗(On Diff #211662)

Is update_llc_test_checks too much for an assertion fix?

pr25080.ll

Did you write a wrong PR number?

qiucf added a comment.Aug 9 2019, 12:04 AM

pr25080.ll

Did you write a wrong PR number?

PR25080 is originally a X86 bug and this test is the piece of code to reproduce it, which is fixed by D13660.

qiucf marked an inline comment as done.Aug 9 2019, 12:12 AM
qiucf added inline comments.
llvm/test/CodeGen/PowerPC/pr25080.ll
1 ↗(On Diff #211662)

Checking if it exits successfully with no diagnostics is enough for an assertion fix. Here I just disabled doing the optimization since the occasion is rare.

In case someone would like to do it for such odd vectors in the future, I recommend to keep it as-is. After that, this case can notify and be changed.

This revision was automatically updated to reflect the committed changes.