diff options
author | Evan Cheng <evan.cheng@apple.com> | 2009-02-07 01:21:47 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2009-02-07 01:21:47 +0000 |
commit | b6f5417edb8ad11e06d3a6527e452945e5349a97 (patch) | |
tree | e9d253d625b90e3fe14f69f337f58acbfa250797 | |
parent | 046928077645f6ddad839e85dd03ab11e5b22cbc (diff) |
Don't sink the instruction if TargetRegisterInfo::isSafeToMoveRegClassDefs doesn't think it's safe. This works around PR1911.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63994 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/MachineSink.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/CodeGen/MachineSink.cpp b/lib/CodeGen/MachineSink.cpp index 87114396f9..a85a41fbae 100644 --- a/lib/CodeGen/MachineSink.cpp +++ b/lib/CodeGen/MachineSink.cpp @@ -167,6 +167,10 @@ bool MachineSinking::SinkInstruction(MachineInstr *MI, bool &SawStore) { } else { // Virtual register uses are always safe to sink. if (MO.isUse()) continue; + + // If it's not safe to move defs of the register class, then abort. + if (!TII->isSafeToMoveRegClassDefs(RegInfo->getRegClass(Reg))) + return false; // FIXME: This picks a successor to sink into based on having one // successor that dominates all the uses. However, there are cases where |