Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix instruction order issue in scalarizer (microsoft#5001)
When scalarize shuffle inst which has extract element as the input element, create clone before the shuffle instead of after. Because later when replace the shuffle, new vector will be inserted before the shuffle. The elt define will be after its use if inserted before the shuffle earlier. Like %[[B:.+]] = load <2 x float>, <2 x float>* %b, align 4 %[[X:.+]] = insertelement <4 x float> undef, float %[[BX0]], i32 0 %[[Y:.+]] = insertelement <4 x float> %[[X]], float %[[BY0]], i32 1 %[[Z:.+]] = insertelement <4 x float> %[[Y]], float %[[BX1]], i32 2 %[[W:.+]] = insertelement <4 x float> %[[Z]], float %[[BY1]], i32 3 %[[BX0:.+]] = extractelement <2 x float> %[[B]], i32 0 %[[BY0:.+]] = extractelement <2 x float> %[[B]], i32 1 %[[BX1:.+]] = extractelement <2 x float> %[[B]], i32 0 %[[BY1:.+]] = extractelement <2 x float> %[[B]], i32 1
- Loading branch information