If the instruction have match pattern, llvm-tblgen will infer the sideeffect bit from the match pattern and it works well. If not, the tblgen will set it as true that hurt the scheduling.
// The mayLoad and mayStore flags default to false. // Conservatively assume hasSideEffects if it wasn't explicit. if (InstInfo->hasSideEffects_Unset) InstInfo->hasSideEffects = true;
PowerPC has some instructions that didn't specify the match pattern(i.e. LXSD etc), which is manually selected post-ra according to the register pressure. We need to clear the sideeffect flag for these instructions.
Global memory objects can be hasOrderedMemoryRef as well, so having Global memory object might NOT always due to hasUnmodeledSideEffects.
And it is *NOT* easy to come up the testcase in scheduling that can test the other affected opcode above.
so mi-scheduling might not be a great place to check hasUnmodeledSideEffects.
Maybe we can check it in peephole-opt with MIR. eg:
This way, we can easily add more affected opcodes in the MIR tests. What do you think?