This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Further restricts when a dup(*ext) can be rearranged
ClosedPublic

Authored by NickGuy on Jan 15 2021, 6:51 AM.

Details

Summary

In most cases, the dup(*ext) pattern can be rearranged to perform
the extension on the vector side, allowing for further vector-specific
optimisations to be made. However the initial checks for this conversion
were insufficient, allowing invalid encodings to be attempted (causing
compilation to fail).

Fixes the crash reported in D91271

Diff Detail

Event Timeline

NickGuy created this revision.Jan 15 2021, 6:51 AM
NickGuy requested review of this revision.Jan 15 2021, 6:51 AM
dmgreen added inline comments.Jan 16 2021, 10:23 AM
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
11846–11847

Is it worth making sure Extend.getOperand(0) is the right size instead, with a DAG.getAnyExtOrTrunc?

11855–11856

This probably doesn't need a value type, unless it's an extend_inreg.

NickGuy updated this revision to Diff 317311.Jan 18 2021, 2:48 AM
NickGuy marked 2 inline comments as done.

Addressed comments

dmgreen accepted this revision.Jan 18 2021, 6:02 AM

Thanks. Hopefully that doesn't just cause other problems :)
LGTM

This revision is now accepted and ready to land.Jan 18 2021, 6:02 AM