[InstSimplify] Forbid undef folds in expandBinOp
authorNikita Popov <nikita.ppv@gmail.com>
Mon, 10 Aug 2020 20:06:48 +0000 (22:06 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Tue, 11 Aug 2020 16:39:24 +0000 (18:39 +0200)
commitd110d4aaff31198cd455b68617978019a8339773
tree08b574315df231d1aa5ebb8186457330e2f8b61d
parentcb29c33984bf40beebd22edf80a5034cf8849307
[InstSimplify] Forbid undef folds in expandBinOp

This is the replacement for D84250 based on D84792. As we recursively
fold with the same value twice, we need to disable undef folds,
to prevent an undef from being folded to two different values.

Reverting rG00f3579aea6e3d4a4b7464c3db47294f71cef9e4 and using the
test case from https://reviews.llvm.org/D83360#2145793, it no longer
performs the incorrect fold.

Differential Revision: https://reviews.llvm.org/D85684
llvm/include/llvm/Analysis/InstructionSimplify.h
llvm/lib/Analysis/InstructionSimplify.cpp