When we match a pattern from m_GCst, the register type could be different from original op. So we can't replace the original op to vreg direct.
This code create a new constant with original op type then replace the original op.
Fix #58906
Differential D137778
[GlobalISel] Correct constant type in matchReassocConstantInnerLHS bcl5980 on Nov 10 2022, 3:33 AM. Authored by
Details When we match a pattern from m_GCst, the register type could be different from original op. So we can't replace the original op to vreg direct. Fix #58906
Diff Detail
Event Timeline
|
If you're going to potentially create a new constant anyway, can you just create the constant and get rid of all this moveBefore stuff?