[InstCombine] Support negation of scalable-vector splats
authorFraser Cormack <fraser@codeplay.com>
Mon, 7 Jun 2021 10:19:20 +0000 (11:19 +0100)
committerFraser Cormack <fraser@codeplay.com>
Mon, 7 Jun 2021 14:14:00 +0000 (15:14 +0100)
commitae3f6de3a856006601cbca81ebf9780a2534bdcc
tree3384cce993810f255637f42f33002c61db0b83b2
parentade4662c44f7dc9b0e32f38746e74241d7330253
[InstCombine] Support negation of scalable-vector splats

This patch is an extension of D103421. It allows the InstCombiner to
generate the negated form of integer scalable-vector splats. It can
technically handle fixed-length vectors too but those are completely
covered by the preceding logic.

This enables extra combining opportunities for scalable vector types.

Reviewed By: RKSimon

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