[TypePromotion] Add truncate in ConvertTruncs when the original truncate type is...
authorchenglin.bi <chenglin.bi@linaro.org>
Tue, 3 Jan 2023 10:12:15 +0000 (18:12 +0800)
committerchenglin.bi <chenglin.bi@linaro.org>
Tue, 3 Jan 2023 10:13:20 +0000 (18:13 +0800)
commita0b470c9848c638e86f97eca53063642e07cea67
tree7d5dc702f55dac2ec4250449433efa43036c8c22
parentb9dac89ba450c579895c6219362c5826d4a8eeda
[TypePromotion] Add truncate in ConvertTruncs when the original truncate type is not extend type

If the src type is not extend type, after convert the truncate to and we need to truncate the and also to make sure the all user is legal.

The old fix D137613 doesn't work when the truncate convert to and have the other users. So this time I try to add the truncate after and to avoid all these potential issues.

Fix: #59554

Reviewed By: samparker

Differential Revision: https://reviews.llvm.org/D140869
llvm/lib/CodeGen/TypePromotion.cpp
llvm/test/Transforms/TypePromotion/AArch64/pr58843.ll [deleted file]
llvm/test/Transforms/TypePromotion/AArch64/trunc-zext-chain.ll