[PATCH] D40390: [InstCombine] Don't crash on out of bounds index in the insertelement
Igor Laevsky via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 1 08:46:52 PST 2017
igor-laevsky added a comment.
Seems like I can't make tests any smaller because they need to trigger specific patterns in the instcombine
================
Comment at: lib/Transforms/InstCombine/InstCombineVectorOps.cpp:790
// Inserting an undef or into an undefined place, remove this.
if (isa<UndefValue>(ScalarOp) || isa<UndefValue>(IdxOp))
replaceInstUsesWith(IE, VecOp);
----------------
spatel wrote:
> Maybe off-topic for this patch thread, but since we're cleaning this all up (thanks!), we should fix this line as mentioned in D40231 / D40650. If the index is undef, then we can return undef rather than VecOp (and it should happen in InstSimplify, not here).
Yes, that makes sense. I suspect this might be already covered by the D40721. In any case I will send separate review for this.
https://reviews.llvm.org/D40390
More information about the llvm-commits
mailing list