[TypePromotion] Avoid unnecessary trunc zext pairs
authorSam Parker <sam.parker@arm.com>
Tue, 24 May 2022 14:33:21 +0000 (15:33 +0100)
committerSam Parker <sam.parker@arm.com>
Tue, 24 May 2022 14:34:36 +0000 (15:34 +0100)
commite0fe9785d35203d6b76670cb2b8c6449db4fa576
tree3ab201c962bf5b1390399fdec771c4f30e86b34f
parent89aaa2d033270d6eeeb82429c0bb88a78ae030fa
[TypePromotion] Avoid unnecessary trunc zext pairs

Any zext 'sink' should already have an operand that is in the legal
value, so avoid using a trunc and just use the trunc operand instead.

Differential Revision: https://reviews.llvm.org/D118905
llvm/lib/CodeGen/TypePromotion.cpp
llvm/test/Transforms/TypePromotion/ARM/casts.ll