[PATCH] Constfold insertelement to undef when index is out-of-bounds

Paweł Bylica chfast at gmail.com
Mon Apr 27 00:07:43 PDT 2015


Hi majnemer,

This patch adds constant folding of insertelement instruction to undef value when index operand is constant and is not less than vector size or is undef.

InstCombine does not support this case, but I'm happy to add it there also if this change is accepted.

REPOSITORY
  rL LLVM

http://reviews.llvm.org/D9287

Files:
  lib/IR/ConstantFold.cpp
  test/Transforms/ConstProp/InsertElement.ll
  unittests/IR/ConstantsTest.cpp

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D9287.24455.patch
Type: text/x-patch
Size: 4461 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150427/50ca965b/attachment.bin>


More information about the llvm-commits mailing list