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

Igor Laevsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 5 03:54:34 PST 2017


igor-laevsky updated this revision to Diff 125493.
igor-laevsky added a comment.

Add constant folding. 
This breaks `InstSimplify/pr28725.ll`. However it's now folded into constant expression and instcombine simplifies it fully. Added relevant test case to the instcombine.


https://reviews.llvm.org/D40650

Files:
  include/llvm/Analysis/ConstantFolding.h
  include/llvm/Analysis/InstructionSimplify.h
  lib/Analysis/InstructionSimplify.cpp
  test/Transforms/InstCombine/pr28725.ll
  test/Transforms/InstSimplify/insertelement.ll
  test/Transforms/InstSimplify/pr28725.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40650.125493.patch
Type: text/x-patch
Size: 5516 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171205/5ffe31e1/attachment.bin>


More information about the llvm-commits mailing list