[ConstProp] Handle insertelement constants
authorArthur Eubanks <aeubanks@google.com>
Mon, 10 Aug 2020 19:53:30 +0000 (12:53 -0700)
committerArthur Eubanks <aeubanks@google.com>
Thu, 13 Aug 2020 22:59:17 +0000 (15:59 -0700)
commit41f49736a9a06650d9d4f1ada21d051585ab7bbe
treeb5c6c5ebcd797b95fd97e00c983f2eeba44fb9e6
parentae6523cd62a44642390f4f9d9ba9ce17d5bbbc58
[ConstProp] Handle insertelement constants

Previously ConstantFoldExtractElementInstruction() would only work with
insertelement instructions, not contants. This properly handles
insertelement constants as well.

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D85865
llvm/lib/IR/ConstantFold.cpp
llvm/test/Transforms/InstSimplify/vscale.ll