This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine] Fix extractelement use before def
ClosedPublic

Authored by svenvh on May 23 2017, 9:57 AM.

Details

Summary

This fixes a bug that can cause extractelements with operands that
haven't been defined yet to be inserted at a wrong point when
optimising insertelements.

Patch by Karl Hylen.

Diff Detail

Repository
rL LLVM

Event Timeline

svenvh created this revision.May 23 2017, 9:57 AM
spatel edited edge metadata.May 24 2017, 8:43 AM

The code change looks good. Thanks for finding/fixing that bug.

Please use the script at utils/update_test_checks.py to generate the CHECK lines for the test. That will make it easier to update this file in the future.
To use the script, add just the new test source to the file (remove the CHECK lines that you have included in this version of the patch), and then:
$ <path/to/update_test_checks.py> --tool=<path/to/opt> --function=extractelt_insertion insert-extract-shuffle.ll

svenvh updated this revision to Diff 100719.May 30 2017, 9:04 AM

Auto-generate CHECK patterns.

spatel accepted this revision.Jun 2 2017, 4:55 AM

LGTM.

This revision is now accepted and ready to land.Jun 2 2017, 4:55 AM
This revision was automatically updated to reflect the committed changes.