[PATCH] D138874: [InstCombine] canonicalize trunc + insert as bitcast + shuffle, part 3

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 8 06:59:18 PST 2022


dmgreen added a comment.

> After thinking this over again, we should be able to add a more specific peephole that finds the common source op by looking through shifts and casts:
> https://alive2.llvm.org/ce/z/_4iTEu
> It's bigger than the typical pattern match, but it's not that bad. It could start off very narrow and be generalized in a few steps. 
> That avoids creating a shuffle, so it sidesteps the backend problems noted here. The question of whether we should canonicalize in the opposite direction from this patch is still open.

I don't want to block any work, don't consider me having any real objection. Some of this feels a little X86-shaped for instcombine, but the motivating example in #17113 seems like it would apply to any architecture, and I haven't seen any cases that can't be fixed up in the backend.


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

https://reviews.llvm.org/D138874



More information about the llvm-commits mailing list