2 Commits

Author SHA1 Message Date
Sanjay Patel
e5a32d720e [InstCombine] move extend after insertelement if both operands are extended
I was wondering how instcombine does on the examples in D109236,
and we're missing a basic transform:

inselt (ext X), (ext Y), Index --> ext (inselt X, Y, Index)

https://alive2.llvm.org/ce/z/z2aBu9

Note that there are several possible extensions of this fold
(see TODO comments).

Differential Revision: https://reviews.llvm.org/D109537
2021-09-15 14:38:03 -04:00
Sanjay Patel
3cb5aa8622 [InstCombine] add tests for insertelement with cast ops; NFC 2021-09-09 14:58:39 -04:00