[AArch64][GlobalISel] Correct function evaluation order in applyINS
The order in which the nested calls to Builder.buildWhatever are evaluated in differs between GCC and Clang. This caused a bot failure because the MIR in the testcase was coming out in a different order than expected. Rather than using nested calls, pull them out in order to fix the order of evaluation.
This commit is contained in:
parent
ef312951fd
commit
daf7d7f0dc
|
|
@ -456,11 +456,10 @@ static bool applyINS(MachineInstr &MI, MachineRegisterInfo &MRI,
|
||||||
Register DstVec, SrcVec;
|
Register DstVec, SrcVec;
|
||||||
int DstLane, SrcLane;
|
int DstLane, SrcLane;
|
||||||
std::tie(DstVec, DstLane, SrcVec, SrcLane) = MatchInfo;
|
std::tie(DstVec, DstLane, SrcVec, SrcLane) = MatchInfo;
|
||||||
Builder.buildInsertVectorElement(
|
auto SrcCst = Builder.buildConstant(LLT::scalar(64), SrcLane);
|
||||||
Dst, DstVec,
|
auto Extract = Builder.buildExtractVectorElement(ScalarTy, SrcVec, SrcCst);
|
||||||
Builder.buildExtractVectorElement(
|
auto DstCst = Builder.buildConstant(LLT::scalar(64), DstLane);
|
||||||
ScalarTy, SrcVec, Builder.buildConstant(LLT::scalar(64), SrcLane)),
|
Builder.buildInsertVectorElement(Dst, DstVec, Extract, DstCst);
|
||||||
Builder.buildConstant(LLT::scalar(64), DstLane));
|
|
||||||
MI.eraseFromParent();
|
MI.eraseFromParent();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue