[PATCH] D40650: [InstSimplify] Fold insertelement into undef if index is out of bounds

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 4 09:15:40 PST 2017


spatel requested changes to this revision.
spatel added a comment.
This revision now requires changes to proceed.

As noted in https://reviews.llvm.org/D40721, we should add a constant folding check to the top of SimplifyInsertElementInst() to avoid a regression in folding an insertelement with all operands constant.
This won't fold directly to a constant for the test in pr28725.ll but rather a constant expression. I think that's ok. Instcombine will manage to fold that further when it does its own constant folding.


https://reviews.llvm.org/D40650





More information about the llvm-commits mailing list