[InstCombine] avoid infinite loop from shuffle-extract-insert sequence (PR30923)
authorSanjay Patel <spatel@rotateright.com>
Thu, 10 Nov 2016 00:15:14 +0000 (00:15 +0000)
committerSanjay Patel <spatel@rotateright.com>
Thu, 10 Nov 2016 00:15:14 +0000 (00:15 +0000)
commit4e1b5a53c728ea48460c7ca8c8ac28e9bef92334
tree77de61b15b99cd698bd9056ff488f7a6ef81fc91
parent35e007515fe45259be7ecde609d2d8bf9b46028b
[InstCombine] avoid infinite loop from shuffle-extract-insert sequence (PR30923)

Removing the limitation in visitInsertElementInst() causes several regressions
because we're not prepared to fold sequences of shuffles or inserts and extracts
separated by shuffles. Fixing that appears to be a difficult mission because we
are purposely trying to avoid creating shuffles with arbitrary shuffle masks
because some targets may choke on those.

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

llvm-svn: 286423
llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
llvm/test/Transforms/InstCombine/insert-extract-shuffle.ll