[PATCH] D138872: [InstCombine] canonicalize trunc + insert as bitcast + shuffle, part 1
Sanjay Patel via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 30 09:07:50 PST 2022
spatel added a comment.
In D138872#3960754 <https://reviews.llvm.org/D138872#3960754>, @lebedev.ri wrote:
> In D138872#3960604 <https://reviews.llvm.org/D138872#3960604>, @spatel wrote:
>
>> Patch updated:
>>
>> 1. Added documentation comment for the general transform.
>> 2. Added TODO for one-use restriction.
>
> Actually, i guess i was thinking about canonicalizing all insertelements @ constant idx into shuffles
> (+the shuffle to convert the scalar into an appropriately-sized vector),
> but i guess that is almost borderline bad?
> So LG i suppose.
Ah, I see. Yes, we could turn all insert-to-constant-index into shuffles after bitcasting a scalar to a <1 x N> type. The insertelt is the direct representation though, so that's a tough sell. TBH even with a trunc, it's a borderline canonicalization; it could go either way. I think the backend is fine either way too, but I'll watch for fallout.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D138872/new/
https://reviews.llvm.org/D138872
More information about the llvm-commits
mailing list