[PATCH] D109537: [InstCombine] move extend after insertelement if both operands are extended

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 10 04:58:19 PDT 2021


spatel added a comment.

In D109537#2992713 <https://reviews.llvm.org/D109537#2992713>, @RKSimon wrote:

> Should we handle trunc as well? https://alive2.llvm.org/ce/z/93QN9g

I want to check that codegen isn't impacted by using insertelement on a wider (possible illegal type) vector op, but I think the answer is 'yes'.

In fact, we should probably do this for all cast opcodes to be consistent. I have to go through the whole opcode list (and add piles of tests) to be sure, but it works for these at least:
https://alive2.llvm.org/ce/z/HxH4AC (fptosi / fptoui / sitofp / uitofp)
https://alive2.llvm.org/ce/z/Rh_dqv (bitcast)

Another TODO for this patch, or do we prefer to handle it all in one patch?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109537/new/

https://reviews.llvm.org/D109537



More information about the llvm-commits mailing list