When performing memory folding (thus changing the register form of an instruction to it's memory form), make sure the register classes of the machine operands of the replaced instruction comply to the constrains of the register classes of the new instruction - If not, change them.
Details
Details
Diff Detail
Diff Detail
Event Timeline
lib/Target/X86/X86InstrInfo.cpp | ||
---|---|---|
7713 | for (unsigned i = 0, e = MOs.size(); i < e; i++) { |
Comment Actions
@craig.topper, i encountered this issue by coincidence but could not find a test case which fails without this. all the folded instructions right now have the same register classes constrains for both register and memory forms.
But as we entirely replace the instruction I saw that this change should be added even though it doesn't effect anything right now. Maybe it will be needed in the future.
for (unsigned i = 0, e = MOs.size(); i < e; i++) {