Page MenuHomePhabricator

[InstSimplify] Return poison if insertelement touches out of bounds
ClosedPublic

Authored by aqjune on Sun, Jan 3, 7:06 AM.

Details

Summary

This is a simple patch that updates InstSimplify to return poison if the index is/can be out-of-bounds

Diff Detail

Event Timeline

aqjune created this revision.Sun, Jan 3, 7:06 AM
aqjune requested review of this revision.Sun, Jan 3, 7:06 AM
Herald added a project: Restricted Project. · View Herald TranscriptSun, Jan 3, 7:06 AM
nikic accepted this revision.Sun, Jan 3, 7:30 AM

LGTM

llvm/test/Transforms/InstCombine/vector_insertelt_shuffle-inseltpoison.ll
57

Update comment

llvm/test/Transforms/InstCombine/vector_insertelt_shuffle.ll
57

Update comment

This revision is now accepted and ready to land.Sun, Jan 3, 7:30 AM
nikic added inline comments.Sun, Jan 3, 7:32 AM
llvm/lib/Analysis/InstructionSimplify.cpp
4403

Unrelated, but we should probably have an explicit fold for poison Val here, in which case we don't need non-poison vec.

aqjune added inline comments.Sun, Jan 3, 8:18 AM
llvm/lib/Analysis/InstructionSimplify.cpp
4403

I'll make a patch for this