diff options
| author | Evan Cheng <evan.cheng@apple.com> | 2011-01-07 23:50:32 +0000 |
|---|---|---|
| committer | Evan Cheng <evan.cheng@apple.com> | 2011-01-07 23:50:32 +0000 |
| commit | 6eb516dbeaf4effee65dd609a7099397bf52aed5 (patch) | |
| tree | c7770705fb274c93e1778d512398fad221d73dd5 /llvm/lib/CodeGen/TargetInstrInfoImpl.cpp | |
| parent | 006089b761d0b92c2ce5a5f14ebe2b34a053b8b4 (diff) | |
| download | bcm5719-llvm-6eb516dbeaf4effee65dd609a7099397bf52aed5.tar.gz bcm5719-llvm-6eb516dbeaf4effee65dd609a7099397bf52aed5.zip | |
Do not model all INLINEASM instructions as having unmodelled side effects.
Instead encode llvm IR level property "HasSideEffects" in an operand (shared
with IsAlignStack). Added MachineInstrs::hasUnmodeledSideEffects() to check
the operand when the instruction is an INLINEASM.
This allows memory instructions to be moved around INLINEASM instructions.
llvm-svn: 123044
Diffstat (limited to 'llvm/lib/CodeGen/TargetInstrInfoImpl.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/TargetInstrInfoImpl.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/TargetInstrInfoImpl.cpp b/llvm/lib/CodeGen/TargetInstrInfoImpl.cpp index 28b973b16eb..5fc7f323079 100644 --- a/llvm/lib/CodeGen/TargetInstrInfoImpl.cpp +++ b/llvm/lib/CodeGen/TargetInstrInfoImpl.cpp @@ -329,8 +329,13 @@ isReallyTriviallyReMaterializableGeneric(const MachineInstr *MI, const TargetInstrDesc &TID = MI->getDesc(); // Avoid instructions obviously unsafe for remat. - if (TID.hasUnmodeledSideEffects() || TID.isNotDuplicable() || - TID.mayStore()) + if (TID.isNotDuplicable() || TID.mayStore() || + MI->hasUnmodeledSideEffects()) + return false; + + // Don't remat inline asm. We have no idea how expensive it is + // even if it's side effect free. + if (MI->isInlineAsm()) return false; // Avoid instructions which load from potentially varying memory. |

