This patch has implements these optimizations:
extract.vector(insert.vector(Vector, Value, Idx), Idx) --> Value
extract.vector(insert.vector(Vector, Value, InsertIndex), ExtractIndex)
--> extract.vector(Vector, ExtractIndex)
Differential D132137
[InstCombine] For vector extract when extract vector and insert value type is the same CarolineConcatto on Aug 18 2022, 7:44 AM. Authored by
Details This patch has implements these optimizations: extract.vector(insert.vector(Vector, Value, Idx), Idx) --> Value extract.vector(insert.vector(Vector, Value, InsertIndex), ExtractIndex) --> extract.vector(Vector, ExtractIndex)
Diff Detail
Event TimelineComment Actions Perhaps it is worth noting that this code follows from code we had for svget/svset, which will be removed in D131548.
|
I am not sure this transform is correct.
My understanding of the documentation is that these are inserting *vectors* not single elements. Given that, don't we need to prove that the vectors don't overlap?
In this example, if vscale = 6 on real hardware, isn't this transform unsound?
If it is sound, the semantics of the insert/extract intrinsics are non-obvious with regards to indexing, and the docs could be improved.