This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine] Correct the check for vector GEPs
ClosedPublic

Authored by mssimpso on Mar 29 2017, 9:31 AM.

Details

Summary

Some of the GEP combines (e.g., descaling) can't handle vector GEPs. We have an existing check that attempts to bail out if given a vector GEP. However, the check only tests the GEP's pointer operand. A GEP results in a vector of pointers if at least one of its operands is vector-typed (i.e., its pointer operand could be a scalar but its index could be a vector). We should probably just check the type of the GEP itself. This should fix PR32414.

The added test case causes an assertion without this patch.

Reference: https://bugs.llvm.org/show_bug.cgi?id=32414

Diff Detail

Repository
rL LLVM

Event Timeline

mssimpso created this revision.Mar 29 2017, 9:31 AM
efriedma accepted this revision.Mar 29 2017, 9:53 AM
efriedma added a subscriber: efriedma.

LGTM.

This revision is now accepted and ready to land.Mar 29 2017, 9:53 AM
This revision was automatically updated to reflect the committed changes.