OSDN Git Service

[InstCombine] Push negation through multiply (PR44234)
authorNikita Popov <nikita.ppv@gmail.com>
Fri, 24 Jan 2020 21:11:41 +0000 (22:11 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Fri, 31 Jan 2020 19:58:55 +0000 (20:58 +0100)
commitff17da3f75b4825f71e81e1caa2e5084d500a1a1
treef7bf6ba6ed4b973faf24b54b3842c11901f20528
parent2a6ef2aecf2d75f410195cef14846348f33a24de
[InstCombine] Push negation through multiply (PR44234)

Fixes https://bugs.llvm.org/show_bug.cgi?id=44234 by adding
multiply support to freelyNegateValue(). Only one of the operands
needs to be negatible, so this still fits within the framework.

Differential Revision: https://reviews.llvm.org/D73410
llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
llvm/test/Transforms/InstCombine/mul.ll
llvm/test/Transforms/InstCombine/sub.ll