[InstCombine] Fixed bug introduced in r282237
authorAlexey Bataev <a.bataev@hotmail.com>
Mon, 26 Sep 2016 13:18:59 +0000 (13:18 +0000)
committerAlexey Bataev <a.bataev@hotmail.com>
Mon, 26 Sep 2016 13:18:59 +0000 (13:18 +0000)
commit793c946ecbf1d833842d286534db958c843a3b2e
treef74a477b06541b8c8674f6c87011918a1e57eb2d
parentac2f1933d418e7bcdb24f6a62ec29382cdcfba7e
[InstCombine] Fixed bug introduced in r282237

The index of the new insertelement instruction was evaluated in the
wrong way, it was considered as the index of the inserted value instead
of index of the position, where the value should be inserted.

llvm-svn: 282401
llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
llvm/test/Transforms/InstCombine/vec_demanded_elts.ll