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.