diff options
author | Preston Gurd <preston.gurd@intel.com> | 2012-10-29 15:01:23 +0000 |
---|---|---|
committer | Preston Gurd <preston.gurd@intel.com> | 2012-10-29 15:01:23 +0000 |
commit | a836563e3208ad0b74019dc33ad361d3eb72f178 (patch) | |
tree | 659bf7512d46159c37c1002f242b6c17bf2d9d18 /lib/CodeGen/ScheduleDAGInstrs.cpp | |
parent | 01d013ec043407a558b8b87f75ec207336e8a4ae (diff) |
This patch addresses a problem with the Post RA scheduler generating an
incorrect instruction sequence due to it not being aware that an
inline assembly instruction may reference memory.
This patch fixes the problem by causing the scheduler to always assume that any
inline assembly code instruction could access memory. This is necessary because
the internal representation of the inline instruction does not include
any information about memory accesses.
This should fix PR13504.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166929 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/ScheduleDAGInstrs.cpp')
-rw-r--r-- | lib/CodeGen/ScheduleDAGInstrs.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/CodeGen/ScheduleDAGInstrs.cpp b/lib/CodeGen/ScheduleDAGInstrs.cpp index 496473d3a4..8ea0f8a3ea 100644 --- a/lib/CodeGen/ScheduleDAGInstrs.cpp +++ b/lib/CodeGen/ScheduleDAGInstrs.cpp @@ -420,6 +420,11 @@ void ScheduleDAGInstrs::addVRegUseDeps(SUnit *SU, unsigned OperIdx) { /// Return true if MI is an instruction we are unable to reason about /// (like a call or something with unmodeled side effects). static inline bool isGlobalMemoryObject(AliasAnalysis *AA, MachineInstr *MI) { + if (MI->isInlineAsm()) { + // Until we can tell if an inline assembly instruction accesses + // memory, we must assume all such instructions do so. + return true; + } if (MI->isCall() || MI->hasUnmodeledSideEffects() || (MI->hasOrderedMemoryRef() && (!MI->mayLoad() || !MI->isInvariantLoad(AA)))) |