[InstSimplify] Simplify smul.fix and smul.fix.sat
authorBjorn Pettersson <bjorn.a.pettersson@ericsson.com>
Tue, 9 Mar 2021 21:05:41 +0000 (22:05 +0100)
committerBjorn Pettersson <bjorn.a.pettersson@ericsson.com>
Fri, 12 Mar 2021 08:09:58 +0000 (09:09 +0100)
commit529c8e8dc6e9826b298b5e8586d55940abfee0ba
treef5397cef2184315085090460c3d7041a4f6bac7a
parent3638bdfbda01e5a4f17c330edc602e413359c722
[InstSimplify] Simplify smul.fix and smul.fix.sat

Add simplification of smul.fix and smul.fix.sat according to
  X * 0 -> 0
  X * undef -> 0
  X * (1 << scale) -> X

This includes the commuted patterns and splatted vectors.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D98299
llvm/lib/Analysis/InstructionSimplify.cpp
llvm/test/Transforms/InstSimplify/smul_fix.ll [new file with mode: 0644]