This is an archive of the discontinued LLVM Phabricator instance.

Strengthen handling of GEPs and generic calls for all undef lanes
ClosedPublic

Authored by reames on Jan 30 2019, 12:57 PM.

Details

Summary

If all lanes in a vector can be proven undef, then the result is undef. This patch implements and tests the GEP case. Once the masked.load patch (D57372) has landed, I'll update to include call tests as well.

Diff Detail

Event Timeline

reames created this revision.Jan 30 2019, 12:57 PM
spatel added inline comments.Feb 12 2019, 11:26 AM
lib/Transforms/InstCombine/InstCombineCalls.cpp
1922

I'm not sure how to expose this in a regression test, but would it make sense to add this check to the bottom of SimplifyDemandedVectorElts() itself, so callers don't have to deal with this possibility themselves?

reames updated this revision to Diff 190846.Mar 15 2019, 10:06 AM

Address review comment

spatel accepted this revision.Mar 15 2019, 10:21 AM

LGTM

lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
1686

Interest -> Intersect?

This revision is now accepted and ready to land.Mar 15 2019, 10:21 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMar 15 2019, 12:53 PM

Looks like this change can produce invalid IR:
https://bugs.llvm.org/show_bug.cgi?id=41624