Currently it seems like -enable-misched behaves differently to overriding
SubtargetInfo::enableMachineScheduler. The latter uses the source ordering in
SelectionDAGISel.cpp, while the former uses a more advanced scheduler.
This change updates SelectionDAGISel.cpp and MachineScheduler to use the same
criterion to decide whether to use the MachineScheduler or not. This patch is
work in progress, as quite a few test cases fail. So far I looked into the
ARM test failures and CodeGen/ARM/cortex-a57-misched-basic.ll fails because
the MachineScheduler falls back to source ordering and with -enable-misched the
instructions have been ordered optimally during SelectionDAGISel.
Full list of failing codegen tests:
Failing Tests (14):
LLVM :: CodeGen/AArch64/aarch64-a57-fp-load-balancing.ll LLVM :: CodeGen/AArch64/arm64-aapcs.ll LLVM :: CodeGen/AArch64/arm64-abi-varargs.ll LLVM :: CodeGen/AArch64/arm64-abi.ll LLVM :: CodeGen/AArch64/arm64-abi_align.ll LLVM :: CodeGen/AArch64/arm64-misched-multimmo.ll LLVM :: CodeGen/AArch64/arm64-vshift.ll LLVM :: CodeGen/ARM/cortex-a57-misched-basic.ll LLVM :: CodeGen/ARM/misched-fusion-aes.ll LLVM :: CodeGen/X86/partial-fold32.ll LLVM :: CodeGen/X86/partial-fold64.ll LLVM :: CodeGen/X86/pr16031.ll LLVM :: CodeGen/X86/win64_alloca_dynalloca.ll LLVM :: CodeGen/X86/zext-fold.ll